Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10120 in orxonox.OLD for branches/playability/src/util


Ignore:
Timestamp:
Dec 20, 2006, 12:02:01 PM (17 years ago)
Author:
muellmic
Message:

some interface hacks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/util/hud.cc

    r10111 r10120  
    2424#include "glgui_widget.h"
    2525#include "glgui_box.h"
     26#include "elements/glgui_energywidgetvertical.h"
    2627
    2728#include "glgui_inputline.h"
     
    108109    this->energyWidget->show();
    109110    this->energyWidget->shiftDir2D(270);
    110     //this->energyWidget->setDisplayedName("Electronics")
     111    dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->energyWidget)->setDisplayedName("Electronics");
    111112    this->shipValuesBox->pack(this->energyWidget);
    112113    /*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
     
    118119
    119120void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget)
    120 {}
     121{
     122  // decopple old widget
     123  if (this->shieldWidget != NULL)
     124  {
     125    this->shieldWidget->hide();
     126  }
     127
     128  this->shieldWidget = widget;
     129  if (this->shieldWidget != NULL)
     130  {
     131    this->shieldWidget->show();
     132    this->shieldWidget->shiftDir2D(270);
     133    this->shipValuesBox->pack(this->shieldWidget);
     134    /*    this->shieldWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
     135        this->shieldWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
     136  }
     137
     138  this->updateResolution();
     139}
    121140
    122141void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget)
    123 {}
     142{
     143// decopple old widget
     144  if (this->armorWidget != NULL)
     145  {
     146    this->armorWidget->hide();
     147  }
     148
     149  this->armorWidget = widget;
     150  if (this->armorWidget != NULL)
     151  {
     152    this->armorWidget->show();
     153    this->armorWidget->shiftDir2D(270);
     154    //this->shipValuesBox->pack(this->armorWidget);
     155    /*    this->armorWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
     156        this->armorWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
     157  }
     158
     159  this->updateResolution();
     160}
    124161
    125162void Hud::setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec)
     
    235272  if (this->shipValuesBox != NULL)
    236273  {
    237     this->shipValuesBox->setAbsCoor2D(0.2 * this->resX, 0.85 * this->resY);
     274    this->shipValuesBox->setAbsCoor2D(0.8 * this->resX, 0.85 * this->resY);
    238275    this->shipValuesBox->setWidgetSize(.4 * this->resX, 0.1 * this->resY);
    239276  }
Note: See TracChangeset for help on using the changeset viewer.