2020-12-21 13:16:29 -03:00
|
|
|
#pragma once
|
|
|
|
#include "LanguageScript.h"
|
2021-06-16 14:51:58 +01:00
|
|
|
#include "LuaHandler.h"
|
2022-02-06 11:00:13 +00:00
|
|
|
#include "Logic/LogicHandler.h"
|
2021-07-26 18:28:13 +01:00
|
|
|
#include "GameScriptColor.h"
|
2021-07-28 19:06:15 +01:00
|
|
|
#include "GameScriptLevel.h"
|
|
|
|
#include "GameScriptSettings.h"
|
2021-12-01 15:18:47 +03:00
|
|
|
#include "GameScriptAnimations.h"
|
2021-11-29 21:54:36 +00:00
|
|
|
#include "ScriptInterfaceGame.h"
|
2022-02-06 15:02:16 +00:00
|
|
|
#include "Flow/ScriptInterfaceFlowHandler.h"
|
2020-12-21 13:16:29 -03:00
|
|
|
|
2022-02-06 15:02:16 +00:00
|
|
|
class FlowHandler : public LuaHandler, public ScriptInterfaceFlowHandler
|
2020-12-21 13:16:29 -03:00
|
|
|
{
|
|
|
|
private:
|
2021-07-28 19:06:15 +01:00
|
|
|
GameScriptSettings m_settings;
|
2021-06-16 14:51:58 +01:00
|
|
|
|
|
|
|
std::unordered_map < std::string, std::vector<std::string > > m_translationsMap;
|
|
|
|
std::vector<std::string> m_languageNames;
|
|
|
|
|
2021-07-28 19:06:15 +01:00
|
|
|
std::map<short, short> m_itemsMap;
|
2020-12-21 13:16:29 -03:00
|
|
|
|
|
|
|
public:
|
2021-07-26 18:23:29 +01:00
|
|
|
int FogInDistance{ 0 };
|
|
|
|
int FogOutDistance{ 0 };
|
|
|
|
bool PlayAnyLevel{ true };
|
|
|
|
bool FlyCheat{ true };
|
|
|
|
bool DebugMode{ false };
|
2021-08-17 13:36:34 +01:00
|
|
|
byte GameFarView{ 0 };
|
2020-12-21 13:16:29 -03:00
|
|
|
|
2021-12-01 15:18:47 +03:00
|
|
|
// New animation flag table
|
|
|
|
GameScriptAnimations Animations{};
|
|
|
|
|
2020-12-21 13:16:29 -03:00
|
|
|
// Selected language set
|
2021-09-16 01:12:19 +03:00
|
|
|
std::vector<GameScriptLevel*> Levels;
|
2020-12-21 13:16:29 -03:00
|
|
|
|
2022-02-06 14:50:53 +00:00
|
|
|
FlowHandler(sol::state* lua, sol::table & parent);
|
|
|
|
~FlowHandler();
|
2020-12-21 13:16:29 -03:00
|
|
|
|
2021-08-15 23:04:56 +01:00
|
|
|
void AddLevel(GameScriptLevel const& level);
|
2022-02-05 23:50:35 +00:00
|
|
|
void LoadFlowScript();
|
2021-08-17 13:37:08 +01:00
|
|
|
char const * GetString(const char* id) const;
|
2021-08-15 23:04:56 +01:00
|
|
|
void SetStrings(sol::nested<std::unordered_map<std::string, std::vector<std::string>>> && src);
|
|
|
|
void SetLanguageNames(sol::as_table_t<std::vector<std::string>> && src);
|
2021-12-01 15:18:47 +03:00
|
|
|
void SetAnimations(GameScriptAnimations const & src);
|
2021-08-15 23:04:56 +01:00
|
|
|
void SetSettings(GameScriptSettings const & src);
|
|
|
|
GameScriptSettings* GetSettings();
|
|
|
|
GameScriptLevel* GetLevel(int id);
|
2021-08-17 13:37:08 +01:00
|
|
|
int GetNumLevels() const;
|
2021-08-15 23:04:56 +01:00
|
|
|
void SetIntroImagePath(std::string const& path);
|
|
|
|
void SetTitleScreenImagePath(std::string const& path);
|
2021-08-17 13:36:34 +01:00
|
|
|
void SetGameFarView(byte val);
|
2022-01-25 23:52:20 +00:00
|
|
|
bool IsFlyCheatEnabled() const;
|
2022-01-28 13:40:01 +00:00
|
|
|
bool CanPlayAnyLevel() const;
|
2022-01-25 23:52:20 +00:00
|
|
|
|
2022-01-28 13:40:01 +00:00
|
|
|
bool HasCrawlExtended() const override { return Animations.CrawlExtended; }
|
|
|
|
bool HasCrouchRoll() const override { return Animations.CrouchRoll; }
|
|
|
|
bool HasCrawlspaceSwandive() const override { return Animations.CrawlspaceSwandive; }
|
|
|
|
bool HasMonkeyTurn180() const override { return Animations.MonkeyTurn180; }
|
|
|
|
bool HasMonkeyAutoJump() const override { return Animations.MonkeyAutoJump; }
|
|
|
|
bool HasOscillateHang() const override { return Animations.OscillateHang; }
|
|
|
|
bool HasAFKPose() const override { return Animations.Pose; }
|
2022-02-05 23:50:35 +00:00
|
|
|
bool DoFlow() override;
|
2021-09-16 01:12:19 +03:00
|
|
|
};
|
|
|
|
|