- Timestamp:
- Apr 16, 2010, 12:22:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2/src/orxonox/overlays/GUISheet.cc
r6722 r6737 40 40 : BaseObject(creator) 41 41 , bShowOnLoad_(false) 42 , bShowCursor_(true)43 42 , bHidePrevious_(false) 43 , bHidePreviousSet_(false) 44 44 { 45 45 RegisterObject(GUISheet); … … 57 57 SUPER(GUISheet, XMLPort, xmlElement, mode); 58 58 59 XMLPortParam(GUISheet, "showOnLoad", setShowOnLoad, getShowOnLoad, xmlElement, mode); 60 XMLPortParam(GUISheet, "showCursor", setCursorVisibility, getCursorVisibility, xmlElement, mode); 61 XMLPortParam(GUISheet, "hidePrevious", setPreviousHiding, getPreviousHiding, xmlElement, mode); 62 XMLPortParam(GUISheet, "script", setScript, getScript, xmlElement, mode); 59 XMLPortParam(GUISheet, "showOnLoad", setShowOnLoad, getShowOnLoad, xmlElement, mode); 60 XMLPortParam(GUISheet, "hidePrevious", setPreviousHiding, getPreviousHiding, xmlElement, mode); 61 XMLPortParam(GUISheet, "sheetName", setSheetName, getSheetName, xmlElement, mode); 62 XMLPortParam(GUISheet, "backgroundImage", setBackgroundImage, getBackgroundImage, xmlElement, mode); 63 64 if (this->bShowOnLoad_) 65 this->show(); 63 66 } 64 67 65 68 void GUISheet::show() 66 69 { 67 GUIManager::showGUI(this->script_, this->bHidePrevious_); 70 GUIManager::getInstance().setBackgroundImage(this->backgroundImage_); 71 if (this->bHidePreviousSet_) 72 GUIManager::getInstance().showGUI(this->sheetName_, this->bHidePrevious_); 73 else 74 GUIManager::getInstance().showGUI(this->sheetName_); 68 75 } 69 76 70 77 void GUISheet::hide() 71 78 { 72 GUIManager::hideGUI(this->script_); 79 GUIManager::getInstance().hideGUI(this->sheetName_); 80 if (!this->backgroundImage_.empty()) 81 GUIManager::getInstance().setBackgroundImage(""); 73 82 } 74 83 75 void GUISheet::setS cript(const std::string& filename)84 void GUISheet::setSheetName(const std::string& name) 76 85 { 77 this->script_ = filename; 78 GUIManager::getInstance().loadGUI(this->script_); 79 if (this->bShowOnLoad_) 80 this->show(); 81 } 82 83 void GUISheet::setCursorVisibility(bool bShow) 84 { 85 this->bShowCursor_ = bShow; 86 // TODO: This call has no effect when already showing! 86 this->sheetName_ = name; 87 GUIManager::getInstance().loadGUI(this->sheetName_); 87 88 } 88 89 … … 90 91 { 91 92 this->bHidePrevious_ = bHide; 92 // TODO: This call has no effect when already showing! 93 this->bHidePreviousSet_ = true; 94 // Note: This call has no effect when already showing! 93 95 } 94 96 }
Note: See TracChangeset
for help on using the changeset viewer.