32 using namespace eastl;
52 const GUIMap::iterator it = targetMap.find(
id);
53 if (it != std::end(targetMap))
55 delete it->second.first;
56 it->second.first = element;
57 it->second.second = element ? element->visible() :
false;
61 insert(targetMap,
id, std::make_pair(element, element ? element->visible() :
false));
69 const GUIMap::const_iterator it =
_guiElements[i].find(elementName);
71 ret = it->second.first;
78 ret = it->second.first;
89 for (
const GUIMap::value_type& guiStackIterator :
_guiElements[i]) {
90 element = guiStackIterator.second.first;
91 if (element !=
nullptr && element->
getGUID() == elementID) {
102 element = guiStackIterator.second.first;
103 if (element !=
nullptr && element->
getGUID() == elementID) {
117 const string& rootSheetID) {
118 const U64 guiID =
_ID(name);
120 assert(getGUIElement<GUIButton>(guiID) ==
nullptr);
122 CEGUI::Window*
parent =
nullptr;
125 if (!rootSheetID.empty()) {
130 beepSound.assetName(
"beep.wav");
131 beepSound.assetLocation(Paths::g_soundsLocation);
150 const string& message,
152 const U64 guiID =
_ID(name);
154 assert(getGUIElement<GUIMessageBox>(guiID) ==
nullptr);
171 const bool multiLine,
173 const U64 guiID =
_ID(name);
175 assert(getGUIElement<GUIText>(guiID) ==
nullptr);
193 const U64 guiID =
_ID(name);
194 assert(getGUIElement<GUIFlash>(guiID) ==
nullptr);
203 const U64 guiID =
_ID(name);
212 assert(textElement !=
nullptr);
214 textElement->
text(text.c_str(), multiLine);
220 CEGUI::Window* window = CEGUI::WindowManager::getSingleton().createWindow(type, name);
221 if (window !=
nullptr) {
229 CEGUI::Window* window = CEGUI::WindowManager::getSingleton().loadLayoutFromFile(layoutFileName);
230 if (window !=
nullptr) {
FORCE_INLINE I64 getGUID() const noexcept
virtual GUIType type() const noexcept
Graphical User Interface.
CEGUI::GUIContext * getCEGUIContext() noexcept
Provides direct access to the CEGUI context. Used by plugins (e.g. GUIConsole, GUIInput,...
CEGUI::Window * rootSheet() const noexcept
Get a pointer to the root sheet that CEGUI renders into.
virtual GUIMessageBox * addMsgBox(const char *name, const string &title, const string &message, vec2< I32 > offsetFromCentre=vec2< I32 >(0))
virtual CEGUI::Window * createWindow(const CEGUI::String &type, const CEGUI::String &name)
void onLanguageChange(std::string_view newLanguage)
virtual GUIFlash * addFlash(const char *name, const RelativePosition2D &position, const RelativeScale2D &size)
virtual CEGUI::Window * loadWindowFromLayoutFile(const char *layoutFileName)
virtual GUIText * addText(const char *name, const RelativePosition2D &position, const string &font, const UColour4 &colour, const string &text, bool multiLine=false, U8 fontSize=16u)
virtual GUIElement * getGUIElementImpl(U64 elementName, GUIType type) const
virtual GUIButton * addButton(const char *name, const string &text, const RelativePosition2D &offset, const RelativeScale2D &size, const string &rootSheetID="")
virtual bool unloadWindow(CEGUI::Window *&window)
hashMap< U64, std::pair< GUIElement *, bool > > GUIMap
void addElement(U64 id, GUIElement *element)
GUIInterface(GUI &context)
virtual GUIText * modifyText(const char *name, const string &text, bool multiLine)
std::array< GUIMap, to_base(GUIType::COUNT)> _guiElements
void SetChangeLanguageCallback(const DELEGATE< void, std::string_view > &cbk)
Set a function to be called on each language change.
bool isMainThread() noexcept
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
void insert(eastl::vector< T, A1 > &target, const eastl::vector< T, A2 > &source)
constexpr U64 _ID(const char *const str, const U64 value=val_64_const) noexcept
FORCE_INLINE Handle< T > CreateResource(const ResourceDescriptor< T > &descriptor, bool &wasInCache, std::atomic_uint &taskCounter)
constexpr U8 to_U8(const T value)
Project const SceneEntry & entry
constexpr auto to_base(const Type value) -> Type
void text(const char *text, const bool multiLine)