233 Commits
Author SHA1 Message Date
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 392ba66df3 Enable dismissing mercs in UB before game start
Jerry Melo complains about too many mercs if player has hired over 6 mercs and refuses to fly. This allows player to dismiss mercs until the pilot is happy.
2026-06-20 08:49:56 +03:00
Asdow d4dd5f07df Disable contract renewal in UB 2026-06-20 08:49:56 +03:00
db29feed11 Don't strip robot's installed components on mapscreen drop-all
The mapscreen "drop everything" hotkey (Shift+W) looped over every
inventory slot from HELMETPOS to NUM_INV_SLOTS and dumped each one.
Madlab's robot stores its installed gear in those same slots - ammo (14),
targeting (15), chassis/armour (16) and utility (17). Dropping these left
the robot defenceless, and the player cannot re-install the components
through normal inventory, so the loss was permanent.

Skip the robot's component slots in the drop loop; only its general cargo
slot (ROBOT_INVENTORY_SLOT) may still be emptied. Regular mercs are
unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 23:06:33 +03:00
Asdow 03edc532e1 Clean up Strategic/*:cpp includes 2025-12-09 00:35:18 +02:00
Asdow 1db41f4c36 Fix helicopter airspace view when switching to travel mode
* Clicking destination column in teamlist for a squad in a helicopter will switch to first airspace view that shows safe / unsafe air sectors instead of the second sector.

* Clicking destination column in teamlist for a squad not in a helicopter while in either airspace view will now correctly turn it off
2025-12-04 23:06:08 +02:00
Marco Antonio J. Costaandmajcosta 3d29eff4d8 use FormatMoney everywhere 2025-10-08 05:36:37 -03:00
Asdow 0b0fffa21d Improve multiselection contract renewal
* Contract duration lines are greyed out if the player lacks funds
*Selecting a mix of AIM and other merc types allows renewing contracts for selected AIM mercs
* Multiselection of only mercs whose contracts are not renewable (IMPs, rebels, etc) will have greyed out contract lines
2025-10-03 23:47:15 +03:00
Asdow f5a7c32bff Use SoldierID instead of pSoldier
ContinueDialogue was possible to be called with pSoldier that isn't null but is not valid pointer to MercPtrs array resulting in debugger catching an illegal memory access.
2025-09-25 22:47:51 +03:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
Marco Antonio J. Costaandmajcosta 3c44f133fd Actually fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected 2025-08-24 07:39:00 -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 07320ba996 Limit TeamList mouseregions to correct amount 2025-04-09 21:33:28 +03:00
Asdow fffb3a45fb Remove 8bit mode
Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
2025-02-24 21:42:36 +02:00
Asdow dcf202990f Remove duplicate header includes 2025-01-05 17:08:02 +02:00
Asdow db40cd433e Move mapscreen bottom coordinates' initialization
Fixes radar map's initial  position in strategic screen being in the top right corner.
2025-01-05 17:08:02 +02:00
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
This one is big, but unless I missed something, should be all be
trivial.

scripted-diff with the following, then manually tweaked whatever needed:
```

if [ $# -ne 3 ]; then
    echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
    exit 1
fi

pattern="$1"
replacement="$2"
filename="$3"

if [ ! -f "$filename" ]; then
    echo "Error: File $filename does not exist."
    exit 1
fi

sed -i '/'"$pattern"'/ {
    :loop
    $ !{
        N
        /'"$pattern"'.*\n.*#endif/ {
            s/'"$pattern"'/'"$replacement"'/
            s/#else/} else {/
            s/#endif/}/
            P
            D
        }
        /'"$pattern"'/ b loop
    }
}' "$filename"

echo "Replacement complete in $filename"
```

h/t to Grok2 for the sed command
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5d19c1fe25 make conditional CHINESE preprocessor def into global constant 2024-12-31 16:28:44 -03:00
Asdow 20a33893d9 Fix Teamlist for smaller resolutions
Merc names were being printed past the end of teamlist area
2024-12-04 20:49:53 +02:00
Asdow de56f653ec Use SoldierID 2024-11-30 23:47:00 +02:00
Asdow f49013307f Convert to SoldierID 2024-11-18 01:01:57 +02:00
Asdow 9532fbfe2c Convert to SoldierID 2024-11-17 19:41:34 +02:00
Asdow c475f9e4e6 Convert MapScreenCharacterSt::usSolID to SoldierID 2024-11-17 01:25:00 +02:00
Asdow 2918801f75 AddSoldierToSector & OBJECTTYPE::soldierID changed to SoldierID 2024-11-16 20:55:08 +02:00
Asdow 0def972901 Convert SetInfoChar & DrawFace to use SoldierID 2024-11-15 01:28:06 +02:00
Asdow 1327d186ed Use usSolID directly
usSolID *is* ubID from Menptr!
2024-11-14 01:08:38 +02:00
Asdow fcf2b27d1a More UINT8 -> UINT16 changes 2024-11-11 00:08:30 +02:00
Asdow 5cf0ef4bde Correct variables from INT8 to INT16 2024-11-09 22:52:21 +02:00
Asdow fdd6859726 Implement multiselection for contract renewal 2024-11-09 20:23:38 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +02:00
AsdowandGitHub 49a119e6b9 Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
2024-08-22 08:48:29 +03:00
Andrzej FałkowskiandGitHub 2060022e94 Battle Panel Multi Resolution (#203)
* Battle panel interface with support for multiple resolutions and scrollable list

* Support for localized versions of battle panel

* Removed commented out code

* Fixed wrong copypasta in German version
2023-08-20 20:52:34 +03:00
rftrdevandGitHub aaeea9aac8 Replace evolution with growth rates (#201) 2023-08-09 18:36:44 -07:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
rftrdevandGitHub ff360153c7 Redraw inventory panel when changing selected merc in strategic view (#127) 2023-02-21 23:22:30 -08:00
AsdowandGitHub e1f7fa7bfb Fix button glitches in widescreen UI (#125)
In widescreen strategic UI, team panel sort buttons would be hidden when transferring items to and fro merc inventory via CTRL + left click
Exit inventory panel button should always be disabled in widescreen UI
2023-02-15 16:36:57 +02:00
majcostaandGitHub 24425a82b1 More unused stuff removal (#49)
* More unused stuff removal

delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers

* remove mentions from vc proj files too

* remove preprocessor conditionals for unused definitions

find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'

then manually fixed a couple files the tool errored out on

* yes, the comments too

as title
2023-01-03 15:51:48 +02:00
rftrdev feaf9827c9 Set up ASSIGNMENT_REBELCOMMAND
Hook up Start Mission button
2022-10-13 11:31:48 -07:00
Asdow 1f0a8f46e8 Import changes from the local SVN working copy 2022-10-10 10:08:44 +03:00
Asdow 9ac2d3c828 Fix wrong offset resulting in character inventory background not drawn in old inventory & 1024x768 resolution
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9397 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-08-16 14:08:09 +00:00
rftr 87b0c7c6b7 new feature: madlab's robot can be upgraded
requires gamedir r2642

https://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=364403

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9338 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-03-21 17:34:49 +00:00
Shadooow a4aa443b32 Stat Progress Bar removed from options and made permanently active.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9307 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-19 13:25:39 +00:00
Shadooow 1c8b6a0f29 fix: force inventory redraw when using the mouse wheel to navigate through your mercs in strategic view. fixes bad inventory render when using a mouse to scroll from vehicle's inventory to a merc, and vice versa (by rftr)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9304 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-17 02:33:23 +00:00
Shadooow 9a11ddb375 Removed body inventory region in mapscreen for vehicles completely. There was no image rendered anyway, this way no popup message duplicating status will be shown and consumables won't popup the "Heh?" error either.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9290 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-02-02 15:39:35 +00:00
Sevenfm be14552e32 Prevented the game trying to delete an already deleted button when leaving mapscreen and fixed visual bug for popup boxes drawing in item description box in widescreen UI (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9276 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-25 22:24:53 +00:00
Shadooow 24775ee398 Fixed crash when the cheat command to teleport on mapscreen assigned previous sector into sector from which the destination cannot be entered.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9272 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-22 20:08:37 +00:00
Sevenfm abdfd022ae Implements mouse wheel scrolling for switching mercs in strategic map when hovering mouse above teamlist, character inventory and character info panels (by Asdow).
Simplified the r9266 inventory scrolling and made it obey inverted mouse wheel scrolling direction that is in the options screen (by Asdow).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9267 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-18 22:05:01 +00:00
Shadooow 8e60b4d442 Fix&Revert of previous commit, I messed it up with my other edits in code that are not tested yet.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9264 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-18 08:03:12 +00:00
Shadooow bbd6b1393f Fixed Daily Expenses to no longer count salary of dead mercs or POW NPCs and RPCs.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9263 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2022-01-18 07:53:06 +00:00