Encapsulate PBI Category-1 transition flags as file-statics

gfEnteringMapScreenToEnterPreBattleInterface, gfAutomaticallyStartAutoResolve
and gfDelayAutoResolveStart are now file-static in PreBattle Interface.cpp
(the latter's definition moved here from Strategic Movement.cpp). External
access goes through accessors declared in the header; PBI.cpp touches the
statics directly.

Accessors exist only where an external caller needs one:
AutomaticallyStartAutoResolve() getter (read in Town Militia,
gamescreen, Player Command); SetAutomaticallyStartAutoResolve (set in
Creature Spreading, strategicmap); SetDelayAutoResolveStart (set in
Strategic Movement);
SetEnteringMapScreenToEnterPreBattleInterface (set in strategicmap).
gfEnteringMapScreen stays a raw cross-read into mapscreen state, not
PBI-owned.  No behavior change: getter returns BOOLEAN.

Verify: grep the three flag names across the tree hits only PreBattle
Interface.cpp (three static defs, four accessor bodies, and in-file
Handle/reader access). No header externs, no external raw refs. Build: JA2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marco Antonio J. Costa
2026-08-02 14:58:24 -03:00
committed by majcosta
co-authored by Claude Opus 4.8
parent f1d5431660
commit 380fedca10
8 changed files with 22 additions and 17 deletions
+8 -3
View File
@@ -53,7 +53,6 @@
#include "GameInitOptionsScreen.h"
extern void InitializeTacticalStatusAtBattleStart();
extern BOOLEAN gfDelayAutoResolveStart;
extern UILayout_Map UI_MAP;
#ifdef JA2BETAVERSION
@@ -69,12 +68,13 @@ GROUP *gpTacticalTraversalGroup = NULL;
SOLDIERTYPE *gpTacticalTraversalChosenSoldier = NULL;
BOOLEAN gfAutomaticallyStartAutoResolve = FALSE;
static BOOLEAN gfAutomaticallyStartAutoResolve = FALSE;
static BOOLEAN gfDelayAutoResolveStart = FALSE;
BOOLEAN gfAutoAmbush = FALSE;
BOOLEAN gfHighPotentialForAmbush = FALSE;
BOOLEAN gfGotoSectorTransition = FALSE;
BOOLEAN gfEnterAutoResolveMode = FALSE;
BOOLEAN gfEnteringMapScreenToEnterPreBattleInterface = FALSE;
static BOOLEAN gfEnteringMapScreenToEnterPreBattleInterface = FALSE;
BOOLEAN gfIgnoreAllInput = TRUE;
BOOLEAN gfZoomDone = FALSE;
@@ -215,6 +215,11 @@ void SetPreBattleInterfaceActive( BOOLEAN fActive ) { gfPreBattleInterfaceActive
BOOLEAN IsPersistantPBI() { return gfUsePersistantPBI; }
void SetPersistantPBI( BOOLEAN fPersistant ) { gfUsePersistantPBI = fPersistant; }
BOOLEAN AutomaticallyStartAutoResolve() { return gfAutomaticallyStartAutoResolve; }
void SetAutomaticallyStartAutoResolve( BOOLEAN fAuto ) { gfAutomaticallyStartAutoResolve = fAuto; }
void SetDelayAutoResolveStart( BOOLEAN fDelay ) { gfDelayAutoResolveStart = fDelay; }
void SetEnteringMapScreenToEnterPreBattleInterface( BOOLEAN fEntering ) { gfEnteringMapScreenToEnterPreBattleInterface = fEntering; }
INT32 giHilitedInvolved = 0;
INT32 giHilitedUninvolved = 0;