-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement DisplayString stuff (#1005)
- Loading branch information
Showing
16 changed files
with
588 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @file | ||
* | ||
* @author Jonathan Wilson | ||
* | ||
* @brief Hotkey | ||
* | ||
* @copyright Thyme is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation, either version | ||
* 2 of the License, or (at your option) any later version. | ||
* A full copy of the GNU General Public License can be found in | ||
* LICENSE | ||
*/ | ||
#include "hotkey.h" | ||
#include "unicodestring.h" | ||
|
||
#ifndef GAME_DLL | ||
HotKeyManager *g_theHotKeyManager; | ||
#endif | ||
|
||
Utf8String HotKeyManager::Search_Hot_Key(const Utf16String &key) | ||
{ | ||
if (!key.Is_Empty()) { | ||
for (const unichar_t *i = key.Str(); i != nullptr && *i != '\0'; i++) { | ||
if (*i == '&') { | ||
Utf16String str(Utf16String::s_emptyString); | ||
str.Concat(i[1]); | ||
Utf8String str2; | ||
str2.Translate(str.Str()); | ||
return str2; | ||
} | ||
} | ||
} | ||
|
||
return Utf8String::s_emptyString; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @file | ||
* | ||
* @author Jonathan Wilson | ||
* | ||
* @brief Hotkey | ||
* | ||
* @copyright Thyme is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation, either version | ||
* 2 of the License, or (at your option) any later version. | ||
* A full copy of the GNU General Public License can be found in | ||
* LICENSE | ||
*/ | ||
#pragma once | ||
#include "always.h" | ||
#include "subsysteminterface.h" | ||
#include <map> | ||
|
||
class GameWindow; | ||
|
||
class HotKey | ||
{ | ||
public: | ||
HotKey() : m_window(nullptr) {} | ||
|
||
private: | ||
Utf8String *m_key; | ||
GameWindow *m_window; | ||
friend class HotKeyManager; | ||
}; | ||
|
||
class HotKeyManager : public SubsystemInterface | ||
{ | ||
public: | ||
virtual ~HotKeyManager() override; | ||
|
||
virtual void Init() override; | ||
virtual void Reset() override; | ||
virtual void Update() override; | ||
Utf8String Search_Hot_Key(const Utf16String &str); | ||
|
||
private: | ||
std::map<Utf8String, HotKey> m_hotKeys; | ||
}; | ||
|
||
#ifdef GAME_DLL | ||
extern HotKeyManager *&g_theHotKeyManager; | ||
#else | ||
extern HotKeyManager *g_theHotKeyManager; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.