Marco Antonio J. Costa and majcosta
1088ffc5b2
prevent shopkeeper interface from adding a second $
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costa and majcosta
3d29eff4d8
use FormatMoney everywhere
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costa and majcosta
0dd32c4670
move FormatMoney to Text Utils
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costa and majcosta
fee56e37e7
better FormatMoney
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costa and majcosta
d79a445ad1
remove ATM_BUTTONS_* definitions
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costa and majcosta
b1ccdf4e38
remove unused TransferFundsFromBankToMerc/MercToBank
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costa and majcosta
3af3b3fbbc
remove sATMText[]
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costa and majcosta
86ec94b40a
stop using sATMText for "Insufficient Funds" message
...
it is about to go
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costa and majcosta
395c18c557
remove gsAtmSideButtonText[]
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costa and majcosta
2eff78a2cf
remove scope and fix whitespace in RenderAtmPanel
2025-10-07 23:09:53 -03:00
Marco Antonio J. Costa and majcosta
3d95c47356
refactor UpDateStateOfStartButton
2025-10-07 23:09:53 -03:00
Marco Antonio J. Costa and majcosta
0ebcf0fa06
remove comments
2025-10-07 23:09:53 -03:00
Marco Antonio J. Costa and majcosta
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. Costa and majcosta
08b8d2f04f
remove leftover unused stuff from personnel.cpp
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
ba2e69d045
remove fATMFlags-dependent code since it is always 0
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
c9cf34d608
remove unused ATMNumberButtonCallback
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
be109b71fa
unused RenderRectangleForPersonnelTransactionAmount
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
690d9e1336
remove unused HandleStateOfATMButtons
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
3c87ae2724
remove unused code when fShowAtmPanel is FALSE
...
fShowAtmPanel is always FALSE
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costa and majcosta
6c96b80afc
Remove unused ATMOther2ButtonCallback
2025-10-07 20:36:22 -03:00
Marco Antonio J. Costa and majcosta
00b5758af1
remove unused ATMOtherButtonCallback
2025-10-07 20:36:22 -03:00
Marco Antonio J. Costa and majcosta
72ab9b0135
Remove unused CreateDestroyATMButton
2025-10-07 20:36:22 -03:00
Marco Antonio J. Costa and majcosta
92813f5ce1
remove unused ATMStartButtonCallback
2025-10-07 20:36:22 -03:00
Marco Antonio J. Costa and majcosta
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. Costa and majcosta
cf6cc2a213
Revert "use link-time optimization when creating a release"
...
If this is ever the default, it should be set in the CMakeLists.txt file, not in the CI alone. My bad.
This reverts commit a7b0091a27 .
2025-09-27 20:02:15 -03:00
Marco Antonio J. Costa and majcosta
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. Costa and majcosta
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
Marco Antonio J. Costa and majcosta
e14a337e03
Prevent AllowReinforcements from reverting to TRUE regardless of setting whenever you save
2025-09-25 15:27:30 -03:00
Marco Antonio J. Costa and majcosta
4ec012ce7b
fix bug where combat doesn't end on team retreat
...
fixes issue #498 where retreating from combat in a sector that has a merc
inbound via the airdrop marker causes combat not to end
the reason this fails is that a the inbound soldier counts as being in
the sector being retreated from, even though he isn't
I add a check for `MercPtrs[i]->bInSector` so this doesn't happen
that way the function doesn't leave early and CheckForEndOfCombatMode is
reached
2025-09-11 22:00:32 -03:00
Marco Antonio J. Costa and majcosta
ac59eba898
get rid of unnecessary #defines
2025-09-05 20:31:11 -03:00
Marco Antonio J. Costa and majcosta
216cd78b18
Let players make an IMP with 3 major and 0 minor traits
2025-09-02 20:02:15 -03:00
Marco Antonio J. Costa and majcosta
7d9cd87da8
fully externalize bQueenLosingControlOfSector
2025-09-02 20:01:47 -03:00
Marco Antonio J. Costa and majcosta
e5d25810f6
nuke console
2025-08-31 13:50:19 -03:00
Marco Antonio J. Costa and majcosta
5d3cc7969f
fix code that relies on transitive includes
2025-08-30 19:09:06 -03:00
Marco Antonio J. Costa and majcosta
272ba56fa1
remove unused function
2025-08-30 18:48:16 -03:00
Marco Antonio J. Costa and majcosta
3c44f133fd
Actually fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected
2025-08-24 07:39:00 -03:00
Marco Antonio J. Costa and majcosta
616d9a08e6
Fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected
2025-08-12 23:18:49 -03:00
Marco Antonio J. Costa and majcosta
ebd2e25e0f
Fix a wrong #ifdef to runtime check conversion
...
I didn't get this right the first time, non-Chinese text was looking
funny in dialog boxes
2025-01-09 21:37:19 -03:00
Marco Antonio J. Costa and majcosta
ff8376d625
Keep UB specific enum value for all builds
...
but at the end, not beginning as to not make a mess
along with an intro.lua change in gamedir/Data-UB/Scripts this gets rid of a nasty preprocessor conditional in a header file
2025-01-09 21:34:07 -03:00
Marco Antonio J. Costa and majcosta
7aa0e18352
Revert "make sure these steps run"
...
This reverts commit 1976dee738 .
Revert "yet another fix for the github actions"
This reverts commit 552951795c .
Revert "make sure CI to assemble release on 'v*' tag push or manually"
This reverts commit 8897769f0d .
2025-01-07 16:51:30 -03:00
Marco Antonio J. Costa and majcosta
1976dee738
make sure these steps run
...
otherwise there is no 'source' working directory for the final step
2025-01-07 14:13:46 -03:00
Marco Antonio J. Costa and majcosta
552951795c
yet another fix for the github actions
...
github.ref_name isn't 'master' when a tag is pushed, but the tag name,
so it won't trigger a release build when a 'v*' tag is pushed
2025-01-07 13:19:03 -03:00
Marco Antonio J. Costa and majcosta
8897769f0d
make sure CI to assemble release on 'v*' tag push or manually
...
also put bash script through shellcheck to be more posix compliant
2025-01-07 13:09:23 -03:00
Marco Antonio J. Costa and majcosta
ac6a1504df
add a space to string to prevent compilation errors in GB2312
2025-01-05 10:04:04 -03:00
Marco Antonio J. Costa and majcosta
22e67f66fa
Move wine.cpp into its own library
...
avoid extra compilations that way
2025-01-05 07:57:57 -03:00
Marco Antonio J. Costa and majcosta
f471b74f5b
fix inconsistent case for a few files
...
you can now build in a case-sensitive filesystem
2025-01-04 13:14:22 -03:00
Marco Antonio J. Costa and majcosta
846abf5f1c
Convert Text.h to utf-8-sig and move ChineseSpecString* there
...
This time without mangling the characters
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costa and majcosta
ed73bd07ae
Revert "Make Chinese specific strings compile-time instead of conditional"
...
When these lines were edited, I likely opened _ChineseText.cpp in the
wrong encoding, and therefore saved it in the wrong encoding, mangling
the characters
This reverts commit cd69f5f3ae .
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costa and majcosta
b908bcecb9
fix missing icon in executable
...
the Ja2.rc file needs to be in the add_executable target for the icon
to appear, and that one requires WinMain.
so get rid of dummy.cpp and put sgp/sgp.cpp in there
2025-01-02 08:02:52 -03:00
Marco Antonio J. Costa and majcosta
a7b0091a27
use link-time optimization when creating a release
...
it's a lot slower, but we don't release often
2025-01-01 18:10:47 -03:00
Marco Antonio J. Costa and majcosta
7aafa7aada
fix the GitHub actions for VS2022's quirk too
...
missed this change in 98cdffe5 , fix it now
2025-01-01 18:10:47 -03:00
Marco Antonio J. Costa
959c29434e
Adjust the build system
...
Language is now just built once per app (still some JA2UB conditionals
going on in there) but building everything should now take eight times
less work
2024-12-31 18:24:36 -03:00
Marco Antonio J. Costa
e9686c0dca
reformat CMakeLists.txt
2024-12-31 16:28:45 -03:00
Marco Antonio J. Costa
10037291f3
remove preprocessor from i18n Multi Language Graphic Utils.cpp
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
9ed713f952
move Utils/Multi Language Graphic Utils.* to i18n
...
has language preprocessor silliness, straight to jail
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
cccec0ef11
straggler in Utils/Font Control.cpp
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
4a7625cef0
Slightly clunky RUSSIAN conversion
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
70f09471c2
just cast g_lang into lua's language code
...
because magically I got the enum order right first try
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
b15c4ef96c
the really gnarly CHINESE #ifdef conversions
...
these seem to be right, chinese text appears to be flowing correctly
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
ecdc8916f2
Move CHINESE BOBBYR_ITEMS_BOUGHT_X conditional definition to i18n
...
Just awful
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
4b563fefc8
Slightly clunkier fix for RUSSIAN conditional
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
cf0b4dfc40
Manual unrolling preprocessor stuff and added function
...
This function is just for GERMAN but it has a unique name so it's no
problem.
Had to slightly change how MercID gets populated
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
5fb989a1fc
Move Text.h over to i18n too
...
Never use relative paths for #includes. Didn't touch the rest because
out of scope.
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
33e8c1dc39
Move all the translated strings over to i18n
...
It's where all conditional language preprocessor goes
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
73f7812165
Slightly less straightforward CHINESE conversion in Interface Items.cpp
...
A bit clunkier, had to repeat function calls because of how
preprocessor tricks don't map 1:1 with actual C++.
2024-12-31 16:28:44 -03: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
cd69f5f3ae
Make Chinese specific strings compile-time instead of conditional
...
eventually we'll switch between CHINESE and other languages during
runtime, so even if language is not chinese, these symbols must still
be there
these symbol names aren't used so this is fine
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
bf6de9f342
Move GetLanguagePrefix function into i18n
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
Marco Antonio J. Costa
4624fe92f0
leave CHINESE struct member UINT8 Width[0x80]
...
this might cause a horrifying alignment bug, but I doubt it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
3acd2cea97
move Ja 2 Libs.* to i18n
...
it has preprocessor silliness in it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa
4d4e039da7
add an internationalization constant
...
gather all ENGLISH|GERMAN|CHINESE etc preprocessor hell into a single
library, so to restrict the number of targets that need to be built 8x
this still has UB/EDITOR definitions so that still needs to be dealt
with before we can build it only 8 times
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa and majcosta
dd5cabc6ba
actually make link-time optimization default to OFF
...
sorry, I lied in the last commit. didn't mean to
2024-12-29 07:29:13 -03:00
Marco Antonio J. Costa and majcosta
a83dfbefb0
add option to enable link time optimization
...
a bit slower to compile for developing so defaults to 'false', but
might be a good idea for the releases.
2024-12-27 18:17:20 -03:00
Marco Antonio J. Costa and majcosta
dc72a43a19
silence narrowing conversions in MSVC
...
we all know they're there, whenever someone fixes it (lol), this
should be removed
2024-12-27 03:08:36 -03:00
Marco Antonio J. Costa and majcosta
897f684705
remove all #include's for Language Defines
...
scripted diff:
find . -type f -iname "*.h" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
find . -type f -iname "*.cpp" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costa and majcosta
0993789430
remove Language Defines file
...
we don't do it like that anymore, the build system takes care of it
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costa and majcosta
6b9997b9c5
we don't use USE_CODE_PAGE anymore
2024-12-26 11:51:31 -03:00
Marco Antonio Jaguaribe Costa and majcosta
f4f48f23c7
cmake: favor vertical layout and absolute paths for include_directories
...
just the way git works should tilt us towards tall code rather than very
long lines, easier for merging/conflicts
2024-12-24 08:28:02 -03:00
Marco Antonio Jaguaribe Costa and majcosta
184b44c386
a couple consistency extension changes
...
iniErrorReport is a log file, all other log files have .log extension, so make it
consistent with that
make Ja2_settings.ini's extension lowercase. OCD, sorry.
2024-12-15 15:25:28 -03:00
Marco Antonio J. Costa and majcosta
86ad401186
add newline at end of file where it's lacking
...
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.
the script:
```
find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
isFile=$(file -0 "$file" | cut -d $'\0' -f2)
case "$isFile" in
(*text*)
echo "$file is text"
if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
echo "" >> "$file"
fi
;;
(*)
echo "file isn't text"
;;
esac
done
```
2024-12-14 19:05:48 -03:00
Marco Antonio J. Costa and majcosta
1d58bda82d
cross-compilation scaffolding WIP
...
requires clang/lld or mingw, obviously
just make sure the MSVC_DIRECTORY env variable points to valid Visual Studio Build Tools directory
and do: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=clang_or_mingw_toolchain_file`
2024-12-13 19:24:59 -03:00
Marco Antonio Jaguaribe Costa and majcosta
98cdffe5fd
(actually) fix broken MS2022 behavior
...
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, completely blowing up the previous
setup.
after this commit, you should either delete the CMakeUserPresets.json
file from your root or add it to your system - NOT repo! - excludesFile:
https://stackoverflow.com/questions/7335420/global-git-ignore
2024-12-09 14:19:25 -03:00
Marco Antonio Jaguaribe Costa and majcosta
2424066aab
Revert "fix broken MS2022 behavior"
...
This reverts commit b89c63058f .
2024-12-09 13:45:08 -03:00
Marco Antonio Jaguaribe Costa and majcosta
b89c63058f
fix broken MS2022 behavior
...
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, this patches it over for now and makes
note to remove it once this is fixed
2024-12-09 13:38:40 -03:00
Marco Antonio Jaguaribe Costa and majcosta
0b21d1d798
add a TODO file
...
put your TODOs here so you won't forget, or in case you do, maybe
someone can pick it up in the decades to come
2024-12-09 12:58:43 -03:00
Marco Costa and majcosta
dee2415d4a
simplify SOLDIERTYPE::GetDiseaseContactProtection( )
2024-04-03 22:09:05 -03:00
Marco Costa and majcosta
049ec47219
make OBJECTTYPE::Exists() const
2024-04-03 22:09:05 -03:00
Marco Costa and majcosta
d670383f3a
add const accessor to Inventory
2024-04-03 22:09:05 -03:00
Marco Antonio Jaguaribe Costa and majcosta
f11393728c
Unbreak Github Actions
...
our CI expects GameVersion.cpp to be at the root directory. just unbreak
for now.
2023-10-23 19:28:23 -03:00
Marco Antonio Jaguaribe Costa and majcosta
5d3118ea75
pluck multiplayer into its own lib
2023-10-23 10:36:35 -03:00
Marco Antonio Jaguaribe Costa and majcosta
eca4086d30
inherit minimum cmake version from ja2
...
all this does is silence the warning that cmake 2.6 is deprecated, we're
never building bfVFS standalone anyway
2023-10-07 09:21:11 -03:00
Marco Antonio Jaguaribe Costa and majcosta
b68f206969
remove annoying warning on MSVC 19.37.32822
...
`register` keyword does exactly nothing:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5033?view=msvc-170
2023-10-07 09:13:55 -03:00
Marco Antonio Jaguaribe Costa and majcosta
764d2f9389
remove int AStarPathFinder::CalcG(int*) function
...
not being called by anyone at the moment
2023-06-03 22:01:38 -03:00
Marco Antonio Jaguaribe Costa and majcosta
760f8ab3d7
Remove all MSBuild files
...
now that CI is using cmake, we can be clean up the tree quite a bit
btw, cmake can still configure for the msbuild generator for those so inclined:
create the folder, cmd to it, run `cmake [project_root_dir] -G"Visual Studio 17 2022" -A Win32 -DLanguages=ENGLISH -DApplications=JA2` once, then open the solution file using Visual Studio 2022
2023-05-08 06:44:35 -03:00
Marco Antonio Jaguaribe Costa and majcosta
18417ce45a
Get CMake's MSBuild generator to work correctly
...
- MSBuild has safe exception handlers (safeseh) enabled by default, which
some of our libraries don't support
- also needs legacy_stdio_definitions.lib to be linked
2023-05-07 07:23:07 -03:00
Marco Antonio Jaguaribe Costa and majcosta
74f4979296
A few nits
...
create empty CMakeUserPresets.json file so build happens on first run
comment doesn't apply anymore
no need to specify the compiler when using msbuild@xxx
ask ninja for the verbose command line when building
2023-04-22 04:31:37 -03:00
Marco Antonio Jaguaribe Costa and majcosta
3173b73ba0
don't build ja2 export tool by default
...
most users don't need this, better if whoever needs it just set
BUILD_JA2EXPORT=ON on their end
2023-04-22 01:40:11 -03:00
Marco Antonio Jaguaribe Costa and majcosta
aa3e10cd29
missing NO_ZLIB_COMPRESSION compile definition for SGP
...
forgot about that one
2023-02-01 10:02:46 -03:00
Marco Antonio Jaguaribe Costa and majcosta
f8f8461a65
replace header preprocessor conditional with cpp function
2023-01-30 09:25:01 -03:00