CmGUISkin.cpp 594 B

12345678910111213141516171819202122232425
  1. #include "CmGUISkin.h"
  2. #include "CmGUIElementStyle.h"
  3. #include "CmDebug.h"
  4. namespace CamelotEngine
  5. {
  6. GUIElementStyle GUISkin::DefaultStyle;
  7. const GUIElementStyle* GUISkin::getStyle(const String& guiElemType) const
  8. {
  9. auto iterFind = mStyles.find(guiElemType);
  10. if(iterFind != mStyles.end())
  11. return &iterFind->second;
  12. LOGWRN("Cannot find GUI style with name: " + guiElemType + ". Returning default style.");
  13. return &DefaultStyle;
  14. }
  15. void GUISkin::setStyle(const String& guiElemType, const GUIElementStyle& style)
  16. {
  17. mStyles[guiElemType] = style;
  18. }
  19. }