From a01e5df650e5728fbbc2968550eccc15ad0cc3a6 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 19 Dec 2021 04:28:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(WIP):=20processing,=20=EB=AA=B0=EC=88=98?= =?UTF-8?q?=20-=20=EC=B4=88=EC=84=B1=EC=97=90=EC=84=9C=20Windows=20?= =?UTF-8?q?=EA=B2=B9=EB=B0=9B=EC=B9=A8,=20Mac=20=EB=90=9C=EC=86=8C?= =?UTF-8?q?=EB=A6=AC=20=EC=9E=90=EC=9D=8C(automata=20=EC=B4=88=EC=84=B1)?= =?UTF-8?q?=20-=20=EC=9E=A5=EC=88=98=20=EC=84=A0=ED=83=9D=EC=97=90?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B2=80=EC=9D=80=EC=83=89=20=ED=85=8C?= =?UTF-8?q?=EB=A7=88=20-=20=EC=96=91=20=EC=84=A0=ED=83=9D=EA=B8=B0?= =?UTF-8?q?=EC=97=90=20=EC=88=AB=EC=9E=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/css/common.css | 1 + hwe/sammo/Command/Nation/che_몰수.php | 19 ++++ hwe/scss/game_bg.scss | 2 + hwe/ts/PartialReservedCommand.vue | 5 +- hwe/ts/colorSelect.ts | 14 --- hwe/ts/defaultSelectCityByMap.ts | 20 ----- hwe/ts/defaultSelectNationByMap.ts | 22 ----- hwe/ts/processing/AmountSelect.vue | 100 +++++++++++++++++++++ hwe/ts/processing/CitySelect.vue | 4 +- hwe/ts/processing/GeneralSelect.vue | 63 ++++++++++--- hwe/ts/processing/Nation/che_몰수.vue | 125 ++++++++++++++++++++++++++ hwe/ts/processing/Nation/che_발령.vue | 18 +++- hwe/ts/processing/Nation/che_포상.vue | 7 -- hwe/ts/processing/Nation/index.ts | 2 +- hwe/ts/processing/NationSelect.vue | 4 +- hwe/ts/util/automata초성.ts | 99 ++++++++++++++++++++ hwe/ts/util/randStr.ts | 25 ++++++ hwe/ts/v_processing.ts | 5 -- 18 files changed, 447 insertions(+), 88 deletions(-) delete mode 100644 hwe/ts/colorSelect.ts delete mode 100644 hwe/ts/defaultSelectCityByMap.ts delete mode 100644 hwe/ts/defaultSelectNationByMap.ts create mode 100644 hwe/ts/processing/AmountSelect.vue create mode 100644 hwe/ts/processing/Nation/che_몰수.vue delete mode 100644 hwe/ts/processing/Nation/che_포상.vue create mode 100644 hwe/ts/util/automata초성.ts create mode 100644 hwe/ts/util/randStr.ts diff --git a/hwe/css/common.css b/hwe/css/common.css index 48f34e5a..75c75e8e 100644 --- a/hwe/css/common.css +++ b/hwe/css/common.css @@ -9,6 +9,7 @@ body { color: white; line-height: 1.3; font-size: 14px; + background-position: center; } input { diff --git a/hwe/sammo/Command/Nation/che_몰수.php b/hwe/sammo/Command/Nation/che_몰수.php index 286edcea..0e58a481 100644 --- a/hwe/sammo/Command/Nation/che_몰수.php +++ b/hwe/sammo/Command/Nation/che_몰수.php @@ -214,6 +214,25 @@ class che_몰수 extends Command\NationCommand return true; } + public function exportJSVars(): array + { + $db = DB::db(); + $nationID = $this->getNationID(); + $troops = Util::convertArrayToDict($db->query('SELECT * FROM troop WHERE nation=%i', $nationID), 'troop_leader'); + $destRawGenerals = $db->queryAllLists('SELECT no,name,officer_level,npc,gold,rice,leadership,strength,intel,city,crew,train,atmos,troop FROM general WHERE nation = %i ORDER BY npc,binary(name)', $nationID); + return [ + 'procRes' => [ + 'troops' => $troops, + 'generals' => $destRawGenerals, + 'generalsKey' => ['no', 'name', 'officerLevel', 'npc', 'gold', 'rice', 'leadership', 'strength', 'intel', 'cityID', 'crew', 'train', 'atmos', 'troopID'], + 'cities' => \sammo\JSOptionsForCities(), + 'minAmount' => 100, + 'maxAmount' => GameConst::$maxResourceActionAmount, + 'amountGuide' => GameConst::$resourceActionAmountGuide, + ] + ]; + } + public function getForm(): string { //TODO: 암행부처럼 보여야... diff --git a/hwe/scss/game_bg.scss b/hwe/scss/game_bg.scss index 6f1447b9..6a59c811 100644 --- a/hwe/scss/game_bg.scss +++ b/hwe/scss/game_bg.scss @@ -17,6 +17,8 @@ table.tb_layout { html, body { font-size: 14px; + background-position: center; + background-repeat: repeat-y; } .tb_layout td, diff --git a/hwe/ts/PartialReservedCommand.vue b/hwe/ts/PartialReservedCommand.vue index 380a3c98..2016de00 100644 --- a/hwe/ts/PartialReservedCommand.vue +++ b/hwe/ts/PartialReservedCommand.vue @@ -210,7 +210,7 @@ import { parseTime } from "@util/parseTime"; import { parseYearMonth } from "@util/parseYearMonth"; import { sammoAPI } from "@util/sammoAPI"; import { filter초성withAlphabet } from "@util/filter초성withAlphabet"; - +import { automata초성All } from "@util/automata초성"; type commandItem = { value: string; title: string; @@ -502,7 +502,8 @@ export default defineComponent({ const [filteredTextH, filteredTextA] = filter초성withAlphabet( command.simpleName.replace(/\s+/g, "") ); - command.searchText = `${command.simpleName} ${filteredTextH} ${filteredTextA}`; + const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH); + command.searchText = `${command.simpleName} ${filteredTextH} ${filteredTextA} ${filteredTextHL1} ${filteredTextHL2}`; } } diff --git a/hwe/ts/colorSelect.ts b/hwe/ts/colorSelect.ts deleted file mode 100644 index 31daa772..00000000 --- a/hwe/ts/colorSelect.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function colorSelect(): void{ - function changeNationColorPlate(){ - const $this = $('#colorType'); - const $option = $this.find('option:selected'); - $this.css({ - 'background-color':$option.css('background-color'), - 'color':$option.css('color') - }); - } - $('#colorType').on('change', function(){ - changeNationColorPlate(); - }); - changeNationColorPlate(); -} \ No newline at end of file diff --git a/hwe/ts/defaultSelectCityByMap.ts b/hwe/ts/defaultSelectCityByMap.ts deleted file mode 100644 index a3f5078e..00000000 --- a/hwe/ts/defaultSelectCityByMap.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { reloadWorldMap } from "@/map"; - -declare let vueReactive_destCityID: number|undefined; - -export function defaultSelectCityByMap(): void { - void reloadWorldMap({ - isDetailMap: false, - clickableAll: true, - neutralView: true, - useCachedMap: true, - selectCallback: function (city) { - if(vueReactive_destCityID === undefined){ - console.error('아직 초기화 되지 않음'); - return false; - } - vueReactive_destCityID = city.id; - return false; - } - }); -} diff --git a/hwe/ts/defaultSelectNationByMap.ts b/hwe/ts/defaultSelectNationByMap.ts deleted file mode 100644 index 0a3c953a..00000000 --- a/hwe/ts/defaultSelectNationByMap.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { reloadWorldMap } from "@/map"; - -declare let vueReactive_destNationID: number|undefined; - -export function defaultSelectNationByMap(): void{ - const $target = $("#destNationID"); - console.log('nation', $target); - void reloadWorldMap({ - isDetailMap: false, - clickableAll: true, - neutralView: true, - useCachedMap: true, - selectCallback: function (city) { - if(typeof vueReactive_destNationID === 'undefined'){ - console.error('아직 초기화 되지 않음'); - return false; - } - vueReactive_destNationID = city.nationID; - return false; - } - }); -} \ No newline at end of file diff --git a/hwe/ts/processing/AmountSelect.vue b/hwe/ts/processing/AmountSelect.vue new file mode 100644 index 00000000..8dddd7d0 --- /dev/null +++ b/hwe/ts/processing/AmountSelect.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/hwe/ts/processing/CitySelect.vue b/hwe/ts/processing/CitySelect.vue index 59b1ad7f..1338aac6 100644 --- a/hwe/ts/processing/CitySelect.vue +++ b/hwe/ts/processing/CitySelect.vue @@ -32,6 +32,7 @@ + + \ No newline at end of file diff --git a/hwe/ts/processing/Nation/che_몰수.vue b/hwe/ts/processing/Nation/che_몰수.vue new file mode 100644 index 00000000..e3f68332 --- /dev/null +++ b/hwe/ts/processing/Nation/che_몰수.vue @@ -0,0 +1,125 @@ + + + diff --git a/hwe/ts/processing/Nation/che_발령.vue b/hwe/ts/processing/Nation/che_발령.vue index b7d7bcf6..86de48da 100644 --- a/hwe/ts/processing/Nation/che_발령.vue +++ b/hwe/ts/processing/Nation/che_발령.vue @@ -16,18 +16,19 @@ 목록을 선택하거나 도시를 클릭하세요.
-
+
-
+
{{ commandName }}
@@ -48,10 +49,12 @@ import TopBackBar from "@/components/TopBackBar.vue"; import BottomBar from "@/components/BottomBar.vue"; import { convertGeneralList, + procGeneralItem, procGeneralKeyList, procGeneralRawItemList, procTroopList, } from "../processingRes"; +import { convertDictById, getNpcColor } from "@/common_legacy"; declare const mapTheme: string; declare const currentCity: number; declare const commandName: string; @@ -101,6 +104,13 @@ export default defineComponent({ const selectedGeneralID = ref(generalList[0].no); + function textHelpGeneral(gen: procGeneralItem): string{ + const troops = (!gen.troopID)?'':`,${procRes.troops[gen.troopID].name}`; + const nameColor = getNpcColor(gen.npc); + const name = nameColor?`${gen.name}`:gen.name; + return `${name} [${citiesMap.get(gen.cityID)?.name}${troops}] (${gen.leadership}/${gen.leadership}/${gen.intel}) <병${gen.crew.toLocaleString()}/훈${gen.train}/사${gen.atmos}>`; + } + async function submit(e: Event) { const event = new CustomEvent("customSubmit", { detail: { @@ -109,6 +119,9 @@ export default defineComponent({ }, }); unwrap(e.target).dispatchEvent(event); + + // title: `${gen.name}[${this.cities.get(gen.cityID)?.name}] (${gen.leadership}/${gen.leadership}/${gen.intel}) <병${gen.crew.toLocaleString()}/훈${gen.train}/사${gen.atmos}`, + } return { @@ -122,6 +135,7 @@ export default defineComponent({ generalList, commandName, selectedCity, + textHelpGeneral, submit, }; }, diff --git a/hwe/ts/processing/Nation/che_포상.vue b/hwe/ts/processing/Nation/che_포상.vue deleted file mode 100644 index f236d0f0..00000000 --- a/hwe/ts/processing/Nation/che_포상.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/hwe/ts/processing/Nation/index.ts b/hwe/ts/processing/Nation/index.ts index 38c83d85..04abdfa9 100644 --- a/hwe/ts/processing/Nation/index.ts +++ b/hwe/ts/processing/Nation/index.ts @@ -1,5 +1,5 @@ export { default as che_국기변경 } from "./che_국기변경.vue"; export { default as che_국호변경 } from "./che_국호변경.vue"; export { default as che_급습 } from "./che_급습.vue"; +export { default as che_몰수 } from "./che_몰수.vue"; export { default as che_발령 } from "./che_발령.vue"; -export { default as che_포상 } from "./che_포상.vue"; \ No newline at end of file diff --git a/hwe/ts/processing/NationSelect.vue b/hwe/ts/processing/NationSelect.vue index 4bc6ba17..c1664bfd 100644 --- a/hwe/ts/processing/NationSelect.vue +++ b/hwe/ts/processing/NationSelect.vue @@ -33,6 +33,7 @@