mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
work-in-progress gui system updating + some settings system updating
This commit is contained in:
parent
2816d8f638
commit
7e490e7213
9 changed files with 340 additions and 243 deletions
|
@ -1009,10 +1009,11 @@ public:
|
|||
// Asks if empty
|
||||
bool getBoolAsk(std::string name, std::string question, bool def)
|
||||
{
|
||||
std::string s = get(name);
|
||||
if(s != "")
|
||||
return is_yes(s);
|
||||
// If it is in settings
|
||||
if(m_settings.find(name))
|
||||
return getBool(name);
|
||||
|
||||
std::string s;
|
||||
char templine[10];
|
||||
std::cout<<question<<" [y/N]: ";
|
||||
std::cin.getline(templine, 10);
|
||||
|
@ -1039,10 +1040,11 @@ public:
|
|||
|
||||
u16 getU16Ask(std::string name, std::string question, u16 def)
|
||||
{
|
||||
std::string s = get(name);
|
||||
if(s != "")
|
||||
return stoi(s, 0, 65535);
|
||||
// If it is in settings
|
||||
if(m_settings.find(name))
|
||||
return getU16(name);
|
||||
|
||||
std::string s;
|
||||
char templine[10];
|
||||
std::cout<<question<<" ["<<def<<"]: ";
|
||||
std::cin.getline(templine, 10);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue