Add car lock options
- Added ModMenuModule::Utils::GetSelectableCarLockStates helper function - Added an option in ModMenuModule::LastVehicleMenu to change car lock state
This commit is contained in:
parent
15ac97992e
commit
25610c28cd
@ -731,6 +731,7 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
||||
<ClInclude Include="src\modules\modmenu\utils\fix-car-utils.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\get-all-weapons.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\angle-utils.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\get-selectable-car-lock-states.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\get-cars-sorted-by-distance.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\give-player-powerup.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\save-game.h" />
|
||||
@ -968,6 +969,7 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
||||
<ClCompile Include="src\modules\modmenu\utils\explode-all-cars.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\fix-car-utils.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\get-all-weapons.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\get-selectable-car-lock-states.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\get-cars-sorted-by-distance.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\give-player-powerup.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\save-game.cpp" />
|
||||
|
||||
@ -169,6 +169,7 @@
|
||||
<ClCompile Include="src\events\window-focus-change.cpp" />
|
||||
<ClCompile Include="src\events\steering-assist.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\cheats\disable-steering-assist.cpp" />
|
||||
<ClCompile Include="src\modules\modmenu\utils\get-selectable-car-lock-states.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\converters\ammo.h" />
|
||||
@ -454,6 +455,7 @@
|
||||
<ClInclude Include="src\modules\modmenu\cheats\disable-steering-assist.h" />
|
||||
<ClInclude Include="src\converters\car-door-lock.h" />
|
||||
<ClInclude Include="src\converters\car-lock-state.h" />
|
||||
<ClInclude Include="src\modules\modmenu\utils\get-selectable-car-lock-states.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="GTA2.props" />
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
#include "../cheats/last-car.h"
|
||||
#include "../../../converters/car-model.h"
|
||||
#include "../../../converters/car-remap.h"
|
||||
#include "../../../converters/car-lock-state.h"
|
||||
#include "../../../converters/car-damage.h"
|
||||
#include "../utils/get-selectable-car-lock-states.h"
|
||||
#include "../utils/fix-car-utils.h"
|
||||
#include "last-vehicle-physics-menu.h"
|
||||
#include "last-vehicle-save-menu.h"
|
||||
@ -62,6 +64,20 @@ bool ModMenuModule::LastVehicleMenu::Attach()
|
||||
);
|
||||
remapController->SetConverter<CarRemapConverter>();
|
||||
|
||||
// lock
|
||||
UiModule::Text* doorsLockText = m_menuController->CreateItem<UiModule::Text>(vertCont, L"", options.textSize);
|
||||
const auto& doorsLockOptionList = Utils::GetSelectableCarLockStates();
|
||||
auto doorsLockController = m_menuController->CreateLatestItemController<UiModule::VarTextSelectController<Game::CAR_LOCK_STATE>>(
|
||||
doorsLockText,
|
||||
Core::MakeResolver(
|
||||
lastCarResolver,
|
||||
mem(&Game::Car::lockState)
|
||||
),
|
||||
doorsLockOptionList,
|
||||
UiModule::VarTextSelectControllerOptions{ L"Lock: #", L"#" }
|
||||
);
|
||||
doorsLockController->SetConverter<CarLockStateConverter>();
|
||||
|
||||
// engine damage
|
||||
UiModule::Text* engineDamageText = m_menuController->CreateItem<UiModule::Text>(vertCont, L"", options.textSize);
|
||||
auto engineDamageController = m_menuController->CreateLatestItemController<UiModule::VarTextEditableController<short>>(
|
||||
|
||||
12
src/modules/modmenu/utils/get-selectable-car-lock-states.cpp
Normal file
12
src/modules/modmenu/utils/get-selectable-car-lock-states.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "get-selectable-car-lock-states.h"
|
||||
|
||||
const std::vector<Game::CAR_LOCK_STATE>& ModMenuModule::Utils::GetSelectableCarLockStates()
|
||||
{
|
||||
static const std::vector<Game::CAR_LOCK_STATE> carLockStates({
|
||||
Game::CAR_LOCK_STATE_UNLOCKED,
|
||||
Game::CAR_LOCK_STATE_LOCKOUT_THIEF,
|
||||
Game::CAR_LOCK_STATE_LOCKOUT_PLAYER,
|
||||
Game::CAR_LOCK_STATE_LOCKED
|
||||
});
|
||||
return carLockStates;
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "../common.h"
|
||||
|
||||
namespace ModMenuModule::Utils {
|
||||
const std::vector<Game::CAR_LOCK_STATE>& GetSelectableCarLockStates();
|
||||
}
|
||||
@ -10,6 +10,7 @@
|
||||
#include "fix-car-utils.h"
|
||||
#include "get-all-weapons.h"
|
||||
#include "get-cars-sorted-by-distance.h"
|
||||
#include "get-selectable-car-lock-states.h"
|
||||
#include "give-player-powerup.h"
|
||||
#include "save-game.h"
|
||||
#include "spawn-car.h"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user