Skip to content

Commit

Permalink
Reworked Gameplay Enhancements, load gamepad mappings also from confi…
Browse files Browse the repository at this point in the history
…g dir, minor changes
  • Loading branch information
deathkiller committed Dec 28, 2023
1 parent 2a6d268 commit 16b7729
Show file tree
Hide file tree
Showing 32 changed files with 1,387 additions and 716 deletions.
Binary file modified Content/Translations/cs.mo
Binary file not shown.
213 changes: 146 additions & 67 deletions Content/Translations/cs.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/it.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/it.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/pl.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/pl.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/pt.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/pt.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/pt_BR.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/pt_BR.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/ro.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/ro.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/ru.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/ru.po

Large diffs are not rendered by default.

Binary file modified Content/Translations/tr.mo
Binary file not shown.
211 changes: 145 additions & 66 deletions Content/Translations/tr.po

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Sources/Jazz2/Multiplayer/MultiLevelHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace Jazz2::Multiplayer
_lastSpawnedActorId = UINT8_MAX;

std::uint8_t flags = 0;
if (PreferencesCache::EnableReforged) {
if (PreferencesCache::EnableReforgedGameplay) {
flags |= 0x01;
}
MemoryStream packet(10 + _episodeName.size() + _levelFileName.size());
Expand Down Expand Up @@ -1012,7 +1012,7 @@ namespace Jazz2::Multiplayer
switch (packetType) {
case ClientPacketType::Auth: {
std::uint8_t flags = 0;
if (PreferencesCache::EnableReforged) {
if (PreferencesCache::EnableReforgedGameplay) {
flags |= 0x01;
}

Expand Down
16 changes: 13 additions & 3 deletions Sources/Jazz2/PreferencesCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace Jazz2
#else
bool PreferencesCache::UnalignedViewport = false;
#endif
bool PreferencesCache::EnableReforged = true;
bool PreferencesCache::EnableReforgedGameplay = true;
bool PreferencesCache::EnableReforgedHUD = true;
bool PreferencesCache::EnableReforgedMainMenu = true;
bool PreferencesCache::EnableLedgeClimb = true;
WeaponWheelStyle PreferencesCache::WeaponWheel = WeaponWheelStyle::Enabled;
#if !defined(DEATH_TARGET_ANDROID) && !defined(DEATH_TARGET_IOS) && !defined(DEATH_TARGET_SWITCH) && !defined(DEATH_TARGET_WINDOWS_RT)
Expand Down Expand Up @@ -156,7 +158,7 @@ namespace Jazz2
ShowPlayerTrails = ((boolOptions & BoolOptions::ShowPlayerTrails) == BoolOptions::ShowPlayerTrails);
LowGraphicsQuality = ((boolOptions & BoolOptions::LowGraphicsQuality) == BoolOptions::LowGraphicsQuality);
UnalignedViewport = ((boolOptions & BoolOptions::UnalignedViewport) == BoolOptions::UnalignedViewport);
EnableReforged = ((boolOptions & BoolOptions::EnableReforged) == BoolOptions::EnableReforged);
EnableReforgedGameplay = ((boolOptions & BoolOptions::EnableReforgedGameplay) == BoolOptions::EnableReforgedGameplay);
EnableLedgeClimb = ((boolOptions & BoolOptions::EnableLedgeClimb) == BoolOptions::EnableLedgeClimb);
WeaponWheel = ((boolOptions & BoolOptions::EnableWeaponWheel) == BoolOptions::EnableWeaponWheel ? WeaponWheelStyle::Enabled : WeaponWheelStyle::Disabled);
EnableRgbLights = ((boolOptions & BoolOptions::EnableRgbLights) == BoolOptions::EnableRgbLights);
Expand All @@ -168,6 +170,12 @@ namespace Jazz2
TutorialCompleted = ((boolOptions & BoolOptions::TutorialCompleted) == BoolOptions::TutorialCompleted);
ResumeOnStart = ((boolOptions & BoolOptions::ResumeOnStart) == BoolOptions::ResumeOnStart);

if (version >= 3) {
// These 2 new options needs to be enabled by default
EnableReforgedHUD = ((boolOptions & BoolOptions::EnableReforgedHUD) == BoolOptions::EnableReforgedHUD);
EnableReforgedMainMenu = ((boolOptions & BoolOptions::EnableReforgedMainMenu) == BoolOptions::EnableReforgedMainMenu);
}

if (WeaponWheel != WeaponWheelStyle::Disabled && (boolOptions & BoolOptions::ShowWeaponWheelAmmoCount) == BoolOptions::ShowWeaponWheelAmmoCount) {
WeaponWheel = WeaponWheelStyle::EnabledWithAmmoCount;
}
Expand Down Expand Up @@ -337,7 +345,7 @@ namespace Jazz2
if (ShowPlayerTrails) boolOptions |= BoolOptions::ShowPlayerTrails;
if (LowGraphicsQuality) boolOptions |= BoolOptions::LowGraphicsQuality;
if (UnalignedViewport) boolOptions |= BoolOptions::UnalignedViewport;
if (EnableReforged) boolOptions |= BoolOptions::EnableReforged;
if (EnableReforgedGameplay) boolOptions |= BoolOptions::EnableReforgedGameplay;
if (EnableLedgeClimb) boolOptions |= BoolOptions::EnableLedgeClimb;
if (WeaponWheel != WeaponWheelStyle::Disabled) boolOptions |= BoolOptions::EnableWeaponWheel;
if (WeaponWheel == WeaponWheelStyle::EnabledWithAmmoCount) boolOptions |= BoolOptions::ShowWeaponWheelAmmoCount;
Expand All @@ -348,6 +356,8 @@ namespace Jazz2
if (TutorialCompleted) boolOptions |= BoolOptions::TutorialCompleted;
if (Language[0] != '\0') boolOptions |= BoolOptions::SetLanguage;
if (ResumeOnStart) boolOptions |= BoolOptions::ResumeOnStart;
if (EnableReforgedHUD) boolOptions |= BoolOptions::EnableReforgedHUD;
if (EnableReforgedMainMenu) boolOptions |= BoolOptions::EnableReforgedMainMenu;
co.WriteValue<uint64_t>((uint64_t)boolOptions);

if (Language[0] != '\0') {
Expand Down
13 changes: 9 additions & 4 deletions Sources/Jazz2/PreferencesCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ namespace Jazz2
static bool UnalignedViewport;

// Gameplay
static bool EnableReforged;
static bool EnableReforgedGameplay;
static bool EnableReforgedHUD;
static bool EnableReforgedMainMenu;
static bool EnableLedgeClimb;
static WeaponWheelStyle WeaponWheel;
static bool EnableRgbLights;
Expand Down Expand Up @@ -136,7 +138,7 @@ namespace Jazz2
LowGraphicsQuality = 0x10,
UnalignedViewport = 0x20,

EnableReforged = 0x100,
EnableReforgedGameplay = 0x100,
EnableLedgeClimb = 0x200,
EnableWeaponWheel = 0x400,
EnableRgbLights = 0x800,
Expand All @@ -147,12 +149,15 @@ namespace Jazz2

TutorialCompleted = 0x10000,
SetLanguage = 0x20000,
ResumeOnStart = 0x40000
ResumeOnStart = 0x40000,

EnableReforgedHUD = 0x100000,
EnableReforgedMainMenu = 0x200000
};

DEFINE_PRIVATE_ENUM_OPERATORS(BoolOptions);

static constexpr std::uint8_t FileVersion = 2;
static constexpr std::uint8_t FileVersion = 3;

static constexpr float TouchPaddingMultiplier = 0.003f;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Jazz2/UI/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ namespace Jazz2::UI
std::int32_t charOffset = 0;
std::int32_t charOffsetShadow = 0;

if (_levelHandler->IsReforged()) {
if (PreferencesCache::EnableReforgedHUD) {
for (std::int32_t i = 0; i < player->_health; i++) {
stringBuffer[i] = '|';
}
Expand Down Expand Up @@ -544,7 +544,7 @@ namespace Jazz2::UI
std::int32_t charOffset = 0;
std::int32_t charOffsetShadow = 0;

if (_levelHandler->IsReforged()) {
if (PreferencesCache::EnableReforgedHUD) {
DrawElement(PickupFood, -1, view.X + 3.0f, view.Y + 3.0f + 1.6f, ShadowLayer, Alignment::TopLeft, Colorf(0.0f, 0.0f, 0.0f, 0.4f));
DrawElement(PickupFood, -1, view.X + 3.0f, view.Y + 3.0f, MainLayer, Alignment::TopLeft, Colorf::White);

Expand Down
4 changes: 2 additions & 2 deletions Sources/Jazz2/UI/Menu/CreateServerOptionsSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ namespace Jazz2::UI::Menu
{
PlayerType players[] = { (PlayerType)((int32_t)PlayerType::Jazz + _selectedPlayerType) };
LevelInitialization levelInit(_episodeName, StringView(_levelName), GameDifficulty::Multiplayer,
PreferencesCache::EnableReforged, false, players, countof(players));
PreferencesCache::EnableReforgedGameplay, false, players, countof(players));

if (!_previousEpisodeName.empty()) {
auto previousEpisodeEnd = PreferencesCache::GetEpisodeEnd(_previousEpisodeName);
Expand All @@ -362,7 +362,7 @@ namespace Jazz2::UI::Menu
}
}

if (PreferencesCache::EnableReforged && _levelName == "01_xmas1"_s) {
if (PreferencesCache::EnableReforgedGameplay && _levelName == "01_xmas1"_s) {
levelInit.LastExitType = ExitType::Warp | ExitType::Frozen;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Jazz2/UI/Menu/EpisodeSelectSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ namespace Jazz2::UI::Menu

PlayerType players[] = { (PlayerType)((episodeContinue->State.DifficultyAndPlayerType >> 4) & 0x0f) };
LevelInitialization levelInit(selectedItem.Item.Description.Name, episodeContinue->LevelName, (GameDifficulty)(episodeContinue->State.DifficultyAndPlayerType & 0x0f),
PreferencesCache::EnableReforged, false, players, countof(players));
PreferencesCache::EnableReforgedGameplay, false, players, countof(players));

if ((episodeContinue->State.Flags & EpisodeContinuationFlags::CheatsUsed) == EpisodeContinuationFlags::CheatsUsed) {
levelInit.CheatsUsed = true;
Expand Down
Loading

0 comments on commit 16b7729

Please sign in to comment.