Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8906 in orxonox.OLD


Ignore:
Timestamp:
Jun 29, 2006, 2:03:36 PM (18 years ago)
Author:
bensch
Message:

Gui Element

Location:
branches/mountain_lake/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/lib/gui/gl/glgui_handler.cc

    r8743 r8906  
    8888  void GLGuiHandler::activate()
    8989  {
    90     EventHandler::getInstance()->pushState(ES_MENU);
     90    //EventHandler::getInstance()->pushState(ES_MENU);
    9191
    9292
     
    9696  void GLGuiHandler::deactivate()
    9797  {
    98     EventHandler::getInstance()->popState();
     98    //EventHandler::getInstance()->popState();
    9999
    100100
  • branches/mountain_lake/src/world_entities/environments/mapped_water.cc

    r8885 r8906  
    2222#include "math.h"
    2323
     24#include "glgui.h"
     25
     26
     27#include "shell_command.h"
    2428
    2529CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
     30
     31SHELL_COMMAND(gui, MappedWater, openGui);
    2632
    2733/**
     
    5157
    5258  tempcounter = 0;
     59  this->box = NULL;
    5360}
    5461
     
    205212}
    206213
     214void MappedWater::resetWaterColorR(float r)
     215{
     216  this->resetWaterColor(r, this->waterColor.y, this->waterColor.z);
     217}
     218
     219
     220void MappedWater::resetWaterColorG(float g)
     221{
     222  this->resetWaterColor(this->waterColor.x, g, this->waterColor.z);
     223}
     224
     225
     226void MappedWater::resetWaterColorB(float b)
     227{
     228  this->resetWaterColor(this->waterColor.x, this->waterColor.y, b);
     229}
     230
     231
     232
    207233/**
    208234 * @brief resets the shininess in the Shader
     
    304330}
    305331
     332
     333void MappedWater::openGui()
     334{
     335  if (this->box == NULL)
     336  {
     337    this->box = new OrxGui::GLGuiBox(OrxGui::Vertical);
     338    {
     339      OrxGui::GLGuiBox* colorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     340      {
     341        OrxGui::GLGuiInputLine* ColorText = new OrxGui::GLGuiInputLine();
     342        ColorText->setText("Color");
     343        colorBox->pack(ColorText);
     344
     345        OrxGui::GLGuiSlider* waterColorR = new OrxGui::GLGuiSlider();
     346        waterColorR->setRange(0, 1.0);
     347        waterColorR->setValue(this->waterColor.x);
     348        waterColorR->connect(SIGNAL(waterColorR, valueChanged), this, SLOT(MappedWater, resetWaterColorR));
     349        colorBox->pack(waterColorR);
     350
     351        OrxGui::GLGuiSlider* waterColorG = new OrxGui::GLGuiSlider();
     352        waterColorG->setRange(0, 1.0);
     353        waterColorG->setValue(this->waterColor.y);
     354        waterColorG->connect(SIGNAL(waterColorG, valueChanged), this, SLOT(MappedWater, resetWaterColorG));
     355        colorBox->pack(waterColorG);
     356
     357        OrxGui::GLGuiSlider* waterColorB = new OrxGui::GLGuiSlider();
     358        waterColorB->setRange(0, 1.0);
     359        waterColorB->setValue(this->waterColor.z);
     360        waterColorB->connect(SIGNAL(waterColorB, valueChanged), this, SLOT(MappedWater, resetWaterColorB));
     361        colorBox->pack(waterColorB);
     362
     363      }
     364      this->box->pack(colorBox);
     365
     366    }
     367    this->box->showAll();
     368    this->box->setAbsCoor2D(300, 40);
     369    OrxGui::GLGuiHandler::getInstance()->activate();
     370    OrxGui::GLGuiHandler::getInstance()->activateCursor();
     371  }
     372
     373
     374}
     375
     376
     377void MappedWater::closeGui()
     378{
     379  delete this->box;
     380  this->box = NULL;
     381
     382}
     383
     384
    306385/**
    307386 * @brief activates the water shader and draws a quad with four textures on it
  • branches/mountain_lake/src/world_entities/environments/mapped_water.h

    r8885 r8906  
    2828#include "shader.h"
    2929
     30namespace OrxGui { class GLGuiBox; };
     31
    3032// forward declaration
    3133template <class T> class tAnimation;
     
    4749  void activateRefraction();
    4850  void deactivateRefraction();
     51
     52
     53  void openGui();
     54  void closeGui();
     55
     56
    4957
    5058  // functions to set parameters for the water, usually they're called through loadparam
     
    7078  void resetWaterAngle(float angle) { this->setWaterAngle(angle); this->calcVerts(); }
    7179  void resetWaterColor(float r, float g, float b);
     80  void resetWaterColorR(float r);
     81  void resetWaterColorG(float g);
     82  void resetWaterColorB(float b);
    7283  void resetShineSize(float shine);
    7384  void resetShineStrength(float strength);
     
    128139  bool                          bFadeShineSize;
    129140
     141  OrxGui::GLGuiBox*             box;
     142
    130143  int tempcounter;
    131144};
Note: See TracChangeset for help on using the changeset viewer.