4#include "Etterna/Actor/Base/ActorFrame.h"
5#include "Etterna/Models/Misc/CodeSet.h"
6#include "Etterna/Models/Misc/EnumHelper.h"
7#include "ScreenMessage.h"
8#include "Etterna/Models/Misc/ThemeMetric.h"
15using CreateScreenFn =
Screen* (*)(
const std::string&);
27#define REGISTER_SCREEN_CLASS(className) \
28 static Screen* Create##className(const std::string& sName) \
30 LuaThreadVariable var("LoadingScreen", sName); \
31 Screen* pRet = new className; \
32 pRet->SetName(sName); \
33 Screen::InitScreen(pRet); \
36 static RegisterScreenClass register_##className(#className, \
59ScreenTypeToString(ScreenType st);
60LuaDeclareType(ScreenType);
66 static void InitScreen(
Screen* pScreen);
83 void Update(
float fDeltaTime)
override;
84 virtual void UpdateTimedFunctions(
float fDeltaTime);
86 virtual void HandleScreenMessage(
const ScreenMessage& SM);
87 void SetLockInputSecs(
const float f) { m_fLockInputSecs = f; }
101 virtual ScreenType GetScreenType()
const
115 void PushSelf(lua_State* L)
override;
117 std::vector<std::pair<std::function<void()>,
float>> delayedFunctions;
118 void SetTimeout(
const std::function<
void()>& f,
float ms);
119 std::list<std::tuple<std::function<void()>, float, float,
int>>
120 delayedPeriodicFunctions;
121 std::vector<int> delayedPeriodicFunctionIdsToDelete;
122 void SetInterval(
const std::function<
void()>& f,
float ms,
int fRemove);
124 bool b_PreviewNoteFieldIsActive =
false;
155 std::string m_sPrevScreen;
156 ScreenMessage m_smSendOnPop;
158 float m_fLockInputSecs = 0.F;
161 bool m_bRunning =
false;
164 std::string GetNextScreenName()
const;
165 std::string GetPrevScreen()
const;
166 void SetNextScreenName(std::string
const& name);
167 void SetPrevScreenName(std::string
const& name);
170 void AddInputCallbackFromStack(lua_State* L);
171 void RemoveInputCallback(lua_State* L);
172 virtual bool AllowCallbackInput() {
return true; }
187 using callback_key_t =
const void*;
188 std::map<callback_key_t, LuaReference> m_InputCallbacks;
189 std::vector<callback_key_t> orderedcallbacks;
190 std::vector<callback_key_t> m_DelayedCallbackRemovals;
191 bool m_CallingInputCallbacks =
false;
192 void InternalRemoveCallback(callback_key_t key);
A container for other Actors.
Definition ActorFrame.h:8
Class that holds a screen-full of Actors.
Definition Screen.h:64
void PostScreenMessage(const ScreenMessage &SM, float fDelay)
Put the specified message onto the screen for a specified time.
Definition Screen.cpp:367
virtual void EndScreen()
This is called when the screen is popped.
Definition Screen.cpp:128
virtual void Init()
This is called immediately after construction, to allow initializing after all derived classes exist.
Definition Screen.cpp:60
std::string m_sNextScreen
The next screen to go to once this screen is done.
Definition Screen.h:154
void ClearMessageQueue()
Clear the entire message queue.
Definition Screen.cpp:378
virtual bool AllowLateJoin() const
Determine if we allow extra players to join in on this screen.
Definition Screen.h:112
virtual void BeginScreen()
This is called immediately before the screen is used.
Definition Screen.cpp:105
ThemeMetric< bool > ALLOW_OPERATOR_MENU_BUTTON
Do we allow the operator menu button to be pressed here?
Definition Screen.h:144
std::vector< QueuedScreenMessage > m_QueuedMessages
The list of messages that are sent to a Screen.
Definition Screen.h:137
ThemeMetric< bool > HANDLE_BACK_BUTTON
Do we handle the back button being pressed here?
Definition Screen.h:146
The theme specific data.
Definition ThemeMetric.h:52
Allow registering the screen for easier access.
Definition Screen.h:23
Holds the messages sent to a Screen.
Definition Screen.h:129
ScreenMessage SM
The message being held.
Definition Screen.h:131
float fDelayRemaining
How long the message is up.
Definition Screen.h:133