602 Commits
Author SHA1 Message Date
ee098125e6 Strip dead per-language .slf entries from gGameLibaries
InitializeFileDatabase, the only reader of gGameLibaries[], is called
nowhere in the tree — VFS replaced this legacy loader. Delete the
7 #ifdef GERMAN/POLISH/DUTCH/ITALIAN/RUSSIAN/FRENCH/CHINESE entries
outright rather than runtime-selecting them.

NPC.h: two commented-out #if defined(CRIPPLED_VERSION)||defined(RUSSIAN)
triplets. AimMembers.cpp: two commented-out #ifdef POLISH character-remap
switch blocks. All already-dead. Verify grep for language macros outside
i18n/ now returns only unrelated hits (filename literal, dev-tool CLI flag,
stray comment, historical prose) — no #ifdef guards left.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 09:46:41 -03:00
fd2c74727e Make LANGUAGE switchable in runtime (#653)
squashed into a single commit because doing it in steps that all
compiled involved a lot of boilerplate that is pointless to commit to
the repository. GH still has the PR for reference.

g_lang, MAX_MESSAGES_ON_MAP_BOTTOM, and GetLanguagePrefix() were
compile-time constants selected by the ENGLISH/GERMAN/... build
define. They're now runtime, defaulting to the same per-exe value the
define used to pick, and overridable at startup from [Ja2 Settings]
LANGUAGE in Ja2.ini.

-

XMLTacticalMessages is filled at runtime from NewTacticalMessages.xml,
never from compiled-in per-language data: all 8 per-language definitions
were the identical all-zero { L"" }. Delete them and define one shared
buffer in Utils/XML_Language.cpp (the loader) instead of pointer-rebinding
it like the static tables — this drops 9 dead 800KB zero-buffers (8
namespaced copies in LanguageStrings.cpp plus the standalone one) and
leaves no bind-ordering hazard for the XML load path.

-

ExportStrings.cpp privately recompiled one language's full text table
by #including the raw _<LANG>Text.cpp inside namespace Loc, keyed off
the exe-level ENGLISH/GERMAN/... compile macro (whichever the build
happened to select). That's redundant with the pointer globals every
other subsystem already uses (Text.h / LanguageStrings.cpp).

Drop the private copy; the unqualified table names in Loc::ExportStrings
now resolve to the global pointer externs, which BindLanguageStrings has
already rebound to the runtime g_lang by the time this runs (EXPORT_STRINGS
ini flag, checked after GetRuntimeSettings in sgp.cpp). gs_Lang (used only
by Loc::Translate for the Polish/Russian byte remap on raw .edt exports) is
now derived from g_lang via ToLocLanguage, so the export always matches
whatever language is actually active instead of a compile-time pick.

-

Editor/popupmenu.cpp and Strategic/Scheduling.cpp kept their own
call-site extern of gszScheduleActions as CHAR16[NUM_SCHEDULE_ACTIONS][20]
after the real definition changed into a rebindable pointer
(CHAR16 (*)[20], LanguageStrings.cpp). MSVC decays the outer array
dimension when mangling globals, so both declarations produce the same
symbol (?gszScheduleActions@@3PAY0BE@_WA) and the mismatch linked
silently -- but the array-typed TUs then indexed the 4-byte pointer
slot itself as string data, so the editor schedule popup and the map
schedule message text read garbage.

-

add text.def to be single-source of truth on symbol names and use it
 .much simpler, less error prone if adding more strings

-

add pseudo interface for language state. MAX_SAGES_ON_BOTTOM must always
 change in lockstep with g_lang. this isn't foolproof but better

---------

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-07-21 05:33:03 -03:00
Asdow b1c076416c Remove magic numbers 2026-01-04 14:57:55 +02:00
Asdow cc984b09f6 Fix comparison check 2026-01-03 17:27:43 +02:00
Asdow 8d00a316c5 Remove unused enum conditionals 2026-01-03 17:27:43 +02:00
Asdow d51f1e6088 Add comment 2026-01-03 17:27:43 +02:00
Asdow 1c86d96e9d Remove custom_email.edt
Unfinished feature as far as I can tell and new emails will be easier to add via Emails.xml
2026-01-03 17:27:43 +02:00
Asdow 6f6aadf89c Remove unused & unfinished email externalizations 2026-01-03 17:27:43 +02:00
Asdow 96de96e9c6 Remove unused includes
* Formatting
2026-01-03 17:27:43 +02:00
Asdow ebcc5449c5 Make functions static 2026-01-03 17:27:43 +02:00
Asdow 6b7bc51a52 Remove commented out variables 2026-01-03 17:27:43 +02:00
Asdow 622cffce82 Use #define instead of magic numbers 2026-01-03 17:27:43 +02:00
Asdow 5ed79c3edb Fix email sorting
* Simplify pSubject copying else ifs
* Formatting
2026-01-03 17:27:43 +02:00
Asdow fe69dba958 Add missing email 2026-01-03 17:27:43 +02:00
Asdow f8b6ee1672 Use externalized emails 2026-01-03 17:27:43 +02:00
Asdow 30070035cc Correct pSubject size 2026-01-03 17:27:43 +02:00
Asdow ff3079ff23 Formatting 2026-01-03 17:27:43 +02:00
Asdow aba3688b4b Add framework for adding externalized emails
Emails from new GameDir file TableData/Email/Emails.xml can be added via lua scripting using calls to AddEmailFromXML & AddPreReadEmailFromXML. The order of emails in Emails.xml acts as the index to be referenced and provided when calling lua  functions.

An error message  will be displayed if an email is added with an out-of-scope index but game will be able to continue.

Localization is supported and was tested on Chinese localization.
2026-01-03 17:27:43 +02:00
Asdow 9cfcfac376 include cleanup 2025-12-03 23:52:05 +02:00
Marco Antonio J. Costaandmajcosta 049981b35f remove now unused functions
we use a single function to turn a number into a money formatted string
now
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 3d29eff4d8 use FormatMoney everywhere 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 0dd32c4670 move FormatMoney to Text Utils 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta fee56e37e7 better FormatMoney 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta d79a445ad1 remove ATM_BUTTONS_* definitions 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta b1ccdf4e38 remove unused TransferFundsFromBankToMerc/MercToBank 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 86ec94b40a stop using sATMText for "Insufficient Funds" message
it is about to go
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 2eff78a2cf remove scope and fix whitespace in RenderAtmPanel 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta 3d95c47356 refactor UpDateStateOfStartButton 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta 0ebcf0fa06 remove comments 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta d6166000c9 rename fShowAtmPanelStartButton into something truthful
there is no start button, this just controls whether to draw the four
buttons in the Personnel tab of the laptop or not

also get rid of lying comments

also make it static, laptop.cpp doesn't use it at all
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 08b8d2f04f remove leftover unused stuff from personnel.cpp 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta ba2e69d045 remove fATMFlags-dependent code since it is always 0 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta c9cf34d608 remove unused ATMNumberButtonCallback 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta be109b71fa unused RenderRectangleForPersonnelTransactionAmount 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 690d9e1336 remove unused HandleStateOfATMButtons 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 3c87ae2724 remove unused code when fShowAtmPanel is FALSE
fShowAtmPanel is always FALSE
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 6c96b80afc Remove unused ATMOther2ButtonCallback 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 00b5758af1 remove unused ATMOtherButtonCallback 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 72ab9b0135 Remove unused CreateDestroyATMButton 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 92813f5ce1 remove unused ATMStartButtonCallback 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta a9dd9d0ca6 fix visual bug introduced by removing DrawMoneyOnScreen
AIM profile fees now display correctly for old inventory system as well
2025-10-05 10:54:44 -03:00
Marco Antonio J. Costaandmajcosta e8aedb29d5 show daily discounted costs for 1week and 2week contracts
also shorten translations to fit the UI
2025-09-26 02:31:02 -03:00
Marco Antonio J. Costaandmajcosta ffe987061e remove DrawMoneyOnScreen
there's already a function to draw text on the screen. a money amount is
text, so just return a string and print that.
2025-09-26 02:31:02 -03:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
BeatAroundTheBuscherandGitHub ed00830202 Fixes Upper/Lower Casing for include paths (#487)
* Fixing upper/lower case for includes

types.h, zconf.h and zlib.h were renamed so that global includes like Types.h
are not used.
2025-08-16 22:01:12 -03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow 9b83d6a3bc Increase squad amount to 40 2025-08-08 16:39:52 +03:00
Asdow ee2807ae64 Default to 1st kit if deciding not to buy gear in UB
1st one is included in the hiring fee
2025-04-26 00:37:38 +03:00
Asdow b23c9ac8b1 Do not prompt for buying inventory for 1st kit in UB 2025-04-26 00:37:38 +03:00
Asdow fa0c5a2862 Prevent hiring MERC in UB if not enough funds 2025-04-26 00:37:38 +03:00