Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CInput.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 1,170 Lines • ▼ Show 20 Lines | void CInput::Draw() | ||||
CColor color, color_selected; | CColor color, color_selected; | ||||
GUI<CStrW>::GetSetting(this, "font", font_name_w); | GUI<CStrW>::GetSetting(this, "font", font_name_w); | ||||
GUI<CColor>::GetSetting(this, "textcolor", color); | GUI<CColor>::GetSetting(this, "textcolor", color); | ||||
GUI<CColor>::GetSetting(this, "textcolor_selected", color_selected); | GUI<CColor>::GetSetting(this, "textcolor_selected", color_selected); | ||||
CStrIntern font_name(font_name_w.ToUTF8()); | CStrIntern font_name(font_name_w.ToUTF8()); | ||||
// Get pointer of caption, it might be very large, and we don't | // Get pointer of caption, it might be very large, and we don't | ||||
// want to copy it continuously. | // want to copy it continuously. | ||||
CStrW* pCaption = NULL; | CStrW* pCaption = nullptr; | ||||
wchar_t mask_char = L'*'; | wchar_t mask_char = L'*'; | ||||
if (mask) | if (mask) | ||||
{ | { | ||||
CStrW maskStr; | CStrW maskStr; | ||||
GUI<CStrW>::GetSetting(this, "mask_char", maskStr); | GUI<CStrW>::GetSetting(this, "mask_char", maskStr); | ||||
if (maskStr.length() > 0) | if (maskStr.length() > 0) | ||||
mask_char = maskStr[0]; | mask_char = maskStr[0]; | ||||
} | } | ||||
else | else | ||||
pCaption = (CStrW*)m_Settings["caption"].m_pSetting; | pCaption = (CStrW*)m_Settings["caption"].m_pSetting; | ||||
CGUISpriteInstance* sprite = NULL; | CGUISpriteInstance* sprite = nullptr; | ||||
CGUISpriteInstance* sprite_selectarea = NULL; | CGUISpriteInstance* sprite_selectarea = nullptr; | ||||
int cell_id; | int cell_id; | ||||
GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite", sprite); | GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite", sprite); | ||||
GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite_selectarea", sprite_selectarea); | GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite_selectarea", sprite_selectarea); | ||||
GUI<int>::GetSetting(this, "cell_id", cell_id); | GUI<int>::GetSetting(this, "cell_id", cell_id); | ||||
GetGUI()->DrawSprite(*sprite, cell_id, bz, m_CachedActualSize); | GetGUI()->DrawSprite(*sprite, cell_id, bz, m_CachedActualSize); | ||||
▲ Show 20 Lines • Show All 929 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator