AddFloorSigns 0, true, Button, right, -3.5 / 2 + 0.01, -3.301 - 0.2 - 0.33, 0.5, 0.42, 5.5
<Floor 0>
- AddActionControl AccessSwitch, switch.wav, right, -3.5 / 2 + 0.01, -3.301 - 0.2 - 0.33 + 5.706, 0.25, 0.25, 6.5, AccessDownLanding, AccessOffLanding, AccessUpLanding, Fire1Off, Fire1Bypass, Fire1On
+ AddActionControl AccessSwitch, switch.wav, right, -3.5 / 2 + 0.01, -3.301 - 0.2 - 0.33 + 5.706, 0.25, 0.25, 6.5, 2, AccessDownLanding, AccessOffLanding, AccessUpLanding, Fire1Off, Fire1Bypass, Fire1On
<EndFloor>
<Floor 9>
+ AddActionControl AccessSwitch, switch.wav, right, -3.5 / 2 + 0.01, -3.301 - 0.2 - 0.33 + 5.706, 0.25, 0.25, 6.5, 2, AccessDownTop, AccessOffTop, AccessUpTop, Fire1Off, Fire1Bypass, Fire1On
<EndFloor>
action defined by AddAction.<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddActionControl
<em>name, sound, direction, centerx, centerz, width, height, voffset,
-action_name(s), texture_name(s)<br>
+selection_position, action_name(s), texture_name(s)<br>
</em></font>Example: <font face="Courier New, Courier, mono"
size="2">AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4,
-UndoMyAction, MyAction, Touch, TouchLit<br>
+1, UndoMyAction, MyAction, Touch, TouchLit<br>
</font><br>
AddActionControl command creates an advanced control similar to elevator button
panel controls, but assigned to an action created with the AddAction command.
action, and switches to the next actions in sequence when it's clicked.
<em>Direction</em> is the direction the control itself will face in 3D space
(front, left, right, back). <em>Voffset</em> is relative of the floor's base.
-Leave the <em>sound</em> field blank for no sound to be played.</p>
+Leave the <em>sound</em> field blank for no sound to be played. <em>Selection_position</em> is the selection position to start at, which is normally 1.</p>
<p style="text-align:left;margin-left:0;margin-right:auto;"><strong>32.
AddShaftActionControl</strong> - creates a custom control in a specified shaft
that uses a specific action defined by AddAction.<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddShaftActionControl
<em>number, name, sound, direction, centerx, centerz, width, height, voffset,
-action_name(s), texture_name(s)<br>
+selection_position, action_name(s), texture_name(s)<br>
</em></font>Example: <font face="Courier New, Courier, mono"
size="2">AddShaftActionControl 1, MyControl, switch.wav, front, -10, 10, 1.5,
-1.5, 4, UndoMyAction, MyAction, Touch, TouchLit<br>
+1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit<br>
</font><br>
This command creates an advanced control similar to elevator car button panel
controls, but assigned to an action created with the AddAction command. The
<em>Direction</em> is the direction the control itself will face in 3D space
(front, left, right, back). <em>Voffset</em> is relative of the floor's base.
Leave the <em>sound</em> field blank for no sound to be
-played.<strong></strong></p>
+played. <em>Selection_position</em> is the starting selection position, which
+is normally 1.</p>
<p style="text-align:left;margin-left:0;margin-right:auto;"><strong>33.
AddStairsActionControl</strong> - creates a custom control in a specified
stairwell that uses a specific action defined by AddAction.<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddStairsActionControl
<em>number, name, sound, direction, centerx, centerz, width, height, voffset,
-action_name(s), texture_name(s)<br>
+selection_position, action_name(s), texture_name(s)<br>
</em></font>Example: <font face="Courier New, Courier, mono"
size="2">AddStairsActionControl 1, MyControl, switch.wav, front, -10, 10, 1.5,
-1.5, 4, UndoMyAction, MyAction, Touch, TouchLit<br>
+1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit<br>
</font><br>
This command creates an advanced control similar to elevator button panel
controls, but assigned to an action created with the AddAction command. The
<em>Direction</em> is the direction the control itself will face in 3D space
(front, left, right, back). <em>Voffset</em> is relative of the floor's base.
Leave the <em>sound</em> field blank for no sound to be
-played.<strong></strong></p>
+played. <em>Selection_position</em> is the starting selection position, which is
+normally 1.</p>
<p style="text-align:left;margin-left:0;margin-right:auto;"><strong>34.
AddTrigger</strong> - creates a trigger that is used to signal an action when
buttons, switches and knobs on the panel<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddControl
<em>panel_number, sound, row, column, width, height, hoffset, voffset,
-command_name(s), texture_name(s)<br>
+selection_position, command_name(s), texture_name(s)<br>
</em></font>Example 1: <font face="Courier New, Courier, mono"
-size="2">AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, open, ButtonOpen</font><br>
+size="2">AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, 1, open, ButtonOpen</font><br>
Example 2: <font face="Courier New, Courier, mono" size="2">AddControl 1,
-switch.wav, 7, 3, 1, 1, 0, 0, FanOff, FanOn, SwitchFanOff,
+switch.wav, 7, 3, 1, 1, 0, 0, 1, FanOff, FanOn, SwitchFanOff,
SwitchFanOn</font><br>
Example 3: <font face="Courier New, Courier, mono" size="2">AddControl 1,
-switch.wav, 7, 3, 1, 1, 0, 0, Off, 4, Button5, ButtonLit5</font><br>
+switch.wav, 7, 3, 1, 1, 0, 0, 1, Off, 4, Button5, ButtonLit5</font><br>
Example 4: <font face="Courier New, Courier, mono" size="2">AddControl 1,
-switch.wav, 7, 3, 1, 1, 0, 0, Fire2Off, Fire2On, Fire2Hold, FireKnob1,
+switch.wav, 7, 3, 1, 1, 0, 0, 1, Fire2Off, Fire2On, Fire2Hold, FireKnob1,
FireKnob2, FireKnob3</font></p>
<p align="left">The AddControl command creates an advanced control on the
with the "SwitchFanOn" texture being used for that. Example 3 shows a standard
floor button being created (which is what the AddButton command does) and
example 4 shows a fire service mode knob being created with 3 positions. Leave
-the sound field blank for no sound to be played.</p>
+the sound field blank for no sound to be played. The <em>selection_position</em>
+parameter specifies the starting selection position, which is normally 1.</p>
<p align="left">Available command names for elevators:</p>
action defined by AddAction.<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddActionControl
<em>name, sound, direction, centerx, centerz, width, height, voffset,
-action_name(s), texture_name(s)<br>
+selection_position, action_name(s), texture_name(s)<br>
</em></font>Example: <font face="Courier New, Courier, mono"
size="2">AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4,
-UndoMyAction, MyAction, Touch, TouchLit<br>
+1, UndoMyAction, MyAction, Touch, TouchLit<br>
</font><br>
AddActionControl command creates an advanced control similar to elevator button
panel controls, but assigned to an action created with the AddAction command.
<em>Direction</em> is the direction the control itself will face in 3D space
(front, left, right, back). <em>Voffset</em> is relative of the elevator car's
base. Leave the sound field blank for no sound to be
-played.<strong></strong></p>
+played. <em>Selection_position</em> is the starting selection position, which is
+normally 1.</p>
<p style="text-align:left;margin-left:0;margin-right:auto;"><strong>22.
AddTrigger</strong> - creates a trigger that is used to signal an action when
action defined by AddAction.<br>
Syntax: <font face="Courier New, Courier, mono" size="2">AddActionControl
<em>name, sound, direction, centerx, centerz, width, height, voffset,
-action_name(s), texture_name(s)<br>
+selection_position, action_name(s), texture_name(s)<br>
</em></font>Example: <font face="Courier New, Courier, mono"
size="2">AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4,
-UndoMyAction, MyAction, Touch, TouchLit<br>
+1, UndoMyAction, MyAction, Touch, TouchLit<br>
</font><br>
AddActionControl command creates an advanced control similar to elevator button
panel controls, but assigned to an action created with the AddAction command.
action, and switches to the next actions in sequence when it's clicked.
<em>Direction</em> is the direction the control itself will face in 3D space
(front, left, right, back). Leave the sound field blank for no sound to be
-played.</p>
+played. <em>Selection_position</em> is the selection position to start at,
+which is normally 1.</p>
<p style="text-align:left;margin-left:0;margin-right:auto;"><strong>al.
AddTrigger</strong> - creates a trigger that is used to signal an action when
if (params < 10)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[8]) == false)
+ compat = true;
+
+ int end = 8;
+ if (compat == true)
+ end = 7;
+
//check numeric values
- for (int i = 3; i <= 7; i++)
+ for (int i = 3; i <= end; i++)
{
if (!IsNumeric(tempdata[i]))
return ScriptError("Invalid value: " + tempdata[i]);
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 8; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 8; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
//check to see if file exists
parent->CheckFile("data/" + tempdata[1]);
- Control* control = Simcore->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = Simcore->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), 1, action_array, tex_array);
+ else
+ control = Simcore->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToInt(tempdata[8]), action_array, tex_array);
if (control)
{
if (params < 10)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[8]) == false)
+ compat = true;
+
+ int end = 8;
+ if (compat == true)
+ end = 7;
+
//check numeric values
- for (int i = 1; i <= 7; i++)
+ for (int i = 1; i <= end; i++)
{
if (i == 1)
i++;
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 8; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 8; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
//check to see if file exists
parent->CheckFile("data/" + tempdata[1]);
- Control* control = car->GetPanel(ToInt(tempdata[0]))->AddControl(tempdata[1], ToInt(tempdata[2]), ToInt(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = car->GetPanel(ToInt(tempdata[0]))->AddControl(tempdata[1], ToInt(tempdata[2]), ToInt(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), 1, action_array, tex_array);
+ else
+ control = car->GetPanel(ToInt(tempdata[0]))->AddControl(tempdata[1], ToInt(tempdata[2]), ToInt(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToInt(tempdata[8]), action_array, tex_array);
if (control)
{
if (params < 10)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[8]) == false)
+ compat = true;
+
+ int end = 8;
+ if (compat == true)
+ end = 7;
+
//check numeric values
- for (int i = 3; i <= 7; i++)
+ for (int i = 3; i <= end; i++)
{
if (!IsNumeric(tempdata[i]))
return ScriptError("Invalid value: " + tempdata[i]);
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 8; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 8; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
//check to see if file exists
parent->CheckFile("data/" + tempdata[1]);
- Control* control = car->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = car->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), 1, action_array, tex_array);
+ else
+ control = car->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToInt(tempdata[8]), action_array, tex_array);
if (control)
{
if (params < 10)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[8]) == false)
+ compat = true;
+
+ int end = 8;
+ if (compat == true)
+ end = 7;
+
//check numeric values
- for (int i = 3; i <= 7; i++)
+ for (int i = 3; i <= end; i++)
{
if (!IsNumeric(tempdata[i]))
return ScriptError("Invalid value: " + tempdata[i]);
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 8; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 8; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
//check to see if file exists
parent->CheckFile("data/" + tempdata[1]);
- Control* control = floor->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = floor->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), 1, action_array, tex_array);
+ else
+ control = floor->AddControl(tempdata[0], tempdata[1], tempdata[2], ToFloat(tempdata[3]), ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToInt(tempdata[8]), action_array, tex_array);
if (control)
{
if (params < 11)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[9]) == false)
+ compat = true;
+
+ int end = 9;
+ if (compat == true)
+ end = 8;
+
//check numeric values
- for (int i = 0; i <= 8; i++)
+ for (int i = 0; i <= end; i++)
{
if (i == 1)
i = 4;
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 9; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 9; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
if (Simcore->GetShaft(ToInt(tempdata[0])))
{
- Control* control = Simcore->GetShaft(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = Simcore->GetShaft(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), 1, action_array, tex_array);
+ else
+ control = Simcore->GetShaft(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), ToInt(tempdata[9]), action_array, tex_array);
if (control)
{
if (params < 11)
return ScriptError("Incorrect number of parameters");
+ //set backwards compatibility
+ bool compat = false;
+ if (IsNumeric(tempdata[9]) == false)
+ compat = true;
+
+ int end = 9;
+ if (compat == true)
+ end = 8;
+
//check numeric values
- for (int i = 0; i <= 8; i++)
+ for (int i = 0; i <= end; i++)
{
if (i == 1)
i = 4;
//get number of action & texture parameters
slength = (int)tempdata.size();
- parameters = slength - 9; //strip off main parameters
+ parameters = slength - (end + 1); //strip off main parameters
//action & texture parameter number needs to be even
if (IsEven(parameters) == false)
return ScriptError("Incorrect number of parameters");
- for (int i = 9; i < slength - (parameters / 2); i++)
+ for (int i = (end + 1); i < slength - (parameters / 2); i++)
action_array.push_back(tempdata[i]);
for (int i = slength - (parameters / 2); i < slength; i++)
tex_array.push_back(tempdata[i]);
if (Simcore->GetStairs(ToInt(tempdata[0])))
{
- Control* control = Simcore->GetStairs(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), action_array, tex_array);
+ Control* control = 0;
+ if (compat == true)
+ control = Simcore->GetStairs(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), 1, action_array, tex_array);
+ else
+ control = Simcore->GetStairs(ToInt(tempdata[0]))->AddControl(Current, tempdata[1], tempdata[2], tempdata[3], ToFloat(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), ToInt(tempdata[9]), action_array, tex_array);
if (control)
{
else
names.push_back(newtype);
- return AddControl(sound, row, column, width, height, hoffset, voffset, names, textures);
+ return AddControl(sound, row, column, width, height, hoffset, voffset, 1, names, textures);
}
-Control* ButtonPanel::AddControl(const std::string &sound, int row, int column, float bwidth, float bheight, float hoffset, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* ButtonPanel::AddControl(const std::string &sound, int row, int column, float bwidth, float bheight, float hoffset, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//create an elevator control (button, switch, knob)
actions.push_back(off_action);
}
- Control *control = controls[control_index] = new Control(this, name, false, sound, actionsnull, actions, textures, Direction, ButtonWidth * bwidth, ButtonHeight * bheight, false);
+ Control *control = controls[control_index] = new Control(this, name, false, sound, actionsnull, actions, textures, Direction, ButtonWidth * bwidth, ButtonHeight * bheight, false, selection_position);
//move control
controls[control_index]->Move(position);
ButtonPanel(ElevatorCar *car, int index, const std::string &texture, int rows, int columns, const std::string &direction, float CenterX, float CenterZ, float buttonwidth, float buttonheight, float spacingX, float spacingY, float voffset, float tw, float th);
~ButtonPanel();
Control* AddButton(const std::string &sound, const std::string &texture, const std::string &texture_lit, int row, int column, const std::string &type, float width, float height, float hoffset = 0, float voffset = 0);
- Control* AddControl(const std::string &sound, int row, int column, float bwidth, float bheight, float hoffset, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(const std::string &sound, int row, int column, float bwidth, float bheight, float hoffset, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
void Enabled(bool value);
bool AddWall(const std::string &name, const std::string &texture, float thickness, float x1, float z1, float x2, float z2, float height1, float height2, float voffset1, float voffset2, float tw, float th);
void ChangeLight(int floor, bool value);
namespace SBS {
-Control::Control(Object *parent, const std::string &name, bool permanent, const std::string &sound_file, const std::vector<std::string> &action_names, const std::vector<Action*> &actions, std::vector<std::string> &textures, const std::string &direction, float width, float height, bool center) : Object(parent)
+Control::Control(Object *parent, const std::string &name, bool permanent, const std::string &sound_file, const std::vector<std::string> &action_names, const std::vector<Action*> &actions, std::vector<std::string> &textures, const std::string &direction, float width, float height, bool center, int selection_position) : Object(parent)
{
//create a control at the specified location
Direction = direction;
is_enabled = true;
TextureArray = textures;
- current_position = 1;
Locked = false;
KeyID = 0;
light_status = false;
//create object mesh
ControlMesh = new MeshObject(this, name2, 0, "", sbs->GetConfigFloat("Skyscraper.SBS.MaxSmallRenderDistance", 100));
+ //set selection position to starting value
+ SetSelectPosition(selection_position);
+
+ std::string texture = GetTexture(selection_position);
+
sbs->TexelOverride = true;
WallObject *wall;
if (Direction == "front")
}
sbs->DrawWalls(true, false, false, false, false, false);
wall = ControlMesh->CreateWallObject(name);
- sbs->AddWallMain(wall, name, textures[0], 0, x, 0, y, 0, height, height, 0, 0, 1, 1, false);
+ sbs->AddWallMain(wall, name, texture, 0, x, 0, y, 0, height, height, 0, 0, 1, 1, false);
}
if (Direction == "back")
{
}
sbs->DrawWalls(false, true, false, false, false, false);
wall = ControlMesh->CreateWallObject(name);
- sbs->AddWallMain(wall, name, textures[0], 0, x, 0, y, 0, height, height, 0, 0, 1, 1, false);
+ sbs->AddWallMain(wall, name, texture, 0, x, 0, y, 0, height, height, 0, 0, 1, 1, false);
}
if (Direction == "left")
{
}
sbs->DrawWalls(true, false, false, false, false, false);
wall = ControlMesh->CreateWallObject(name);
- sbs->AddWallMain(wall, name, textures[0], 0, 0, x, 0, y, height, height, 0, 0, 1, 1, false);
+ sbs->AddWallMain(wall, name, texture, 0, 0, x, 0, y, height, height, 0, 0, 1, 1, false);
}
if (Direction == "right")
{
}
sbs->DrawWalls(false, true, false, false, false, false);
wall = ControlMesh->CreateWallObject(name);
- sbs->AddWallMain(wall, name, textures[0], 0, 0, x, 0, y, height, height, 0, 0, 1, 1, false);
+ sbs->AddWallMain(wall, name, texture, 0, 0, x, 0, y, height, height, 0, 0, 1, 1, false);
}
sbs->ResetWalls();
sbs->TexelOverride = false;
current_position = position;
- return ControlMesh->ChangeTexture(TextureArray[position - 1]);
+ return ControlMesh->ChangeTexture(GetTexture(position));
}
bool Control::ChangeSelectPosition(int position)
TextureArray[position - 1] = texture;
}
+std::string Control::GetTexture(int position)
+{
+ //get texture for specified position
+
+ if (position < 1 || position > GetPositions())
+ return "";
+
+ return TextureArray[position - 1];
+
+}
+
int Control::GetPositions()
{
//return number of available positions, based on size of Actions array
std::string Direction;
//functions
- Control(Object *parent, const std::string &name, bool permanent, const std::string &sound, const std::vector<std::string> &action_names, const std::vector<Action*> &actions, std::vector<std::string> &textures, const std::string &direction, float width, float height, bool center);
+ Control(Object *parent, const std::string &name, bool permanent, const std::string &sound, const std::vector<std::string> &action_names, const std::vector<Action*> &actions, std::vector<std::string> &textures, const std::string &direction, float width, float height, bool center, int selection_position);
~Control();
void Enabled(bool value);
bool SetSelectPosition(int position);
int GetPositions();
void PlaySound();
void SetTexture(int position, const std::string &texture);
+ std::string GetTexture(int position);
int FindActionPosition(const std::string &name);
int FindNumericActionPosition();
bool DoAction();
return value;
}
-Control* ElevatorCar::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* ElevatorCar::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//add a control
std::vector<Action*> actionnull; //not used
- Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true);
+ Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true, selection_position);
control->Move(Ogre::Vector3(CenterX, voffset, CenterZ));
ControlArray.push_back(control);
return control;
Model* AddModel(const std::string &name, const std::string &filename, bool center, Ogre::Vector3 position, Ogre::Vector3 rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
void AddModel(Model *model);
void AddDisplayFloor(int floor);
- Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
Trigger* AddTrigger(const std::string &name, const std::string &sound_file, Ogre::Vector3 &area_min, Ogre::Vector3 &area_max, std::vector<std::string> &action_names);
bool ReplaceTexture(const std::string &oldtexture, const std::string &newtexture);
std::vector<Sound*> GetSound(const std::string &name);
ColumnFrame->ReplaceTexture(oldtexture, newtexture);
}
-Control* Floor::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* Floor::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//add a control
std::vector<Action*> actionnull; //not used
- Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true);
+ Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true, selection_position);
control->Move(CenterX, GetBase(true) + voffset, CenterZ);
ControlArray.push_back(control);
return control;
Model* AddModel(const std::string &name, const std::string &filename, bool center, Ogre::Vector3 position, Ogre::Vector3 rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
void AddModel(Model *model);
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture);
- Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
Trigger* AddTrigger(const std::string &name, const std::string &sound_file, Ogre::Vector3 &area_min, Ogre::Vector3 &area_max, std::vector<std::string> &action_names);
CameraTexture* AddCameraTexture(const std::string &name, bool enabled, int quality, float fov, Ogre::Vector3 position, bool use_rotation, Ogre::Vector3 rotation);
Escalator* AddEscalator(const std::string &name, bool run, bool run_direction, const std::string &sound_file, const std::string &texture, const std::string &direction, float CenterX, float CenterZ, float width, float risersize, float treadsize, int num_steps, float voffset, float tw, float th);
AmbientB = OldAmbientB;
}
-Control* SBS::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* SBS::AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//add a control
std::vector<Action*> actionnull; //not used
- Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true);
+ Control* control = new Control(this, name, false, sound, action_names, actionnull, textures, direction, width, height, true, selection_position);
control->SetPosition(CenterX, voffset, CenterZ);
ControlArray.push_back(control);
return control;
void ResetDoorwayWalls();
void SetLighting(float red = 1.0, float green = 1.0, float blue = 1.0);
void ResetLighting();
- Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
Trigger* AddTrigger(const std::string &name, const std::string &sound_file, const Ogre::Vector3 &area_min, const Ogre::Vector3 &area_max, std::vector<std::string> &action_names);
Action* AddAction(const std::string &name, std::vector<Object*> &action_parents, const std::string &command, const std::vector<std::string> ¶meters);
Action* AddAction(const std::string &name, std::vector<Object*> &action_parents, const std::string &command);
ModelArray[floor - startfloor].push_back(model);
}
-Control* Shaft::AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* Shaft::AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//add a control
return 0;
std::vector<Action*> actionnull; //not used
- Control* control = new Control(GetMeshObject(floor), name, false, sound, action_names, actionnull, textures, direction, width, height, true);
+ Control* control = new Control(GetMeshObject(floor), name, false, sound, action_names, actionnull, textures, direction, width, height, true, selection_position);
control->Move(CenterX, voffset, CenterZ);
ControlArray[floor - startfloor].push_back(control);
return control;
Light* AddLight(int floor, const std::string &name, int type, Ogre::Vector3 position, Ogre::Vector3 direction, float color_r, float color_g, float color_b, float spec_color_r, float spec_color_g, float spec_color_b, float spot_inner_angle, float spot_outer_angle, float spot_falloff, float att_range, float att_constant, float att_linear, float att_quadratic);
Model* AddModel(int floor, const std::string &name, const std::string &filename, bool center, Ogre::Vector3 position, Ogre::Vector3 rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
void AddModel(int floor, Model *model);
- Control* AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
Trigger* AddTrigger(int floor, const std::string &name, const std::string &sound_file, Ogre::Vector3 &area_min, Ogre::Vector3 &area_max, std::vector<std::string> &action_names);
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture);
void OnInit();
ModelArray[floor - startfloor].push_back(model);
}
-Control* Stairs::AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures)
+Control* Stairs::AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures)
{
//add a control
return 0;
std::vector<Action*> actionnull; //not used
- Control* control = new Control(GetMeshObject(floor), name, false, sound, action_names, actionnull, textures, direction, width, height, true);
+ Control* control = new Control(GetMeshObject(floor), name, false, sound, action_names, actionnull, textures, direction, width, height, true, selection_position);
control->Move(CenterX, voffset, CenterZ);
ControlArray[floor - startfloor].push_back(control);
return control;
MeshObject* GetMeshObject(int floor);
Model* AddModel(int floor, const std::string &name, const std::string &filename, bool center, Ogre::Vector3 position, Ogre::Vector3 rotation, float max_render_distance = 0, float scale_multiplier = 1, bool enable_physics = false, float restitution = 0, float friction = 0, float mass = 0);
void AddModel(int floor, Model *model);
- Control* AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, std::vector<std::string> &action_names, std::vector<std::string> &textures);
+ Control* AddControl(int floor, const std::string &name, const std::string &sound, const std::string &direction, float CenterX, float CenterZ, float width, float height, float voffset, int selection_position, std::vector<std::string> &action_names, std::vector<std::string> &textures);
Trigger* AddTrigger(int floor, const std::string &name, const std::string &sound_file, Ogre::Vector3 &area_min, Ogre::Vector3 &area_max, std::vector<std::string> &action_names);
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture);
void OnInit();