Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Jan 23, 2024
1 parent 367c612 commit 470b831
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
Binary file modified Content/Translations/pl.mo
Binary file not shown.
9 changes: 5 additions & 4 deletions Content/Translations/pl.po
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ msgstr "Chcę zagrać w grę z jakimiś nowościami."
#. TRANSLATORS: Header in First Run section
#: Sources/Jazz2/UI/Menu/FirstRunSection.cpp:53
msgid "Welcome to \f[c:0x9e7056]Jazz Jackrabbit 2\f[c] reimplementation!"
msgstr "Witaj w reimplementacji \f[c:0x9e7056]Jazz Jackrabbit 2\f[c]"
msgstr "Witaj w reimplementacji \f[c:0x9e7056]Jazz Jackrabbit 2\f[c]!"

#. TRANSLATORS: Menu item in Options section
#: Sources/Jazz2/UI/Menu/FirstRunSection.cpp:57
Expand All @@ -1644,9 +1644,10 @@ msgid ""
"For more information, visit %s and  Discord!"
msgstr ""
"Możesz wybrać preferowany przez siebie styl rozgrywki.\n"
"To ustawienie może zostać zmienione, kiedy tylko ci się spodoba w "
"\f[c:0x707070]%s\f[c] > \f[c:0x707070]%s\f[c] > \f[c:0x707070]%s\f[c].\n"
"Po więcej informacji, odwiedź %s oraz  serwer Discord!"
"To ustawienie może zostać zmienione,\n"
"kiedy tylko ci się spodoba w \f[c:0x707070]%s\f[c] > \f[c:0x707070]%s\f[c] > "
"\f[c:0x707070]%s\f[c].\n"
"Po więcej informacji, odwiedź %s oraz serwer  Discord!"

#. TRANSLATORS: Menu item in Options > Gameplay > Enhancements section
#: Sources/Jazz2/UI/Menu/GameplayEnhancementsSection.cpp:16
Expand Down
11 changes: 11 additions & 0 deletions Sources/Jazz2/LevelHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,17 @@ namespace Jazz2

// Also apply overriden actions (by touch controls)
_pressedActions |= _overrideActions;

if ((_overrideActions & (1 << (std::int32_t)PlayerActions::Right)) != 0) {
_playerRequiredMovement.X = 1.0f;
} else if ((_overrideActions & (1 << (std::int32_t)PlayerActions::Left)) != 0) {
_playerRequiredMovement.X = -1.0f;
}
if ((_overrideActions & (1 << (std::int32_t)PlayerActions::Down)) != 0) {
_playerRequiredMovement.Y = 1.0f;
} else if ((_overrideActions & (1 << (std::int32_t)PlayerActions::Up)) != 0) {
_playerRequiredMovement.Y = -1.0f;
}
}

void LevelHandler::UpdateRichPresence()
Expand Down
46 changes: 25 additions & 21 deletions Sources/Jazz2/UI/Menu/RemapControlsSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,40 +351,44 @@ namespace Jazz2::UI::Menu

void RemapControlsSection::OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos)
{
auto& mapping = ControlScheme::_mappings[_currentPlayerIndex * (std::int32_t)PlayerActions::Count + newIndex];

float centerX = viewSize.X / 2;
float firstColumnX = centerX * (0.81f - 0.1f);
float columnWidth = centerX * 0.2f;

float x = touchPos.X - firstColumnX;
if (x >= 0.0f && x < columnWidth * MaxTargetCount) {
std::int32_t newColumn = (std::int32_t)(x / columnWidth);
if (_selectedIndex == newIndex && _selectedColumn == newColumn) {
if (_waitForInput) {
// If we are already waiting for input, delete the target instead
_waitForInput = false;
if (newColumn <= mapping.Targets.size()) {
if (_selectedIndex == newIndex && _selectedColumn == newColumn) {
if (_waitForInput) {
// If we are already waiting for input, delete the target instead
_waitForInput = false;

if (_selectedIndex == (int32_t)PlayerActions::Menu && _selectedColumn == 0) {
return;
}
if (_selectedIndex == (int32_t)PlayerActions::Menu && _selectedColumn == 0) {
return;
}

auto& mapping = ControlScheme::_mappings[_currentPlayerIndex * (std::int32_t)PlayerActions::Count + _selectedIndex];
if (_selectedColumn < mapping.Targets.size()) {
mapping.Targets.erase(mapping.Targets.begin() + _selectedColumn);
if (_selectedColumn < mapping.Targets.size()) {
mapping.Targets.erase(mapping.Targets.begin() + _selectedColumn);

_isDirty = true;
_root->PlaySfx("MenuSelect"_s, 0.5f);
_root->ApplyPreferencesChanges(ChangedPreferencesType::ControlScheme);
_isDirty = true;
_root->PlaySfx("MenuSelect"_s, 0.5f);
_root->ApplyPreferencesChanges(ChangedPreferencesType::ControlScheme);
}
} else {
OnExecuteSelected();
}
} else {
OnExecuteSelected();
_root->PlaySfx("MenuSelect"_s, 0.5f);
_waitForInput = false;
_animation = 0.0f;
_selectedIndex = newIndex;
_selectedColumn = newColumn;
EnsureVisibleSelected();
OnSelectionChanged(_items[_selectedIndex]);
}
} else {
_root->PlaySfx("MenuSelect"_s, 0.5f);
_animation = 0.0f;
_selectedIndex = newIndex;
_selectedColumn = newColumn;
EnsureVisibleSelected();
OnSelectionChanged(_items[_selectedIndex]);
}
}
}
Expand Down

0 comments on commit 470b831

Please sign in to comment.