Skyscraper 2.0
buttonpanel.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Elevator Button Panel Object
3 The Skyscraper Project - Version 2.0
4 Copyright (C)2004-2024 Ryan Thoryk
5 https://www.skyscrapersim.net
6 https://sourceforge.net/projects/skyscraper/
7 Contact - ryan@skyscrapersim.net
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22*/
23
24#ifndef _SBS_BUTTON_H
25#define _SBS_BUTTON_H
26
27namespace SBS {
28
30{
31public:
32
33 int Index; //index number of panel
34 std::string Direction;
41 int Rows;
44
45 //functions
46 ButtonPanel(Object *parent, int index, const std::string &texture, int rows, int columns, const std::string &direction, Real CenterX, Real CenterZ, Real buttonwidth, Real buttonheight, Real spacingX, Real spacingY, Real voffset, Real tw, Real th, bool autosize = true);
48 Control* AddButton(const std::string &sound, const std::string &texture, const std::string &texture_lit, int row, int column, const std::string &type, Real width, Real height, Real hoffset = 0, Real voffset = 0);
49 Control* AddControl(const std::string &sound, int row, int column, Real bwidth, Real bheight, Real hoffset, Real voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
50 void Enabled(bool value);
51 bool AddWall(const std::string &name, const std::string &texture, Real thickness, Real x1, Real z1, Real x2, Real z2, Real height1, Real height2, Real voffset1, Real voffset2, Real tw, Real th, bool autosize);
52 void ChangeLight(int floor, bool value);
53 void ChangeAllLights(bool value);
54 Control* GetFloorButton(int floor);
55 Control* GetControl(int index);
56 Control* GetControl(const std::string &name);
57 void RemoveControl(Control *control);
58 int GetControlCount();
59 void SetControls(const std::string &action_name);
60
61private:
62
63 MeshObject* mesh; //button panel mesh object
65 std::vector<Control*> controls; //control objects
66 std::vector<Action*> action_list; //list used for action cleanup on delete
67};
68
69}
70
71#endif
Action * off_action
Definition buttonpanel.h:64
std::string Direction
Definition buttonpanel.h:34
std::vector< Action * > action_list
Definition buttonpanel.h:66
MeshObject * mesh
Definition buttonpanel.h:63
std::vector< Control * > controls
Definition buttonpanel.h:65
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53