From 7d123a9542ae98e89078117a3432971782a6672f Mon Sep 17 00:00:00 2001 From: Geoffray Levasseur Date: Sat, 7 Nov 2026 00:58:34 +0100 Subject: [PATCH] final advance implementation --- game/localplayer/Diplomacy.cpp | 4 ++-- game/localplayer/Select.cpp | 8 ++++---- game/localplayer/Term.MainScreen.Client.cpp | 14 ++++---------- game/localplayer/Term.MainScreen.Turn.cpp | 7 +++---- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/game/localplayer/Diplomacy.cpp b/game/localplayer/Diplomacy.cpp index da789d6..3c2b941 100644 --- a/game/localplayer/Diplomacy.cpp +++ b/game/localplayer/Diplomacy.cpp @@ -28,6 +28,7 @@ #include "Diplomacy.h" +#include "Global.h" #include "Tribes.h" #include @@ -75,8 +76,7 @@ QString phraseTreaty(int treatyType) QString phraseAdvance(int advance) { - // Advance names (Rules.pas/StringTables.pas) aren't ported here. - return QStringLiteral("advance #%1").arg(advance); + return phrases.lookup(QStringLiteral("ADVANCES"), advance); } QString priceToString(int p, std::uint32_t price) diff --git a/game/localplayer/Select.cpp b/game/localplayer/Select.cpp index b1a671b..acb4a85 100644 --- a/game/localplayer/Select.cpp +++ b/game/localplayer/Select.cpp @@ -104,22 +104,22 @@ QString phrase(const QString &key) QString advanceName(int advance) { - return QStringLiteral("Advance #%1").arg(advance); + return phrases.lookup(QStringLiteral("ADVANCES"), advance); } QString impName(int iix) { - return QStringLiteral("Improvement #%1").arg(iix); + return phrases.lookup(QStringLiteral("IMPROVEMENTS"), iix); } QString governmentName(int gov) { - return QStringLiteral("Government #%1").arg(gov); + return phrases.lookup(QStringLiteral("GOVERNMENT"), gov); } QString spyMissionName(int mission) { - return QStringLiteral("Mission #%1").arg(mission); + return phrases.lookup(QStringLiteral("SPYMISSION"), mission); } } // namespace diff --git a/game/localplayer/Term.MainScreen.Client.cpp b/game/localplayer/Term.MainScreen.Client.cpp index 2edebb2..d1985dd 100644 --- a/game/localplayer/Term.MainScreen.Client.cpp +++ b/game/localplayer/Term.MainScreen.Client.cpp @@ -29,16 +29,10 @@ // TMainScreen.Client() (Term.pas): the command dispatcher the server calls // for the human player. // -// PORT STATUS: served so far - cDebugMessage, cShowNego, cInitModule, -// cReleaseModule, cHelpOnly/cStartHelp/cStartCredits, cNewGame/cLoadGame/ -// cMovie/cNewMap, cGetReady/cReplay, cBreakGame, cShowGame, cShowTurnChange, -// cTurn/cResume/cContinue, cMovieTurn/cMovieEndTurn, cEditMap, scContact, -// scDipStart..scDipBreak, the pure message commands (cShowCancelTreaty*, -// cShowSupportAllianceAgainst, cShowPeaceViolation, cShowMissionResult, -// cShowShipChange, cShowGreatLibTech), cShowEndContact and the client -// exclusive commands. Still missing because they need MoveUnit/ShowMove -// (not ported): cShowUnitChanged/CityChanged/AfterMove/AfterAttack/Moving/ -// Capturing/Attacking, cRefreshDebugMap. +// Fully ported: every command handled by the original's top-level case +// statement is handled here too, including the cShowXxx move/combat +// feedback commands (delegated to clientShow(), see Term.MainScreen.Show.cpp) +// and cRefreshDebugMap. #include "Term.MainScreen.h" diff --git a/game/localplayer/Term.MainScreen.Turn.cpp b/game/localplayer/Term.MainScreen.Turn.cpp index 24ae55d..ec02365 100644 --- a/game/localplayer/Term.MainScreen.Turn.cpp +++ b/game/localplayer/Term.MainScreen.Turn.cpp @@ -1,11 +1,10 @@ // TMainScreen.InitTurn, NextUnit, EndTurn, ZoomToCity and CityClosed (Term.pas). // // PORT STATUS / deviations: -// - sound (Play, SoundPreload) is not ported; +// - SoundPreload() is deliberately not ported (Sound.pas's asset-preload +// step has no effect now that Sound.pas itself is a no-op, see Play()); // - the menu check marks the original reads (mRepScreens, mWaitTurn, ...) are -// read from optionChecked, which the menus will keep in sync; -// - InitTurn's continuation of multi-turn goto/terrain enhancement needs -// MoveUnit (not ported) and is marked TODO. +// read from optionChecked, which the menus will keep in sync. #include "Term.MainScreen.h"