Refactor teleport class
This commit is contained in:
parent
46732744c0
commit
29cec3a0bd
@ -289,7 +289,7 @@ void CheatMenu::Init()
|
|||||||
D3dHook::SetMouseState(m_bShowMenu);
|
D3dHook::SetMouseState(m_bShowMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Teleport::m_bQuickTeleport && quickTeleport.PressedRealtime())
|
if (Teleport::IsQuickTeleportActive() && quickTeleport.PressedRealtime())
|
||||||
{
|
{
|
||||||
D3dHook::SetMouseState(true);
|
D3dHook::SetMouseState(true);
|
||||||
}
|
}
|
||||||
|
204
src/teleport.cpp
204
src/teleport.cpp
@ -34,6 +34,11 @@ void Teleport::FetchRadarSpriteData()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool Teleport::IsQuickTeleportActive()
|
||||||
|
{
|
||||||
|
return m_bQuickTeleport;
|
||||||
|
}
|
||||||
|
|
||||||
void Teleport::Init()
|
void Teleport::Init()
|
||||||
{
|
{
|
||||||
m_bTeleportMarker = gConfig.Get("Features.TeleportMarker", false);
|
m_bTeleportMarker = gConfig.Get("Features.TeleportMarker", false);
|
||||||
@ -41,52 +46,14 @@ void Teleport::Init()
|
|||||||
m_fMapSize.x = gConfig.Get("Game.MapSizeX", 6000.0f);
|
m_fMapSize.x = gConfig.Get("Game.MapSizeX", 6000.0f);
|
||||||
m_fMapSize.y = gConfig.Get("Game.MapSizeY", 6000.0f);
|
m_fMapSize.y = gConfig.Get("Game.MapSizeY", 6000.0f);
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::drawingEvent += []
|
||||||
{
|
{
|
||||||
if ((TPMarker::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - TPMarker::m_nTimer) > 50))
|
|
||||||
{
|
|
||||||
CPlayerPed* player = FindPlayerPed();
|
|
||||||
|
|
||||||
#ifdef GTASA
|
|
||||||
CEntity* player_entity = FindPlayerEntity(-1);
|
|
||||||
TPMarker::m_fPos.z = CWorld::FindGroundZFor3DCoord(TPMarker::m_fPos.x, TPMarker::m_fPos.y,
|
|
||||||
TPMarker::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
|
|
||||||
#else
|
|
||||||
TPMarker::m_fPos.z = CWorld::FindGroundZFor3DCoord(TPMarker::m_fPos.x, TPMarker::m_fPos.y,
|
|
||||||
TPMarker::m_fPos.z + 100.0f, nullptr) + 1.0f;
|
|
||||||
#endif
|
|
||||||
CVehicle* pVeh = player->m_pVehicle;
|
|
||||||
|
|
||||||
if (pVeh && BY_GAME(player->m_nPedFlags.bInVehicle, player->m_pVehicle, player->m_pVehicle))
|
|
||||||
{
|
|
||||||
BY_GAME(pVeh->Teleport(TPMarker::m_fPos, false), pVeh->Teleport(TPMarker::m_fPos), player->Teleport(TPMarker::m_fPos));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BY_GAME(player->Teleport(TPMarker::m_fPos, false), player->Teleport(TPMarker::m_fPos), player->Teleport(TPMarker::m_fPos));
|
|
||||||
}
|
|
||||||
#ifdef GTASA
|
|
||||||
if (TPMarker::m_bJetpack)
|
|
||||||
{
|
|
||||||
Command<Commands::TASK_JETPACK>(CPools::GetPedRef(player));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TPMarker::m_bEnabled = false;
|
|
||||||
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(CPools::GetPedRef(player), false);
|
|
||||||
Command<Commands::RESTORE_CAMERA_JUMPCUT>();
|
|
||||||
TheCamera.Fade(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bTeleportMarker && teleportMarker.Pressed())
|
if (m_bTeleportMarker && teleportMarker.Pressed())
|
||||||
{
|
{
|
||||||
WarpPlayer<eTeleportType::Marker>();
|
WarpPlayer<eTeleportType::Marker>();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Events::drawingEvent += []
|
|
||||||
{
|
|
||||||
if (m_bQuickTeleport && quickTeleport.PressedRealtime())
|
if (m_bQuickTeleport && quickTeleport.PressedRealtime())
|
||||||
{
|
{
|
||||||
static CSprite2d map;
|
static CSprite2d map;
|
||||||
@ -120,56 +87,42 @@ void Teleport::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GTASA
|
||||||
template<eTeleportType Type>
|
template<eTeleportType Type>
|
||||||
void Teleport::WarpPlayer(CVector pos, int interiorID)
|
void Teleport::WarpPlayer(CVector pos, int interiorID)
|
||||||
{
|
{
|
||||||
CPlayerPed* pPlayer = FindPlayerPed();
|
CPlayerPed* pPlayer = FindPlayerPed();
|
||||||
CVehicle* pVeh = pPlayer->m_pVehicle;
|
CVehicle* pVeh = pPlayer->m_pVehicle;
|
||||||
int hplayer = CPools::GetPedRef(pPlayer);
|
int hplayer = CPools::GetPedRef(pPlayer);
|
||||||
|
bool jetpack = Command<Commands::IS_PLAYER_USING_JETPACK>(0);
|
||||||
|
|
||||||
#ifdef GTASA
|
if (Type == eTeleportType::Marker)
|
||||||
TPMarker::m_bJetpack = Command<Commands::IS_PLAYER_USING_JETPACK>(0);
|
{
|
||||||
if (Type == eTeleportType::Marker || Type == eTeleportType::MapPosition)
|
tRadarTrace targetBlip = CRadar::ms_RadarTrace[LOWORD(FrontEndMenuManager.m_nTargetBlipIndex)];
|
||||||
{
|
if (targetBlip.m_nRadarSprite != RADAR_SPRITE_WAYPOINT)
|
||||||
if (Type == eTeleportType::Marker)
|
|
||||||
{
|
{
|
||||||
tRadarTrace targetBlip = CRadar::ms_RadarTrace[LOWORD(FrontEndMenuManager.m_nTargetBlipIndex)];
|
Util::SetMessage(TEXT("Teleport.TargetBlipText"));
|
||||||
if (targetBlip.m_nRadarSprite != RADAR_SPRITE_WAYPOINT)
|
return;
|
||||||
{
|
}
|
||||||
Util::SetMessage(TEXT("Teleport.TargetBlipText"));
|
pos = targetBlip.m_vecPos;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
pos = targetBlip.m_vecPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
CEntity* pPlayerEntity = FindPlayerEntity(-1);
|
|
||||||
pos.z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, 1000, nullptr, &pPlayerEntity) + 500.f;
|
|
||||||
|
|
||||||
TPMarker::m_fPos = pos;
|
|
||||||
TPMarker::m_nTimer = CTimer::m_snTimeInMilliseconds;
|
|
||||||
TPMarker::m_bEnabled = true;
|
|
||||||
TheCamera.Fade(0, 0);
|
|
||||||
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(CPools::GetPedRef(pPlayer), true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GTA3
|
|
||||||
CStreaming::LoadScene(pos);
|
|
||||||
#else
|
|
||||||
CStreaming::LoadScene(&pos);
|
CStreaming::LoadScene(&pos);
|
||||||
CStreaming::LoadSceneCollision(&pos);
|
CStreaming::LoadSceneCollision(&pos);
|
||||||
#endif
|
|
||||||
CStreaming::LoadAllRequestedModels(false);
|
CStreaming::LoadAllRequestedModels(false);
|
||||||
|
|
||||||
#ifdef GTASA
|
if (Type == eTeleportType::Marker || Type == eTeleportType::MapPosition)
|
||||||
|
{
|
||||||
|
CEntity* pPlayerEntity = FindPlayerEntity(-1);
|
||||||
|
pos.z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, 1000, nullptr, &pPlayerEntity) + 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if (pVeh && pPlayer->m_nPedFlags.bInVehicle)
|
if (pVeh && pPlayer->m_nPedFlags.bInVehicle)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (CModelInfo::IsTrainModel(pVeh->m_nModelIndex))
|
if (CModelInfo::IsTrainModel(pVeh->m_nModelIndex))
|
||||||
{
|
{
|
||||||
CVector vehPos = pVeh->GetPosition();
|
CVector vehPos = pVeh->GetPosition();
|
||||||
@ -203,15 +156,33 @@ void Teleport::WarpPlayer(CVector pos, int interiorID)
|
|||||||
pPlayer->Teleport(pos, false);
|
pPlayer->Teleport(pos, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TPMarker::m_bJetpack)
|
if (jetpack)
|
||||||
{
|
{
|
||||||
Command<Commands::TASK_JETPACK>(hplayer);
|
Command<Commands::TASK_JETPACK>(hplayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pPlayer->m_nAreaCode = interiorID;
|
||||||
|
Command<Commands::SET_AREA_VISIBLE>(interiorID);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
template<eTeleportType Type>
|
||||||
|
void Teleport::WarpPlayer(CVector pos, int interiorID)
|
||||||
|
{
|
||||||
|
CPlayerPed* pPlayer = FindPlayerPed();
|
||||||
|
CVehicle* pVeh = pPlayer->m_pVehicle;
|
||||||
|
|
||||||
|
#ifdef GTAVC
|
||||||
|
CStreaming::LoadScene(&pos);
|
||||||
|
CStreaming::LoadSceneCollision(&pos);
|
||||||
|
#else
|
||||||
|
CStreaming::LoadScene(pos);
|
||||||
|
#endif
|
||||||
|
CStreaming::LoadAllRequestedModels(false);
|
||||||
|
|
||||||
if (pVeh && pPlayer->m_pVehicle)
|
if (pVeh && pPlayer->m_pVehicle)
|
||||||
{
|
{
|
||||||
#ifdef GTAVC
|
#ifdef GTAVC
|
||||||
pPlayer->m_nAreaCode = interiorID;
|
pVeh->m_nAreaCode = interiorID;
|
||||||
#endif
|
#endif
|
||||||
pVeh->Teleport(pos);
|
pVeh->Teleport(pos);
|
||||||
}
|
}
|
||||||
@ -219,45 +190,17 @@ void Teleport::WarpPlayer(CVector pos, int interiorID)
|
|||||||
{
|
{
|
||||||
pPlayer->Teleport(pos);
|
pPlayer->Teleport(pos);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined GTASA || defined GTAVC
|
#ifdef GTAVC
|
||||||
pPlayer->m_nAreaCode = interiorID;
|
pPlayer->m_nAreaCode = interiorID;
|
||||||
Command<Commands::SET_AREA_VISIBLE>(interiorID);
|
Command<Commands::SET_AREA_VISIBLE>(interiorID);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void Teleport::TeleportToLocation(std::string& rootkey, std::string& bLocName, std::string& loc)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int dimension = 0;
|
|
||||||
CVector pos;
|
|
||||||
sscanf(loc.c_str(), "%d,%f,%f,%f", &dimension, &pos.x, &pos.y, &pos.z);
|
|
||||||
WarpPlayer<eTeleportType::Coordinate>(pos, dimension);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
Util::SetMessage(TEXT("Teleport.InvalidLocation"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Teleport::RemoveTeleportEntry(std::string& category, std::string& key, std::string& val)
|
|
||||||
{
|
|
||||||
if (category == "Custom")
|
|
||||||
{
|
|
||||||
m_locData.m_pData->RemoveKey("Custom", key.c_str());
|
|
||||||
Util::SetMessage(TEXT("Teleport.LocationRemoved"));
|
|
||||||
m_locData.m_pData->Save();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Util::SetMessage(TEXT("Teleport.CustomLocationRemoveOnly"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Teleport::ShowPage()
|
void Teleport::ShowPage()
|
||||||
{
|
{
|
||||||
|
static char locBuf[INPUT_BUFFER_SIZE], inBuf[INPUT_BUFFER_SIZE];
|
||||||
if (ImGui::BeginTabBar("Teleport", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
|
if (ImGui::BeginTabBar("Teleport", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
@ -266,52 +209,53 @@ void Teleport::ShowPage()
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::BeginChild("Teleport Child"))
|
if (ImGui::BeginChild("Teleport Child"))
|
||||||
{
|
{
|
||||||
|
#ifdef GTASA
|
||||||
ImGui::Columns(2, nullptr, false);
|
ImGui::Columns(2, nullptr, false);
|
||||||
ImGui::Checkbox(TEXT("Teleport.InsertCoord"), &m_bInsertCoord);
|
ImGui::Checkbox(TEXT("Teleport.InsertCoord"), &m_bInsertCoord);
|
||||||
#ifdef GTASA
|
|
||||||
if (Widget::Checkbox(TEXT("Teleport.QuickTeleport"), &m_bQuickTeleport,
|
if (Widget::Checkbox(TEXT("Teleport.QuickTeleport"), &m_bQuickTeleport,
|
||||||
std::string(TEXT_S("Teleport.QuickTeleportHint")
|
std::string(TEXT_S("Teleport.QuickTeleportHint")
|
||||||
+ quickTeleport.GetNameString()).c_str()))
|
+ quickTeleport.GetNameString()).c_str()))
|
||||||
{
|
{
|
||||||
gConfig.Set("Features.QuickTeleport", m_bQuickTeleport);
|
gConfig.Set("Features.QuickTeleport", m_bQuickTeleport);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
#ifdef GTASA
|
|
||||||
if (Widget::Checkbox(TEXT("Teleport.TeleportMarker"), &m_bTeleportMarker,
|
if (Widget::Checkbox(TEXT("Teleport.TeleportMarker"), &m_bTeleportMarker,
|
||||||
std::string(TEXT_S("Teleport.TeleportMarkerHint")
|
std::string(TEXT_S("Teleport.TeleportMarkerHint")
|
||||||
+ teleportMarker.GetNameString()).c_str()))
|
+ teleportMarker.GetNameString()).c_str()))
|
||||||
{
|
{
|
||||||
gConfig.Set("Features.TeleportMarker", m_bTeleportMarker);
|
gConfig.Set("Features.TeleportMarker", m_bTeleportMarker);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
|
#else
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::Sameline();
|
||||||
|
ImGui::Checkbox(TEXT("Teleport.InsertCoord"), &m_bInsertCoord);
|
||||||
|
#endif
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if (m_bInsertCoord)
|
if (m_bInsertCoord)
|
||||||
{
|
{
|
||||||
CVector pos = FindPlayerPed()->GetPosition();
|
CVector pos = FindPlayerPed()->GetPosition();
|
||||||
|
|
||||||
strcpy(m_nInputBuffer,
|
strcpy(inBuf,
|
||||||
(std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) +
|
(std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) +
|
||||||
", " + std::to_string(static_cast<int>(pos.z))).c_str());
|
", " + std::to_string(static_cast<int>(pos.z))).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::InputTextWithHint(TEXT("Teleport.Coordinates"), "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer));
|
ImGui::InputTextWithHint(TEXT("Teleport.Coordinates"), "x, y, z", inBuf, INPUT_BUFFER_SIZE);
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if (ImGui::Button(TEXT("Teleport.TeleportToCoord"), Widget::CalcSize(2)))
|
if (ImGui::Button(TEXT("Teleport.TeleportToCoord"), Widget::CalcSize(2)))
|
||||||
{
|
{
|
||||||
CVector pos{0, 0, 10};
|
CVector pos{0, 0, 10};
|
||||||
|
if (sscanf(inBuf,"%f,%f,%f", &pos.x, &pos.y, &pos.z) == 3)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
sscanf(m_nInputBuffer,"%f,%f,%f", &pos.x, &pos.y, &pos.z);
|
|
||||||
pos.z += 1.0f;
|
pos.z += 1.0f;
|
||||||
WarpPlayer(pos);
|
WarpPlayer(pos);
|
||||||
}
|
}
|
||||||
catch (...)
|
else
|
||||||
{
|
{
|
||||||
Util::SetMessage(TEXT("Teleport.InvalidCoord"));
|
Util::SetMessage(TEXT("Teleport.InvalidCoord"));
|
||||||
}
|
}
|
||||||
@ -369,13 +313,13 @@ void Teleport::ShowPage()
|
|||||||
if (ImGui::CollapsingHeader(TEXT("Window.AddNew")))
|
if (ImGui::CollapsingHeader(TEXT("Window.AddNew")))
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::InputTextWithHint(TEXT("Teleport.Location"), TEXT("Teleport.LocationHint"), m_nLocationBuffer, IM_ARRAYSIZE(m_nInputBuffer));
|
ImGui::InputTextWithHint(TEXT("Teleport.Location"), TEXT("Teleport.LocationHint"), locBuf, INPUT_BUFFER_SIZE);
|
||||||
ImGui::InputTextWithHint(TEXT("Teleport.Coordinates"), "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer));
|
ImGui::InputTextWithHint(TEXT("Teleport.Coordinates"), "x, y, z", inBuf, INPUT_BUFFER_SIZE);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::Button(TEXT("Teleport.AddLocation"), Widget::CalcSize()))
|
if (ImGui::Button(TEXT("Teleport.AddLocation"), Widget::CalcSize()))
|
||||||
{
|
{
|
||||||
std::string key = std::string("Custom.") + m_nLocationBuffer;
|
std::string key = std::string("Custom.") + locBuf;
|
||||||
m_locData.m_pData->Set(key.c_str(), ("0, " + std::string(m_nInputBuffer)));
|
m_locData.m_pData->Set(key.c_str(), ("0, " + std::string(inBuf)));
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
// Clear the Radar coordinates
|
// Clear the Radar coordinates
|
||||||
@ -387,7 +331,31 @@ void Teleport::ShowPage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Widget::DataList(m_locData, TeleportToLocation, RemoveTeleportEntry);
|
Widget::DataList(m_locData,
|
||||||
|
[](std::string& unk1, std::string& unk2, std::string& loc){
|
||||||
|
int dim = 0;
|
||||||
|
CVector pos;
|
||||||
|
if (sscanf(loc.c_str(), "%d,%f,%f,%f", &dim, &pos.x, &pos.y, &pos.z) == 4)
|
||||||
|
{
|
||||||
|
WarpPlayer<eTeleportType::Coordinate>(pos, dim);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Util::SetMessage(TEXT("Teleport.InvalidLocation"));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[](std::string& category, std::string& key, std::string& _){
|
||||||
|
if (category == "Custom")
|
||||||
|
{
|
||||||
|
m_locData.m_pData->RemoveKey("Custom", key.c_str());
|
||||||
|
Util::SetMessage(TEXT("Teleport.LocationRemoved"));
|
||||||
|
m_locData.m_pData->Save();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Util::SetMessage(TEXT("Teleport.CustomLocationRemoveOnly"));
|
||||||
|
}
|
||||||
|
});
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
|
@ -8,23 +8,17 @@ enum class eTeleportType
|
|||||||
Coordinate,
|
Coordinate,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Teleport Class
|
||||||
|
Contains code for the Teleport menu page
|
||||||
|
*/
|
||||||
class Teleport
|
class Teleport
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static inline bool m_bInsertCoord;
|
static inline bool m_bInsertCoord;
|
||||||
static inline bool m_bTeleportMarker;
|
static inline bool m_bTeleportMarker;
|
||||||
static inline char m_nInputBuffer[INPUT_BUFFER_SIZE];
|
static inline bool m_bQuickTeleport;
|
||||||
static inline char m_nLocationBuffer[INPUT_BUFFER_SIZE];
|
|
||||||
static inline ImVec2 m_fMapSize;
|
static inline ImVec2 m_fMapSize;
|
||||||
|
|
||||||
struct TPMarker
|
|
||||||
{
|
|
||||||
static inline bool m_bEnabled;
|
|
||||||
static inline CVector m_fPos = { -1, -1, -1 };
|
|
||||||
static inline uint m_nTimer;
|
|
||||||
static inline bool m_bJetpack;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static inline DataStore m_SpriteData {"sprites"};
|
static inline DataStore m_SpriteData {"sprites"};
|
||||||
|
|
||||||
@ -35,17 +29,21 @@ private:
|
|||||||
static void FetchRadarSpriteData();
|
static void FetchRadarSpriteData();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void TeleportToLocation(std::string& rootkey, std::string& bLocName, std::string& loc);
|
|
||||||
static void RemoveTeleportEntry(std::string& rootkey, std::string& key, std::string& val);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static inline ResourceStore m_locData{"locations", eResourceType::TYPE_TEXT};
|
||||||
|
|
||||||
Teleport() = delete;
|
Teleport() = delete;
|
||||||
Teleport(const Teleport&) = delete;
|
Teleport(const Teleport&) = delete;
|
||||||
static inline ResourceStore m_locData{ "locations", eResourceType::TYPE_TEXT };
|
|
||||||
static inline bool m_bQuickTeleport;
|
|
||||||
|
|
||||||
static void Init();
|
static void Init();
|
||||||
|
|
||||||
|
// Warp player to position, marker, map etc
|
||||||
template<eTeleportType Type = eTeleportType::Coordinate>
|
template<eTeleportType Type = eTeleportType::Coordinate>
|
||||||
static void WarpPlayer(CVector pos = CVector(0, 0, 0), int interiorID = 0);
|
static void WarpPlayer(CVector pos = CVector(0, 0, 0), int interiorID = 0);
|
||||||
|
|
||||||
|
// Returns true if quick teleport feature is active
|
||||||
|
static bool IsQuickTeleportActive();
|
||||||
|
|
||||||
|
// Draws the teleport menu page
|
||||||
static void ShowPage();
|
static void ShowPage();
|
||||||
};
|
};
|
||||||
|
@ -1065,12 +1065,9 @@ void Vehicle::ShowPage()
|
|||||||
{
|
{
|
||||||
Widget::Checkbox(TEXT("Vehicle.LockSpeed"), &m_bLockSpeed);
|
Widget::Checkbox(TEXT("Vehicle.LockSpeed"), &m_bLockSpeed);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::InputFloat(TEXT("Vehicle.Set"), &m_fLockSpeed);
|
Widget::InputFloat(TEXT("Vehicle.Set"), &m_fLockSpeed, 1.0f, 0.0f, 100.0f);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
m_fLockSpeed = m_fLockSpeed > 100 ? 100 : m_fLockSpeed;
|
|
||||||
m_fLockSpeed = m_fLockSpeed < 0 ? 0 : m_fLockSpeed;
|
|
||||||
|
|
||||||
if (ImGui::Button(TEXT("Vehicle.Set"), ImVec2(Widget::CalcSize(2))))
|
if (ImGui::Button(TEXT("Vehicle.Set"), ImVec2(Widget::CalcSize(2))))
|
||||||
{
|
{
|
||||||
Util::SetCarForwardSpeed(pVeh, m_fLockSpeed);
|
Util::SetCarForwardSpeed(pVeh, m_fLockSpeed);
|
||||||
|
Loading…
Reference in New Issue
Block a user