Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10265 in orxonox.OLD


Ignore:
Timestamp:
Jan 17, 2007, 4:51:13 PM (17 years ago)
Author:
hejja
Message:

Klasse ist jetzt +- scriptable

Location:
branches/gui/src/world_entities
Files:
3 edited

Legend:

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

    r10225 r10265  
    5151#include "shell_command.h"
    5252
    53 
    54 
    55 
    5653ObjectListDefinition(QuestGUI);
    5754
     
    6158
    6259
     60#include "script_class.h"
     61CREATE_SCRIPTABLE_CLASS(QuestGUI,
     62                        addMethod("guiInit", Executor0<QuestGUI, lua_State*>(&QuestGUI::guiInit))
     63                       );
     64
     65
     66
    6367QuestGUI::QuestGUI(const TiXmlElement* root)
    6468{
     69  if (root != NULL)
     70  {
    6571  this->registerObject(this, QuestGUI::_objectList);
    6672
     
    7177  this->bKillGui = false;
    7278
    73   this->background = "maps/pogo_bunny.png";
     79  this->background = "maps/rand2.png";
     80 
     81  this->backgroundBottom = "maps/rand-untent.png";
    7482
    7583  this->myQuest = new Quest(root);
    7684  if(root)
    7785    this->loadParams( root);
    78 
     86  }
    7987}
    8088
     
    110118    questBox->setBorderTop(10);
    111119    questBox->setBorderRight(10);
    112     questBox->setBorderBottom(20);
    113120    questBox->setBorderLeft(10);
     121    questBox->setBorderBottom(10);
    114122    this->questBox->setBackgroundTexture(background);
    115123    this->bKillGui = false;
     
    117125    OrxGui::GLGuiBox* headerBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    118126    {
     127      headerBox->setBackgroundTexture(backgroundBottom);
    119128      OrxGui::GLGuiImage* questImage = new OrxGui::GLGuiImage();
    120129      questImage->setWidgetSize(100, 100);
     
    124133
    125134      OrxGui::GLGuiBox* outlineBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
    126       {
     135      {     
    127136        OrxGui::GLGuiMultiLineText* questDetails = new OrxGui::GLGuiMultiLineText();
    128137        questDetails->setText(this->myQuest->getQuestDifficulty());
     
    130139        outlineBox->setBorderTop(0);
    131140        outlineBox->setBorderRight(0);
    132         outlineBox->setBorderBottom(20);
    133141        outlineBox->setBorderLeft(0);
     142        outlineBox->setBorderBottom(10);
    134143        outlineBox->pack(questDetails);
    135144      }
    136145      headerBox->setBorderTop(0);
    137146      headerBox->setBorderRight(0);
    138       headerBox->setBorderBottom(20);
    139147      headerBox->setBorderLeft(0);
     148      headerBox->setBorderBottom(10);
    140149      headerBox->pack(outlineBox);
    141150    }
    142151
    143     OrxGui::GLGuiBox* labelBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
    144     {
     152    OrxGui::GLGuiBox* labelBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     153    {
     154      labelBox->setWidgetSize(500,500);
     155      labelBox->setBackgroundTexture(backgroundBottom);
    145156      OrxGui::GLGuiMultiLineText* questTxt = new OrxGui::GLGuiMultiLineText();
    146157      questTxt->setText(this->myQuest->getQuestDescription());
     158      //questTxt->setLineWidth( 400);
     159      labelBox->pack(questTxt);
    147160      labelBox->setBorderTop(0);
    148161      labelBox->setBorderRight(0);
    149       labelBox->setBorderBottom(20);
    150       labelBox->setBorderLeft(0);
    151       labelBox->pack(questTxt);
    152     }
    153 
    154 
    155     OrxGui::GLGuiBox* rewardBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
     162      labelBox->setBorderLeft(40);
     163      labelBox->setBorderBottom(10);
     164    }
     165
     166
     167    OrxGui::GLGuiBox* rewardBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    156168    {
    157169      OrxGui::GLGuiImage* rewardImage = new OrxGui::GLGuiImage();
    158       rewardImage->setWidgetSize(50, 50);
     170      rewardImage->setWidgetSize(100, 100);
    159171      rewardImage->loadImageFromFile(this->myQuest->getRewardPicture());
    160172      rewardImage->show();
     
    165177      rewardBox->setBorderTop(0);
    166178      rewardBox->setBorderRight(0);
    167       rewardBox->setBorderBottom(20);
    168179      rewardBox->setBorderLeft(0);
     180      rewardBox->setBorderBottom(10);
    169181      rewardBox->pack(rewardTxt);
    170182    }
     
    176188        OrxGui::GLGuiButton* acceptButton = new OrxGui::GLGuiPushButton("Accept");
    177189        acceptButton->released.connect(this, &QuestGUI::accept);
    178         acceptBox->setBorderRight(70);
     190        acceptBox->setBorderLeft(50);
     191        acceptBox->setBorderRight(150);
    179192        acceptBox->pack(acceptButton);
    180193      }
     
    187200        refuseBox->pack(refuseButton);
    188201      }
     202      answerBox->setBorderTop(0);
     203      answerBox->setBorderRight(0);
     204      answerBox->setBorderLeft(0);
     205      answerBox->setBorderBottom(0);
    189206      answerBox->pack(acceptBox);
    190207      answerBox->pack(refuseBox);
  • branches/gui/src/world_entities/questGUI/quest_gui.h

    r10167 r10265  
    1616 
    1717  public:
    18    QuestGUI (const TiXmlElement* root);
     18   QuestGUI (const TiXmlElement* root = NULL);
    1919   virtual ~QuestGUI ();
    2020                     
     
    2929    bool                    bKillGui;
    3030    std::string             background;
     31    std::string             backgroundBottom;
    3132   
    3233    OrxGui::GLGuiBox*       headerBox;
     
    4142    OrxGui::GLGuiBox*       refuseBox;
    4243
     44
    4345    OrxSound::SoundSource*  selectorSource;
    4446   
  • branches/gui/src/world_entities/script_trigger.cc

    r9869 r10265  
    6060  scriptCalled = false;
    6161  scriptIsOk = false;
    62   triggerRemains = true;
     62  triggerRemains = false;
    6363  addToScript = false;
    6464  this->activeOnCreation = false;
     
    180180   }
    181181
    182   if(triggerRemains && scriptCalled)
     182 if(triggerRemains && scriptCalled)
    183183  {
    184184    executeAction(timestep);
    185185    return;
    186186  }
    187 
    188   if( !invert && this->distance(target) < radius)
    189   {
     187 
     188 if( !invert && this->distance(target) < radius)
     189  {
     190    //printf("Distance is %f \n", this->distance(target));
    190191    executeAction(timestep);
    191192    scriptCalled = true;
     
    193194
    194195  }
    195   else if( invert && this->distance(target) > radius)
     196 
     197  if( invert && this->distance(target) > radius)
    196198  {
    197199    executeAction(timestep);
     
    207209void ScriptTrigger::executeAction(float timestep)
    208210{
    209 
     211  printf("Script %s called \n",this->functionName.c_str());
    210212  if(scriptIsOk)
    211213  {
Note: See TracChangeset for help on using the changeset viewer.