From 53d3c34d1ed16ebdc1dd45a6f534c28d339ad46b Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 26 Mar 2022 23:11:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=82=AC=EB=A0=B9=EB=B6=80=EC=9D=98=20?= =?UTF-8?q?=ED=84=B4=20=EC=84=A0=ED=83=9D=EA=B8=B0=EC=97=90=20=EA=B3=A0?= =?UTF-8?q?=EA=B8=89=20=EB=AA=A8=EB=93=9C=20=EC=A0=81=EC=9A=A9=20(#212)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 사령부 턴 페이지를 vue3 setup 형태로 변경 - 턴 조작기 함수 중 공용 함수 분리 - 사령부 턴 조작기 코드 범위를 다시 조정 - 사령부 일반 모드, 고급 모드 이원화 - 사령부에서 다른 수뇌의 턴 '복사하기' 제공 Co-authored-by: Hide_D Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/212 Co-authored-by: hide_d Co-committed-by: hide_d --- .../API/NationCommand/ReserveBulkCommand.php | 76 + hwe/scss/chiefCenter.scss | 14 +- hwe/ts/ChiefCenter/TopItem.vue | 220 ++- hwe/ts/PageChiefCenter.vue | 532 ++----- hwe/ts/PartialReservedCommand.vue | 428 ++---- hwe/ts/SammoAPI.ts | 5 + hwe/ts/components/ChiefReservedCommand.vue | 1295 +++++++++++------ hwe/ts/components/CommandSelectForm.vue | 100 +- hwe/ts/components/DragSelect.vue | 2 +- hwe/ts/util/QueryActionHelper.ts | 173 +++ hwe/ts/util/StoredActionsHelper.ts | 39 +- hwe/v_chiefCenter.php | 5 + 12 files changed, 1677 insertions(+), 1212 deletions(-) create mode 100644 hwe/sammo/API/NationCommand/ReserveBulkCommand.php create mode 100644 hwe/ts/util/QueryActionHelper.ts diff --git a/hwe/sammo/API/NationCommand/ReserveBulkCommand.php b/hwe/sammo/API/NationCommand/ReserveBulkCommand.php new file mode 100644 index 00000000..b8da199d --- /dev/null +++ b/hwe/sammo/API/NationCommand/ReserveBulkCommand.php @@ -0,0 +1,76 @@ +args as $idx => $turn) { + $v = new Validator($turn); + $v->rule('required', [ + 'action', + 'turnList' + ]) + ->rule('lengthMin', 'action', 1) + ->rule('integerArray', 'turnList'); + + if (!$v->validate()) { + return "{$idx}:{$v->errorStr()}"; + } + } + + return null; + } + + public function getRequiredSessionMode(): int + { + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + } + + public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) + { + $briefList = []; + foreach ($this->args as $idx => $turn) { + $action = $turn['action']; + $turnList = $turn['turnList']; + $arg = $turn['arg'] ?? []; + + if (!$turnList) { + return "{$idx}: 턴이 입력되지 않았습니다"; + } + + if (!in_array($action, Util::array_flatten(GameConst::$availableChiefCommand))) { + return "{$idx}: 사용할 수 없는 커맨드입니다."; + } + + if (!is_array($arg)) { + return "{$idx}: 올바른 arg 형태가 아닙니다."; + } + $partialResult = setNationCommand($session->generalID, $turnList, $action, $arg); + if(!$partialResult['result']){ + return [ + 'result' => false, + 'briefList' => $briefList, + 'errorIdx' => $idx, + 'reason' => $partialResult['reason'] + ]; + } + $briefList[$idx] = $partialResult['brief']; + } + + return [ + 'result' => true, + 'briefList' => $briefList, + 'reason' => 'success' + ]; + } +} diff --git a/hwe/scss/chiefCenter.scss b/hwe/scss/chiefCenter.scss index f340adaa..dab8b4da 100644 --- a/hwe/scss/chiefCenter.scss +++ b/hwe/scss/chiefCenter.scss @@ -31,11 +31,16 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); line-height: 30px; } + .time_pad.inverted{ + background-color: gray; + color: white; + } + .turn_pad { line-height: 30px; } - .row:nth-child(odd) .turn_pad { + .row:nth-of-type(odd) .turn_pad { background-color: $modcolor2; } } @@ -83,7 +88,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); } .commandBox .controlPad { - .turn_pad:nth-child(2n) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } @@ -109,7 +114,6 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); width: 500px; height: 460px; margin: auto; - overflow: hidden; } #mainTable { @@ -131,7 +135,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); .commandBox .controlPad { margin-top: 10px; - .turn_pad:nth-child(even) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } @@ -145,7 +149,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); overflow: hidden; - .turn_pad:nth-child(even) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } diff --git a/hwe/ts/ChiefCenter/TopItem.vue b/hwe/ts/ChiefCenter/TopItem.vue index e1c9af4c..8e3fe4bd 100644 --- a/hwe/ts/ChiefCenter/TopItem.vue +++ b/hwe/ts/ChiefCenter/TopItem.vue @@ -1,88 +1,170 @@ - diff --git a/hwe/ts/PageChiefCenter.vue b/hwe/ts/PageChiefCenter.vue index e549eafa..396796ac 100644 --- a/hwe/ts/PageChiefCenter.vue +++ b/hwe/ts/PageChiefCenter.vue @@ -7,10 +7,7 @@ v-if="chiefList !== undefined" :class="`${targetIsMe ? 'targetIsMe' : 'targetIsNotMe'}`" > -