Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1398


Ignore:
Timestamp:
May 23, 2008, 7:12:05 PM (17 years ago)
Author:
rgrieder
Message:
  • removed the mouseHandler in SpaceShip
Location:
code/branches/network/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/InputHandler.cc

    r1391 r1398  
    3333
    3434#include "InputHandler.h"
     35#include <fstream>
    3536#include "util/Convert.h"
    3637#include "util/SubString.h"
     
    469470    COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
    470471
     472    clearBindings();
     473
     474    /*std::ifstream infile;
     475    infile.open("keybindings.ini");
     476    if (!infile.is_open())
     477    {
     478      ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings_def.ini");
     479      setConfigValues();
     480    }
     481    infile.close();*/
    471482    ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
    472     clearBindings();
    473483    setConfigValues();
    474484
     
    486496    SetConfigValue(derivePeriod_, 0.1f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
    487497    SetConfigValue(mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
     498    SetConfigValue(keybindingsDefault_, "keybindings_def.ini").description("Default ini file for the keybindings.");
    488499
    489500    float oldThresh = buttonThreshold_;
     
    580591      if (halfAxes_[i].relVal_ > analogThreshold_ || halfAxes_[i].absVal_ > analogThreshold_)
    581592      {
    582         COUT(3) << halfAxes_[i].name_ << "\t" << halfAxes_[i].absVal_ << std::endl;
     593        //COUT(3) << halfAxes_[i].name_ << "\t" << halfAxes_[i].absVal_ << std::endl;
    583594        halfAxes_[i].execute();
    584595      }
  • code/branches/network/src/core/InputHandler.h

    r1391 r1398  
    226226    //! mouse sensitivity if mouse input is derived
    227227    float mouseSensitivityDerived_;
     228    //! default ini file for the keybindings
     229    std::string keybindingsDefault_;
    228230  };
    229231
  • code/branches/network/src/core/InputManager.cc

    r1391 r1398  
    409409          enableKeyHandler("keybinder");
    410410          enableMouseHandler("keybinder");
    411           enableMouseHandler("SpaceShip");
    412411          enableJoyStickHandler("keybinder", 0);
    413412          break;
     
    419418        case IS_CONSOLE:
    420419          enableMouseHandler("keybinder");
    421           enableMouseHandler("SpaceShip");
    422420          enableJoyStickHandler("keybinder", 0);
    423421          enableKeyHandler("buffer");
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1391 r1398  
    159159    void SpaceShip::init()
    160160    {
    161         if ((server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==objectID ) ))
    162         {
    163               if (!setMouseEventCallback_)
    164               {
    165                   InputManager::addMouseHandler(this, "SpaceShip");
    166                   InputManager::enableMouseHandler("SpaceShip");
    167                   setMouseEventCallback_ = true;
    168               }
    169         }
    170 
    171161        // START CREATING THRUSTER
    172162        this->tt_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
     
    314304    }
    315305
    316     void SpaceShip::mouseButtonPressed(MouseButton::Enum id)
    317     {
    318         if (id == MouseButton::Right)
    319             this->bRMousePressed_ = true;
    320     }
    321 
    322     void SpaceShip::mouseButtonReleased(MouseButton::Enum id)
    323     {
    324         if (id == MouseButton::Right)
    325         {
    326             this->bRMousePressed_ = false;
    327             this->camNode_->resetOrientation();
    328         }
    329     }
    330 
    331306    std::string SpaceShip::whereAmI() {
    332307        return getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().x)
  • code/branches/network/src/orxonox/objects/SpaceShip.h

    r1391 r1398  
    4141namespace orxonox
    4242{
    43     class _OrxonoxExport SpaceShip : public Model, public MouseHandler
     43    class _OrxonoxExport SpaceShip : public Model
    4444    {
    4545        public:
     
    7878            static void moveLateral(float value);
    7979            static void fire();
    80 
    81             void mouseButtonPressed (MouseButton::Enum id);
    82             void mouseButtonReleased(MouseButton::Enum id);
    83             void mouseButtonHeld    (MouseButton::Enum id) { }
    84             void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) { }
    85             void mouseScrolled      (int abs, int rel) { }
    8680
    8781            float getMaxSpeed();
Note: See TracChangeset for help on using the changeset viewer.