Changeset View
Changeset View
Standalone View
Standalone View
source/gui/SettingTypes/CGUIHotkey.h
- This file was copied from source/gui/ObjectTypes/CImage.cpp.
Show All 9 Lines | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#include "precompiled.h" | #ifndef INCLUDED_CGUIHOTKEY | ||||
#define INCLUDED_CGUIHOTKEY | |||||
#include "CImage.h" | #include "gui/CGUISetting.h" | ||||
#include "ps/CStr.h" | |||||
#include "gui/CGUI.h" | /** | ||||
* Manages a hotkey setting for a GUI object. | |||||
CImage::CImage(CGUI& pGUI) | */ | ||||
: IGUIObject(pGUI), | class CGUIHotkey : public CGUISimpleSetting<CStr> | ||||
m_Sprite() | |||||
{ | |||||
RegisterSetting("sprite", m_Sprite); | |||||
} | |||||
CImage::~CImage() | |||||
{ | { | ||||
} | public: | ||||
CGUIHotkey(IGUIObject* pObject, const CStr& Name) : CGUISimpleSetting<CStr>(pObject, Name) | |||||
{} | |||||
NONCOPYABLE(CGUIHotkey); | |||||
MOVABLE(CGUIHotkey); | |||||
bool DoFromString(const CStrW& value) override; | |||||
bool DoFromJSVal(const ScriptRequest& rq, JS::HandleValue value) override; | |||||
void OnSettingChange(const CStr& setting, bool sendMessage) override; | |||||
}; | |||||
void CImage::Draw() | #endif // INCLUDED_CGUIHOTKEY | ||||
{ | |||||
m_pGUI.DrawSprite(m_Sprite, GetBufferedZ(), m_CachedActualSize); | |||||
} |
Wildfire Games · Phabricator