mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 01:11:15 +00:00
- consolidation of defbinds definitions.
Putting all the generic definitions in files used by all games greatly reduces the clutter and chance for errors.
This commit is contained in:
parent
0f4d80b5d3
commit
1adceb82ef
28 changed files with 167 additions and 1367 deletions
|
@ -649,7 +649,7 @@ CCMD(rebind)
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void ReadBindings(int lump)
|
||||
void ReadBindings(int lump, bool override)
|
||||
{
|
||||
FScanner sc(lump);
|
||||
|
||||
|
@ -675,20 +675,26 @@ void ReadBindings(int lump)
|
|||
}
|
||||
key = GetConfigKeyFromName(sc.String);
|
||||
sc.MustGetString();
|
||||
dest->SetBind(key, sc.String);
|
||||
dest->SetBind(key, sc.String, override);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CONFIG_SetDefaultKeys(const char* baseconfig)
|
||||
{
|
||||
auto lump = fileSystem.GetFile(baseconfig);
|
||||
ReadBindings(lump);
|
||||
auto lump = fileSystem.GetFile("demolition/commonbinds.txt", ELookupMode::FullName, 0);
|
||||
if (lump >= 0) ReadBindings(lump, true);
|
||||
int lastlump = 0;
|
||||
|
||||
while ((lump = fileSystem.Iterate(baseconfig, &lastlump)) != -1)
|
||||
{
|
||||
if (fileSystem.GetFileContainer(lump) > 0) break;
|
||||
ReadBindings(lump, true);
|
||||
}
|
||||
|
||||
while ((lump = fileSystem.Iterate("defbinds.txt", &lastlump)) != -1)
|
||||
{
|
||||
ReadBindings(lump);
|
||||
ReadBindings(lump, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,9 @@ public:
|
|||
void DoBind (const char *key, const char *bind);
|
||||
void DefaultBind(const char *keyname, const char *cmd);
|
||||
|
||||
void SetBind(unsigned int key, const char *bind)
|
||||
void SetBind(unsigned int key, const char *bind, bool override = true)
|
||||
{
|
||||
if (!override && Binds[key].IsNotEmpty()) return;
|
||||
if (key < NUM_KEYS) Binds[key] = bind;
|
||||
}
|
||||
|
||||
|
|
|
@ -578,7 +578,7 @@ void FListMenuItemNativeText::Drawer(DListMenu* menu, const DVector2& origin, bo
|
|||
{
|
||||
if (*text == '$') text = GStrings(text + 1);
|
||||
auto state = selected ? NIT_SelectedState : mEnabled ? NIT_ActiveState : NIT_InactiveState;
|
||||
gi->DrawNativeMenuText(mFontnum, state, int((origin.X + mXpos) / 65536) , int((origin.Y + mYpos) / 65536), 1.f, text, menu->Descriptor()->mFlags);
|
||||
gi->DrawNativeMenuText(mFontnum, state, int((origin.X + mXpos) * 65536) , int((origin.Y + mYpos) * 65536), 1.f, text, menu->Descriptor()->mFlags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue