diff --git a/source/gui/ObjectTypes/CHotkeyPicker.cpp b/source/gui/ObjectTypes/CHotkeyPicker.cpp index 5e68128299..15785bc0dd 100644 --- a/source/gui/ObjectTypes/CHotkeyPicker.cpp +++ b/source/gui/ObjectTypes/CHotkeyPicker.cpp @@ -19,11 +19,14 @@ #include "CHotkeyPicker.h" +#include "gui/ObjectBases/IGUIObject.h" #include "lib/timer.h" +#include "ps/CLogger.h" #include "ps/Hotkey.h" #include "ps/KeyName.h" #include "scriptinterface/ScriptConversions.h" + const CStr CHotkeyPicker::EventNameCombination = "Combination"; const CStr CHotkeyPicker::EventNameKeyChange = "KeyChange"; diff --git a/source/gui/ObjectTypes/CHotkeyPicker.h b/source/gui/ObjectTypes/CHotkeyPicker.h index c7866794a6..0c41f39b0f 100644 --- a/source/gui/ObjectTypes/CHotkeyPicker.h +++ b/source/gui/ObjectTypes/CHotkeyPicker.h @@ -18,9 +18,12 @@ #ifndef INCLUDED_CHOTKEYPICKER #define INCLUDED_CHOTKEYPICKER +#include "gui/CGUI.h" #include "lib/external_libraries/libsdl.h" #include "ps/CStr.h" +#include + class ScriptInterface; /** diff --git a/source/ps/KeyName.cpp b/source/ps/KeyName.cpp index 75298f4942..d5d764dba8 100644 --- a/source/ps/KeyName.cpp +++ b/source/ps/KeyName.cpp @@ -84,7 +84,7 @@ static const std::unordered_map> scancodemap {{ { UNIFIED_SUPER, { "Super", "Left Gui", "Right Gui" } }, }}; -SDL_Scancode FindScancode(const CStr& keyname) +SDL_Scancode FindScancode(const CStr8& keyname) { // Find (ignoring case) a corresponding scancode, if one exists. std::unordered_map>::const_iterator it = diff --git a/source/ps/KeyName.h b/source/ps/KeyName.h index af93bc0b4e..5aeea83e4c 100644 --- a/source/ps/KeyName.h +++ b/source/ps/KeyName.h @@ -23,7 +23,7 @@ class CStr8; -extern SDL_Scancode FindScancode(const CStr& keyname); +extern SDL_Scancode FindScancode(const CStr8& keyname); // Map a scancode to a locale-independent scancode name. extern CStr8 FindScancodeName(SDL_Scancode scancode); // Map a scancode to a locale-dependent key name (to show the user). diff --git a/source/ps/scripting/JSInterface_Hotkey.cpp b/source/ps/scripting/JSInterface_Hotkey.cpp index 89493abfee..9486f4721f 100644 --- a/source/ps/scripting/JSInterface_Hotkey.cpp +++ b/source/ps/scripting/JSInterface_Hotkey.cpp @@ -19,14 +19,16 @@ #include "JSInterface_Hotkey.h" -#include -#include - #include "lib/external_libraries/libsdl.h" +#include "ps/CLogger.h" #include "ps/Hotkey.h" #include "ps/KeyName.h" #include "scriptinterface/ScriptConversions.h" +#include +#include +#include + /** * Convert an unordered map to a JS object, mapping keys to values. * Assumes T to have a c_str() method that returns a const char* diff --git a/source/tools/entity/checkrefs.pl b/source/tools/entity/checkrefs.pl index 8b1a1c02b0..29970741e8 100755 --- a/source/tools/entity/checkrefs.pl +++ b/source/tools/entity/checkrefs.pl @@ -435,7 +435,8 @@ sub add_gui_xml { push @files, $f; - if ($f =~ /^gui\/page_/) + # GUI page definitions are assumed to be named page_[something].xml and alone in that. + if ($f =~ /\/page_[^.\/]+\.xml$/) { push @roots, $f; my $xml = XMLin(vfs_to_physical($f), ForceArray => [qw(include)], KeyAttr => []) or die "Failed to parse '$f': $!";