diff --git a/hwe/sammo/API/Nation/GeneralList.php b/hwe/sammo/API/Nation/GeneralList.php index bfd95d3c..2b3ca226 100644 --- a/hwe/sammo/API/Nation/GeneralList.php +++ b/hwe/sammo/API/Nation/GeneralList.php @@ -121,6 +121,7 @@ class GeneralList extends \sammo\BaseAPI 'autorun_limit' => 1, 'impossibleUserAction' => 1, + 'reservedUserAction' => 1, ]; public function validateArgs(): ?string @@ -288,7 +289,36 @@ class GeneralList extends \sammo\BaseAPI } } return $impossibleUserAction; - } + }, + 'reservedUserAction' => function ($rawGeneral) use ($env) { + $rawUserAction = ($rawGeneral['aux'] ?? [])[UserActionCommand::USER_ACTION_KEY] ?? []; + $userAction = UserAction::fromArray($rawUserAction); + $reservedUserAction = []; + + $emptyTurnObj = [ + 'brief' => '휴식', + 'action' => '휴식', + 'arg' => [], + ]; + + for($i = 0; $i < 5; $i++){ + $reservedUserAction[] = $emptyTurnObj; + } + + if ($userAction->reserved) { + foreach ($userAction->reserved as $turnIdx => $reserved) { + if($turnIdx >= 5){ + continue; + } + $reservedUserAction[$turnIdx] = [ + 'brief' => $reserved->brief, + 'action' => $reserved->command, + 'arg' => [], + ]; + } + } + return $reservedUserAction; + }, ]; foreach ($rankColumns as $rankKey) { diff --git a/hwe/ts/components/GeneralList.vue b/hwe/ts/components/GeneralList.vue index 321cc784..2f7c32f1 100644 --- a/hwe/ts/components/GeneralList.vue +++ b/hwe/ts/components/GeneralList.vue @@ -7,71 +7,50 @@  보관하기 -
+ +
{{ key }}
-
삭제
+
+ 삭제 +
-
+
+
-
- +
+
@@ -1048,6 +1027,34 @@ const columnRawDefs = ref } ] }, + reservedUserAction: { + colId: "reservedUserAction", + headerName: "개인전략", + field: "reservedUserAction", + width: 120, + cellRenderer: ({ data }: GenValueParams) => { + if (data === undefined) { + return "?"; + } + if (data.npc >= 2) { + return "NPC 장수"; + } + if(!data.st1){ + return '-'; + } + const commandList = data.reservedUserAction; + if (!commandList) { + return "???"; + } + return commandList + .map(({ brief }) => brief) + .join("
"); + }, + cellStyle: { + lineHeight: "1em", + fontSize: "0.85em" + }, + }, turntime: { colId: "turntime", headerName: "턴", @@ -1231,6 +1238,7 @@ watch(columnRawDefs, (val) => { .g-tr { border-bottom: solid gray 1px; } + .g-thead-tr { position: sticky; top: 0px; @@ -1247,51 +1255,63 @@ watch(columnRawDefs, (val) => { text-decoration: underline; cursor: pointer; } + .ag-root-wrapper .cell-middle { display: flex; align-items: center; } + .ag-root-wrapper { font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic"; font-size: 14px; overflow: auto; } + .ag-root { overflow: auto; } + .ag-header { position: sticky; top: 0; z-index: 10; } + .cell-center { justify-content: space-around; text-align: center; } + .cell-right { justify-content: flex-end; text-align: right; } + .cell-sp .col { min-width: 30px; } + .ag-header-cell, .ag-header-group-cell, .ag-cell { padding-left: 4px; padding-right: 4px; } + .ag-header-cell-label, .ag-header-group-cell-label { justify-content: center; } + .ag-ltr .ag-floating-filter-button { margin-left: 2px; } + .ag-rtl .ag-floating-filter-button { margin-right: 2px; } } + .general-list-toolbar { .column-menu { column-count: 3; diff --git a/hwe/ts/defs/API/Nation.ts b/hwe/ts/defs/API/Nation.ts index fa12ee10..fd207076 100644 --- a/hwe/ts/defs/API/Nation.ts +++ b/hwe/ts/defs/API/Nation.ts @@ -83,6 +83,7 @@ export type GeneralListItemP1 = { firenum: number; impossibleUserAction: [string, number][]; + reservedUserAction: TurnObj[] | null; } & GeneralListItemP0; export type GeneralListItemP2 = GeneralListItemP1;