forked from oerkki/voxelands
make controls menu display keybinds correctly
This commit is contained in:
parent
79e3e6a52a
commit
f28e30694d
|
@ -327,7 +327,7 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 110, 30);
|
core::rect < s32 > rect(0, 0, 110, 30);
|
||||||
rect += topleft_content + offset + v2s32(155, -5);
|
rect += topleft_content + offset + v2s32(155, -5);
|
||||||
Environment->addButton(rect, this, GUI_ID_KEYSETTINGS_BASE+i, keys[i].guiName());
|
Environment->addButton(rect, this, GUI_ID_KEYSETTINGS_BASE+i, keys[i].guiName().c_str());
|
||||||
}
|
}
|
||||||
offset += v2s32(0, 33);
|
offset += v2s32(0, 33);
|
||||||
if (offset.Y > 450) {
|
if (offset.Y > 450) {
|
||||||
|
@ -579,7 +579,7 @@ bool GUISettingsMenu::OnEvent(const SEvent& event)
|
||||||
gui::IGUIElement *e = getElementFromId(activeKey);
|
gui::IGUIElement *e = getElementFromId(activeKey);
|
||||||
if (e != NULL && e->getType() == gui::EGUIET_BUTTON) {
|
if (e != NULL && e->getType() == gui::EGUIET_BUTTON) {
|
||||||
e->setEnabled(true);
|
e->setEnabled(true);
|
||||||
e->setText(kp.guiName());
|
e->setText(kp.guiName().c_str());
|
||||||
keys[activeKey-GUI_ID_KEYSETTINGS_BASE] = kp;
|
keys[activeKey-GUI_ID_KEYSETTINGS_BASE] = kp;
|
||||||
}
|
}
|
||||||
activeKey = -1;
|
activeKey = -1;
|
||||||
|
|
|
@ -339,10 +339,10 @@ const char *KeyPress::name() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t *KeyPress::guiName() const
|
const std::wstring KeyPress::guiName() const
|
||||||
{
|
{
|
||||||
const char* n = name();
|
const char* n = name();
|
||||||
return narrow_to_wide(n).c_str();
|
return narrow_to_wide(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
const KeyPress EscapeKey("KEY_ESCAPE");
|
const KeyPress EscapeKey("KEY_ESCAPE");
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
|
|
||||||
const char *sym() const;
|
const char *sym() const;
|
||||||
const char *name() const;
|
const char *name() const;
|
||||||
const wchar_t *guiName() const;
|
const std::wstring guiName() const;
|
||||||
|
|
||||||
std::string debug() const;
|
std::string debug() const;
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue