Changeset 9101
- Timestamp:
- Apr 20, 2012, 4:19:27 PM (13 years ago)
- Location:
- code/branches/shipSelection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/shipSelection/data/gui/scripts/ShipSelectionMenu.lua
r9074 r9101 121 121 local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1] 122 122 local index = tabIndexes[listbox:getItemIndex(choice)+1] 123 return P.levelList[index]123 --return P.levelList[index] 124 124 else 125 125 return nil … … 155 155 156 156 if selectedlevel ~= nil then 157 orxonox.execute("startGame " .. selectedlevel:getXMLFilename()) 157 selectedlevel:selectShip("meinModell") 158 --orxonox.execute("startGame " .. selectedlevel:getXMLFilename()) 158 159 hideAllMenuSheets() 159 160 else -
code/branches/shipSelection/src/orxonox/LevelInfo.h
r9057 r9101 43 43 44 44 #include "core/BaseObject.h" 45 #include <iostream> 46 #include <fstream> 45 47 #include "core/OrxonoxClass.h" 46 48 … … 136 138 137 139 inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export 140 inline void selectShip (const std::string& ship) { this->changeShip(ship); } // tolua_export 141 138 142 139 143 protected: … … 148 152 149 153 private: 154 inline void changeShip (const std::string& model) { 155 //HACK: Read Level XML File, find "shipselection", replace with ship model 156 std::string text; 157 std::ifstream myLevel ("test.txt"); 158 std::ofstream tempLevel ("test2.txt"); 159 while(!myLevel.eof()) 160 { 161 std::string buff; 162 std::getline(myLevel, buff); 163 tempLevel.write(buff.c_str(), buff.length()); 164 } 165 myLevel.close(); 166 tempLevel.close(); 167 orxout(user_status) << "done" << endl; 168 } 150 169 void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed. 151 170 void shipsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
Note: See TracChangeset
for help on using the changeset viewer.