Made command key font configurable
This commit is contained in:
parent
c71ed93de9
commit
ac15818a02
3 changed files with 13 additions and 4 deletions
|
@ -250,6 +250,7 @@ typedef struct _ui_ {
|
|||
int NumButtonButtons; /// Number of button panel buttons
|
||||
int ButtonPanelX; /// Button panel screen X position
|
||||
int ButtonPanelY; /// Button panel screen Y position
|
||||
int CommandKeyFont; /// Command key font
|
||||
|
||||
// Map area
|
||||
ViewportMode ViewportMode; /// Current viewport mode
|
||||
|
|
|
@ -383,18 +383,22 @@ global void DrawButtonPanel(void)
|
|||
//
|
||||
if (ShowCommandKey) {
|
||||
Button* b;
|
||||
int f;
|
||||
|
||||
b = &TheUI.ButtonButtons[i];
|
||||
f = TheUI.CommandKeyFont;
|
||||
if (CurrentButtons[i].Key == 27) {
|
||||
strcpy(buf, "ESC");
|
||||
VideoDrawText(b->X + 4 + b->Width - VideoTextLength(GameFont, buf),
|
||||
b->Y + 5 + b->Height - VideoTextHeight(GameFont), GameFont, buf);
|
||||
VideoDrawText(b->X + 4 + b->Width - VideoTextLength(f, buf),
|
||||
b->Y + 5 + b->Height - VideoTextHeight(f),
|
||||
f, buf);
|
||||
} else {
|
||||
// FIXME: real DrawChar would be useful
|
||||
buf[0] = toupper(CurrentButtons[i].Key);
|
||||
buf[1] = '\0';
|
||||
VideoDrawText(b->X + 3 + b->Width - VideoTextLength(GameFont, buf),
|
||||
b->Y + 3 + b->Height - VideoTextHeight(GameFont), GameFont, buf);
|
||||
VideoDrawText(b->X + 3 + b->Width - VideoTextLength(f, buf),
|
||||
b->Y + 3 + b->Height - VideoTextHeight(f),
|
||||
f, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1548,6 +1548,10 @@ local int CclDefineUI(lua_State* l)
|
|||
}
|
||||
CclParseButtonIcons(l, ui);
|
||||
lua_pop(l, 1);
|
||||
} else if (!strcmp(value, "command-key-font")) {
|
||||
lua_rawgeti(l, j + 1, k + 1);
|
||||
ui->CommandKeyFont = FontByIdent(LuaToString(l, -1));
|
||||
lua_pop(l, 1);
|
||||
} else {
|
||||
LuaError(l, "Unsupported tag: %s" _C_ value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue