diff --git a/hwe/func_history.php b/hwe/func_history.php index 687e9e52..10ddbc07 100644 --- a/hwe/func_history.php +++ b/hwe/func_history.php @@ -254,6 +254,7 @@ function pushGeneralHistoryLog(int $generalID, ?array $history, $year=null, $mon } +/** @deprecated */ function getGeneralHistoryLogAll(int $generalID):array { $db = DB::db(); @@ -263,6 +264,15 @@ function getGeneralHistoryLogAll(int $generalID):array { ); } +function getGeneralHistoryLogWithLogID(int $generalID):array { + $db = DB::db(); + + return Util::convertPairArrayToDict($db->queryAllLists( + 'SELECT `id`, `text` from general_record WHERE general_id = %i AND log_type = "history" order by id desc', + $generalID + )); +} + function pushNationHistoryLog(int $nationID, ?array $history, ?int $year=null, ?int $month=null) { if(!$history){ diff --git a/hwe/sammo/API/General/GetGeneralLog.php b/hwe/sammo/API/General/GetGeneralLog.php index 4edbe965..2cbf2db3 100644 --- a/hwe/sammo/API/General/GetGeneralLog.php +++ b/hwe/sammo/API/General/GetGeneralLog.php @@ -18,12 +18,12 @@ class GetGeneralLog extends GetNationGeneralLog $v = new Validator($this->args); $v ->rule('required', [ - 'type', + 'reqType', ]) ->rule('int', [ 'reqTo', ]) - ->rule('in', 'type', [ + ->rule('in', 'reqType', [ self::GENERAL_HISTORY, self::GENERAL_ACTION, self::BATTLE_RESULT, diff --git a/hwe/sammo/API/Nation/GetGeneralLog.php b/hwe/sammo/API/Nation/GetGeneralLog.php index 857d0b61..09128e69 100644 --- a/hwe/sammo/API/Nation/GetGeneralLog.php +++ b/hwe/sammo/API/Nation/GetGeneralLog.php @@ -14,6 +14,7 @@ use function sammo\getBattleResultRecent; use function sammo\getGeneralActionLogMore; use function sammo\getGeneralActionLogRecent; use function sammo\getGeneralHistoryLogAll; +use function sammo\getGeneralHistoryLogWithLogID; class GetGeneralLog extends \sammo\BaseAPI { @@ -28,13 +29,13 @@ class GetGeneralLog extends \sammo\BaseAPI $v ->rule('required', [ 'generalID', - 'type', + 'reqType', ]) ->rule('integer', [ 'generalID', 'reqTo', ]) - ->rule('in', 'type', [ + ->rule('in', 'reqType', [ self::GENERAL_HISTORY, self::GENERAL_ACTION, self::BATTLE_RESULT, @@ -76,7 +77,7 @@ class GetGeneralLog extends \sammo\BaseAPI return '같은 나라의 장수가 아닙니다.'; } - $reqType = $this->args['type']; + $reqType = $this->args['reqType']; if ( $reqType === self::GENERAL_ACTION && $testGeneralNPCType < 2 && @@ -103,7 +104,7 @@ class GetGeneralLog extends \sammo\BaseAPI $userID = $session->userID; $targetGeneralID = $this->getTargetGeneralID($session); - $reqType = $this->args['type']; + $reqType = $this->args['reqType']; $reqTo = $this->args['reqTo'] ?? null; $db = DB::db(); @@ -124,7 +125,7 @@ class GetGeneralLog extends \sammo\BaseAPI 'result' => true, 'reqType' => $reqType, 'generalID' => $targetGeneralID, - 'log' => getGeneralHistoryLogAll($targetGeneralID) + 'log' => getGeneralHistoryLogWithLogID($targetGeneralID) ]; } diff --git a/hwe/scss/battleLog.scss b/hwe/scss/battleLog.scss new file mode 100644 index 00000000..8961a66c --- /dev/null +++ b/hwe/scss/battleLog.scss @@ -0,0 +1,33 @@ +.small_war_log { + display: inline-block; +} + +.small_war_log .war_type_attack { + color: cyan; +} + +.small_war_log .war_type_defense { + color: magenta; +} + +.small_war_log .war_type_siege { + color: white; +} + +.small_war_log .name_plate { + font-size: 0.75em; +} + +.small_war_log .name_plate_cover { + color: yellow; +} + +.small_war_log .crew_plate { + color: orangered; + font-size: 90%; +} + +.hidden_but_copyable { + color: rgba(0, 0, 0, 0); + font-size: 0; +} \ No newline at end of file diff --git a/hwe/scss/common_legacy.scss b/hwe/scss/common_legacy.scss index 85fe1bc2..8de8a276 100644 --- a/hwe/scss/common_legacy.scss +++ b/hwe/scss/common_legacy.scss @@ -105,35 +105,6 @@ div.bar_out div.bar_in { content: "◆"; } -.small_war_log { - display: inline-block; -} - -.small_war_log .war_type_attack { - color: cyan; -} - -.small_war_log .war_type_defense { - color: magenta; -} - -.small_war_log .war_type_siege { - color: white; -} - -.small_war_log .name_plate { - font-size: 0.75em; -} - -.small_war_log .name_plate_cover { - color: yellow; -} - -.small_war_log .crew_plate { - color: orangered; - font-size: 90%; -} - .t_date { font-size: 0.75em; } diff --git a/hwe/ts/PageBattleCenter.vue b/hwe/ts/PageBattleCenter.vue index 23223f14..1a1d3593 100644 --- a/hwe/ts/PageBattleCenter.vue +++ b/hwe/ts/PageBattleCenter.vue @@ -1,33 +1,61 @@ + diff --git a/hwe/ts/PageNationGeneral.vue b/hwe/ts/PageNationGeneral.vue index 3c755198..4b528870 100644 --- a/hwe/ts/PageNationGeneral.vue +++ b/hwe/ts/PageNationGeneral.vue @@ -97,7 +97,7 @@ async function reload() { } function openBattleCenter(generalID: number){ - window.open(`b_battleCenter.php?gen=${generalID}`) + window.open(`v_battleCenter.php?gen=${generalID}`) } onMounted(async () => { diff --git a/hwe/ts/SammoAPI.ts b/hwe/ts/SammoAPI.ts index 9ac1395e..bf926c51 100644 --- a/hwe/ts/SammoAPI.ts +++ b/hwe/ts/SammoAPI.ts @@ -18,7 +18,7 @@ import type { BettingDetailResponse, BettingListResponse } from "./defs/API/Bett import type { ReserveBulkCommandResponse, ReserveCommandResponse, ReservedCommandResponse } from "./defs/API/Command"; import type { ChiefResponse } from "./defs/API/NationCommand"; import type { inheritBuffType, InheritLogResponse } from "./defs/API/InheritAction"; -import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListResponse, LiteNationInfoResponse, NationInfoResponse } from "./defs/API/Nation"; +import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListResponse, NationInfoResponse } from "./defs/API/Nation"; import type { UploadImageResponse } from "./defs/API/Misc"; import type { GeneralLogType, GetGeneralLogResponse, JoinArgs } from "./defs/API/General"; import type { diff --git a/hwe/ts/components/GeneralSupplementCard.vue b/hwe/ts/components/GeneralSupplementCard.vue index 6bd27e6b..99b29da6 100644 --- a/hwe/ts/components/GeneralSupplementCard.vue +++ b/hwe/ts/components/GeneralSupplementCard.vue @@ -1,29 +1,29 @@