Author SHA1 Message Date
Asdow ba270534c6 Revert "Add if conditional for !(uiFlags & TILES_DIRTY)"
This reverts commit b49c37e0a9.
2023-09-27 23:40:46 +03:00
Asdow 0cf0e054ab Remove useless code
Mouse XY position is fetched, but never used
2023-09-27 23:24:20 +03:00
Asdow fc6bdad94b add static keyword 2023-09-27 23:23:37 +03:00
Asdow b49c37e0a9 Add if conditional for !(uiFlags & TILES_DIRTY)
One extra level of nesting, but clears up the scoping for which situations are done if TILES_DIRTY flag is not set
2023-09-27 23:07:55 +03:00
Asdow bbbfdb8bd5 Simplify item blitting
fZBlit was always set to true
bItemOutline was either always true or false depending on the branch
2023-09-27 22:48:40 +03:00
Asdow 195dc57e96 Remove commented out code 2023-09-27 22:46:08 +03:00
Asdow 52f46c60c7 Replace StructZLevel & SoldierZLevel defines with functions 2023-09-27 22:28:28 +03:00
Asdow c1f6000980 Rename original function 2023-09-27 22:27:14 +03:00
Asdow 05582b960d Check for nullptr 2023-09-27 22:26:46 +03:00
605 changed files with 23123 additions and 8096 deletions
+60 -23
View File
@@ -154,7 +154,7 @@ jobs:
cat dist/versions.env cat dist/versions.env
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: versions.env name: versions.env
path: dist/ path: dist/
@@ -179,40 +179,77 @@ jobs:
steps: steps:
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
path: dist path: artifacts
pattern: '*_release'
merge-multiple: true
- name: Move release archives to dist/
shell: bash
run: |
set -eux
mkdir dist/
mv artifacts/*_release/* dist/
- name: Delete Latest Release and Tag
if: github.ref == 'refs/heads/master'
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
delete_release: true
tag_name: "latest"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repo - name: Checkout Repo
uses: actions/checkout@v4 if: github.ref == 'refs/heads/master'
uses: actions/checkout@v3
with: with:
path: source path: source
fetch-depth: 1 fetch-depth: 1
sparse-checkout: 'README.md' sparse-checkout: 'README.md'
- name: Create latest pre-release - name: Create Latest Tag
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
working-directory: source working-directory: source
run: | run: |
gh release delete latest --cleanup-tag || true
git tag -d latest || true git tag -d latest || true
git push --delete origin refs/tags/latest || true
git tag latest git tag latest
git push --force origin refs/tags/latest git push origin latest
sleep 15 # make sure github can find the tag for gh release - id: release_latest
gh release create latest ../dist/* \ name: Release Latest
--generate-notes \ if: github.ref == 'refs/heads/master'
--title "Latest (unstable)" \ uses: ncipollo/release-action@v1
--verify-tag \ with:
--prerelease artifactErrorsFailBuild: true
env: artifacts: dist/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} generateReleaseNotes: true
makeLatest: true
name: "Latest (unstable)"
prerelease: true
tag: "latest"
- name: Upload to tagged release - id: release_tag
name: Release Tag
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
working-directory: source with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: dist/*
draft: false
generateReleaseNotes: true
makeLatest: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
- name: Show release outputs
shell: bash
run: | run: |
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber echo 'id: '
env: echo -n '${{ steps.release_tag.outputs.id }}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} echo -n '${{ steps.release_latest.outputs.id }}'
echo ''
echo ''
echo 'url:'
echo -n '${{ steps.release_tag.outputs.html_url }}'
echo -n '${{ steps.release_latest.outputs.html_url }}'
echo ''
+17 -29
View File
@@ -30,10 +30,10 @@ jobs:
steps: steps:
- name: Checkout source - name: Checkout source
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Download versions.env - name: Download versions.env
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: versions.env name: versions.env
path: artifacts path: artifacts
@@ -41,7 +41,6 @@ jobs:
shell: bash shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV run: cat artifacts/versions.env >> $GITHUB_ENV
# TODO: Move this into CMake, just taking the GitHub Actions parameters as -D variables
- name: Update GameVersion.cpp - name: Update GameVersion.cpp
shell: bash shell: bash
run: | run: |
@@ -50,26 +49,16 @@ jobs:
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\') GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION" GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION"
GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\') GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\')
sed -i "s|@Version@|${GAME_VERSION:0:15}|" Ja2/GameVersion.cpp sed -i "s|@Version@|${GAME_VERSION:0:15}|" GameVersion.cpp
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp sed -i "s|@Build@|${GAME_BUILD:0:255}|" GameVersion.cpp
cat Ja2/GameVersion.cpp cat GameVersion.cpp
- name: Turn on link-time optimization?
if: fromJSON(inputs.assemble)
shell: bash
run: |
set -eux
echo "
LTO=ON
" >> $GITHUB_ENV
- name: Prepare build properties - name: Prepare build properties
shell: bash shell: bash
run: | run: |
set -eux set -eux
touch CMakePresets.json touch CMakeUserPresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]') JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]') JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
@@ -79,7 +68,7 @@ jobs:
JA2Application=$JA2Application JA2Application=$JA2Application
" >> $GITHUB_ENV " >> $GITHUB_ENV
- uses: microsoft/setup-msbuild@v2 - uses: microsoft/setup-msbuild@v1.1
with: with:
msbuild-architecture: x86 msbuild-architecture: x86
- uses: ilammy/msvc-dev-cmd@v1 - uses: ilammy/msvc-dev-cmd@v1
@@ -87,7 +76,7 @@ jobs:
arch: x86 arch: x86
- name: Prepare build - name: Prepare build
run: | run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO" cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
- name: Build - name: Build
run: | run: |
cmake --build build/ -- -v cmake --build build/ -- -v
@@ -97,7 +86,7 @@ jobs:
find build/ find build/
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: ${{ inputs.language }}_${{ matrix.application }} name: ${{ inputs.language }}_${{ matrix.application }}
path: build/*.exe path: build/*.exe
@@ -110,7 +99,7 @@ jobs:
steps: steps:
- name: Download versions.env - name: Download versions.env
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: versions.env name: versions.env
path: artifacts path: artifacts
@@ -119,7 +108,7 @@ jobs:
run: cat artifacts/versions.env >> $GITHUB_ENV run: cat artifacts/versions.env >> $GITHUB_ENV
- name: Checkout gamedir - name: Checkout gamedir
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
repository: ${{ env.GAMEDIR_REPOSITORY }} repository: ${{ env.GAMEDIR_REPOSITORY }}
ref: ${{ env.GAMEDIR_COMMIT_SHA }} ref: ${{ env.GAMEDIR_COMMIT_SHA }}
@@ -127,7 +116,7 @@ jobs:
- name: Checkout gamedir-languages - name: Checkout gamedir-languages
if: inputs.language != 'English' if: inputs.language != 'English'
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }} repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }} ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
@@ -141,25 +130,25 @@ jobs:
cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/ cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/
- name: Download ja2 - name: Download ja2
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ inputs.language }}_ja2 name: ${{ inputs.language }}_ja2
path: artifacts/ja2 path: artifacts/ja2
- name: Download ja2mapeditor - name: Download ja2mapeditor
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ inputs.language }}_ja2mapeditor name: ${{ inputs.language }}_ja2mapeditor
path: artifacts/ja2mapeditor path: artifacts/ja2mapeditor
- name: Download ja2ub - name: Download ja2ub
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ inputs.language }}_ja2ub name: ${{ inputs.language }}_ja2ub
path: artifacts/ja2ub path: artifacts/ja2ub
- name: Download ja2ubmapeditor - name: Download ja2ubmapeditor
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ inputs.language }}_ja2ubmapeditor name: ${{ inputs.language }}_ja2ubmapeditor
path: artifacts/ja2ubmapeditor path: artifacts/ja2ubmapeditor
@@ -209,8 +198,7 @@ jobs:
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" . 7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: ${{ inputs.language }}_release name: ${{ inputs.language }}_release
path: dist/ path: dist/
compression-level: 0
+1 -1
View File
@@ -6,6 +6,6 @@
/.vs/ /.vs/
/build/ /build/
/out/ /out/
/CMakePresets.json
/CMakeSettings.json /CMakeSettings.json
/CMakeUserPresets.json
/lib/ /lib/
+125 -112
View File
@@ -9,25 +9,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
include(CheckIPOSupported)
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
if(LinkTimeOptimization AND LTO_OPTION)
message(STATUS "Configuring WITH link-time optimization")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
endif()
option(ADDRESS_SANITIZER OFF) option(ADDRESS_SANITIZER OFF)
if(ADDRESS_SANITIZER) if(ADDRESS_SANITIZER)
message(STATUS "AddressSanitizer ENABLED for non-Release builds") message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>) add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
endif()
if(MSVC)
add_compile_options("/wd4838")
endif() endif()
# whether we are using MSBuild as a generator # whether we are using MSBuild as a generator
@@ -37,25 +22,8 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
# TODO: build our own Lua 5.1.2 from source so we can use whichever # TODO: build our own Lua 5.1.2 from source so we can use whichever
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE) add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP USE_VFS _CRT_SECURE_NO_DEPRECATE)
include_directories( include_directories(${CMAKE_SOURCE_DIR} "ext/VFS/include" Utils TileEngine TacticalAI ModularizedTacticalAI Tactical Strategic "Standard Gaming Platform" Res Lua Laptop Multiplayer "Multiplayer/raknet" Editor Console)
"${CMAKE_SOURCE_DIR}/Ja2"
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
"${CMAKE_SOURCE_DIR}/Utils"
"${CMAKE_SOURCE_DIR}/TileEngine"
"${CMAKE_SOURCE_DIR}/TacticalAI"
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
"${CMAKE_SOURCE_DIR}/Tactical"
"${CMAKE_SOURCE_DIR}/Strategic"
"${CMAKE_SOURCE_DIR}/sgp"
"${CMAKE_SOURCE_DIR}/Ja2/Res"
"${CMAKE_SOURCE_DIR}/Lua"
"${CMAKE_SOURCE_DIR}/Laptop"
"${CMAKE_SOURCE_DIR}/Multiplayer"
"${CMAKE_SOURCE_DIR}/Editor"
"${CMAKE_SOURCE_DIR}/Console"
"${CMAKE_SOURCE_DIR}/i18n/include"
)
# external libraries # external libraries
add_subdirectory("ext/libpng") add_subdirectory("ext/libpng")
@@ -66,47 +34,95 @@ target_link_libraries(bfVFS PRIVATE 7z)
# ja2export utility # ja2export utility
add_subdirectory("ext/export/src") add_subdirectory("ext/export/src")
# static libraries whose translation units don't rely on Application preprocessor definitions. # static libraries whose source files, header files or header files included
add_subdirectory(lua) # by header files do not rely on Applications or Languages preprocessor definitions,
add_subdirectory(Multiplayer) # and therefore only need to be compiled once. Good.
add_subdirectory(wine) add_subdirectory(Lua)
# static libraries whose source files, header files or header files included
# by header files rely on Application and Language preprocessor definitions, and
# therefore need to be compiled multiple times. Very Bad.
add_subdirectory(TileEngine)
add_subdirectory(TacticalAI)
add_subdirectory(Utils)
add_subdirectory(Strategic)
add_subdirectory("Standard Gaming Platform")
add_subdirectory(Laptop)
add_subdirectory(Editor)
add_subdirectory(Console)
add_subdirectory(Tactical)
add_subdirectory(ModularizedTacticalAI)
# TODO: Rename 'Standard Gaming Platform' directory to 'SGP' so this can be refactored away
set(Ja2_Libs
TileEngine
TacticalAI
Utils
Strategic
SGP
Laptop
Editor
Console
Tactical
ModularizedTacticalAI
)
# TODO: Move these units into their own directory to declutter the root dir and CMakeLists.txt file
set(Ja2Src
"aniviewscreen.cpp"
"Credits.cpp"
"Fade Screen.cpp"
"FeaturesScreen.cpp"
"GameInitOptionsScreen.cpp"
"gameloop.cpp"
"gamescreen.cpp"
"GameSettings.cpp"
"GameVersion.cpp"
"HelpScreen.cpp"
"Init.cpp"
"Intro.cpp"
"JA2 Splash.cpp"
"Ja25Update.cpp"
"jascreens.cpp"
"Language Defines.cpp"
"Loading Screen.cpp"
"MainMenuScreen.cpp"
"MessageBoxScreen.cpp"
"MPChatScreen.cpp"
"MPConnectScreen.cpp"
"MPHostScreen.cpp"
"MPJoinScreen.cpp"
"MPScoreScreen.cpp"
"MPXmlTeams.cpp"
"Multiplayer/client.cpp"
"Multiplayer/server.cpp"
"Multiplayer/transfer_rules.cpp"
"Options Screen.cpp"
"profiler.cpp"
"SaveLoadGame.cpp"
"SaveLoadScreen.cpp"
"SCREENS.cpp"
"Sys Globals.cpp"
"ub_config.cpp"
"XML_DifficultySettings.cpp"
"XML_IntroFiles.cpp"
"XML_Layout_MainMenu.cpp"
Res/ja2.rc
)
set(Ja2_Libraries set(Ja2_Libraries
"${CMAKE_SOURCE_DIR}/binkw32.lib" "${PROJECT_SOURCE_DIR}/libexpatMT.lib"
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"Dbghelp.lib" "Dbghelp.lib"
"Winmm.lib"
"ws2_32.lib"
bfVFS
Lua Lua
Multiplayer "${PROJECT_SOURCE_DIR}/lua51.lib"
wine "${PROJECT_SOURCE_DIR}/lua51.vc9.lib"
"Winmm.lib"
"${PROJECT_SOURCE_DIR}/SMACKW32.LIB"
"${PROJECT_SOURCE_DIR}/binkw32.lib"
bfVFS
"${PROJECT_SOURCE_DIR}/Multiplayer/raknet/RakNetLibStatic.lib"
"ws2_32.lib"
) )
# static libraries whose translation units rely on Application preprocessor definitions.
set(Ja2_Libs
Console
Editor
Ja2
Laptop
ModularizedTacticalAI
sgp
Strategic
Tactical
TacticalAI
TileEngine
Utils
)
foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib})
endforeach()
# language library relies on Application _and_ Language preprocessor definition. very bad.
add_subdirectory(i18n)
# simple function to validate Languages and Application choices # simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake) include(cmake/ValidateOptions.cmake)
@@ -120,50 +136,47 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
# preprocessor definitions for Debug build, per the legacy MSBuild # preprocessor definitions for Debug build, per the legacy MSBuild
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>) set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
foreach(app IN LISTS ApplicationTargets) # Due to widespread preprocessor definition abuse in the codebase, practically
set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>) # every library-language-executable combination is its own compilation target
set(isUb $<STREQUAL:${app},JA2UB>) # TODO: refactor preprocessor usage onto, ideally, a single translation unit
set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>) foreach(lang IN LISTS LangTargets)
set(compilationFlags foreach(exe IN LISTS ApplicationTargets)
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,> set(Executable ${exe}_${lang})
$<IF:${isUb},JA2UB;JA2UBMAPS,>
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
)
foreach(lib IN LISTS Ja2_Libs) # executable for an application/language combination, e.g. JA2_ENGLISH.exe
# library for an application, e.g. JA2UB_sgp add_executable(${Executable} WIN32)
set(game_library ${app}_${lib}) target_sources(${Executable} PRIVATE ${Ja2Src})
add_library(${game_library})
target_sources(${game_library} PRIVATE ${${lib}Src})
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
endforeach()
foreach(lang IN LISTS LangTargets) # Good libraries have already been built, can be simply linked here
# executable for an application/language combination, e.g. JA2_ENGLISH.exe target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
set(exe ${app}_${lang}) target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
add_executable(${exe} WIN32
sgp/sgp.cpp
Ja2/Res/ja2.rc
)
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n # for each app/lang combination, the Very Bad libraries need to be built,
set(language_library ${exe}_i18n) # with the appropriate preprocessor definitions
add_library(${language_library}) foreach(lib IN LISTS Ja2_Libs)
target_sources(${language_library} PRIVATE ${i18nSrc}) # syntactic sugar to hopefully make this more readable
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang}) set(VeryBadLib ${Executable}_${lib})
target_link_libraries(${exe} PRIVATE ${language_library}) set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>)
set(isUb $<STREQUAL:${exe},JA2UB>)
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
# go through all game libraries again and link them to the app/language executable # static library for an app/lang combination, e.g. JA2_ENGLISH_SGP.lib
foreach(lib IN LISTS Ja2_Libs) add_library(${VeryBadLib})
target_link_libraries(${exe} PRIVATE ${app}_${lib}) target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
endforeach()
endforeach()
# for SGP only target_compile_definitions(${VeryBadLib} PUBLIC
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib") $<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
target_link_libraries(${app}_sgp PRIVATE libpng) $<IF:${isUb},JA2UB;JA2UBMAPS,>
target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION) $<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
${debugFlags}
${lang}
)
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
endforeach()
# for SGP only
target_link_libraries(${Executable}_SGP PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${Executable}_SGP PUBLIC libpng)
target_compile_definitions(${Executable}_SGP PRIVATE NO_ZLIB_COMPRESSION)
endforeach()
endforeach() endforeach()
+2 -1
View File
@@ -1,6 +1,7 @@
#ifndef _CHEATS__H_ #ifndef _CHEATS__H_
#define _CHEATS__H_ #define _CHEATS__H_
#include "Language Defines.h"
extern UINT8 gubCheatLevel; extern UINT8 gubCheatLevel;
@@ -21,4 +22,4 @@ extern UINT8 gubCheatLevel;
#define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 ) #define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 )
#define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 ) #define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 )
#endif #endif
+1 -1
View File
@@ -78,4 +78,4 @@ public:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // _COMBSTROUT_H_ #endif // _COMBSTROUT_H_
+1 -1
View File
@@ -106,4 +106,4 @@ public:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // _COMVARIANTOUT_H_ #endif // _COMVARIANTOUT_H_
+1
View File
@@ -1,5 +1,6 @@
#include "Types.h" #include "Types.h"
#include "Credits.h" #include "Credits.h"
#include "Language Defines.h"
#include "vsurface.h" #include "vsurface.h"
#include "mousesystem.h" #include "mousesystem.h"
#include "Text.h" #include "Text.h"
View File
+1 -1
View File
@@ -40,4 +40,4 @@ extern BOOLEAN gfCurrentSelectionWithRightButton;
#endif #endif
#endif #endif
+1 -1
View File
@@ -14,4 +14,4 @@ void ShowExitGrids();
void HideExitGrids(); void HideExitGrids();
#endif #endif
#endif #endif
+1 -1
View File
@@ -7,4 +7,4 @@
void CreateEditorTaskbarInternal(); void CreateEditorTaskbarInternal();
#endif #endif
#endif #endif
+1 -1
View File
@@ -67,4 +67,4 @@ extern UINT32 guiMercTempBuffer;
extern INT32 giEditMercImage[2]; extern INT32 giEditMercImage[2];
#endif #endif
#endif #endif
+2 -2
View File
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i]; item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR ) //if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue; // continue;
if(ItemIsNotInEditor(i)) if(item->notineditor)
continue; continue;
if( i == SWITCH || i == ACTION_ITEM ) if( i == SWITCH || i == ACTION_ITEM )
{ {
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue; continue;
} }
item = &Item[usCounter]; item = &Item[usCounter];
if(ItemIsNotInEditor(usCounter)) if(item->notineditor)
{ {
usCounter++; usCounter++;
continue; continue;
+42 -11
View File
@@ -83,7 +83,9 @@ INT32 iCurrFileShown;
INT32 iLastFileClicked; INT32 iLastFileClicked;
INT32 iLastClickTime; INT32 iLastClickTime;
#ifdef USE_VFS
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213 CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
#endif
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909 CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
extern INT16 gsSelSectorX; extern INT16 gsSelSectorX;
extern INT16 gsSelSectorY; extern INT16 gsSelSectorY;
@@ -163,6 +165,7 @@ void LoadSaveScreenEntry()
} }
iTopFileShown = iTotalFiles = 0; iTopFileShown = iTotalFiles = 0;
#ifdef USE_VFS//dnl ch37 300909
gzProfileName[0] = 0;//dnl ch81 021213 gzProfileName[0] = 0;//dnl ch81 021213
FDLG_LIST* TempFileList = NULL; FDLG_LIST* TempFileList = NULL;
vfs::CProfileStack* st = getVFS()->getProfileStack(); vfs::CProfileStack* st = getVFS()->getProfileStack();
@@ -173,15 +176,7 @@ void LoadSaveScreenEntry()
vfs::CVirtualProfile* prof = it.value(); vfs::CVirtualProfile* prof = it.value();
memset(&FileInfo, 0, sizeof(GETFILESTRUCT)); memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
strcpy(FileInfo.zFileName, "< "); strcpy(FileInfo.zFileName, "< ");
// Cut filename off if it's too long for the buffer strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
{
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
}
else
{
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
}
strcat(FileInfo.zFileName, " >"); strcat(FileInfo.zFileName, " >");
FileInfo.zFileName[FILENAME_BUFLEN] = 0; FileInfo.zFileName[FILENAME_BUFLEN] = 0;
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY; FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
@@ -225,6 +220,25 @@ void LoadSaveScreenEntry()
} }
while(FileList->pPrev) while(FileList->pPrev)
FileList = FileList->pPrev; FileList = FileList->pPrev;
#else
if(GetFileFirst("MAPS\\*.dat", &FileInfo))
{
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
{
FileList = AddToFDlgList(FileList, &FileInfo);
iTotalFiles++;
}
while(GetFileNext(&FileInfo))
{
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
{
FileList = AddToFDlgList(FileList, &FileInfo);
iTotalFiles++;
}
}
GetFileClose(&FileInfo);
}
#endif
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" ); swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
swprintf( gzFilename, L"%S", gubFilename ); swprintf( gzFilename, L"%S", gubFilename );
@@ -269,8 +283,7 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
{ {
if( gfReadOnly ) if( gfReadOnly )
{ {
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here? FileClearAttributes( gszCurrFilename );
//FileClearAttributes( gszCurrFilename );
gfReadOnly = FALSE; gfReadOnly = FALSE;
} }
FileDelete( gszCurrFilename ); FileDelete( gszCurrFilename );
@@ -455,6 +468,19 @@ UINT32 LoadSaveScreenHandle(void)
} }
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename); sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
gfFileExists = FALSE; gfFileExists = FALSE;
#ifndef USE_VFS
gfReadOnly = FALSE;
if(FileExists(gszCurrFilename))
{
gfFileExists = TRUE;
if(GetFileFirst(gszCurrFilename, &FileInfo))
{
if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY))
gfReadOnly = TRUE;
GetFileClose(&FileInfo);
}
}
#else
gfReadOnly = TRUE; gfReadOnly = TRUE;
vfs::CProfileStack* st = getVFS()->getProfileStack(); vfs::CProfileStack* st = getVFS()->getProfileStack();
vfs::CProfileStack::Iterator it = st->begin(); vfs::CProfileStack::Iterator it = st->begin();
@@ -476,6 +502,7 @@ UINT32 LoadSaveScreenHandle(void)
} }
it.next(); it.next();
} }
#endif
if(gfReadOnly) if(gfReadOnly)
{ {
CreateMessageBox(L" File is read only! Choose a different name? "); CreateMessageBox(L" File is read only! Choose a different name? ");
@@ -699,6 +726,7 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
iLastClickTime = iCurrClickTime; iLastClickTime = iCurrClickTime;
iLastFileClicked = x; iLastFileClicked = x;
//dnl ch81 021213 //dnl ch81 021213
#ifdef USE_VFS
gzProfileName[0] = 0; gzProfileName[0] = 0;
while(FListNode = FListNode->pPrev) while(FListNode = FListNode->pPrev)
{ {
@@ -709,6 +737,7 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
break; break;
} }
} }
#endif
break; break;
} }
FListNode = FListNode->pNext; FListNode = FListNode->pNext;
@@ -921,6 +950,7 @@ void HandleMainKeyEvents( InputAtom *pEvent )
SetInputFieldStringWith16BitString(0, L""); SetInputFieldStringWith16BitString(0, L"");
wcscpy(gzFilename, L""); wcscpy(gzFilename, L"");
} }
#ifdef USE_VFS
gzProfileName[0] = 0; gzProfileName[0] = 0;
while(curr = curr->pPrev) while(curr = curr->pPrev)
{ {
@@ -931,6 +961,7 @@ void HandleMainKeyEvents( InputAtom *pEvent )
break; break;
} }
} }
#endif
} }
} }
} }
+3 -1
View File
@@ -1,7 +1,7 @@
#include "BuildDefines.h" #include "BuildDefines.h"
#include "Fileman.h" #include "Fileman.h"
#define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213 #define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
#ifdef JA2EDITOR #ifdef JA2EDITOR
@@ -51,7 +51,9 @@ extern CHAR16 gzErrorCatchString[ 256 ];
//dnl ch81 031213 //dnl ch81 031213
extern CHAR16 gzFilename[FILENAME_BUFLEN]; extern CHAR16 gzFilename[FILENAME_BUFLEN];
#ifdef USE_VFS
extern CHAR8 gzProfileName[FILENAME_BUFLEN]; extern CHAR8 gzProfileName[FILENAME_BUFLEN];
#endif
#endif #endif
#endif #endif
+6 -34
View File
@@ -403,42 +403,14 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
while( gRoadMacros[ i ].sMacroID == iMacroID ) while( gRoadMacros[ i ].sMacroID == iMacroID )
{ {
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size // need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS); INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS); INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
// Take into account the dfference between old and new row size for tiles that are shifted
// by one row due to X offset
// For example:
// {RBR, 159},
//{ RBR, -159 },
//
// Offsets for 160x160 map
// [] [] [-159]
// [] [0] []
// [159] [] []
//
// Converted to 200x200 map
// [] [] [-199]
// [] [0] []
// [199] [] []
//
// Without this the original conversion would output 159 and -159 for X coordinate
if (sdX < -OLD_WORLD_COLS/2)
{
sdX -= WORLD_COLS - OLD_WORLD_COLS;
}
else if (sdX > OLD_WORLD_COLS / 2)
{
sdX += WORLD_COLS - OLD_WORLD_COLS;
}
INT32 sOffset = sdY*WORLD_COLS + sdX; INT32 sOffset = sdY*WORLD_COLS + sdX;
INT32 newGridNo = iMapIndex + sOffset; //
AddToUndoList( iMapIndex + sOffset );
AddToUndoList( newGridNo ); RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex ); GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( newGridNo, usTileIndex ); AddObjectToHead( iMapIndex + sOffset, usTileIndex );
i++; i++;
} }
} }
+1 -1
View File
@@ -61,4 +61,4 @@ void InitializeRoadMacros();
#endif #endif
#endif #endif
+177 -2
View File
@@ -1923,14 +1923,40 @@ BOOLEAN HandleSummaryInput( InputAtom *pEvent )
void CreateGlobalSummary() void CreateGlobalSummary()
{ {
#ifndef USE_VFS
FILE *fp;
STRING512 Dir;
STRING512 ExecDir;
#endif
OutputDebugString( "Generating GlobalSummary Information...\n" ); OutputDebugString( "Generating GlobalSummary Information...\n" );
gfGlobalSummaryExists = FALSE; gfGlobalSummaryExists = FALSE;
//Set current directory to JA2\DevInfo which contains all of the summary data //Set current directory to JA2\DevInfo which contains all of the summary data
#ifndef USE_VFS
GetExecutableDirectory( ExecDir );
sprintf( Dir, "%s\\DevInfo", ExecDir );
// Snap: save current directory
//GetFileManCurrentDirectory( DataDir );
//Directory doesn't exist, so create it, and continue.
if( !MakeFileManDirectory( Dir ) )
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
if( !SetFileManCurrentDirectory( Dir ) )
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
//Generate a simple readme file.
fp = fopen( "readme.txt", "w" );
Assert( fp );
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
"This directory or it's contents shouldn't be included with final release." );
fclose( fp );
#else
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true); vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
std::string str = "This information is used in conjunction with the editor.\n"; std::string str = "This information is used in conjunction with the editor.\n";
str += "This directory or it's contents shouldn't be included with final release.\n"; str += "This directory or it's contents shouldn't be included with final release.\n";
SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" ); SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" );
#endif
// Snap: Restore the data directory once we are finished. // Snap: Restore the data directory once we are finished.
//SetFileManCurrentDirectory( DataDir ); //SetFileManCurrentDirectory( DataDir );
@@ -2177,8 +2203,7 @@ void SummarySaveMapCallback( GUI_BUTTON *btn, INT32 reason )
{ {
CHAR8 filename[40]; CHAR8 filename[40];
sprintf( filename, "MAPS\\%S", gszDisplayName ); sprintf( filename, "MAPS\\%S", gszDisplayName );
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here? FileClearAttributes( filename );
//FileClearAttributes( filename );
} }
if( ExternalSaveMap( gszDisplayName ) ) if( ExternalSaveMap( gszDisplayName ) )
{ {
@@ -2256,6 +2281,12 @@ void CalculateOverrideStatus()
void LoadGlobalSummary() void LoadGlobalSummary()
{ {
HWFILE hfile; HWFILE hfile;
#ifndef USE_VFS
STRING512 DataDir;
STRING512 ExecDir;
STRING512 DevInfoDir;
STRING512 MapsDir;
#endif
UINT32 uiNumBytesRead; UINT32 uiNumBytesRead;
FLOAT dMajorVersion; FLOAT dMajorVersion;
INT32 x,y; INT32 x,y;
@@ -2264,16 +2295,34 @@ void LoadGlobalSummary()
OutputDebugString( "Executing LoadGlobalSummary()...\n" ); OutputDebugString( "Executing LoadGlobalSummary()...\n" );
// Snap: save current directory // Snap: save current directory
#ifndef USE_VFS
GetFileManCurrentDirectory( DataDir );
#endif
gfMustForceUpdateAllMaps = FALSE; gfMustForceUpdateAllMaps = FALSE;
gusNumberOfMapsToBeForceUpdated = 0; gusNumberOfMapsToBeForceUpdated = 0;
gfGlobalSummaryExists = FALSE; gfGlobalSummaryExists = FALSE;
//Set current directory to JA2\DevInfo which contains all of the summary data //Set current directory to JA2\DevInfo which contains all of the summary data
#ifndef USE_VFS
GetExecutableDirectory( ExecDir );
sprintf( DevInfoDir, "%s\\DevInfo", ExecDir );
sprintf( MapsDir, "%s\\Maps", DataDir );
//Check to make sure we have a DevInfo directory. If we don't create one!
if( !SetFileManCurrentDirectory( DevInfoDir ) )
{
OutputDebugString( "LoadGlobalSummary() aborted -- doesn't exist on this local computer.\n");
return;
}
#endif
//TEMP //TEMP
#ifndef USE_VFS
FileDelete( "_global.sum" );
#else
if(FileExists("DevInfo\\_global.sum")) if(FileExists("DevInfo\\_global.sum"))
{ {
FileDelete( "DevInfo\\_global.sum" ); FileDelete( "DevInfo\\_global.sum" );
} }
#endif
gfGlobalSummaryExists = TRUE; gfGlobalSummaryExists = TRUE;
//Analyse all sectors to see if matching maps exist. For any maps found, the information //Analyse all sectors to see if matching maps exist. For any maps found, the information
@@ -2288,12 +2337,19 @@ void LoadGlobalSummary()
sprintf( szSector, "%c%d", 'A' + y, x + 1 ); sprintf( szSector, "%c%d", 'A' + y, x + 1 );
//main ground level //main ground level
#ifndef USE_VFS
sprintf( szFilename, "%c%d.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= GROUND_LEVEL_MASK; gbSectorLevels[x][y] |= GROUND_LEVEL_MASK;
@@ -2303,16 +2359,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s.sum", szSector ); sprintf( szFilename, "DevInfo\\%s.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//main B1 level //main B1 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b1.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK; gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK;
@@ -2322,16 +2389,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b1.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//main B2 level //main B2 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b2.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK; gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK;
@@ -2341,16 +2419,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b2.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//main B3 level //main B3 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b3.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK; gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK;
@@ -2360,16 +2449,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b3.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//alternate ground level //alternate ground level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_a.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK; gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK;
@@ -2379,16 +2479,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_a.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_a.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_a.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//alternate B1 level //alternate B1 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b1_a.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK; gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;
@@ -2398,16 +2509,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b1_a.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//alternate B2 level //alternate B2 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b2_a.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= ALTERNATE_B2_MASK; gbSectorLevels[x][y] |= ALTERNATE_B2_MASK;
@@ -2417,16 +2539,27 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b2_a.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
//alternate B3 level //alternate B3 level
#ifndef USE_VFS
sprintf( szFilename, "%c%d_b3_a.dat", 'A' + y, x + 1 );
SetFileManCurrentDirectory( MapsDir );
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
SetFileManCurrentDirectory( DevInfoDir );
#else
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 ); sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
hfile = NULL; hfile = NULL;
if(FileExists(szFilename)) if(FileExists(szFilename))
{ {
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
} }
#endif
if( hfile ) if( hfile )
{ {
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;; gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;;
@@ -2436,12 +2569,20 @@ void LoadGlobalSummary()
} }
else else
{ {
#ifndef USE_VFS
sprintf( szFilename, "%s_b3_a.sum", szSector );
#else
sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector ); sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector );
#endif
FileDelete( szFilename ); FileDelete( szFilename );
} }
} }
OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') ); OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') );
} }
#ifndef USE_VFS
// Snap: Restore the data directory once we are finished.
SetFileManCurrentDirectory( DataDir );
#endif
//sprintf( MapsDir, "%s\\Data", ExecDir ); //sprintf( MapsDir, "%s\\Data", ExecDir );
//SetFileManCurrentDirectory( MapsDir ); //SetFileManCurrentDirectory( MapsDir );
@@ -2458,6 +2599,39 @@ void LoadGlobalSummary()
void GenerateSummaryList() void GenerateSummaryList()
{ {
#ifndef USE_VFS
FILE *fp;
STRING512 DataDir;
STRING512 ExecDir;
STRING512 Dir;
// Snap: save current directory
GetFileManCurrentDirectory( DataDir );
//Set current directory to JA2\DevInfo which contains all of the summary data
GetExecutableDirectory( ExecDir );
sprintf( Dir, "%s\\DevInfo", ExecDir );
if( !SetFileManCurrentDirectory( Dir ) )
{
//Directory doesn't exist, so create it, and continue.
if( !MakeFileManDirectory( Dir ) )
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
if( !SetFileManCurrentDirectory( Dir ) )
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
//Generate a simple readme file.
fp = fopen( "readme.txt", "w" );
Assert( fp );
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
"This directory or it's contents shouldn't be included with final release." );
fclose( fp );
}
// Snap: Restore the data directory once we are finished.
SetFileManCurrentDirectory( DataDir );
//Set current directory back to data directory!
//sprintf( Dir, "%s\\Data", ExecDir );
//SetFileManCurrentDirectory( Dir );
#else
try try
{ {
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true); vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
@@ -2469,6 +2643,7 @@ void GenerateSummaryList()
{ {
SGP_RETHROW(L"Could not create readme.txt", ex); SGP_RETHROW(L"Could not create readme.txt", ex);
} }
#endif
} }
//dnl ch28 260909 //dnl ch28 260909
+1 -1
View File
@@ -35,4 +35,4 @@ void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, I
void ResetCustomFileSectorSummary(void);//dnl ch30 150909 void ResetCustomFileSectorSummary(void);//dnl ch30 150909
#endif #endif
#endif #endif
+1 -1
View File
@@ -62,4 +62,4 @@ UINT16 GetHorizontalWallClass( INT32 iMapIndex );
BOOLEAN ValidDecalPlacement( INT32 iMapIndex ); BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
#endif #endif
#endif #endif
+14 -38
View File
@@ -1,4 +1,4 @@
#include "builddefines.h" #include "builddefines.h"
#ifdef JA2EDITOR #ifdef JA2EDITOR
@@ -79,6 +79,8 @@
class OBJECTTYPE; class OBJECTTYPE;
class SOLDIERTYPE; class SOLDIERTYPE;
extern CHAR8 *szMusicList[NUM_MUSIC];
BOOLEAN gfCorruptMap = FALSE; BOOLEAN gfCorruptMap = FALSE;
BOOLEAN gfCorruptSchedules = FALSE; BOOLEAN gfCorruptSchedules = FALSE;
BOOLEAN gfProfileDataLoaded = FALSE; BOOLEAN gfProfileDataLoaded = FALSE;
@@ -167,7 +169,6 @@ LEVELNODE *gCursorNode = NULL;
INT32 gsCursorGridNo; INT32 gsCursorGridNo;
INT32 giMusicID = 0; INT32 giMusicID = 0;
NewMusicList gMusicMode = MUSICLIST_MAIN_MENU;
void EraseWorldData( ); void EraseWorldData( );
@@ -1069,7 +1070,10 @@ void ShowCurrentDrawingMode( void )
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on // Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
usFillColor = GenericButtonFillColors[0]; usFillColor = GenericButtonFillColors[0];
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES ); pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf ); if(gbPixelDepth==16)
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
else if(gbPixelDepth==8)
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
UnLockVideoSurface( FRAME_BUFFER ); UnLockVideoSurface( FRAME_BUFFER );
@@ -1612,27 +1616,16 @@ void HandleKeyboardShortcuts( )
break; break;
case F4: case F4:
MusicPlay(gMusicMode, giMusicID); #ifdef NEWMUSIC
ScreenMsg( FONT_YELLOW, MSG_INTERFACE, L"%S", MusicLists[gMusicMode][giMusicID] ); MusicPlay( giMusicID, MUSIC_OLD_TYPE, FALSE );
#else
MusicPlay( giMusicID );
#endif
// Select next track ScreenMsg( FONT_YELLOW, MSG_DEBUG, L"%S", szMusicList[giMusicID] );
giMusicID++; giMusicID++;
if (giMusicID >= MusicLists[gMusicMode].size()) if( giMusicID >= NUM_MUSIC )
{
giMusicID = 0; giMusicID = 0;
for (size_t i = 0; i < MAX_MUSIC; i++)
{
if (gMusicMode == i)
{
gMusicMode = static_cast<NewMusicList>(i + 1);
if (gMusicMode == MAX_MUSIC)
{
gMusicMode = MUSICLIST_MAIN_MENU;
}
break;
}
}
}
break; break;
case F5: case F5:
@@ -2951,23 +2944,6 @@ UINT32 WaitForSelectionWindowResponse( void )
} }
} }
// Mousewheel scroll
if (_WheelValue > 0)
{
while (_WheelValue--)
{
ScrollSelWinUp();
}
}
else
{
while (_WheelValue++)
{
ScrollSelWinDown();
}
}
_WheelValue = 0;
if ( DoWindowSelection( ) ) if ( DoWindowSelection( ) )
{ {
fSelectionWindow = FALSE; fSelectionWindow = FALSE;
+36 -60
View File
@@ -29,16 +29,6 @@ extern BOOLEAN fDontUseRandom;
extern UINT16 GenericButtonFillColors[40]; extern UINT16 GenericButtonFillColors[40];
struct SelectionWindow
{
SGPRect window;
SGPPoint displayAreaStart; // Area where selectable items are drawn
SGPPoint displayAreaEnd;
SGPPoint spacing; // For displayed items
};
SelectionWindow gSelection;
BOOLEAN gfRenderSquareArea = FALSE; BOOLEAN gfRenderSquareArea = FALSE;
INT16 iStartClickX,iStartClickY; INT16 iStartClickX,iStartClickY;
INT16 iEndClickX,iEndClickY; INT16 iEndClickX,iEndClickY;
@@ -50,6 +40,7 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
BOOLEAN fAllDone=FALSE; BOOLEAN fAllDone=FALSE;
BOOLEAN fButtonsPresent=FALSE; BOOLEAN fButtonsPresent=FALSE;
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
//These definitions help define the start and end of the various wall indices. //These definitions help define the start and end of the various wall indices.
//This needs to be maintained if the walls change. //This needs to be maintained if the walls change.
@@ -181,30 +172,6 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
// //
void CreateJA2SelectionWindow( INT16 sWhat ) void CreateJA2SelectionWindow( INT16 sWhat )
{ {
auto selectWinWidth = 600;
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
if (iResolution > _800x600)
{
selectWinWidth = 900;
}
auto tlX = 0;
auto tlY = 0;
auto brX = tlX + selectWinWidth;
auto brY = tlY + selectWinHeight;
gSelection.window.iLeft = tlX;
gSelection.window.iTop = tlY;
gSelection.window.iRight = brX;
gSelection.window.iBottom = brY;
gSelection.displayAreaStart.iX = tlX + 1;
gSelection.displayAreaStart.iY = tlY + 15;
gSelection.displayAreaEnd.iX = brX - 1;
gSelection.displayAreaEnd.iY= brY - 1;
gSelection.spacing.iX = 2;
gSelection.spacing.iY = 2;
iTopWinCutOff = gSelection.displayAreaStart.iY;
iBotWinCutOff = gSelection.displayAreaEnd.iY;
DisplaySpec *pDSpec; DisplaySpec *pDSpec;
UINT16 usNSpecs; UINT16 usNSpecs;
@@ -218,33 +185,32 @@ void CreateJA2SelectionWindow( INT16 sWhat )
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" ); iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" ); iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, SelWinClkCallback); DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0, iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 0, BUTTON_USE_DEFAULT, 600, 0,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, OkClkCallback); DEFAULT_MOVE_CALLBACK, OkClkCallback);
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]); SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0, iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 40, BUTTON_USE_DEFAULT, 600, 40,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, CnclClkCallback); DEFAULT_MOVE_CALLBACK, CnclClkCallback);
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]); SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0, iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 80, BUTTON_USE_DEFAULT, 600, 80,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, UpClkCallback); DEFAULT_MOVE_CALLBACK, UpClkCallback);
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]); SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0, iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
BUTTON_USE_DEFAULT, selectWinWidth, 240, BUTTON_USE_DEFAULT, 600, 240,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DwnClkCallback); DEFAULT_MOVE_CALLBACK, DwnClkCallback);
@@ -252,6 +218,18 @@ void CreateJA2SelectionWindow( INT16 sWhat )
fButtonsPresent = TRUE; fButtonsPresent = TRUE;
SelWinSpacing.iX = 2;
SelWinSpacing.iY = 2;
SelWinStartPoint.iX = 1;
SelWinStartPoint.iY = 15;
iTopWinCutOff = 15;
SelWinEndPoint.iX = 599;
SelWinEndPoint.iY = 359;
iBotWinCutOff = 359;
switch( sWhat ) switch( sWhat )
{ {
@@ -369,8 +347,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
return; return;
} }
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd, BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
&gSelection.spacing, CLEAR_BACKGROUND); &SelWinSpacing, CLEAR_BACKGROUND);
} }
@@ -871,14 +849,12 @@ void RenderSelectionWindow( void )
return; return;
ColorFillVideoSurfaceArea(FRAME_BUFFER, ColorFillVideoSurfaceArea(FRAME_BUFFER,
gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom, 0, 0, 600, 400,
GenericButtonFillColors[0] GenericButtonFillColors[0]);
);
DrawSelections( ); DrawSelections( );
MarkButtonsDirty(); MarkButtonsDirty();
RenderButtons( ); RenderButtons( );
// Draw selection rectangle
if ( gfRenderSquareArea ) if ( gfRenderSquareArea )
{ {
button = ButtonList[iSelectWin]; button = ButtonList[iSelectWin];
@@ -886,7 +862,7 @@ void RenderSelectionWindow( void )
return; return;
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) || if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) ) (abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) )
{ {
// iSX = (INT32)iStartClickX; // iSX = (INT32)iStartClickX;
// iEX = (INT32)button->Area.MouseXPos; // iEX = (INT32)button->Area.MouseXPos;
@@ -894,7 +870,7 @@ void RenderSelectionWindow( void )
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY); // iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
iSX = iStartClickX; iSX = iStartClickX;
iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY; iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY;
iEX = gusMouseXPos; iEX = gusMouseXPos;
iEY = gusMouseYPos; iEY = gusMouseYPos;
@@ -913,10 +889,10 @@ void RenderSelectionWindow( void )
iEY ^= iSY; iEY ^= iSY;
} }
iEX = min( gSelection.displayAreaEnd.iX, iEX); iEX = min( iEX, 600 );
iSY = max( gSelection.displayAreaStart.iY, iSY ); iSY = max( SelWinStartPoint.iY, iSY );
iEY = min( gSelection.displayAreaEnd.iY, iEY ); iEY = min( 359, iEY );
iEY = max( gSelection.displayAreaStart.iY, iEY ); iEY = max( SelWinStartPoint.iY, iEY );
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0)); usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
usFillGreen += usDir; usFillGreen += usDir;
@@ -952,7 +928,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
return; return;
iClickX = button->Area.MouseXPos; iClickX = button->Area.MouseXPos;
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY; iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN) if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
{ {
@@ -1059,9 +1035,9 @@ void DisplaySelectionWindowGraphicalInformation()
UINT16 y; UINT16 y;
//Determine if there is a valid picture at cursor position. //Determine if there is a valid picture at cursor position.
//iRelX = gusMouseXPos; //iRelX = gusMouseXPos;
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY; //iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY; y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY;
pNode = pDispList; pNode = pDispList;
fDone = FALSE; fDone = FALSE;
while( (pNode != NULL) && !fDone ) while( (pNode != NULL) && !fDone )
@@ -1494,10 +1470,10 @@ void DrawSelections( void )
{ {
SGPRect ClipRect, NewRect; SGPRect ClipRect, NewRect;
NewRect.iLeft = gSelection.displayAreaStart.iX; NewRect.iLeft = SelWinStartPoint.iX;
NewRect.iTop = gSelection.displayAreaStart.iY; NewRect.iTop = SelWinStartPoint.iY;
NewRect.iRight = gSelection.displayAreaEnd.iX; NewRect.iRight = SelWinEndPoint.iX;
NewRect.iBottom = gSelection.displayAreaEnd.iY; NewRect.iBottom = SelWinEndPoint.iY;
GetClippingRect(&ClipRect); GetClippingRect(&ClipRect);
SetClippingRect(&NewRect); SetClippingRect(&NewRect);
@@ -1507,7 +1483,7 @@ void DrawSelections( void )
SetObjectShade( gvoLargeFontType1, 0 ); SetObjectShade( gvoLargeFontType1, 0 );
// SetObjectShade( gvoLargeFont, 0 ); // SetObjectShade( gvoLargeFont, 0 );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND ); DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND );
SetObjectShade( gvoLargeFontType1, 4 ); SetObjectShade( gvoLargeFontType1, 4 );
+7 -3
View File
@@ -681,9 +681,13 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES); pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES); pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, if(gbPixelDepth==16)
(UINT16 *)pSrcBuf, uiSrcPitchBYTES, {
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ); // BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
UnLockVideoSurface(FRAME_BUFFER); UnLockVideoSurface(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER); UnLockVideoSurface(guiSAVEBUFFER);
+1 -1
View File
@@ -37,4 +37,4 @@ BOOLEAN HandleFadeInCallback( );
void FadeInNextFrame( ); void FadeInNextFrame( );
void FadeOutNextFrame( ); void FadeOutNextFrame( );
#endif #endif
@@ -26,6 +26,7 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "Sys Globals.h" #include "Sys Globals.h"
@@ -1830,7 +1830,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{ {
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1280x720) if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
@@ -1850,7 +1850,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON); btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1280x720 ) if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
+5 -19
View File
@@ -10,6 +10,7 @@
#include "GameVersion.h" #include "GameVersion.h"
#include "LibraryDataBase.h" #include "LibraryDataBase.h"
#include "Debug.h" #include "Debug.h"
#include "Language Defines.h"
#include "HelpScreen.h" #include "HelpScreen.h"
#include "INIReader.h" #include "INIReader.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
@@ -44,7 +45,7 @@
#include <vfs/Core/vfs_file_raii.h> #include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#define GAME_SETTINGS_FILE "Ja2_Settings.ini" #define GAME_SETTINGS_FILE "Ja2_Settings.INI"
#define FEATURE_FLAGS_FILE "Ja2_Features.ini" #define FEATURE_FLAGS_FILE "Ja2_Features.ini"
@@ -991,17 +992,9 @@ void LoadGameExternalOptions()
//Madd: set number of pItem files to be used //Madd: set number of pItem files to be used
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS); gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
//################# Backgrounds #################
// Flugente: backgrounds // Flugente: backgrounds
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Backgrounds", "ENABLE_BACKGROUNDS", TRUE ); gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Data File Settings", "BACKGROUNDS", TRUE );
// Kitty: show additional IMP backgrounds and determine which IMP backgrounds are available at selection based on choices for skills, chararcter traits and disabilities
gGameExternalOptions.fAltIMPCreation = iniReader.ReadBoolean("Backgrounds", "ALTERNATIVE_IMP_CREATION", FALSE);
// Kitty: only show additional IMP backgrounds enabled by AlternativeImpCreation (same rules which are shown as with AlternativeImpCreation)
gGameExternalOptions.fReducedIMPCreation = iniReader.ReadBoolean("Backgrounds", "REDUCED_IMP_CREATION", FALSE);
//################# Merc Recruitment Settings ################# //################# Merc Recruitment Settings #################
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta) // silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
@@ -1192,12 +1185,6 @@ void LoadGameExternalOptions()
// Flugente: additional decals on objects (cracked walls, blood spatters etc.) // Flugente: additional decals on objects (cracked walls, blood spatters etc.)
gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE ); gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE );
// anv: map color variants
gGameExternalOptions.ubRadarMapModeDay = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_DAY", 0, 0, 2);
gGameExternalOptions.ubRadarMapModeNight = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_NIGHT", 3, 0, 3);
gGameExternalOptions.ubOverheadMapModeDay = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_DAY", 0, 0, 2);
gGameExternalOptions.ubOverheadMapModeNight = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_NIGHT", 0, 0, 3);
//################# Sound Settings ################# //################# Sound Settings #################
gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/); gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/);
@@ -1998,7 +1985,6 @@ void LoadGameExternalOptions()
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE); gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f); gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE); gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
//################# Disease Settings ################## //################# Disease Settings ##################
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE ); gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
@@ -3794,7 +3780,7 @@ void LoadCTHConstants()
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
-14
View File
@@ -337,7 +337,6 @@ BOOLEAN UsingBackGroundSystem();
BOOLEAN UsingImprovedInterruptSystem(); BOOLEAN UsingImprovedInterruptSystem();
BOOLEAN UsingInventoryCostsAPSystem(); BOOLEAN UsingInventoryCostsAPSystem();
BOOLEAN IsNIVModeValid(bool checkRes = true); BOOLEAN IsNIVModeValid(bool checkRes = true);
// Snap: Options read from an INI file in the default of custom Data directory // Snap: Options read from an INI file in the default of custom Data directory
@@ -506,7 +505,6 @@ typedef struct
FLOAT sFoodDecayModificator; FLOAT sFoodDecayModificator;
BOOLEAN fFoodEatingSounds; BOOLEAN fFoodEatingSounds;
BOOLEAN fAlwaysFood;
// Flugente: disease settings // Flugente: disease settings
BOOLEAN fDisease; BOOLEAN fDisease;
@@ -954,12 +952,6 @@ typedef struct
BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.) BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.)
// anv: map color variants
UINT8 ubRadarMapModeDay;
UINT8 ubRadarMapModeNight;
UINT8 ubOverheadMapModeDay;
UINT8 ubOverheadMapModeNight;
//enable ext mouse key //enable ext mouse key
BOOLEAN bAltAimEnabled; BOOLEAN bAltAimEnabled;
BOOLEAN bAimedBurstEnabled; BOOLEAN bAimedBurstEnabled;
@@ -1560,12 +1552,6 @@ typedef struct
// Flugente: backgrounds // Flugente: backgrounds
BOOLEAN fBackGround; BOOLEAN fBackGround;
// Kitty: Alternative IMP Creation (choices in skills/char-traits/disabilities determine available backgrounds, plus additional available backgrounds)
BOOLEAN fAltIMPCreation;
// Kitty: Reduced IMP Backgrounds (same as fAltIMPCreation, but for this only the additional backgrounds)
BOOLEAN fReducedIMPCreation;
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed) // Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
UINT8 ubAllowAlternativeWeaponHolding; UINT8 ubAllowAlternativeWeaponHolding;
+2 -2
View File
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
// //
// Keeps track of the saved game version. Increment the saved game version whenever // Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file // you will invalidate the saved game file
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184 #define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183 #define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us #define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA #define SAVE_GAME_VERSION GROWTH_MODIFIERS
//#define RUSSIANGOLD //#define RUSSIANGOLD
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -72,4 +72,4 @@ void NewScreenSoResetHelpScreen( );
INT8 HelpScreenDetermineWhichMapScreenHelpToShow(); INT8 HelpScreenDetermineWhichMapScreenHelpToShow();
#endif #endif
+117 -88
View File
@@ -35,6 +35,7 @@
#include "tile cache.h" #include "tile cache.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "Map Information.h" #include "Map Information.h"
#include "laptop.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
#include "Exit Grids.h" #include "Exit Grids.h"
#include "Summary Info.h" #include "Summary Info.h"
@@ -50,7 +51,6 @@
#include "Multilingual Text Code Generator.h" #include "Multilingual Text Code Generator.h"
#include "editscreen.h" #include "editscreen.h"
#include "Arms Dealer Init.h" #include "Arms Dealer Init.h"
#include "Map Screen Interface Bottom.h"
#include "MPXmlTeams.hpp" #include "MPXmlTeams.hpp"
#include "Strategic Mines LUA.h" #include "Strategic Mines LUA.h"
#include "UndergroundInit.h" #include "UndergroundInit.h"
@@ -76,8 +76,7 @@
#include "AimArchives.h" #include "AimArchives.h"
#include "connect.h" #include "connect.h"
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes() #include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
#include "Animation Data.h" // added by Flugente
#include <language.hpp>
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0}; extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08 extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -135,6 +134,34 @@ static void AddLanguagePrefix(STR fileName, const STR language)
memmove( fileComponent, language, strlen( language) ); memmove( fileComponent, language, strlen( language) );
} }
static const STR GetLanguagePrefix()
{
#ifdef ENGLISH
return "";
#endif
#ifdef GERMAN
return GERMAN_PREFIX;
#endif
#ifdef RUSSIAN
return RUSSIAN_PREFIX;
#endif
#ifdef DUTCH
return DUTCH_PREFIX;
#endif
#ifdef POLISH
return POLISH_PREFIX;
#endif
#ifdef FRENCH
return FRENCH_PREFIX;
#endif
#ifdef ITALIAN
return ITALIAN_PREFIX;
#endif
#ifdef CHINESE
return CHINESE_PREFIX;
#endif
}
static void AddLanguagePrefix(STR fileName) static void AddLanguagePrefix(STR fileName)
{ {
AddLanguagePrefix( fileName, GetLanguagePrefix()); AddLanguagePrefix( fileName, GetLanguagePrefix());
@@ -227,7 +254,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
@@ -241,9 +268,9 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} }
} else { #else
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} #endif
// Lesh: added this, begin // Lesh: added this, begin
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -267,14 +294,14 @@ if( g_lang != i18n::Lang::en ) {
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags // the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
} }
} #endif
//if(!WriteItemStats()) //if(!WriteItemStats())
// return FALSE; // return FALSE;
@@ -339,14 +366,14 @@ if( g_lang != i18n::Lang::en ) {
strcat( fileName, DISEASEFILENAME ); strcat( fileName, DISEASEFILENAME );
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME ); SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME); SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME); strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
@@ -384,14 +411,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LOADSCREENHINTSFILENAME); strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, ARMOURSFILENAME); strcat(fileName, ARMOURSFILENAME);
@@ -411,24 +438,22 @@ if( g_lang != i18n::Lang::en ) {
if (isMultiplayer == false) if (isMultiplayer == false)
{ {
using namespace LogicalBodyTypes; using namespace LogicalBodyTypes;
CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"}; SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME);
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf); SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
} }
} }
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
} }
} #endif
// THE_BOB : added for pocket popup definitions // THE_BOB : added for pocket popup definitions
LBEPocketPopup.clear(); LBEPocketPopup.clear();
@@ -436,7 +461,7 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if (FileExists(fileName)) if (FileExists(fileName))
@@ -451,10 +476,10 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} }
} else { #else
// WANNE: Load english file // WANNE: Load english file
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} #endif
#ifdef JA2UB #ifdef JA2UB
@@ -470,14 +495,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, MERCSTARTINGGEARFILENAME); strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
} }
} #endif
#endif #endif
@@ -494,14 +519,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, ATTACHMENTSLOTSFILENAME); strcat(fileName, ATTACHMENTSLOTSFILENAME);
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
} }
} #endif
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls // Flugente: created separate gun and item choices for different soldier classes - read in different xmls
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -675,14 +700,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, CITYTABLEFILENAME); strcat(fileName, CITYTABLEFILENAME);
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME); SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
} }
} #endif
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp, // Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
// function BOOLEAN InitStrategicMovementCosts(); // function BOOLEAN InitStrategicMovementCosts();
@@ -733,14 +758,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
} }
} #endif
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, DELIVERYMETHODSFILENAME); strcat(fileName, DELIVERYMETHODSFILENAME);
@@ -753,14 +778,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
} }
} #endif
// HEADROCK HAM 3.4: Read in facility locations // HEADROCK HAM 3.4: Read in facility locations
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -774,14 +799,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
} }
} #endif
// HEADROCK HAM 5: Read in Coolness by Sector // HEADROCK HAM 5: Read in Coolness by Sector
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -803,7 +828,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -811,7 +836,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInMercProfiles(fileName,TRUE)) if(!ReadInMercProfiles(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
} }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -829,14 +854,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
} }
} #endif
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data // HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -899,14 +924,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
} }
} #endif
} }
@@ -918,14 +943,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
} }
} #endif
} }
@@ -935,14 +960,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
} }
} #endif
if (gGameExternalOptions.fEnemyRank == TRUE) if (gGameExternalOptions.fEnemyRank == TRUE)
{ {
@@ -952,14 +977,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
} }
} #endif
} }
// Flugente: backgrounds // Flugente: backgrounds
@@ -968,14 +993,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
} }
} #endif
// Flugente: individual militia // Flugente: individual militia
strcpy( fileName, directoryName ); strcpy( fileName, directoryName );
@@ -989,14 +1014,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
} }
} #endif
// WANNE: Only in a singleplayer game... // WANNE: Only in a singleplayer game...
// Externalised taunts // Externalised taunts
@@ -1017,14 +1042,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
} #endif
while( GetFileNext(&FileInfo) ) while( GetFileNext(&FileInfo) )
{ {
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1032,14 +1057,14 @@ if( g_lang != i18n::Lang::en ) {
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
} #endif
} }
GetFileClose(&FileInfo); GetFileClose(&FileInfo);
} }
@@ -1051,14 +1076,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME); SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
} }
} #endif
// IMP Portraits List by Jazz // IMP Portraits List by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1066,14 +1091,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
} }
} #endif
LoadIMPPortraitsTEMP( ); LoadIMPPortraitsTEMP( );
@@ -1158,14 +1183,14 @@ if( g_lang != i18n::Lang::en ) {
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME); SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
//WriteFaceGear(); //WriteFaceGear();
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
} }
} #endif
UINT32 i; UINT32 i;
for(i=0; i<NUM_PROFILES; i++) for(i=0; i<NUM_PROFILES; i++)
{ {
@@ -1179,14 +1204,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
} }
} #endif
//Main Menu by Jazz //Main Menu by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1199,7 +1224,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME); SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1207,7 +1232,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInActionItems(fileName,TRUE)) if(!ReadInActionItems(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
if ( ReadXMLEmail == TRUE ) if ( ReadXMLEmail == TRUE )
{ {
@@ -1217,7 +1242,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE); SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1225,7 +1250,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailMercAvailable(fileName,TRUE)) if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
// EMAIL MERC LEVEL UP by Jazz // EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1233,7 +1258,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP); SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1241,7 +1266,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailMercLevelUp(fileName,TRUE)) if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
} }
/* /*
// EMAIL OTHER by Jazz // EMAIL OTHER by Jazz
@@ -1250,7 +1275,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER); SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1258,7 +1283,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInEmailOther(fileName,TRUE)) if(!ReadInEmailOther(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
*/ */
//new vehicles by Jazz //new vehicles by Jazz
@@ -1269,7 +1294,7 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME); SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1277,9 +1302,9 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInNewVehicles(fileName,TRUE)) if(!ReadInNewVehicles(fileName,TRUE))
return FALSE; return FALSE;
} }
} #endif
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1287,7 +1312,7 @@ if( g_lang != i18n::Lang::en ) {
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0)) if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
return FALSE; return FALSE;
} }
} #endif
#ifdef ENABLE_BRIEFINGROOM #ifdef ENABLE_BRIEFINGROOM
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1295,14 +1320,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
} }
} #endif
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0); BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
@@ -1314,14 +1339,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME); SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
} }
} #endif
// Old AIM Archive // Old AIM Archive
UINT8 p; UINT8 p;
@@ -1335,14 +1360,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
} }
} #endif
UINT8 emptyslotsinarchives = 0; UINT8 emptyslotsinarchives = 0;
for (p=0;p<NUM_PROFILES;p++) for (p=0;p<NUM_PROFILES;p++)
{ {
@@ -1392,14 +1417,14 @@ if( g_lang != i18n::Lang::en ) {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
if( g_lang != i18n::Lang::en ) { #ifndef ENGLISH
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
} }
} #endif
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true); LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix()); g_luaUnderground.LoadScript(GetLanguagePrefix());
@@ -1473,10 +1498,6 @@ UINT32 InitializeJA2(void)
return( ERROR_SCREEN ); return( ERROR_SCREEN );
} }
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
// before calling InitTacticalEngine()
InitMapScreenInterfaceBottomCoords();
// Init tactical engine // Init tactical engine
if ( !InitTacticalEngine( ) ) if ( !InitTacticalEngine( ) )
{ {
@@ -1493,6 +1514,12 @@ UINT32 InitializeJA2(void)
// INit intensity tables // INit intensity tables
BuildIntensityTable( ); BuildIntensityTable( );
// Init Event Manager
if ( !InitializeEventManager( ) )
{
return( ERROR_SCREEN );
}
// Initailize World // Initailize World
if ( !InitializeWorld( ) ) if ( !InitializeWorld( ) )
{ {
@@ -1671,6 +1698,8 @@ void ShutdownJA2(void)
ShutdownJA2Sound( ); ShutdownJA2Sound( );
ShutdownEventManager( );
ShutdownBaseDirtyRectQueue( ); ShutdownBaseDirtyRectQueue( );
// Unload any text box images! // Unload any text box images!
View File
+3 -4
View File
@@ -36,7 +36,6 @@
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "XML.h" #include "XML.h"
#include <language.hpp>
BOOLEAN Style_JA = TRUE; BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0; extern INT8 Test = 0;
@@ -727,11 +726,11 @@ void DisplaySirtechSplashScreen()
* (2006-10-10, Sergeant_Kolja) * (2006-10-10, Sergeant_Kolja)
*/ */
#ifdef _DEBUG #ifdef _DEBUG
if( g_lang == i18n::Lang::en ) { # if defined(ENGLISH)
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) ); AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
} else if( g_lang == i18n::Lang::de ) { # elif defined(GERMAN)
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) ); AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
} # endif
#endif #endif
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) ); AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
return; return;
+5 -3
View File
@@ -12,11 +12,13 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode' //enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType enum EIntroType
{ {
#ifdef JA2UB
INTRO_HELI_CRASH,
#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video. INTRO_ENDING, //set when viewing the end game video.
INTRO_SPLASH, INTRO_SPLASH,
// Unfinished Business
INTRO_HELI_CRASH
}; };
@@ -40,4 +42,4 @@ typedef struct
extern INTRO_NAMES_VALUES zVideoFile[255]; extern INTRO_NAMES_VALUES zVideoFile[255];
#endif #endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef _JA2_DEMO_ADS_H
#define _JA2_DEMO_ADS_H
#include "types.h"
#endif
+3 -4
View File
@@ -5,7 +5,6 @@
#include "Timer Control.h" #include "Timer Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <stdio.h> #include <stdio.h>
#include <language.hpp>
UINT32 guiSplashFrameFade = 10; UINT32 guiSplashFrameFade = 10;
UINT32 guiSplashStartTime = 0; UINT32 guiSplashStartTime = 0;
@@ -14,10 +13,10 @@ extern HVSURFACE ghFrameBuffer;
//Simply create videosurface, load image, and draw it to the screen. //Simply create videosurface, load image, and draw it to the screen.
void InitJA2SplashScreen() void InitJA2SplashScreen()
{ {
if( g_lang == i18n::Lang::en ) { #ifdef ENGLISH
ClearMainMenu(); ClearMainMenu();
} else { #else
UINT32 uiLogoID = 0; UINT32 uiLogoID = 0;
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
@@ -70,7 +69,7 @@ if( g_lang == i18n::Lang::en ) {
GetVideoSurface( &hVSurface, uiLogoID ); GetVideoSurface( &hVSurface, uiLogoID );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
DeleteVideoSurfaceFromIndex( uiLogoID ); DeleteVideoSurfaceFromIndex( uiLogoID );
} // ENGLISH #endif // ENGLISH
InvalidateScreen(); InvalidateScreen();
RefreshScreen( NULL ); RefreshScreen( NULL );
+1 -1
View File
@@ -6,4 +6,4 @@ void InitJA2SplashScreen();
extern UINT32 guiSplashFrameFade; extern UINT32 guiSplashFrameFade;
extern UINT32 guiSplashStartTime; extern UINT32 guiSplashStartTime;
#endif #endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef _JA2PROTOTYPES_H
#define _JA2PROTOTYPES_H
/*
* This header does not define any structures. It simply provides a way for all code that only needs a pointer
* reference to structures, to have it without getting locked into mutual includes and other
* hard-to-trace-and-fix behavior. More class and struct defs can be added as necessary.
*/
class SOLDIERTYPE;
struct AnimationSurfaceType;
#endif
-37
View File
@@ -1,37 +0,0 @@
set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/aniviewscreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Credits.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Fade Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FeaturesScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameInitOptionsScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/gameloop.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/gamescreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameSettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameVersion.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/HelpScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Init.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Intro.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPChatScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPConnectScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPHostScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPJoinScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPScoreScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MPXmlTeams.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Options Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Screens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
PARENT_SCOPE)
-72
View File
@@ -1,72 +0,0 @@
#include "TimeLogging.h"
#include "time.h"
#include <stdio.h>
clock_t starttime;
clock_t t0;
clock_t t1;
FILE* fp_timelog = nullptr;
static void indent(int n)
{
for (int i = 0; i < n; i++)
fputc('\t', fp_timelog);
}
void TimingLogInitialize(const CHAR8* filename)
{
starttime = clock();
t1 = starttime;
if (!fp_timelog)
{
fp_timelog = fopen(filename, "a");
}
}
void TimingLog(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
}
void TimingLogTotalTime(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - starttime) / CLOCKS_PER_SEC));
}
}
void TimingLogWrite(const CHAR8* text)
{
if (fp_timelog)
{
fprintf(fp_timelog, text);
}
}
void TimingLogStop()
{
if (fp_timelog)
{
fprintf(fp_timelog, "\n");
fclose(fp_timelog);
fp_timelog = nullptr;
}
}
-8
View File
@@ -1,8 +0,0 @@
#pragma once
#include "Types.h"
void TimingLogInitialize(const CHAR8* filename);
void TimingLog(const CHAR8* logEvent, int n);
void TimingLogTotalTime(const CHAR8* logEvent, int n);
void TimingLogWrite(const CHAR8* text);
void TimingLogStop();
+1
View File
@@ -11,6 +11,7 @@
#include "Animation Cache.h" #include "Animation Cache.h"
#include "Animation Data.h" #include "Animation Data.h"
#include "Animation Control.h" #include "Animation Control.h"
#include "container.h"
#include <math.h> #include <math.h>
#include "pathai.h" #include "pathai.h"
#include "Random.h" #include "Random.h"
View File
+21
View File
@@ -0,0 +1,21 @@
#include "Language Defines.h"
#if defined(ENGLISH)
# pragma message(" (Language set to ENGLISH, You'll need english CDs)")
#elif defined(GERMAN)
# pragma message(" (Language set to GERMAN, You'll need Topware/german CDs)")
#elif defined(RUSSIAN)
# pragma message(" (Language set to RUSSIAN, You'll need russian CDs)")
#elif defined(DUTCH)
# pragma message(" (Language set to DUTCH, You'll need dutch CDs)")
#elif defined(POLISH)
# pragma message(" (Language set to POLISH, You'll need polish CDs)")
#elif defined(FRENCH)
# pragma message(" (Language set to FRENCH, You'll need french CDs)")
#elif defined(ITALIAN)
# pragma message(" (Language set to ITALIAN, You'll need italian CDs)")
#elif defined(CHINESE)
# pragma message(" (Language set to CHINESE, You'll need chinese CDs)")
#else
# error "At least You have to specify a Language somewhere. See comments above."
#endif
+119
View File
@@ -0,0 +1,119 @@
#ifndef __LANGUAGE_DEFINES_H
#define __LANGUAGE_DEFINES_H
#pragma once
/* ============================================================================
* ONLY ONE OF THESE LANGUAGES CAN BE DEFINED AT A TIME!
* BUT now You can define it _here_ by uncommenting one _or_ (better):
* You can comment them all out and then set it _global_ in "Preprocessor
* options" (do it for ALL projects in the workspace and both debug & release)
* _or_
* give it do Your MAKEFILE, f.i. make ENGLISH, but keep in mind that some
* weird make tools will require 'make ENGLISH=1' instead
*
* using one of the two later methods will keep this SVN file unchanged for the
* future, only Your private project files (workspace/solution) will differ
* from the SVN stuff.
* (2006-10-10, Sergeant_Kolja)
*/
/* The recommend approach for VS2010 multi-language builds is to use the command line or the ja2.props file.
By default the language is ENGLISH and the Language Prefix is EN.
There are 3 ways you can build the JA2 1.13 executable file:
// -------------------------------------------------------
// 1. Using the command line
// -------------------------------------------------------
For example, where msbuild is located in %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ if not on your path
msbuild.exe /p:Configuration=Release ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=PL /p:JA2Language=POLISH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=RU /p:JA2Language=RUSSIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=NL /p:JA2Language=DUTCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=FR /p:JA2Language=FRENCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=IT /p:JA2Language=ITALIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=CN /p:JA2Language=CHINESE ja2_VS2010.sln
Note: If you want to build "Unfinished Business" version, just append the /p:JA2Config=JA2UB in the command line
msbuild.exe /p:Configuration=Release /p:JA2Config=JA2UB ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB ja2_VS2010.sln
Note2: You can also specify the target output name with the parameter /p:TargetName
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB /p:TargetName="JA2UB_113" ja2_VS2010.sln
// --------------------------------------------------------
// 2. Editing the ja2.props file and then build in VS 2010
// -------------------------------------------------------
1. Open the "ja2.props" file in a text editor and set the <BuildMacro> tags to your likeing.
For example: If you want to build Russian Version (normal JA2, not UB) then set the following:
<BuildMacro Include="JA2Config">
<Value></Value>
</BuildMacro>
<BuildMacro Include="JA2LangPrefix">
<Value>RU</Value>
</BuildMacro>
<BuildMacro Include="JA2Language">
<Value>RUSSIAN</Value>
</BuildMacro>
2. Save the file
3. Build the project in Visual Studio 2010
// --------------------------------------------------------
// 3. The "old" way for building the executable
// -------------------------------------------------------
1. Enable the "#undef ENGLISH" define below, so English will not be used anymore
2. Set the desired language below
3. If you want to build "Unfinished Business" version, enable "#define JA2UB" and "#define JA2UBMAPS" in builddefines.h"
4. Build the executable in VS 2005 / 2008 / 2010
5. The output will be placed in the "Build\bin\" folder
*/
// Only enable this "undef", if you use the 3. way of building the executable!
#undef ENGLISH
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
/* please set one manually here (by uncommenting) if not willingly to set Workspace wide */
#define ENGLISH
//#define GERMAN
//#define RUSSIAN
//#define DUTCH
//#define FRENCH
//#define ITALIAN
//#define POLISH
// INFO: For Chinese 1.13 version, you also have to set USE_WINFONTS = 1 in ja2.ini inside your JA2 installation directory!
//#define CHINESE
#endif
//**ddd direct link libraries
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "gdi32.lib")
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "shell32.lib")
/* ====================================================================
* Regardless of if we did it Workspace wide or by uncommenting above,
* HERE we must see, what language was selected. If one, we
*/
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
# error "At least You have to specify a Language somewhere. See comments above."
#endif
//if the language represents words as single chars
/*#ifdef TAIWAN
#define SINGLE_CHAR_WORDS
#endif*/
#endif
+39 -102
View File
@@ -36,6 +36,7 @@
#include "Strategic Status.h" #include "Strategic Status.h"
#include "Merc Contract.h" #include "Merc Contract.h"
#include "Strategic Merc Handler.h" #include "Strategic Merc Handler.h"
#include "Language Defines.h"
#include "Assignments.h" #include "Assignments.h"
#include "Sound Control.h" #include "Sound Control.h"
#include "Quests.h" #include "Quests.h"
@@ -49,7 +50,6 @@
#include "Encrypted File.h" #include "Encrypted File.h"
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include <sstream> #include <sstream>
#include <language.hpp>
// //
//****** Defines ****** //****** Defines ******
@@ -148,16 +148,10 @@
#define FEE_X PRICE_X + 7 #define FEE_X PRICE_X + 7
#define FEE_Y NAME_Y #define FEE_Y NAME_Y
#define FEE_WIDTH 37 #define FEE_WIDTH 37
#define FEE_X_UB PRICE_X + 40
#define FEE_Y_UB STATS_Y + 28
#define FEE_Y_UB_NSGI STATS_Y
#define AIM_CONTRACT_X PRICE_X + 51 #define AIM_CONTRACT_X PRICE_X + 51
#define AIM_CONTRACT_Y FEE_Y #define AIM_CONTRACT_Y FEE_Y
#define AIM_CONTRACT_WIDTH 59 #define AIM_CONTRACT_WIDTH 59
#define AIM_CONTRACT_X_UB PRICE_X + 19
#define AIM_OFFER_X PRICE_X + 3
#define AIM_OFFER_WIDTH 110
#define ONEDAY_X AIM_CONTRACT_X #define ONEDAY_X AIM_CONTRACT_X
#define ONEWEEK_X AIM_CONTRACT_X #define ONEWEEK_X AIM_CONTRACT_X
@@ -1126,13 +1120,7 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Draw fee & contract //Draw fee & contract
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1141,6 +1129,9 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1149,7 +1140,6 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
#endif // JA2UB
} }
else else
{ {
@@ -1173,12 +1163,6 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
//Draw fee & contract //Draw fee & contract
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1188,6 +1172,9 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
@@ -1196,7 +1183,6 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
#endif
} }
DisableAimButton(); DisableAimButton();
@@ -1323,10 +1309,6 @@ BOOLEAN UpdateMercInfo(void)
if(gGameExternalOptions.gfUseNewStartingGearInterface) if(gGameExternalOptions.gfUseNewStartingGearInterface)
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1353,8 +1335,6 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif // JA2UB
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -1383,10 +1363,6 @@ BOOLEAN UpdateMercInfo(void)
} }
else else
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1413,7 +1389,6 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -2553,21 +2528,6 @@ BOOLEAN DisplayVideoConferencingDisplay()
DisplayMercChargeAmount(); DisplayMercChargeAmount();
#ifdef JA2UB
if (gubVideoConferencingMode == AIM_VIDEO_HIRE_MERC_MODE)
{
CHAR16 offerText[190];
swprintf(offerText, zNewTacticalMessages[TACT_MSG__AIMMEMBER_ONE_TIME_FEE], gMercProfiles[gbCurrentSoldier].zNickname);
const auto xCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_X + 115;
const auto yCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_Y + 45;
const auto textAreaWidth = 245;
SetFontShadow(AIM_M_VIDEO_NAME_SHADOWCOLOR);
DisplayWrappedString(xCoord, yCoord, textAreaWidth, 2, AIM_M_FONT_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, offerText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
SetFontShadow(DEFAULT_SHADOW);
}
#endif // JA2UB
// if( gfMercIsTalking && !gfIsAnsweringMachineActive) // if( gfMercIsTalking && !gfIsAnsweringMachineActive)
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] ) if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
{ {
@@ -2617,9 +2577,6 @@ BOOLEAN DisplayMercsVideoFace()
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown) void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
{ {
#ifdef JA2UB
return;
#else
UINT16 i, usPosY, usPosX; UINT16 i, usPosY, usPosX;
//First draw the select light for the contract length buttons //First draw the select light for the contract length buttons
@@ -2673,8 +2630,6 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP; usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
} }
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
#endif // JA2UB
} }
@@ -2698,10 +2653,7 @@ UINT32 DisplayMercChargeAmount()
giContractAmount = 0; giContractAmount = 0;
//the contract charge amount //the contract charge amount
#ifdef JA2UB
// Special offer for a limited time! Act fast!
giContractAmount = gMercProfiles[gbCurrentSoldier].uiWeeklySalary;
#else
// Get the salary rate // Get the salary rate
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY) if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary; giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
@@ -2723,7 +2675,6 @@ UINT32 DisplayMercChargeAmount()
{ {
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost; giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
} }
#endif
} }
@@ -2734,15 +2685,10 @@ UINT32 DisplayMercChargeAmount()
//if the merc hasnt just been hired //if the merc hasnt just been hired
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL ) // if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
{ {
#ifdef JA2UB
// Don't even have to pay for medical insurance! What a DEAL!
swprintf(wTemp, L"%s", wDollarTemp);
#else
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit ) if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] ); swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
else else
swprintf(wTemp, L"%s", wDollarTemp ); swprintf(wTemp, L"%s", wDollarTemp );
#endif // JA2UB
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -3941,14 +3887,14 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
MSYS_DisableRegion(&gSelectedShutUpMercRegion); MSYS_DisableRegion(&gSelectedShutUpMercRegion);
//Enable the ability to click on the BIG face to go to different screen //Enable the ability to click on the BIG face to go to different screen
MSYS_EnableRegion(&gSelectedFaceRegion); MSYS_EnableRegion(&gSelectedFaceRegion);
// EnableDisableCurrentVideoConferenceButtons(FALSE); // EnableDisableCurrentVideoConferenceButtons(FALSE);
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE ) if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
{ {
// Enable the current video conference buttons // Enable the current video conference buttons
EnableDisableCurrentVideoConferenceButtons(FALSE); EnableDisableCurrentVideoConferenceButtons(FALSE);
} }
fVideoConferenceCreated = FALSE; fVideoConferenceCreated = FALSE;
@@ -4139,22 +4085,6 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT); // InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE ); DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
#ifdef JA2UB
// Disable and hide contract length & gear purchase buttons
gfBuyEquipment = TRUE;
for (size_t i = 0; i < 3; i++)
{
DisableButton(giContractLengthButton[i]);
HideButton(giContractLengthButton[i]);
if (i < 2)
{
DisableButton(giBuyEquipmentButton[i]);
HideButton(giBuyEquipmentButton[i]);
}
}
#endif // JA2UB
} }
@@ -5367,17 +5297,11 @@ BOOLEAN DisplayShadedStretchedMercFace( UINT8 ubMercID, UINT16 usPosX, UINT16 us
void DemoHiringOfMercs( ) void DemoHiringOfMercs( )
{ {
INT16 i; INT16 i;
UINT8 MercID[5]; #ifdef GERMAN
MercID[0] = 7; UINT8 MercID[]={ 7, 10, 4, 14, 50 };
MercID[1] = 10; #else
MercID[2] = 4; UINT8 MercID[]={ 7, 10, 4, 42, 33 };
if( g_lang == i18n::Lang::de ) { #endif
MercID[3] = 14;
MercID[4] = 50;
} else {
MercID[3] = 42;
MercID[4] = 33;
}
MERC_HIRE_STRUCT HireMercStruct; MERC_HIRE_STRUCT HireMercStruct;
static BOOLEAN fHaveCalledBefore=FALSE; static BOOLEAN fHaveCalledBefore=FALSE;
@@ -5468,20 +5392,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
//create the string to display to the user, looks like.... //create the string to display to the user, looks like....
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival // L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
if( g_lang == i18n::Lang::de ) { #ifdef GERMAN
//Germans version has a different argument order //Germans version has a different argument order
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString, zTimeString,
zSectorIDString ); zSectorIDString );
} else { #else
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
zSectorIDString, zSectorIDString,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString ); zTimeString );
} #endif
@@ -5709,15 +5633,28 @@ void EnableWeaponKitSelectionButtons()
{ {
if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable ) if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable )
{ {
bool bShow;
INT16 usItem;
for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i) for(int i=0; i<NUM_MERCSTARTINGGEAR_KITS; ++i)
{ {
bShow = false;
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j) for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
{ {
if(gMercProfileGear[gbCurrentSoldier][i].inv[j] != NONE) usItem = gMercProfileGear[gbCurrentSoldier][i].inv[j];
if(usItem != NONE)
{ {
ShowButton( giWeaponboxSelectionButton[i] ); bShow = true;
break; //shadooow: if any of the item in kit is limited to specific system and this system isn't enabled then disable the whole kit from selection
} if (((Item[usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
{
bShow = false;
break;
}
}
}
if (bShow)
{
ShowButton(giWeaponboxSelectionButton[i]);
} }
} }
} }
+1 -1
View File
@@ -627,7 +627,7 @@ TestTable::Display( )
{ {
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown], MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow, usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
MSYS_PRIORITY_HIGHEST-3, CURSOR_WWW, MSYS_PRIORITY_HIGHEST, CURSOR_WWW,
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack ); MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] ); MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
+20 -21
View File
@@ -20,7 +20,6 @@
// HEADROCK HAM 4 // HEADROCK HAM 4
#include "input.h" #include "input.h"
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item #include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
#include <language.hpp>
#define BOBBYR_DEFAULT_MENU_COLOR 255 #define BOBBYR_DEFAULT_MENU_COLOR 255
@@ -116,7 +115,11 @@
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1 #define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40 #define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X #ifdef CHINESE
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH - 10 //BOBBYR_ITEM_QTY_NUM_X
#else
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#endif
#define BOBBY_RAY_NOT_PURCHASED 255 #define BOBBY_RAY_NOT_PURCHASED 255
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200 #define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
@@ -1762,11 +1765,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
{ {
if ( iSubFilter > -1 ) // Madd: new BR filters if ( iSubFilter > -1 ) // Madd: new BR filters
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter ) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter )
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
bAddItem = TRUE; bAddItem = TRUE;
} }
else else
@@ -2503,11 +2506,7 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED) if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
{ {
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased); swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
auto bobbyRItemsBoughtX{ BOBBYR_ITEMS_BOUGHT_X }; DrawTextToScreen(sTemp, BOBBYR_ITEMS_BOUGHT_X, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if (g_lang == i18n::Lang::zh) {
bobbyRItemsBoughtX -= 10;
}
DrawTextToScreen(sTemp, bobbyRItemsBoughtX, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
} }
@@ -2517,11 +2516,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
//if it's a used item, display how damaged the item is //if it's a used item, display how damaged the item is
if( fUsed ) if( fUsed )
{ {
if ( g_lang == i18n::Lang::zh ) { #ifdef CHINESE
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
} else { #else
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality ); swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
} #endif
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -2654,11 +2653,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
{ {
if (iSubFilter > -1 ) if (iSubFilter > -1 )
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment )
bCntNumItems = TRUE; bCntNumItems = TRUE;
} }
else else
@@ -3642,11 +3641,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
{ {
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
{ {
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode) if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex)) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex)) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
bCntItem = TRUE; bCntItem = TRUE;
} }
else else
@@ -4182,7 +4181,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (it = range.first; it != range.second; it++) for (it = range.first; it != range.second; it++)
{ {
UINT16 attachmentId = it->second.attachmentIndex; UINT16 attachmentId = it->second.attachmentIndex;
if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE)) if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE) if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
@@ -4195,7 +4194,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++) for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
{ {
// If the attachment is not hidden and attachable to the gun (usItemNumber) // If the attachment is not hidden and attachable to the gun (usItemNumber)
if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) && if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment &&
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId)) ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
+6 -7
View File
@@ -30,7 +30,6 @@
#include "GameSettings.h" #include "GameSettings.h"
#include <vfs/Core/vfs.h> #include <vfs/Core/vfs.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#include <language.hpp>
/* /*
typedef struct typedef struct
@@ -489,11 +488,11 @@ BOOLEAN EnterBobbyRMailOrder()
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE ); SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
if(g_lang == i18n::Lang::fr) { #ifdef FRENCH
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
} else { #else
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
} #endif
// Accept Order button // Accept Order button
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 ); guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
@@ -505,11 +504,11 @@ if(g_lang == i18n::Lang::fr) {
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback); DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
if(g_lang == i18n::Lang::fr) { #ifdef FRENCH
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
} else { #else
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
} #endif
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED ); SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
if( gbSelectedCity == -1 ) if( gbSelectedCity == -1 )
+1 -1
View File
@@ -17,4 +17,4 @@ BOOLEAN DrawBriefingRoomDefaults();
BOOLEAN DisplayBriefingRoomSlogan(); BOOLEAN DisplayBriefingRoomSlogan();
BOOLEAN DisplayBriefingRoomCopyright(); BOOLEAN DisplayBriefingRoomCopyright();
#endif #endif
+1 -1
View File
@@ -17,4 +17,4 @@ BOOLEAN DrawBriefingRoomEnterDefaults();
BOOLEAN DisplayBriefingRoomEnterSlogan(); BOOLEAN DisplayBriefingRoomEnterSlogan();
BOOLEAN DisplayBriefingRoomEnterCopyright(); BOOLEAN DisplayBriefingRoomEnterCopyright();
#endif #endif
+1 -1
View File
@@ -133,4 +133,4 @@ extern BOOLEAN SaveBriefingRoomToSaveGameFile( HWFILE hFile );
#endif #endif
+1 -1
View File
@@ -3,4 +3,4 @@
#endif // __CAMPAIGNHISTORY_DATA_H #endif // __CAMPAIGNHISTORY_DATA_H
+1 -1
View File
@@ -27,4 +27,4 @@ void ExitCampaignHistory_News();
void HandleCampaignHistory_News(); void HandleCampaignHistory_News();
void RenderCampaignHistory_News(); void RenderCampaignHistory_News();
#endif // __CAMPAIGNHISTORY_SUMMARY_H #endif // __CAMPAIGNHISTORY_SUMMARY_H
+1 -1
View File
@@ -332,4 +332,4 @@ STR16 GetIncidentName( UINT32 aIncidentId );
UINT32 GetIdOfCurrentlyOngoingIncident(); UINT32 GetIdOfCurrentlyOngoingIncident();
#endif // __CAMPAIGNSTATS_H #endif // __CAMPAIGNSTATS_H
+1 -1
View File
@@ -21,7 +21,7 @@
#include "QuestText.h" //quest: name #include "QuestText.h" //quest: name
#include "laptop.h" //ui positions #include "laptop.h" //ui positions
#include "Utilities.h" #include "Utilities.h"
#include "Cursors.h" #include "Utils/Cursors.h"
#include "sysutil.h" //extra Buffer for scaling image #include "sysutil.h" //extra Buffer for scaling image
#include "vsurface.h" //fill extra buffer with black color #include "vsurface.h" //fill extra buffer with black color
#include "Text.h" #include "Text.h"
+1 -1
View File
@@ -36,7 +36,7 @@
#include "laptop.h"//UI dimensions, mouse regions #include "laptop.h"//UI dimensions, mouse regions
#include "Utilities.h"//file names #include "Utilities.h"//file names
#include "vobject.h"//video objects #include "vobject.h"//video objects
#include "Cursors.h" #include "Utils/Cursors.h"
#include "Text.h"//button text #include "Text.h"//button text
#include "Button System.h" #include "Button System.h"
#include "Encyclopedia_new.h" #include "Encyclopedia_new.h"
+1 -1
View File
@@ -7,4 +7,4 @@ void ExitIMPAboutUs( void );
void EnterIMPAboutUs( void ); void EnterIMPAboutUs( void );
void HandleIMPAboutUs( void ); void HandleIMPAboutUs( void );
#endif #endif
+1 -1
View File
@@ -8,4 +8,4 @@ void HandleIMPAttributeEntrance( void );
#endif #endif
+1 -1
View File
@@ -7,4 +7,4 @@ void RenderIMPAttributeFinish( void );
void ExitIMPAttributeFinish( void ); void ExitIMPAttributeFinish( void );
void HandleIMPAttributeFinish( void ); void HandleIMPAttributeFinish( void );
#endif #endif
+1 -1
View File
@@ -22,4 +22,4 @@ extern BOOLEAN fReturnStatus;
INT8 StartingLevelChosen(); // added - SANDRO INT8 StartingLevelChosen(); // added - SANDRO
#endif #endif
+45 -226
View File
@@ -17,7 +17,6 @@
#include "IMP Compile Character.h" #include "IMP Compile Character.h"
#include "IMP Disability Trait.h" #include "IMP Disability Trait.h"
#include "IMP Character Trait.h" #include "IMP Character Trait.h"
#include "IMP Minor Trait.h"
#include "GameSettings.h" #include "GameSettings.h"
#include "Interface.h" #include "Interface.h"
@@ -603,187 +602,81 @@ void ResetDisplaySkills()
extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ]; extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ];
extern BOOLEAN gfSkillTraitQuestions[20]; BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
extern BOOLEAN gfSkillTraitQuestions2[20];
extern BOOLEAN gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS];
BOOLEAN IsBackGroundAllowed(UINT16 ubNumber)
{ {
if (!ubNumber) if ( !ubNumber )
return FALSE; return FALSE;
// some backgrounds are only allowed to specific genders. Set both to forbid a background from ever showing up in IMP creation (for merc-specific backgrounds) // some backgrounds are only allowed to specific genders. Set both to forbid a background from ever showing up in IMP creation (for merc-specific backgrounds)
if (fCharacterIsMale && zBackground[ubNumber].uiFlags & BACKGROUND_NO_MALE) if ( fCharacterIsMale && zBackground[ ubNumber ].uiFlags & BACKGROUND_NO_MALE )
return FALSE; return FALSE;
else if (!fCharacterIsMale && zBackground[ubNumber].uiFlags & BACKGROUND_NO_FEMALE) else if ( !fCharacterIsMale && zBackground[ ubNumber ].uiFlags & BACKGROUND_NO_FEMALE )
return FALSE; return FALSE;
// added new ini-options and accompanying background-tag if ( SkillsList[0] == HEAVY_WEAPONS_NT || SkillsList[1] == HEAVY_WEAPONS_NT || SkillsList[2] == HEAVY_WEAPONS_NT )
// choices in skills/character-traits/disabilities determine available backgrounds if true in ja2options.ini
// new tag <alt_impcreation> has been added to backgrounds.xml
if (!gGameExternalOptions.fAltIMPCreation)
{ {
if (zBackground[ubNumber].uiFlags & BACKGROUND_ALT_IMP_CREATION) // don't show BG with tag <alt_impcreation> if Alt_Imp_Creation isn't true in ja2options.ini if ( zBackground[ ubNumber ].value[BG_ARTILLERY] > 0 )
{
return FALSE;
}
else
{
return TRUE;
}
}
// show BG with tag <alt_impcreation>,
// but don't show BG whose tags would contradict with a main bonus/penalty gained by skill/char-trait/disability
if (gGameExternalOptions.fAltIMPCreation)
// define which tags are considered contradicting for major traits, minor traits, disablities and character traits
// major traits (single-trait and dual-trait)
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_HEAVY_WEAPONS])
{
if (zBackground[ubNumber].value[BG_ARTILLERY] > 0) //dual trait (expert)
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_ARTILLERY] > 10) //single trait
return FALSE;
}
}
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_PROF_SNIPER] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_PROF_SNIPER])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_PROF_SNIPER] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_PROF_SNIPER])
{
if (zBackground[ubNumber].value[BG_PERC_CTH_MAX] < 0 || zBackground[ubNumber].value[BG_MARKSMANSHIP] < 0 )
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_PERC_CTH_MAX] < 0 )
return FALSE;
}
}
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_MARTIAL_ARTS])
{
if (zBackground[ubNumber].value[BG_RESI_PHYSICAL] < 0 )
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_RESI_PHYSICAL] < 0 )
return FALSE;
}
}
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_TECHNICIAN] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_TECHNICIAN])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_TECHNICIAN] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_TECHNICIAN])
{
if (zBackground[ubNumber].value[BG_MECHANICAL] < 0)
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_MECHANICAL] < 0)
return FALSE;
}
}
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_DOCTOR] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_DOCTOR])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_DOCTOR] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_DOCTOR])
{
if (zBackground[ubNumber].value[BG_PERC_BANDAGING] < 0 || zBackground[ubNumber].value[BG_MEDICAL] < 0 )
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_PERC_BANDAGING] < 0)
return FALSE;
}
}
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_SQUADLEADER] || gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_SQUADLEADER])
{
if (gfSkillTraitQuestions[IMP_SKILL_TRAITS_NEW_SQUADLEADER] && gfSkillTraitQuestions2[IMP_SKILL_TRAITS_NEW_SQUADLEADER])
{
if (zBackground[ubNumber].value[BG_RESI_SUPPRESSION] < 0 || zBackground[ubNumber].value[BG_RESI_FEAR] < 0 )
return FALSE;
}
else
{
if (zBackground[ubNumber].value[BG_RESI_SUPPRESSION] < 0)
return FALSE;
}
}
// Minor Traits (single trait only)
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_MELEE])
{
if (zBackground[ubNumber].value[BG_PERC_CTH_BLADE] < 0 || zBackground[ubNumber].value[BG_PERC_DAMAGE_MELEE] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_STEALTHY]) if ( SkillsList[0] == SNIPER_NT || SkillsList[1] == SNIPER_NT || SkillsList[2] == SNIPER_NT )
{ {
if (zBackground[ubNumber].value[BG_PERC_STEALTH] < 0) if ( zBackground[ ubNumber ].value[BG_PERC_CTH_MAX] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_DEMOLITIONS]) if ( SkillsList[0] == SURVIVAL_NT || SkillsList[1] == SURVIVAL_NT || SkillsList[2] == SURVIVAL_NT )
{ {
if (zBackground[ubNumber].value[BG_BONUS_BREACHINGCHARGE] < 0 || zBackground[ubNumber].value[BG_EXPLOSIVE_ASSIGN] < 0 ) if ( zBackground[ ubNumber ].value[BG_PERC_CAMO] < 0 )
return FALSE;
}
if ( SkillsList[0] == MARTIAL_ARTS_NT || SkillsList[1] == MARTIAL_ARTS_NT || SkillsList[2] == MARTIAL_ARTS_NT )
{
if ( zBackground[ ubNumber ].value[BG_PERC_DAMAGE_MELEE] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_SURVIVAL]) if ( SkillsList[0] == TECHNICIAN_NT || SkillsList[1] == TECHNICIAN_NT || SkillsList[2] == TECHNICIAN_NT )
{ {
if (zBackground[ubNumber].value[BG_TRAVEL_FOOT] < 0 || zBackground[ubNumber].value[BG_TRAVEL_CAR] <0 || zBackground[ubNumber].value[BG_TRAVEL_AIR] <0 || if ( zBackground[ ubNumber ].value[BG_MECHANICAL] < 0 )
zBackground[ubNumber].value[BG_RESI_DISEASE] < 0 || zBackground[ubNumber].value[BG_SNAKEDEFENSE] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_BODYBUILDING]) if ( SkillsList[0] == DOCTOR_NT || SkillsList[1] == DOCTOR_NT || SkillsList[2] == DOCTOR_NT )
{ {
if (zBackground[ubNumber].value[BG_PERC_CARRYSTRENGTH] < 0) if ( zBackground[ ubNumber ].value[BG_MEDICAL] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_AMBIDEXTROUS]) if ( SkillsList[0] == MELEE_NT || SkillsList[1] == MELEE_NT || SkillsList[2] == MELEE_NT )
{ {
if (zBackground[ubNumber].value[BG_INVENTORY] > 0) if ( zBackground[ ubNumber ].value[BG_PERC_CTH_BLADE] < 0 )
return FALSE; return FALSE;
} }
if (gfMinorTraitQuestions[IMP_SKILL_TRAITS_NEW_NIGHT_OPS]) if ( SkillsList[0] == STEALTHY_NT || SkillsList[1] == STEALTHY_NT || SkillsList[2] == STEALTHY_NT )
{ {
if (zBackground[ubNumber].value[BG_PERC_SLEEP] > 0 || zBackground[ubNumber].value[BG_PERC_HEARING_NIGHT] < 0 ) if ( zBackground[ ubNumber ].value[BG_PERC_STEALTH] < 0 )
return FALSE; return FALSE;
} }
// Disabiliies if ( SkillsList[0] == ATHLETICS_NT || SkillsList[1] == ATHLETICS_NT || SkillsList[2] == ATHLETICS_NT )
switch (iChosenDisabilityTrait()) {
if ( zBackground[ ubNumber ].value[BG_PERC_SPEED_RUNNING] < 0 )
return FALSE;
}
if ( SkillsList[0] == DEMOLITIONS_NT || SkillsList[1] == DEMOLITIONS_NT || SkillsList[2] == DEMOLITIONS_NT )
{
if ( zBackground[ ubNumber ].value[BG_EXPLOSIVE_ASSIGN] < 0 )
return FALSE;
}
switch ( iChosenDisabilityTrait() )
{ {
case HEAT_INTOLERANT: case HEAT_INTOLERANT:
if (zBackground[ubNumber].value[BG_DESERT] > 0 || zBackground[ubNumber].value[BG_TROPICAL] > 0) if ( zBackground[ ubNumber ].value[BG_DESERT] > 0 )
return FALSE; return FALSE;
break; break;
case NERVOUS: case NERVOUS:
@@ -793,7 +686,7 @@ BOOLEAN IsBackGroundAllowed(UINT16 ubNumber)
return FALSE; return FALSE;
break; break;
case NONSWIMMER: case NONSWIMMER:
if ( zBackground[ ubNumber ].value[BG_RIVER] > 0 || zBackground[ ubNumber ].value[BG_COASTAL] > 0 ) if ( zBackground[ ubNumber ].value[BG_RIVER] > 0 || zBackground[ ubNumber ].value[BG_COASTAL] > 0 || zBackground[ ubNumber ].value[BG_SWIMMING] > 0 )
return FALSE; return FALSE;
break; break;
case FEAR_OF_INSECTS: case FEAR_OF_INSECTS:
@@ -801,109 +694,35 @@ BOOLEAN IsBackGroundAllowed(UINT16 ubNumber)
return FALSE; return FALSE;
break; break;
case FORGETFUL: case FORGETFUL:
if (zBackground[ubNumber].value[BG_INVENTORY] < 0 || zBackground[ubNumber].value[BG_ASSAULT] < 0 ) if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
return FALSE; return FALSE;
break; break;
case PSYCHO: case PSYCHO:
if (zBackground[ubNumber].value[BG_LEADERSHIP] > 5) if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
return FALSE;
break;
case DEAF:
if (zBackground[ ubNumber ].value[BG_PERC_HEARING_NIGHT] > 0 || zBackground[ ubNumber ].value[BG_PERC_HEARING_DAY] > 0)
return FALSE;
break;
case SHORTSIGHTED:
if (zBackground[ ubNumber ].value[BG_PERC_CTH_MAX] > 0 || zBackground[ubNumber].value[BG_PERC_SPOTTER] > 0 )
return FALSE;
break;
case HEMOPHILIAC:
if (zBackground[ubNumber].value[BG_RESI_DISEASE] > 0)
return FALSE; return FALSE;
break; break;
case AFRAID_OF_HEIGHTS: case AFRAID_OF_HEIGHTS:
if ( zBackground[ ubNumber ].value[BG_HEIGHT] > 0 || zBackground[ubNumber].value[BG_AIRDROP] > 0 ) if ( zBackground[ubNumber].value[BG_HEIGHT] > 0 )
return FALSE;
break;
case SELF_HARM:
if (zBackground[ubNumber].value[BG_RESI_DISEASE] > 0)
return FALSE; return FALSE;
break; break;
default: default:
break; break;
} }
// Character Traits switch ( iChosenCharacterTrait() )
switch (iChosenCharacterTrait())
{ {
case CHAR_TRAIT_SOCIABLE: case CHAR_TRAIT_SOCIABLE:
if (zBackground[ubNumber].uiFlags & BACKGROUND_XENOPHOBIC || zBackground[ubNumber].value[BG_PERC_SPOTTER] < 0) if ( zBackground[ ubNumber ].uiFlags & BACKGROUND_XENOPHOBIC )
return FALSE; return FALSE;
break; break;
case CHAR_TRAIT_LONER: case CHAR_TRAIT_LONER:
if (zBackground[ubNumber].value[BG_LEADERSHIP] > 0 || zBackground[ubNumber].value[BG_PERC_SPOTTER] > 0) if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
return FALSE;
break;
case CHAR_TRAIT_OPTIMIST:
if (zBackground[ubNumber].uiFlags & BACKGROUND_TRAPLEVEL)
return FALSE;
break;
case CHAR_TRAIT_ASSERTIVE:
if (zBackground[ubNumber].value[BG_PERC_INTERROGATION] < 0 || zBackground[ubNumber].value[BG_PERC_APPROACH_THREATEN] < 0)
return FALSE;
break;
case CHAR_TRAIT_INTELLECTUAL:
if (zBackground[ubNumber].value[BG_ADMINISTRATION_ASSIGNMENT] < 0)
return FALSE;
break;
case CHAR_TRAIT_PRIMITIVE:
if (zBackground[ubNumber].value[BG_ADMINISTRATION_ASSIGNMENT] > 0)
return FALSE;
break;
case CHAR_TRAIT_AGGRESSIVE:
if (zBackground[ubNumber].uiFlags & BACKGROUND_TRAPLEVEL || zBackground[ubNumber].value[BG_PERC_DISARM] > 0 )
return FALSE;
break;
case CHAR_TRAIT_PHLEGMATIC:
if (zBackground[ubNumber].value[BG_ASSAULT] > 0 )
return FALSE;
break;
case CHAR_TRAIT_DAUNTLESS:
if (zBackground[ubNumber].value[BG_CROUCHEDDEFENSE] < 0 )
return FALSE;
break;
case CHAR_TRAIT_PACIFIST:
break;
case CHAR_TRAIT_MALICIOUS:
if (zBackground[ubNumber].value[BG_PERC_APPROACH_FRIENDLY] > 0)
return FALSE;
break;
case CHAR_TRAIT_SHOWOFF:
break;
case CHAR_TRAIT_COWARD:
if (zBackground[ubNumber].value[BG_PERC_CAPITULATION] > 0)
return FALSE; return FALSE;
break; break;
default: default:
break; break;
} }
// show exclusivly the BG's with tag <alt_impcreation> if Reduced_Imp_Creation is true in ja2options.ini
// requires Alt_Imp_Creation to be true in ja2options.ini (otherwise BG's with tag <alt_impcreation> won't be shown)
if (gGameExternalOptions.fReducedIMPCreation)
{
if (zBackground[ubNumber].uiFlags & BACKGROUND_ALT_IMP_CREATION)
{
return TRUE;
}
else
{
return FALSE;
}
}
return TRUE; return TRUE;
} }
+13 -9
View File
@@ -24,7 +24,6 @@
#include "text.h" #include "text.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
#define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138 #define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138
#define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195 #define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195
@@ -553,14 +552,14 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
//Heinz (18.01.2009): Russian layout //Heinz (18.01.2009): Russian layout
// ViSoR (07.01.2012) : Russian and Belarussian layouts // ViSoR (07.01.2012) : Russian and Belarussian layouts
// //
if(g_lang == i18n::Lang::ru) { #if defined(RUSSIAN) || defined(BELARUSSIAN)
// ViSoR (02.02.2013): Fix for Cyrillic layouts // ViSoR (02.02.2013): Fix for Cyrillic layouts
DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 ); DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 );
DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF; DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF;
if( layout == 0x419 ) // Russian if( layout == 0x419 ) // Russian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨ "; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
@@ -568,23 +567,28 @@ if(g_lang == i18n::Lang::ru) {
else if( layout == 0x423 ) // Belarussian else if( layout == 0x423 ) // Belarussian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨ "; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
} }
else if( !CheckIsKeyValid( uiKey ) ) else if( !CheckIsKeyValid( uiKey ) )
uiKey = '#'; uiKey = '#';
}
if( (g_lang != i18n::Lang::ru && if( uiKey != '#')
uiKey >= 'A' && uiKey <= 'Z' || #else
#ifndef USE_CODE_PAGE
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' || uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' || uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey == '_' || uiKey == '.' ||
uiKey == ' ' || uiKey == '"' || uiKey == ' ' || uiKey == '"' ||
uiKey == 39 // This is ' which cannot be written explicitly here of course uiKey == 39 // This is ' which cannot be written explicitly here of course
) || )
uiKey != '#') #else
if( charSet::IsFromSet( uiKey, charSet::CS_SPACE|charSet::CS_ALPHA_NUM|charSet::CS_SPECIAL_ALPHA ) )
#endif
#endif
{ {
// if the current string position is at max or great, do nothing // if the current string position is at max or great, do nothing
switch( ubTextEnterMode ) switch( ubTextEnterMode )
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPBeginScreen( void );
#endif #endif
@@ -7,4 +7,4 @@ void RenderIMPCharacterAndDisabilityEntrance( void );
void ExitIMPCharacterAndDisabilityEntrance( void ); void ExitIMPCharacterAndDisabilityEntrance( void );
void HandleIMPCharacterAndDisabilityEntrance( void ); void HandleIMPCharacterAndDisabilityEntrance( void );
#endif #endif
+1 -1
View File
@@ -20,4 +20,4 @@ void ClearAllSkillsList( void );
extern STR8 pPlayerSelectedFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ]; extern STR8 pPlayerSelectedFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ];
extern STR8 pPlayerSelectedBigFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ]; extern STR8 pPlayerSelectedBigFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ];
#endif #endif
+16 -5
View File
@@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
if(iOrder[i]!=-1) if(iOrder[i]!=-1)
{ {
// skip if this item is an attachment // skip if this item is an attachment
if(ItemIsAttachment(tInv[iOrder[i]].inv)) if(Item[tInv[iOrder[i]].inv].attachment)
continue; continue;
iSet = FALSE; iSet = FALSE;
number = tInv[iOrder[i]].iNumber; number = tInv[iOrder[i]].iNumber;
@@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
return HELMETPOS; return HELMETPOS;
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST ) if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
return VESTPOS; return VESTPOS;
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) ) if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment))
return LEGPOS; return LEGPOS;
break; break;
case IC_BLADE: case IC_BLADE:
@@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
case IC_GUN: case IC_GUN:
if ( pProfile->inv[HANDPOS] == NONE ) if ( pProfile->inv[HANDPOS] == NONE )
return HANDPOS; return HANDPOS;
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS]))) if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded))
return SECONDHANDPOS; return SECONDHANDPOS;
if((UsingNewInventorySystem() == true)) if((UsingNewInventorySystem() == true))
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0) if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
@@ -1336,6 +1336,16 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat")); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat"));
#ifndef USE_VFS
char zFileName[13];
char temp;
for(int i=0;i < 9;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead
{
temp = (char) gMercProfiles[iProfileId].zNickname[i];
zFileName[i] = temp;
}
#else
char zFileName[32]; char zFileName[32];
if(vfs::Settings::getUseUnicode()) if(vfs::Settings::getUseUnicode())
{ {
@@ -1345,6 +1355,7 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
{ {
vfs::String::narrow(gMercProfiles[iProfileId].zNickname, 10, zFileName, 32); vfs::String::narrow(gMercProfiles[iProfileId].zNickname, 10, zFileName, 32);
} }
#endif
// Changed by ADB, rev 1513 // Changed by ADB, rev 1513
//strcat(zFileName,IMP_FILENAME_SUFFIX); //strcat(zFileName,IMP_FILENAME_SUFFIX);
@@ -1681,7 +1692,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
// give ammo for guns // give ammo for guns
Assert( usItem < gMAXITEMS_READ ); Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) ) if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
@@ -1726,7 +1737,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
MakeProfileInvItemAnySlot(pProfile,usItem,100,1); MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
// give ammo for guns // give ammo for guns
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) ) if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
+1 -1
View File
@@ -8,7 +8,7 @@ void RenderIMPDisabilityTrait( void );
void ExitIMPDisabilityTrait( void ); void ExitIMPDisabilityTrait( void );
void HandleIMPDisabilityTrait( void ); void HandleIMPDisabilityTrait( void );
INT8 iChosenDisabilityTrait(); INT8 iChosenDisabilityTrait();
INT8 iPlayersAttributePointsBonusForDisabilitySelected(); INT8 iPlayersAttributePointsBonusForDisabilitySelected();
#endif #endif
+1 -1
View File
@@ -10,4 +10,4 @@ void HandleIMPFinish( void );
extern BOOLEAN fFinishedCharGeneration; extern BOOLEAN fFinishedCharGeneration;
#endif #endif
+1 -1
View File
@@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
{ {
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
if (ItemIsTwoHanded(usItem)) { if (Item[usItem].twohanded) {
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
} }
else { else {
+1 -1
View File
@@ -15,4 +15,4 @@ void HandleImpHomePage( void );
#define IMP_MERC_FILENAME "IMP" #define IMP_MERC_FILENAME "IMP"
extern INT32 GlowColorsList[][3]; extern INT32 GlowColorsList[][3];
#endif #endif
+1 -1
View File
@@ -29,4 +29,4 @@ enum
IMP__FINISH, IMP__FINISH,
}; };
#endif #endif
+1 -1
View File
@@ -80,7 +80,7 @@ UINT8 gusNewMinorTraitRemap[IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS] =
BOOLEAN gfIMT_Redraw=FALSE; BOOLEAN gfIMT_Redraw=FALSE;
BOOLEAN gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ]; BOOLEAN gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
// these are the buttons for the questions // these are the buttons for the questions
INT32 giIMPMinorTraitAnswerButton[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ]; INT32 giIMPMinorTraitAnswerButton[ IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS ];
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPPersonalityEntrance( void );
STR16 pSkillTraitBeginIMPStrings[]; STR16 pSkillTraitBeginIMPStrings[];
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPPersonalityFinish( void );
extern UINT8 bPersonalityEndState; extern UINT8 bPersonalityEndState;
#endif #endif
+1 -1
View File
@@ -12,4 +12,4 @@ void BltAnswerIndents( INT32 iNumberOfIndents );
extern INT32 giCurrentPersonalityQuizQuestion; extern INT32 giCurrentPersonalityQuizQuestion;
extern INT32 iCurrentAnswer; extern INT32 iCurrentAnswer;
#endif #endif
+1 -1
View File
@@ -10,4 +10,4 @@ BOOLEAN RenderPortrait( INT16 sX, INT16 sY );
extern INT32 iPortraitNumber; extern INT32 iPortraitNumber;
#endif #endif
+2 -2
View File
@@ -98,8 +98,8 @@ UINT8 gusOldMajorTraitRemap[IMP_SKILL_TRAITS__NUMBER_SKILLS] =
// Global Variables // Global Variables
// //
//******************************************************************* //*******************************************************************
BOOLEAN gfSkillTraitQuestions[ 20 ]; BOOLEAN gfSkillTraitQuestions[ 20 ];
BOOLEAN gfSkillTraitQuestions2[ 20 ]; BOOLEAN gfSkillTraitQuestions2[ 20 ];
BOOLEAN gfIST_Redraw=FALSE; BOOLEAN gfIST_Redraw=FALSE;
+3 -4
View File
@@ -38,7 +38,6 @@
#include "GameSettings.h" #include "GameSettings.h"
#endif #endif
#include <language.hpp>
#define IMP_SEEK_AMOUNT 5 * 80 * 2 #define IMP_SEEK_AMOUNT 5 * 80 * 2
@@ -205,18 +204,18 @@ void PrintImpText( void )
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0);
//inshy (18.01.2009): fix position for russian text //inshy (18.01.2009): fix position for russian text
if( g_lang == i18n::Lang::ru ) { #ifdef RUSSIAN
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
} else { #else
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
} #endif
break; break;
case ( IMP_PERSONALITY ): case ( IMP_PERSONALITY ):
+1 -1
View File
@@ -145,4 +145,4 @@ enum{
}; };
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 PlayVoice( void );
extern UINT32 iSelectedIMPVoiceSet; extern UINT32 iSelectedIMPVoiceSet;
#endif #endif
+1 -1
View File
@@ -835,4 +835,4 @@ template<> void TestTableTemplate<3>::Init( UINT16 sX, UINT16 sY, UINT16 sX_End
AddColumnDataProvider( itemnamecol );*/ AddColumnDataProvider( itemnamecol );*/
TestTable::Init( sX, sY, sX_End, sY_End ); TestTable::Init( sX, sY, sX_End, sY_End );
} }
+1 -1
View File
@@ -851,4 +851,4 @@ BOOLEAN LoadPMC( HWFILE hwFile )
} }
return TRUE; return TRUE;
} }
+1 -1
View File
@@ -254,4 +254,4 @@ private:
protected: protected:
}; };
#endif #endif
+1 -1
View File
@@ -305,4 +305,4 @@ enum{
}; };
#endif #endif
#endif #endif
+1 -1
View File
@@ -227,4 +227,4 @@ BOOLEAN WriteAimAvailability(STR fileName)
FileClose( hFile ); FileClose( hFile );
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -287,4 +287,4 @@ BOOLEAN WriteMercAvailability(STR fileName)
FileClose( hFile ); FileClose( hFile );
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -268,4 +268,4 @@ BOOLEAN ReadInDeliveryMethods(STR fileName)
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -236,4 +236,4 @@ BOOLEAN ReadInShippingDestinations(STR fileName, BOOLEAN localizedVersion)
XML_ParserFree(parser); XML_ParserFree(parser);
return( TRUE ); return( TRUE );
} }
+1
View File
@@ -476,6 +476,7 @@ void GameInitFiles( )
{ {
if ( FileExists( FILES_DAT_FILE ) == TRUE ) if ( FileExists( FILES_DAT_FILE ) == TRUE )
{ {
FileClearAttributes( FILES_DAT_FILE );
FileDelete( FILES_DAT_FILE ); FileDelete( FILES_DAT_FILE );
} }
+1
View File
@@ -460,6 +460,7 @@ void GameInitFinances()
// unlink Finances data file // unlink Finances data file
if( (FileExists( FINANCES_DATA_FILE ) ) ) if( (FileExists( FINANCES_DATA_FILE ) ) )
{ {
FileClearAttributes( FINANCES_DATA_FILE );
FileDelete( FINANCES_DATA_FILE ); FileDelete( FINANCES_DATA_FILE );
} }
GetBalanceFromDisk( ); GetBalanceFromDisk( );
+1 -1
View File
@@ -16,4 +16,4 @@ void RenderFloristCards();
extern INT8 gbCurrentlySelectedCard; extern INT8 gbCurrentlySelectedCard;
#endif #endif
+1 -1
View File
@@ -21,4 +21,4 @@ extern UINT32 guiCurrentlySelectedFlower;
extern UINT8 gubCurFlowerIndex; extern UINT8 gubCurFlowerIndex;
#endif #endif
+1 -1
View File
@@ -12,4 +12,4 @@ void InitFloristOrderForm();
void InitFloristOrderFormVariables(); void InitFloristOrderFormVariables();
#endif #endif

Some files were not shown because too many files have changed in this diff Show More