Refactor startup messages
This commit is contained in:
parent
62bca7f3b2
commit
0fe6a80429
@ -23,16 +23,22 @@ namespace Components
|
|||||||
StartupMessages::TotalMessages = StartupMessages::MessageList.size();
|
StartupMessages::TotalMessages = StartupMessages::MessageList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string message = StartupMessages::MessageList.front();
|
const auto& message = StartupMessages::MessageList.front();
|
||||||
StartupMessages::MessageList.pop_front();
|
|
||||||
|
|
||||||
Game::Dvar_SetStringByName("ui_startupMessage", message.data());
|
Game::Dvar_SetStringByName("ui_startupMessage", message.data());
|
||||||
Game::Dvar_SetStringByName("ui_startupMessageTitle", Utils::String::VA("Messages (%d/%d)", StartupMessages::TotalMessages - StartupMessages::MessageList.size(), StartupMessages::TotalMessages));
|
Game::Dvar_SetStringByName("ui_startupMessageTitle", Utils::String::VA("Messages (%d/%d)", StartupMessages::TotalMessages - StartupMessages::MessageList.size(), StartupMessages::TotalMessages));
|
||||||
Game::Dvar_SetStringByName("ui_startupNextButtonText", StartupMessages::MessageList.size() ? "Next" : "Close");
|
Game::Dvar_SetStringByName("ui_startupNextButtonText", StartupMessages::MessageList.size() ? "Next" : "Close");
|
||||||
Game::Cbuf_AddText(0, "openmenu startup_messages");
|
Game::Cbuf_AddText(0, "openmenu startup_messages");
|
||||||
|
|
||||||
|
StartupMessages::MessageList.pop_front();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StartupMessages::~StartupMessages()
|
||||||
|
{
|
||||||
|
StartupMessages::MessageList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void StartupMessages::AddMessage(const std::string& message)
|
void StartupMessages::AddMessage(const std::string& message)
|
||||||
{
|
{
|
||||||
StartupMessages::MessageList.push_back(message);
|
StartupMessages::MessageList.push_back(message);
|
||||||
|
@ -6,6 +6,7 @@ namespace Components
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StartupMessages();
|
StartupMessages();
|
||||||
|
~StartupMessages();
|
||||||
|
|
||||||
static void AddMessage(const std::string& message);
|
static void AddMessage(const std::string& message);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user