Changeset 10265 in orxonox.OLD for branches/gui/src
- Timestamp:
- Jan 17, 2007, 4:51:13 PM (18 years ago)
- Location:
- branches/gui/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/world_entities/questGUI/quest_gui.cc
r10225 r10265 51 51 #include "shell_command.h" 52 52 53 54 55 56 53 ObjectListDefinition(QuestGUI); 57 54 … … 61 58 62 59 60 #include "script_class.h" 61 CREATE_SCRIPTABLE_CLASS(QuestGUI, 62 addMethod("guiInit", Executor0<QuestGUI, lua_State*>(&QuestGUI::guiInit)) 63 ); 64 65 66 63 67 QuestGUI::QuestGUI(const TiXmlElement* root) 64 68 { 69 if (root != NULL) 70 { 65 71 this->registerObject(this, QuestGUI::_objectList); 66 72 … … 71 77 this->bKillGui = false; 72 78 73 this->background = "maps/pogo_bunny.png"; 79 this->background = "maps/rand2.png"; 80 81 this->backgroundBottom = "maps/rand-untent.png"; 74 82 75 83 this->myQuest = new Quest(root); 76 84 if(root) 77 85 this->loadParams( root); 78 86 } 79 87 } 80 88 … … 110 118 questBox->setBorderTop(10); 111 119 questBox->setBorderRight(10); 112 questBox->setBorderBottom(20);113 120 questBox->setBorderLeft(10); 121 questBox->setBorderBottom(10); 114 122 this->questBox->setBackgroundTexture(background); 115 123 this->bKillGui = false; … … 117 125 OrxGui::GLGuiBox* headerBox = new OrxGui::GLGuiBox(OrxGui::Horizontal); 118 126 { 127 headerBox->setBackgroundTexture(backgroundBottom); 119 128 OrxGui::GLGuiImage* questImage = new OrxGui::GLGuiImage(); 120 129 questImage->setWidgetSize(100, 100); … … 124 133 125 134 OrxGui::GLGuiBox* outlineBox = new OrxGui::GLGuiBox(OrxGui::Vertical); 126 { 135 { 127 136 OrxGui::GLGuiMultiLineText* questDetails = new OrxGui::GLGuiMultiLineText(); 128 137 questDetails->setText(this->myQuest->getQuestDifficulty()); … … 130 139 outlineBox->setBorderTop(0); 131 140 outlineBox->setBorderRight(0); 132 outlineBox->setBorderBottom(20);133 141 outlineBox->setBorderLeft(0); 142 outlineBox->setBorderBottom(10); 134 143 outlineBox->pack(questDetails); 135 144 } 136 145 headerBox->setBorderTop(0); 137 146 headerBox->setBorderRight(0); 138 headerBox->setBorderBottom(20);139 147 headerBox->setBorderLeft(0); 148 headerBox->setBorderBottom(10); 140 149 headerBox->pack(outlineBox); 141 150 } 142 151 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); 145 156 OrxGui::GLGuiMultiLineText* questTxt = new OrxGui::GLGuiMultiLineText(); 146 157 questTxt->setText(this->myQuest->getQuestDescription()); 158 //questTxt->setLineWidth( 400); 159 labelBox->pack(questTxt); 147 160 labelBox->setBorderTop(0); 148 161 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); 156 168 { 157 169 OrxGui::GLGuiImage* rewardImage = new OrxGui::GLGuiImage(); 158 rewardImage->setWidgetSize( 50, 50);170 rewardImage->setWidgetSize(100, 100); 159 171 rewardImage->loadImageFromFile(this->myQuest->getRewardPicture()); 160 172 rewardImage->show(); … … 165 177 rewardBox->setBorderTop(0); 166 178 rewardBox->setBorderRight(0); 167 rewardBox->setBorderBottom(20);168 179 rewardBox->setBorderLeft(0); 180 rewardBox->setBorderBottom(10); 169 181 rewardBox->pack(rewardTxt); 170 182 } … … 176 188 OrxGui::GLGuiButton* acceptButton = new OrxGui::GLGuiPushButton("Accept"); 177 189 acceptButton->released.connect(this, &QuestGUI::accept); 178 acceptBox->setBorderRight(70); 190 acceptBox->setBorderLeft(50); 191 acceptBox->setBorderRight(150); 179 192 acceptBox->pack(acceptButton); 180 193 } … … 187 200 refuseBox->pack(refuseButton); 188 201 } 202 answerBox->setBorderTop(0); 203 answerBox->setBorderRight(0); 204 answerBox->setBorderLeft(0); 205 answerBox->setBorderBottom(0); 189 206 answerBox->pack(acceptBox); 190 207 answerBox->pack(refuseBox); -
branches/gui/src/world_entities/questGUI/quest_gui.h
r10167 r10265 16 16 17 17 public: 18 QuestGUI (const TiXmlElement* root );18 QuestGUI (const TiXmlElement* root = NULL); 19 19 virtual ~QuestGUI (); 20 20 … … 29 29 bool bKillGui; 30 30 std::string background; 31 std::string backgroundBottom; 31 32 32 33 OrxGui::GLGuiBox* headerBox; … … 41 42 OrxGui::GLGuiBox* refuseBox; 42 43 44 43 45 OrxSound::SoundSource* selectorSource; 44 46 -
branches/gui/src/world_entities/script_trigger.cc
r9869 r10265 60 60 scriptCalled = false; 61 61 scriptIsOk = false; 62 triggerRemains = true;62 triggerRemains = false; 63 63 addToScript = false; 64 64 this->activeOnCreation = false; … … 180 180 } 181 181 182 182 if(triggerRemains && scriptCalled) 183 183 { 184 184 executeAction(timestep); 185 185 return; 186 186 } 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)); 190 191 executeAction(timestep); 191 192 scriptCalled = true; … … 193 194 194 195 } 195 else if( invert && this->distance(target) > radius) 196 197 if( invert && this->distance(target) > radius) 196 198 { 197 199 executeAction(timestep); … … 207 209 void ScriptTrigger::executeAction(float timestep) 208 210 { 209 211 printf("Script %s called \n",this->functionName.c_str()); 210 212 if(scriptIsOk) 211 213 {
Note: See TracChangeset
for help on using the changeset viewer.