mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03: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 (mode == GM_Name)
|
||||||
{
|
{
|
||||||
if (!nameDialog)
|
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->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
|
||||||
nameDialog->setVisible(true);
|
nameDialog->setVisible(true);
|
||||||
return;
|
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()
|
void WindowManager::updateCharacterGeneration()
|
||||||
{
|
{
|
||||||
if (raceDialog)
|
if (raceDialog)
|
||||||
|
|
|
@ -167,6 +167,15 @@ namespace MWGui
|
||||||
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
||||||
|
|
||||||
private:
|
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 updateCharacterGeneration();
|
||||||
void checkCharacterGeneration(GuiMode mode);
|
void checkCharacterGeneration(GuiMode mode);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue