Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10066 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
Dec 13, 2006, 3:35:48 PM (18 years ago)
Author:
hejja
Message:

Herumspielen am design

Location:
branches/gui/src/world_entities/questGUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/world_entities/questGUI/quest_gui.cc

    r10031 r10066  
    3838#include "menu/glgui_imagebutton.h"
    3939#include "glgui_text.h"
     40#include <glgui_image.h>
    4041
    4142
     
    4950CREATE_FACTORY(QuestGUI);
    5051SHELL_COMMAND(gui, QuestGUI, guiInit);
     52//SHELL_COMMAND(cancel, QuestGUI, guiDestruct);
    5153
    5254
     
    5658
    5759  this->toList(OM_GROUP_00);
    58  
    59   this->mainMenuBox = NULL;
    6060 
    6161  this->questBox = NULL;
     
    8181
    8282/**
    83  * loads the xml tags
     83 * loads the xml tagsthis->questDescription
    8484 * @param root: root xml tag for this element
    8585 */
     
    9292   LoadParam(root, "quest-description", this, QuestGUI, setQuestDescription)
    9393       .describe("sets the description of a quest");
     94   LoadParam(root, "quest-picture", this, QuestGUI, setQuestPicture)
     95       .describe("sets the picture of a quest");
     96   LoadParam(root, "quest-outline", this, QuestGUI, setQuestOutline)
     97       .describe("sets the outline of a quiest");
     98   
    9499}
    95100
     
    100105void QuestGUI::guiInit()
    101106
    102   if (mainMenuBox == NULL)
     107  if (questBox == NULL)
    103108  {
    104     this->mainMenuBox = new OrxGui::GLGuiBox();
    105     {
    106       OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Quests");
    107       startButton->released.connect(this, &QuestGUI::showQuest);
    108       this->mainMenuBox->pack(startButton);
    109       startButton->select();
    110 
    111       OrxGui::GLGuiButton* networkButton = new OrxGui::GLGuiPushButton("Bla Bla");
    112       //networkButton->released.connect(this, &QuestGUI::showMultiPlayer);
    113       this->mainMenuBox->pack(networkButton);
    114 
    115       OrxGui::GLGuiButton* optionsButton = new OrxGui::GLGuiPushButton("Blobb");
    116       //optionsButton->released.connect(this, &QuestGUI::showOptionsMenu);
    117       this->mainMenuBox->pack(optionsButton);
    118 
    119 
    120       OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit Menu");
    121       this->mainMenuBox->pack(quitButton);
    122       quitButton->released.connect(this, &QuestGUI::quitMenu);
    123     }
    124  
    125     this->mainMenuBox->showAll();
    126 
    127     this->mainMenuBox->setRelCoor2D(200, 100); 
    128  
     109    this->questBox= new OrxGui::GLGuiBox();
     110   
     111    OrxGui::GLGuiBox* labelBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     112    //labelBox->setWidgetSize(100, 200);
     113   
     114    OrxGui::GLGuiText* questTxt = new OrxGui::GLGuiText();
     115    questTxt->setText(this->questDescription);
     116    labelBox->pack(questTxt);
     117   
     118    OrxGui::GLGuiImage* image = new OrxGui::GLGuiImage();
     119    image->setWidgetSize(100, 100);
     120    image->loadImageFromFile(questPicture);
     121    image->show();
     122   
     123    this->questBox->setAbsCoor2D(300, 40);
     124    labelBox->setRelCoor2D(300, 300);
     125    image->setRelCoor2D(0, 0);
     126   
     127    this->questBox->pack(image);
     128    this->questBox->pack(labelBox);
     129    this->questBox->showAll();
     130   
    129131    OrxGui::GLGuiHandler::getInstance()->activate();
    130132    OrxGui::GLGuiHandler::getInstance()->activateCursor();
     
    134136    OrxGui::GLGuiHandler::getInstance()->deactivate();
    135137    OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
    136     delete this->mainMenuBox;
    137     this->mainMenuBox = NULL;
     138    delete this->questBox;
     139    this->questBox = NULL;
    138140  }
    139141 
    140 }
    141 
    142 void QuestGUI::showQuest()
    143 {
    144   if (this->questBox== NULL)
    145   {
    146     this->questBox= new OrxGui::GLGuiBox(OrxGui::Horizontal);
    147    
    148     OrxGui::GLGuiBox* labelBox = new OrxGui::GLGuiBox();
    149    
    150     OrxGui::GLGuiText* questTxt = new OrxGui::GLGuiText();
    151     questTxt->setText(this->questDescription);
    152     labelBox->pack(questTxt);
    153 
    154     OrxGui::GLGuiImage* image = new OrxGui::GLGuiImage();
    155     image->show();
    156     image->setWidgetSize( 250, 200);
    157     image->setAbsCoor2D(400, 150);
    158     image->setForegroundColor(Color( 1,1,1,.6));
    159    
    160     this->questBox->pack(labelBox);
    161     this->questBox->pack(image);
    162   }
    163  
    164   this->showSecondLevelElement(this->questBox);
    165 
    166 }
    167 
    168 void QuestGUI::quitMenu()
    169 {
    170   delete this->mainMenuBox;
    171   this->mainMenuBox = NULL;
    172 }
    173 
    174 void QuestGUI::showSecondLevelElement(OrxGui::GLGuiBox* element)
    175 {
    176   if (this->currentlyOpened != NULL && this->currentlyOpened != element)
    177     this->currentlyOpened->hideAll();
    178 
    179   element->showAll();
    180   element->setRelCoor2D(200, 100);
    181 
    182   this->currentlyOpened = element;
    183 
    184   this->mainMenuBox->setRelCoorSoft2D(50, 100, 5);
    185142}
    186143
     
    188145
    189146
    190 
  • branches/gui/src/world_entities/questGUI/quest_gui.h

    r10031 r10066  
    2323   /** @param questName sets the name of this quest */
    2424   inline void setQuestName(const std::string& questName) { this->questName = questName; }
    25    inline void setQuestDescription(const std::string& questDescription) { this->questName = questDescription; }
     25   inline void setQuestDescription(const std::string& questDescription) { this->questDescription = questDescription; }
     26   inline void setQuestPicture(const std::string& questPicture) { this->questPicture = questPicture; }
     27   inline void setQuestOutline(const std::string& questOutline) { this->questOutline = questOutline; }
    2628   void guiInit();
    27    
    28    void showQuest();
    29    
    30    void quitMenu();
    31 
    32 
    33   private:
    34    void showSecondLevelElement(OrxGui::GLGuiBox* element);
    3529
    3630   
     
    3832    std::string             questName;
    3933    std::string             questDescription;
    40     OrxGui::GLGuiBox*       mainMenuBox;
     34    std::string             questPicture;
     35    std::string             questOutline;
    4136   
    4237    OrxGui::GLGuiBox*       questBox;
Note: See TracChangeset for help on using the changeset viewer.