From 5b9587fb7bf8edf400cd29a83f2429bf6cb310fa Mon Sep 17 00:00:00 2001 From: X-20A <155217226+X-20A@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:11:18 +0900 Subject: [PATCH 1/3] commit_test --- assets/commons/content-copy-custom.png | Bin 0 -> 231 bytes css/simulator-ui/main.css | 22 +++++++++- js/simulator-ui/fleet-editor.js | 5 ++- js/simulator-ui/ui-main.js | 56 ++++++++++++++++++++++++- simulator.html | 15 ++++--- 5 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 assets/commons/content-copy-custom.png diff --git a/assets/commons/content-copy-custom.png b/assets/commons/content-copy-custom.png new file mode 100644 index 0000000000000000000000000000000000000000..eb8f43301d35a165675be552ba56192c131db242 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|7J9lkhIn`< zrz|i`XqjnW`s&Jr|NsAQH!v_*F*zyS&yVj8PtLCglP0VC?>lwk#0uB0hYDL=q770{ zP5FN$L*Xi8f&7KLOh%8Ns3|Ka`<9h`lbYdQ_^aWL#ZRCqTkqV7$!!vwAe?gJ%Y!cm zSFkQFY%q21U#8UbROX(7({Tcjwl~z d+k_<|46-&?C8r(sr~*2c!PC{xWt~$(69Am@T$KO- literal 0 HcmV?d00001 diff --git a/css/simulator-ui/main.css b/css/simulator-ui/main.css index 5605b997..44697045 100644 --- a/css/simulator-ui/main.css +++ b/css/simulator-ui/main.css @@ -64,6 +64,9 @@ div.fleet div.iconForm { div.fleet div.iconForm img { height: 40px; } +img.copyIcons { + cursor: pointer; +} #divBattles { width: fit-content; @@ -467,6 +470,23 @@ span.tooltip { #divAutoBonus div.autoBonusMainFoot > div:last-child { margin-left: auto; } +#notice { + position: fixed; + bottom: 30px; + right: 0; + display: flex; + align-items: center; + justify-content: center; + width: 190px; + height: 65px; + border: 2px solid #6ae3ff; + border-right: none; + font-size: 15px; + font-weight: 600; + color: #ffffff; + background-color: #4EABF5; + opacity: 0; +} span.autoBonusStatus { font-weight: bold; } @@ -475,4 +495,4 @@ span.autoBonusStatus.good { } .invisible { visibility: hidden; -} \ No newline at end of file +} diff --git a/js/simulator-ui/fleet-editor.js b/js/simulator-ui/fleet-editor.js index b3dbbd7e..1881595a 100644 --- a/js/simulator-ui/fleet-editor.js +++ b/js/simulator-ui/fleet-editor.js @@ -789,6 +789,9 @@ var UI_FLEETEDITOR = Vue.createApp({ receiveCloseEquip: function() { UI_FLEETEDITOR.refocusEquip(); }, + onclickSelectAll: function(event) { + event.target.select(); + } }, }).component('vmodal',COMMON.CMP_MODAL).use(COMMON.i18n).mount('#divFleetEditor'); @@ -1141,4 +1144,4 @@ COMMON.global.fleetEditorMoveTemp = function(elFrom) { } } -})(); \ No newline at end of file +})(); diff --git a/js/simulator-ui/ui-main.js b/js/simulator-ui/ui-main.js index ef0cdd3f..fddfe4c6 100644 --- a/js/simulator-ui/ui-main.js +++ b/js/simulator-ui/ui-main.js @@ -547,6 +547,47 @@ var UI_MAIN = Vue.createApp({ onclickSetFCF: function() { UI_FCFSETTINGS.doOpen(this.settingsFCF); }, + + onclickCopyResults: function(typeString) { + let isJP = document.querySelector('#divMain input[value="ja"]').checked; + let text = ''; + + const results = this.results; + const retreat_rate = Math.floor(results.retreat * 1000) / 10; + const s_rate = Math.floor(results.rankS * 1000) / 10; + const flagSunk_rate = Math.floor(results.flagSunk * 1000) / 10; + if(typeString === 'S') { + if(isJP) { + text = `撤退率: ${retreat_rate}%, S率: ${s_rate}%\nS勝利あたり\n燃料: ${results.fuelS}\n弾薬: ${results.ammoS}\n鋼材: ${results.steelS}\nボーキ: ${results.bauxS}\nバケツ: ${results.bucketS}`; + } else { + text = `retreat: ${retreat_rate}%, S rate: ${s_rate}%\nAvg Resource Per S\nfuel: ${results.fuelS}\nammo: ${results.ammoS}\nsteel: ${results.steelS}\nbauX: ${results.bauxS}\nbucket: ${results.bucketS}`; + } + } else if(typeString === 'Flag') { + if(isJP) { + text = `撤退率: ${retreat_rate}%, 旗艦撃沈率: ${flagSunk_rate}%\n旗艦撃沈あたり\n燃料: ${results.fuelSunk}\n弾薬: ${results.ammoSunk}\n鋼材: ${results.steelSunk}\nボーキ: ${results.bauxSunk}\nバケツ: ${results.bucketSunk}`; + } else { + text = `retreat: ${retreat_rate}%, Flagship Sunk rate: ${flagSunk_rate}%\nAvg Resource Per Flagship Sunk\nfuel: ${results.fuelSunk}\nammo: ${results.ammoSunk}\nsteel: ${results.steelSunk}\nbauX: ${results.bauxSunk}\nbucket: ${results.bucketSunk}`; + } + } + let textarea = document.createElement('textarea'); + textarea.style.position = 'fixed'; + textarea.style.opacity = 0; + textarea.value = text; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand('Copy'); + document.body.removeChild(textarea); + this.displayNotice('copied'); + }, + + displayNotice: function(text) { + const notice = document.getElementById('notice'); + notice.textContent = text; + notice.style.opacity = '1'; + setTimeout(function() { + notice.style.opacity = '0'; + }, 1000); + } }, }).component('vbattle',{ props: ['battle','candelete','isboss'], @@ -1672,7 +1713,18 @@ var UI_AUTOBONUS = Vue.createApp({ }, }).component('vmodal',COMMON.CMP_MODAL).component('vloading',COMMON.CMP_LOADING).mount('#divAutoBonus'); - +window.addEventListener('keydown', function(event) { + const key = event.key.toLowerCase(); + switch(key) { + case 'enter': + const focusedElement = document.activeElement; + if(focusedElement.tagName !== 'INPUT' && !focusedElement.tagName !== 'TEXTAREA') { + UI_MAIN.onclickGo(); + scrollTo(0, document.querySelector('#divSimStatsButtons input[value="Go"]').getBoundingClientRect().top + window.pageYOffset); + } + break; + } +}); document.body.onunload = function() { if (UI_MAIN.canSave) { @@ -1682,4 +1734,4 @@ document.body.onunload = function() { COMMON.UI_MAIN = UI_MAIN; //debug -})(); \ No newline at end of file +})(); diff --git a/simulator.html b/simulator.html index f83194b3..720a71dd 100644 --- a/simulator.html +++ b/simulator.html @@ -400,7 +400,7 @@

Statistics

-
Avg Resource Per S:
+
Avg Resource Per S:
@@ -411,7 +411,7 @@

Statistics

Fuel{{results.fuelS}}
Ammo{{results.ammoS}}
-
Avg Resource Per Flagship Sunk:
+
Avg Resource Per Flagship Sunk:
@@ -474,6 +474,9 @@

Statistics

2017-03-23 - Fifth slot, separate plane improvement and proficiency, changed save/load code, day soft-cap option
2016-10-25 - Major reworking and improving of calculations. Added calculations explanations.
+
+ テスト +
Bug reports/feature requests: Github
@@ -623,7 +626,7 @@

Statistics

Load options:
From text:
-
+
Fleet:
+
@@ -1087,7 +1090,7 @@

Statistics

-
+
@@ -1394,4 +1397,4 @@

Statistics

- \ No newline at end of file + From e4e887de6a8add471d8506ffecf50d8bc63bd47c Mon Sep 17 00:00:00 2001 From: X-20A <155217226+X-20A@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:27:16 +0900 Subject: [PATCH 2/3] add_comment --- js/simulator-ui/fleet-editor.js | 1 + js/simulator-ui/ui-main.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/js/simulator-ui/fleet-editor.js b/js/simulator-ui/fleet-editor.js index 1881595a..c488dc6d 100644 --- a/js/simulator-ui/fleet-editor.js +++ b/js/simulator-ui/fleet-editor.js @@ -789,6 +789,7 @@ var UI_FLEETEDITOR = Vue.createApp({ receiveCloseEquip: function() { UI_FLEETEDITOR.refocusEquip(); }, + // c.One click on the text area for importing deck builder data will select all the data. onclickSelectAll: function(event) { event.target.select(); } diff --git a/js/simulator-ui/ui-main.js b/js/simulator-ui/ui-main.js index fddfe4c6..f94f4961 100644 --- a/js/simulator-ui/ui-main.js +++ b/js/simulator-ui/ui-main.js @@ -548,6 +548,7 @@ var UI_MAIN = Vue.createApp({ UI_FCFSETTINGS.doOpen(this.settingsFCF); }, + // a. Clipboard copy function on results screen (a'. and simple notification function) onclickCopyResults: function(typeString) { let isJP = document.querySelector('#divMain input[value="ja"]').checked; let text = ''; @@ -580,6 +581,7 @@ var UI_MAIN = Vue.createApp({ this.displayNotice('copied'); }, + // a'. and simple notification function displayNotice: function(text) { const notice = document.getElementById('notice'); notice.textContent = text; @@ -1713,6 +1715,7 @@ var UI_AUTOBONUS = Vue.createApp({ }, }).component('vmodal',COMMON.CMP_MODAL).component('vloading',COMMON.CMP_LOADING).mount('#divAutoBonus'); +// b.Keyboard shortcuts (for now, for the start of calculation) window.addEventListener('keydown', function(event) { const key = event.key.toLowerCase(); switch(key) { From d74a32e2da737619567a8227eaef44ed8273bb99 Mon Sep 17 00:00:00 2001 From: X-20A <155217226+X-20A@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:24:10 +0900 Subject: [PATCH 3/3] edit_design --- css/simulator-ui/main.css | 13 +++++++++++++ css/simulator-ui/selector.css | 31 ++++++++++++++++++++++--------- js/simulator-ui/cmp.js | 2 +- js/simulator-ui/selector.js | 2 +- js/simulator-ui/sim-interface.js | 2 +- simulator.html | 3 ++- 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/css/simulator-ui/main.css b/css/simulator-ui/main.css index 44697045..6de861d9 100644 --- a/css/simulator-ui/main.css +++ b/css/simulator-ui/main.css @@ -68,6 +68,10 @@ img.copyIcons { cursor: pointer; } +#divMain { + width: 1086px; + margin: auto; +} #divBattles { width: fit-content; } @@ -196,6 +200,9 @@ div.fleetCompAdd > div { input.changed { background-color: yellow; } +input[type="button"] { + cursor: pointer; +} #divSimStatsButtons { margin-top: 10px; @@ -241,6 +248,8 @@ div.progressBarInner { display: flex; } #divResultColsWrap div.resultCol { + padding-left: 5px; + border-left: 1px solid #e3e3e3; margin-right: 20px; } #divResultColsWrap div.resultCol > div { @@ -305,6 +314,8 @@ div.progressBarInner { } #divChangeLog { + width: 1086px; + margin: auto; margin-top: 20px; font-size: 14px; } @@ -312,6 +323,8 @@ div.progressBarInner { font-weight: bold; } #divFooter { + width: 1086px; + margin: auto; margin-top: 20px; font-size: 14px; } diff --git a/css/simulator-ui/selector.css b/css/simulator-ui/selector.css index da67bfda..4510a5c9 100644 --- a/css/simulator-ui/selector.css +++ b/css/simulator-ui/selector.css @@ -1,15 +1,19 @@ #divShipSelMain, #divEquipSelMain { background-color: #EDE6D8; width: 720px; - height: 560px; + height: 760px; border: 1px solid transparent; box-shadow: 0 0 5px black; } +#divEquipSelMain { + width: 1200px; +} #divShipSelSearch, #divEquipSelSearch { margin-left: 30px; margin-top: 15px; } #divShipSelResults, #divEquipSelResults { + overscroll-behavior: none; overflow-y: scroll; height: 504px; } @@ -75,7 +79,8 @@ div.selButtonBack > :last-child { } #divShipSelButtonsShip { - max-height: 500px; + max-height: 700px; + overscroll-behavior: none; overflow-y: scroll; margin-left: 30px; margin-top: 15px; @@ -83,7 +88,7 @@ div.selButtonBack > :last-child { flex-basis: 0; flex-wrap: wrap; font-family: Verdana,Arial,sans-serif; - font-size: 1.1em; + font-size: 1.1em; } #divShipSelButtonsShip div.remodelButtonWrap { display: flex; @@ -102,25 +107,34 @@ div.selButtonBack > :last-child { } #divEquipSelButtonsEquip { - max-height: 500px; + overscroll-behavior: none; + max-height: 700px; overflow-y: scroll; margin: 15px 30px; font-family: Verdana,Arial,sans-serif; - font-size: 1.1em; + font-size: 1.1em; } #divEquipSelButtonsEquip div.equipButtonWrap { display: flex; - flex-direction: column; + flex-direction: row; + flex-wrap: wrap; flex-basis: 0; margin-bottom: 30px; font-size: 14px; } #divEquipSelButtonsEquip div.equipButton { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: calc(25% - 20px); display: flex; border: 1px solid black; - margin: 1px; + margin: 2px; padding-bottom: 2px; background-color: white; + border-right: none; + border-bottom: none; + font-size: 13px; } #divEquipSelButtonsEquip div.equipButton:hover { background-color: #78BEB5; @@ -128,10 +142,9 @@ div.selButtonBack > :last-child { } #divEquipSelButtonsEquip div.equipButton img { vertical-align: middle; - margin-left: 12px; + margin-left: 2px; margin-right: 2px; } #divEquipSelButtonsEquip div.equipButton span { vertical-align: middle; } - diff --git a/js/simulator-ui/cmp.js b/js/simulator-ui/cmp.js index 765f1e8a..daa69559 100644 --- a/js/simulator-ui/cmp.js +++ b/js/simulator-ui/cmp.js @@ -190,4 +190,4 @@ COMMON.i18n = VueI18n.createI18n({ messages, }); -})(); \ No newline at end of file +})(); diff --git a/js/simulator-ui/selector.js b/js/simulator-ui/selector.js index 2a57df3f..10f57328 100644 --- a/js/simulator-ui/selector.js +++ b/js/simulator-ui/selector.js @@ -473,4 +473,4 @@ COMMON.global.equipSelectorClose = function() { } -})(); \ No newline at end of file +})(); diff --git a/js/simulator-ui/sim-interface.js b/js/simulator-ui/sim-interface.js index 9fb9022f..bd346067 100644 --- a/js/simulator-ui/sim-interface.js +++ b/js/simulator-ui/sim-interface.js @@ -943,4 +943,4 @@ var SIM = { window.SIM = SIM; -})() \ No newline at end of file +})() diff --git a/simulator.html b/simulator.html index 720a71dd..1decb3ed 100644 --- a/simulator.html +++ b/simulator.html @@ -1,8 +1,9 @@ - + KanColle Sortie Simulator +
Fuel{{results.fuelSunk}}
Ammo{{results.ammoSunk}}