2020-12-02 16:19:16 -05:00
|
|
|
#pragma once
|
2021-10-25 10:03:27 -04:00
|
|
|
#include "pch.h"
|
2022-08-17 21:12:21 -04:00
|
|
|
#include "interface/ipage.h"
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2022-07-29 16:12:34 -04:00
|
|
|
enum class eTeleportType
|
|
|
|
{
|
|
|
|
Marker,
|
|
|
|
MapPosition,
|
|
|
|
Coordinate,
|
|
|
|
};
|
|
|
|
|
2022-08-17 21:12:21 -04:00
|
|
|
class TeleportPage : public IPage<TeleportPage>
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
private:
|
2022-08-17 21:12:21 -04:00
|
|
|
char m_LocBuf[INPUT_BUFFER_SIZE], m_InBuf[INPUT_BUFFER_SIZE];
|
|
|
|
bool m_bInsertCoord;
|
|
|
|
bool m_bTeleportMarker;
|
|
|
|
bool m_bQuickTeleport;
|
2022-12-15 00:22:34 -05:00
|
|
|
bool m_bSpawnUnderwater;
|
2022-08-17 21:12:21 -04:00
|
|
|
ImVec2 m_fMapSize;
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2022-08-17 21:12:21 -04:00
|
|
|
|
|
|
|
DataStore m_SpriteData {"sprites"};
|
2022-06-28 16:23:03 -04:00
|
|
|
|
2022-01-07 03:18:00 -05:00
|
|
|
/*
|
|
|
|
Generates radar sprite coordinates on the fly.
|
|
|
|
Shouldn't get saved in 'teleport.json', needs to be cleared at game shutdown.
|
|
|
|
*/
|
2022-08-17 21:12:21 -04:00
|
|
|
void FetchRadarSpriteData();
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2020-12-09 08:15:50 -05:00
|
|
|
|
2022-01-13 08:57:08 -05:00
|
|
|
public:
|
2022-08-17 21:12:21 -04:00
|
|
|
ResourceStore m_locData{"locations", eResourceType::TYPE_TEXT};
|
2022-01-13 08:57:08 -05:00
|
|
|
|
2022-08-19 22:56:05 -04:00
|
|
|
friend class IFeature;
|
2022-08-17 21:12:21 -04:00
|
|
|
TeleportPage();
|
|
|
|
TeleportPage(const TeleportPage&);
|
2022-07-31 21:03:25 -04:00
|
|
|
|
2022-08-17 21:12:21 -04:00
|
|
|
void Draw();
|
2022-07-31 21:03:25 -04:00
|
|
|
|
|
|
|
// Returns true if quick teleport feature is active
|
2022-08-17 21:12:21 -04:00
|
|
|
bool IsQuickTeleportActive();
|
2022-07-31 21:03:25 -04:00
|
|
|
|
2022-08-17 21:12:21 -04:00
|
|
|
// Callbacks
|
|
|
|
void LocationAddNew();
|
|
|
|
void LocationClick(str&, str&, str&);
|
|
|
|
|
|
|
|
// Warp player to position, marker, map etc
|
|
|
|
template<eTeleportType Type = eTeleportType::Coordinate>
|
|
|
|
void WarpPlayer(CVector pos = CVector(0, 0, 0), int interiorID = 0);
|
2021-06-18 12:49:11 -04:00
|
|
|
};
|
2022-08-17 21:12:21 -04:00
|
|
|
|
|
|
|
extern TeleportPage& teleportPage;
|