Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9101


Ignore:
Timestamp:
Apr 20, 2012, 4:19:27 PM (12 years ago)
Author:
huttemat
Message:

changing xml files

Location:
code/branches/shipSelection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shipSelection/data/gui/scripts/ShipSelectionMenu.lua

    r9074 r9101  
    121121        local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
    122122        local index = tabIndexes[listbox:getItemIndex(choice)+1]
    123         return P.levelList[index]
     123        --return P.levelList[index]
    124124    else
    125125        return nil
     
    155155
    156156    if selectedlevel ~= nil then
    157         orxonox.execute("startGame " .. selectedlevel:getXMLFilename())
     157        selectedlevel:selectShip("meinModell")
     158        --orxonox.execute("startGame " .. selectedlevel:getXMLFilename())
    158159        hideAllMenuSheets()
    159160    else
  • code/branches/shipSelection/src/orxonox/LevelInfo.h

    r9057 r9101  
    4343
    4444#include "core/BaseObject.h"
     45#include <iostream>
     46#include <fstream>
    4547#include "core/OrxonoxClass.h"
    4648
     
    136138
    137139            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
    138142
    139143        protected:
     
    148152
    149153        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            }
    150169            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    151170            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.