Merge pull request #164 from diamante0018/refactor-startup-messages
Refactor startup messages
This commit is contained in:
commit
656ee13fbc
@ -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