Partially integrate ScriptInterfaceFlow and replace instances of direct access to Animations members.

This commit is contained in:
hispidence 2022-01-25 23:52:20 +00:00
parent 4429bd8aa2
commit 2a9175f5fb
9 changed files with 37 additions and 22 deletions

View file

@ -8,6 +8,7 @@
#include "GameScriptAudioTrack.h"
#include "GameScriptAnimations.h"
#include "ScriptInterfaceGame.h"
#include "ScriptInterfaceFlow.h"
enum class TITLE_TYPE
{
@ -15,7 +16,7 @@ enum class TITLE_TYPE
BACKGROUND
};
class GameFlow : public LuaHandler
class GameFlow : public LuaHandler, public ScriptInterfaceFlow
{
private:
GameScriptSettings m_settings;
@ -63,7 +64,16 @@ public:
void SetIntroImagePath(std::string const& path);
void SetTitleScreenImagePath(std::string const& path);
void SetGameFarView(byte val);
bool IsFlyCheatEnabled() const;
bool HasCrawlExtended() const { return Animations.CrawlExtended; }
bool HasCrouchRoll() const { return Animations.CrouchRoll; }
bool HasCrawlspaceSwandive() const { return Animations.CrawlspaceSwandive; }
bool HasMonkeyTurn180() const { return Animations.MonkeyTurn180; }
bool HasMonkeyAutoJump() const { return Animations.MonkeyAutoJump; }
bool HasOscillateHang() const { return Animations.OscillateHang; }
bool HasAFKPose() const { return Animations.Pose; }
};
extern GameFlow* g_GameFlow;
extern ScriptInterfaceGame * g_GameScript;
extern ScriptInterfaceFlow* g_GameFlow;
extern ScriptInterfaceGame* g_GameScript;

View file

@ -16,7 +16,7 @@ using std::string;
using std::vector;
using std::unordered_map;
GameFlow* g_GameFlow;
ScriptInterfaceFlow* g_GameFlow;
ScriptInterfaceGame* g_GameScript;
GameFlow::GameFlow(sol::state* lua) : LuaHandler{ lua }
@ -231,6 +231,11 @@ int GameFlow::GetNumLevels() const
return Levels.size();
}
bool GameFlow::IsFlyCheatEnabled() const
{
return FlyCheat;
}
bool GameFlow::DoGameflow()
{
// We start with the title level