iw4x-client/src/Components/Modules/Theatre.hpp

71 lines
1.8 KiB
C++
Raw Normal View History

2016-07-11 11:14:58 -04:00
namespace Components
{
class Theatre : public Component
{
public:
Theatre();
2016-08-15 10:40:30 -04:00
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() { return "Theatre"; };
2016-08-15 10:40:30 -04:00
#endif
2016-07-11 11:14:58 -04:00
private:
class DemoInfo
2016-07-11 11:14:58 -04:00
{
public:
std::string name;
std::string mapname;
std::string gametype;
std::string author;
int length;
std::time_t timeStamp;
2016-07-11 11:14:58 -04:00
json11::Json to_json() const
{
return json11::Json::object
2016-07-11 11:14:58 -04:00
{
{ "mapname", mapname },
{ "gametype", gametype },
{ "author", author },
{ "length", length },
{ "timestamp", Utils::String::VA("%lld", timeStamp) } //Ugly, but prevents information loss
};
}
2016-07-11 11:14:58 -04:00
};
static DemoInfo CurrentInfo;
static unsigned int CurrentSelection;
static std::vector<DemoInfo> Demos;
2016-07-11 11:14:58 -04:00
static char BaselineSnapshot[131072];
static int BaselineSnapshotMsgLen;
static int BaselineSnapshotMsgOff;
static void WriteBaseline();
static void StoreBaseline(PBYTE snapshotMsg);
static void LoadDemos(UIScript::Token);
static void DeleteDemo(UIScript::Token);
static void PlayDemo(UIScript::Token);
2016-07-11 11:14:58 -04:00
static unsigned int GetDemoCount();
static const char* GetDemoText(unsigned int item, int column);
static void SelectDemo(unsigned int index);
static void GamestateWriteStub(Game::msg_t* msg, char byte);
static void RecordGamestateStub();
static void BaselineStoreStub();
static void BaselineToFileStub();
static void AdjustTimeDeltaStub();
static void ServerTimedOutStub();
static void UISetActiveMenuStub();
static uint32_t InitCGameStub();
static void MapChangeStub();
static void MapChangeSVStub(char* a1, char* a2);
static void RecordStub(int channel, char* message, char* file);
static void StopRecordStub(int channel, char* message);
};
}