Changeset 11560
- Timestamp:
- Nov 13, 2017, 4:20:31 PM (7 years ago)
- Location:
- code/branches/CampaignMap_HS17
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw
r11544 r11560 11 11 include("templates/lodInformation.oxt") 12 12 include("templates/StoryMode.oxt") 13 13 include("HUDTemplates3.oxo") 14 14 include("templates/spaceshipAssff.oxt") 15 15 include("templates/spaceshipEscort.oxt") … … 17 17 ?> 18 18 19 <Level >19 <Level gametype = StoryMode> 20 20 21 21 <templates> … … 29 29 > 30 30 31 <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign= StoryMode/>31 <SpawnPoint position="000.000, 000.000, 1000.000" spawnclass=SpaceShip orientation="0, 0, 0, -1" pawndesign= spaceshipescort /> 32 32 33 33 34 34 <StaticEntity position="0,0,0" direction="0,0,0" > 35 <attached>35 <attached> 36 36 37 37 <Model position="600,370,0" mesh="planets/moon.mesh" scale=100 /> … … 62 62 <Billboard colour="1,1,0.05" position="1500,-1300,-2080" material="Flares/lensflare" scale=5 /> 63 63 64 <Model position="0,0,0" mesh="planets/moon.mesh" scale=100 /> 65 66 64 67 </attached> 65 68 </StaticEntity> 66 67 <MovableEntity>68 69 70 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>71 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />72 73 </MovableEntity>74 69 75 70 -
code/branches/CampaignMap_HS17/data/levels/emptyLevel.oxw
r11545 r11560 10 10 include("HUDTemplates3.oxo") 11 11 include("templates/lodInformation.oxt") 12 include("StoryModeHUD2") 13 include("StoryMode.oxt") 12 14 ?> 13 15 … … 60 62 </attached> 61 63 </StoryModePlanet> 62 63 <MovableEntity> 64 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 65 </MovableEntity> 64 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 66 65 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> 67 66 </Scene> -
code/branches/CampaignMap_HS17/data/levels/templates/StoryMode.oxt
r11359 r11560 1 1 <Template name=StoryMode> 2 2 <SpaceShip 3 hudtemplate = StoryMode Map3 hudtemplate = StoryModeHUD2 4 4 camerapositiontemplate = spaceshipghostcameras 5 5 -
code/branches/CampaignMap_HS17/data/overlays/HUDTemplates3.oxo
r11451 r11560 48 48 <OverlayGroup name = "spaceshiphud" scale = "1, 1"> 49 49 <Map /> 50 51 52 53 <StoryModeHUD 54 name = "StoryMode" 55 correctaspect = false 56 font = "Monofur" 57 textSize = 0.05 58 align = "center" 59 /> 60 61 50 62 51 63 <HUDHealthBar -
code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo
r11544 r11560 22 22 --> 23 23 24 <Template name="spectatorhud">25 <OverlayGroup name = "spectatorhud" scale = "1, 1">26 </OverlayGroup>27 </Template>28 24 29 <Template name=" spaceshiphud">25 <Template name="StoryModeHUD2"> 30 26 <OverlayGroup name = "spaceshiphud" scale = "1, 1"> 31 <Map />32 27 33 28 <!-- … … 46 41 name = "StoryMode" 47 42 correctaspect = true 48 font = " Verdana"43 font = "Monofur" 49 44 textSize = 0.05 50 />51 52 <GUIOverlay53 name = "QuestGUI"54 guiname = "QuestGUI"55 visible = "false"56 />57 58 <GUIOverlay59 name = "PickupInventory"60 guiname = "PickupInventory"61 visible = "false"62 />63 64 <GUIOverlay65 name = "Dialogue"66 guiname = "Dialogue"67 visible = "false"68 45 /> 69 46 -
code/branches/CampaignMap_HS17/src/modules/overlays/hud/CMakeLists.txt
r11353 r11560 27 27 LastTeamStandingInfos.cc 28 28 CountDown.cc 29 StoryModeHUD.cc 29 30 ) -
code/branches/CampaignMap_HS17/src/modules/overlays/hud/StoryModeHUD.cc
r11544 r11560 68 68 { 69 69 RegisterObject(StoryModeHUD); 70 70 71 71 // Set default values 72 this->setFont("Monofur"); 73 this->setTextSize(0.5f); 72 //this->setFont("Monofur"); 73 //this->setTextSize(0.5f); 74 75 // Scales used for dimensions and text size 76 float xScale = this->getActualSize().x; 77 float yScale = this->getActualSize().y; 78 79 // Create text 80 text_ = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton() 81 .createOverlayElement("TextArea", "StoryModeHUD_navText_" + getUniqueNumberString())); 82 //text->setFontName(this->fontName_); 83 //text->setCharHeight(this->textSize_ * yScale); 84 text_->setDimensions(xScale, yScale); 85 86 text_->hide(); 87 88 this->background_->addChild(text_); 74 89 } 75 90 … … 102 117 } 103 118 this->fontName_ = font; 104 for (const auto& mapEntry : this->activeObjectList_) 105 { 106 if (mapEntry.second.text_ != nullptr) 107 mapEntry.second.text_->setFontName(this->fontName_); 108 } 119 if(text_ != nullptr) 120 text_->setFontName(this->fontName_); 109 121 } 110 122 … … 124 136 } 125 137 this->textSize_ = size; 126 for (const auto& mapEntry : this->activeObjectList_) 127 { 128 if (mapEntry.second.text_) 129 mapEntry.second.text_->setCharHeight(size); 130 } 138 131 139 } 132 140 … … 151 159 152 160 153 154 155 text_->setCaption("Hello Muthafuckin' World!");161 //display name next to cursor 162 //TODO: Planet.getName() 163 text_->setCaption("Was geht ab?"); 156 164 157 // Transform to screen coordinates 158 Vector3 pos = camTransform * planet->getRVWorldPosition(); 165 // Transform to screen coordinates 166 Vector3 pos = camTransform * Vector3(0,0,0); // planet->getRVWorldPosition(); 167 168 // If you fly passed the description, it gets out of sight 169 if (pos.z > 1.0) 170 return; 159 171 160 161 text_->setLeft((pos.x + 1.0f + it->second.panel_->getWidth()) * 0.5f);162 it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);172 // Position text 173 text_->setLeft((pos.x+1)/2); // The (0,0) Coordinate is in the upper left corner. 174 text_->setTop((-pos.y+1)/2); // With those two calculations we set the desired positions 163 175 164 165 it->second.text_->show();176 // Make sure the overlays are shown 177 text_->show(); 166 178 167 179 } 168 180 169 void StoryModeHUD::addObject() 170 { 171 // Scales used for dimensions and text size 172 float xScale = this->getActualSize().x; 173 float yScale = this->getActualSize().y; 181 //void StoryModeHUD::addObject() 174 182 175 // Create text 176 Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton() 177 .createOverlayElement("TextArea", "StoryModeHUD_navText_" + getUniqueNumberString())); 178 text->setFontName(this->fontName_); 179 text->setCharHeight(this->textSize_ * yScale); 180 text->setColour(object->getRadarObjectColour()); 181 182 text->hide(); 183 184 this->background_->addChild(text); 185 } 186 187 void StoryModeHUD::removeObject(RadarViewable* viewable) 183 /*void StoryModeHUD::removeObject(RadarViewable* viewable) 188 184 { 189 185 Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.text_); 190 } 186 }*/ 191 187 }
Note: See TracChangeset
for help on using the changeset viewer.