mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
The label for the name dialog is now fetched from the GMST store.
This commit is contained in:
parent
edb2df7d27
commit
3cc57a058a
2 changed files with 21 additions and 1 deletions
|
@ -94,7 +94,10 @@ void WindowManager::updateVisible()
|
|||
if (mode == GM_Name)
|
||||
{
|
||||
if (!nameDialog)
|
||||
nameDialog = new TextInputDialog(environment, "Name", nameChosen, gui->getViewSize());
|
||||
{
|
||||
std::string sName = getGameSettingString("sName", "Name");
|
||||
nameDialog = new TextInputDialog(environment, sName, nameChosen, gui->getViewSize());
|
||||
}
|
||||
nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
|
||||
nameDialog->setVisible(true);
|
||||
return;
|
||||
|
@ -152,6 +155,14 @@ void WindowManager::messageBox (const std::string& message, const std::vector<st
|
|||
}
|
||||
}
|
||||
|
||||
const std::string &WindowManager::getGameSettingString(const std::string &id, const std::string &default)
|
||||
{
|
||||
const ESM::GameSetting *setting = environment.mWorld->getStore().gameSettings.search(id);
|
||||
if (setting && setting->type == ESM::VT_String)
|
||||
return setting->str;
|
||||
return default;
|
||||
}
|
||||
|
||||
void WindowManager::updateCharacterGeneration()
|
||||
{
|
||||
if (raceDialog)
|
||||
|
|
|
@ -167,6 +167,15 @@ namespace MWGui
|
|||
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Fetches a GMST string from the store, if there is no setting with the given
|
||||
* ID or it is not a string the default string is returned.
|
||||
*
|
||||
* @param id Identifier for the GMST setting, e.g. "aName"
|
||||
* @param default Default value if the GMST setting cannot be used.
|
||||
*/
|
||||
const std::string &getGameSettingString(const std::string &id, const std::string &default);
|
||||
|
||||
void updateCharacterGeneration();
|
||||
void checkCharacterGeneration(GuiMode mode);
|
||||
|
||||
|
|
Loading…
Reference in a new issue