relative of the floor's base. Leave the <em>sound</em> field blank for no sound
to be played.</p>
+<p align="left"><strong>35. AddRevolvingDoor</strong> - adds a textured revolving door in the
+specified location.<br>
+Syntax: <font face="Courier New, Courier, mono" size="2">AddDoor <em>sound,
+texturename, thickness</em>, <em>clockwise, segments, speed,
+CenterX</em>, <em>CenterZ</em>, <em>width</em>, <em>height</em>,
+<em>voffset</em>, <em>tw</em>, <em>th, external<br>
+</em></font>Example:<font face="Courier New, Courier, mono" size="2"> AddRevolvingDoor
+, DoorTexture, 0.2, false, 4, 0.2, -8.5, 0, 3.5, 8, 0, 1, 1, false</font></p>
+
+<p align="left"><em>Clockwise</em> determines the direction the door rotates.<br>
+<em>Segments</em> determines how many door segments to create.<br>
+Leave the sound fields blank
+for no sounds to be played.<br>
+</p>
+
<p align="left"><strong></strong></p>
<br>
#include "sound.h"
#include "floorindicator.h"
#include "door.h"
+#include "revolvingdoor.h"
#include "directional.h"
#include "scriptprocessor.h"
#include "script_section.h"
return sNextLine;
}
+ //AddRevolvingDoor command
+ if (linecheck.substr(0, 17) == "addrevolvingdoor ")
+ {
+ //get data
+ int params = SplitData(LineData, 17);
+
+ if (params != 14)
+ return ScriptError("Incorrect number of parameters");
+
+ //check numeric values
+ for (int i = 2; i <= 13; i++)
+ {
+ if (i == 3)
+ i++;
+
+ if (!IsNumeric(tempdata[i]))
+ return ScriptError("Invalid value: " + tempdata[i]);
+ }
+
+ //check to see if file exists
+ parent->CheckFile("data/" + tempdata[0]);
+ parent->CheckFile("data/" + tempdata[1]);
+
+ //stop here if in Check mode
+ if (config->CheckScript == true)
+ return sNextLine;
+
+ //create door
+ RevolvingDoor* door = floor->AddRevolvingDoor(tempdata[0], tempdata[1], ToFloat(tempdata[2]), ToBool(tempdata[3]), ToInt(tempdata[4]), ToFloat(tempdata[5]), ToFloat(tempdata[6]), ToFloat(tempdata[7]), ToFloat(tempdata[8]), ToFloat(tempdata[9]), ToFloat(tempdata[10]), ToFloat(tempdata[11]), ToFloat(tempdata[12]), ToBool(tempdata[13]));
+
+ if (door)
+ door->SetLocked(config->keyvalue);
+
+ StoreCommand(door);
+ return sNextLine;
+ }
+
//handle end of floor section
if (linecheck == "<endfloor>" && config->RangeL == config->RangeH)
{
return 0;
}
-RevolvingDoor* Floor::AddRevolvingDoor(const std::string &soundfile, const std::string &texture, float thickness, bool clockwise, int segments, float speed, float CenterX, float CenterZ, float width, float height, float voffset, float tw, float th)
+RevolvingDoor* Floor::AddRevolvingDoor(const std::string &soundfile, const std::string &texture, float thickness, bool clockwise, int segments, float speed, float CenterX, float CenterZ, float width, float height, float voffset, float tw, float th, bool external)
{
+ //create an external (global) door if specified
+ if (external == true)
+ return sbs->GetRevolvingDoorManager()->AddDoor(soundfile, texture, thickness, clockwise, segments, speed, CenterX, CenterZ, width, height, Altitude + voffset, tw, th);
+
int number = (int)RDoorArray.size();
std::string name = "Floor " + ToString(Number) + ":Door " + ToString(number);
RevolvingDoor* door = new RevolvingDoor(this, DoorWrapper, name, soundfile, texture, thickness, clockwise, segments, speed, CenterX, CenterZ, width, height, GetBase(true) + voffset, tw, th);
#include "manager.h"
#include "mesh.h"
#include "floor.h"
-#include "elevatorcar.h"
-#include "shaft.h"
-#include "stairs.h"
#include "texture.h"
#include "sound.h"
#include "revolvingdoor.h"
//create door
sbs->DrawWalls(true, true, true, true, true, true);
sbs->GetTextureManager()->ResetTextureMapping(true);
- /*if (Direction == 1 || Direction == 2 || Direction == 5 || Direction == 6)
- sbs->GetTextureManager()->SetTextureFlip(0, 1, 0, 0, 0, 0); //flip texture on rear side of door
- if (Direction == 3 || Direction == 4 || Direction == 7 || Direction == 8)
- sbs->GetTextureManager()->SetTextureFlip(1, 0, 0, 0, 0, 0); //flip texture on rear side of door*/
WallObject *wall;
wall = DoorMesh->CreateWallObject(name);
Segments = segments;
if (Segments == 3)
{
- sbs->AddWallMain(wall, name, texture, thickness, -width, -width, 0, 0, height, height, 0, 0, tw, th, false);
- sbs->AddWallMain(wall, name, texture, thickness, 0, 0, width, -width, height, height, 0, 0, tw, th, false);
- sbs->AddWallMain(wall, name, texture, thickness, 0, 0, 0, width, height, height, 0, 0, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(1, 0, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, -width, -width, 0, 0, height, height, voffset, voffset, tw, th, false);
+ sbs->AddWallMain(wall, name, texture, thickness, 0, 0, width, -width, height, height, voffset, voffset, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(0, 1, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, 0, 0, 0, width, height, height, voffset, voffset, tw, th, false);
}
- if (Segments == 4 || Segments == 2)
+ else
{
- sbs->AddWallMain(wall, name, texture, thickness, -width, 0, 0, 0, height, height, 0, 0, tw, th, false);
- sbs->AddWallMain(wall, name, texture, thickness, 0, 0, width, 0, height, height, 0, 0, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(0, 1, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, -width, 0, 0, 0, height, height, voffset, voffset, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(1, 0, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, 0, 0, width, 0, height, height, voffset, voffset, tw, th, false);
if (Segments == 4)
{
- sbs->AddWallMain(wall, name, texture, thickness, 0, -width, 0, 0, height, height, 0, 0, tw, th, false);
- sbs->AddWallMain(wall, name, texture, thickness, 0, 0, 0, width, height, height, 0, 0, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(1, 0, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, 0, -width, 0, 0, height, height, voffset, voffset, tw, th, false);
+ sbs->GetTextureManager()->SetTextureFlip(0, 1, 0, 0, 0, 0); //flip texture on rear side of door
+ sbs->AddWallMain(wall, name, texture, thickness, 0, 0, 0, width, height, height, voffset, voffset, tw, th, false);
}
}
sbs->ResetWalls();