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();
|
||||
}
|
||||
|
||||
std::string message = StartupMessages::MessageList.front();
|
||||
StartupMessages::MessageList.pop_front();
|
||||
const auto& message = StartupMessages::MessageList.front();
|
||||
|
||||
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_startupNextButtonText", StartupMessages::MessageList.size() ? "Next" : "Close");
|
||||
Game::Cbuf_AddText(0, "openmenu startup_messages");
|
||||
|
||||
StartupMessages::MessageList.pop_front();
|
||||
});
|
||||
}
|
||||
|
||||
StartupMessages::~StartupMessages()
|
||||
{
|
||||
StartupMessages::MessageList.clear();
|
||||
}
|
||||
|
||||
void StartupMessages::AddMessage(const std::string& message)
|
||||
{
|
||||
StartupMessages::MessageList.push_back(message);
|
||||
|
@ -6,6 +6,7 @@ namespace Components
|
||||
{
|
||||
public:
|
||||
StartupMessages();
|
||||
~StartupMessages();
|
||||
|
||||
static void AddMessage(const std::string& message);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user