BsGUISkin.cpp 631 B

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