mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-29 15:42:28 +00:00
Bind F10 to open dhewm3Settings menu, unless F10 is already bound
Also fix MSVC build: For some reason Microsoft's sad excuse of a compiler only sets __cplusplus to a value from this millenium if the /Zc:__cplusplus compiler option is set, but that's only supported from VS2017 15.7 on. The alternative is to use _MSVC_LANG, which always holds the version that __cplusplus *should* have...
This commit is contained in:
parent
2892e416f5
commit
ef529cf49a
2 changed files with 11 additions and 1 deletions
|
@ -132,7 +132,7 @@ public:
|
|||
void Swap( idList<type> &other ); // swap the contents of the lists
|
||||
void DeleteContents( bool clear ); // delete the contents of the list
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#if __cplusplus >= 201103L || defined(_MSVC_LANG) && _MSVC_LANG >= 201103L
|
||||
// begin and end allow using C++11 for(ElemType& e : myIdlist) { ... }
|
||||
type* begin() {
|
||||
return list;
|
||||
|
|
|
@ -253,6 +253,16 @@ bool Init(void* _sdlWindow, void* sdlGlContext)
|
|||
//ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
|
||||
//IM_ASSERT(font != nullptr);
|
||||
|
||||
const char* f10bind = idKeyInput::GetBinding( K_F10 );
|
||||
if ( f10bind && f10bind[0] != '\0' ) {
|
||||
if ( idStr::Icmp( f10bind, "dhewm3Settings" ) != 0 ) {
|
||||
// if F10 is already bound, but not to dhewm3Settings, show a message
|
||||
common->Printf( "... the F10 key is already bound to '%s', otherwise it could be used to open the dhewm3 Settings Menu\n" , f10bind );
|
||||
}
|
||||
} else {
|
||||
idKeyInput::SetBinding( K_F10, "dhewm3Settings" );
|
||||
}
|
||||
|
||||
imgui_initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue