3 static string SCENE_DEFAULT_NAME =
"default";
4 static string SCENE_SUFIX =
"scene";
13 static const int SCENE_EDITOR_CMD_REFRESH = 0;
14 static const int SCENE_EDITOR_CMD_POPUP = 1;
15 static const int SCENE_EDITOR_CMD_SAVE = 2;
36 return PluginSceneManager.Cast(
GetPlugin(PluginSceneManager));
44 m_ModuleDeveloper = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
49 m_RulerActivated =
false;
68 if (!IsMouseInScene())
71 if (GetSelectedSceneObject())
72 GetSelectedSceneObject().AddRotation(GetRotationAngle() *
wheel);
98 FreeCameraControlEnable();
100 m_ModuleDeveloper.ToggleFreeCameraBackPos();
110 if (!IsMouseInScene() || !m_IsOpen)
156 if (IsRulerActivated() && GetSelectedSceneObject() ==
NULL)
168 if (!IsMouseInScene() || !m_IsOpen)
171 if (GetSelectedSceneObject() !=
NULL)
202 if (!AreSceneObjectsLinked(GetSelectedSceneObject(),
scene_object))
203 LinkSceneObjects(GetSelectedSceneObject(),
scene_object);
205 UnlinkSceneObjects(GetSelectedSceneObject(),
scene_object);
209 SceneEditorMenuCmdPopup(
"I am sorry. You cant create link on player!");
223 if (!IsMouseInScene() || !m_IsOpen)
226 if (GetSelectedSceneObject() !=
NULL)
254 if (!IsMouseInScene() || !m_IsOpen || m_ClassBrowserSelected ==
"")
292 RestoreSceneObjectsLinks();
294 ExecuteInitScripts();
352 GetGame().GetUIManager().Back();
384 GetGame().GetInput().ChangeGameFocus(-1);
387 GetGame().GetUIManager().ShowUICursor(
false);
389 if (
GetGame().GetUIManager().GetMenu())
390 GetGame().GetUIManager().GetMenu().OnHide();
399 GetGame().GetInput().ChangeGameFocus(1);
402 GetGame().GetUIManager().ShowUICursor(
true);
404 if (
GetGame().GetUIManager().GetMenu())
405 GetGame().GetUIManager().GetMenu().OnShow();
433 SceneEditorMenuCmdPopup(
"You cant delete player!");
444 if (GetSelectedSceneObject() !=
NULL && GetSelectedSceneObject() == obj)
474 vector size = GetSelectedSceneObject().GetSize();
494 if (GetSelectedSceneObject())
496 GetSelectedSceneObject().SetRotation(dir);
543 if (GetSelectedSceneObject())
609 if (GetSelectedSceneObject())
610 GetSelectedSceneObject().AddAttachment(
att_name);
620 if (GetSelectedSceneObject())
621 GetSelectedSceneObject().RemoveAttachment(
e);
660 m_ModuleConfigDebugProfile.SetSceneEditorDrawSelection(
draw);
670 return m_ModuleConfigDebugProfile.GetSceneEditorDrawSelection();
678 m_ModuleConfigDebugProfile.SetSceneEditorLoadPlayerPos(
save);
686 return m_ModuleConfigDebugProfile.GetSceneEditorLoadPlayerPos();
694 m_ModuleConfigDebugProfile.SetSceneEditorRotationAngle(
angle);
702 return m_ModuleConfigDebugProfile.GetSceneEditorRotationAngle();
713 m_SceneData = m_ModuleConfigScene.SceneDataLoad(
scene_name);
733 m_ModuleConfigScene.ClearParams();
734 m_ModuleConfigScene.SceneDataSave(m_SceneData);
735 SceneEditorMenuCmdSave();
770 m_ModuleConfigScene.SceneDuplicate(
scene_name);
794 return m_SceneData.GetNameScene();
804 m_SceneData.SetInitOvercast(
overcast);
805 m_SceneData.SetInitRain(
rain);
806 m_SceneData.SetInitFog(
fog);
815 m_SceneData.SetInitYear(
year);
816 m_SceneData.SetInitMonth(
month);
817 m_SceneData.SetInitDay(
day);
818 m_SceneData.SetInitHour(
hour);
819 m_SceneData.SetInitMinute(
minute);
833 SelectedObjectFocus();
847 string wrapped_script =
"void scMngMain() \n{\n PluginSceneManager se = GetPlugin(Type(\"PluginSceneManager\")); \n SceneObject this_obj = se.GetSceneObjectByIndex(" +
index.ToString() +
"); \n " +
cls +
" this_eai = this_obj.GetObject(); \n " +
script +
"\n}\n";
858 if (IsRulerActivated())
859 m_RulerActivated =
false;
861 m_RulerActivated =
true;
863 SceneEditorMenuCmdRefresh();
871 return m_RulerActivated;
891 for (
int i = 0;
i < m_RulerLines.Count(); ++
i)
892 m_RulerLines.Get(
i).Destroy();
893 m_RulerLines.Clear();
895 for (
int j = 0;
j < m_RulerSpheres.Count(); ++
j)
896 m_RulerSpheres.Get(
j).Destroy();
897 m_RulerSpheres.Clear();
905 m_RulerPoints.Clear();
939 return m_SceneData.GetSceneObjects();
950 return m_SceneData.GetScenePlayers();
961 return m_SceneData.GetSceneObjectsAll();
1009 return m_ModuleConfigScene.GetSceneList();
1023 if (GetSelectedSceneObject() !=
NULL && GetSelectedSceneObject() == obj)
1026 m_SceneData.DeleteSceneObject(obj);
1029 SceneEditorMenuCmdPopup(
"You cant delete player!");
1037 protected PluginDeveloper m_ModuleDeveloper;
1067 if (
GetGame().IsMultiplayer())
1084 if (GetSelectedSceneObject() && GetSelectedSceneObject() == obj)
1086 if (GetDrawSelection())
1107 SceneEditorMenuCmdRefresh();
1152 RulerClearVisuals();
1154 for (
int i = 0;
i < m_RulerPoints.Count(); ++
i)
1160 if (
i < m_RulerPoints.Count() - 1)
@ PLAYER
indicates if driver is controlled by player
const CallID CALL_ID_SCENE_EDITOR_COMMAND
Param CallMethod(CallID call_id, Param params)
class OptionSelectorMultistate extends OptionSelector class_name
PluginBase GetPlugin(typename plugin_type)
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
static void EnableFreeCameraSceneEditor(PlayerBase player)
void SelectAndFocusPlayerObject()
void ExecuteInitScripts()
void SetRotationAngle(int angle)
SceneObject m_SelectedObject
bool SceneCanDelete(string scene_name)
void SetLoadPlayerPos(bool save)
void SelectedObjectDuplicate()
void ~PluginSceneManager()
void Event_OnClickMiddle()
ref SceneData m_SceneData
array< ref ScenePlayer > GetScenePlayers()
void OnMouseWheel(int wheel)
void RestoreSceneObjectsLinks()
void DeleteSceneObject(SceneObject obj)
void SelectedObjectSetDamage(float value)
void SceneLoad(string scene_name)
void SelectedObjectSetPosZ(float value)
void LinkSceneObjects(SceneObject scene_object1, SceneObject scene_object2)
TStringArray GetSceneList()
void SceneDuplicate(string scene_name)
bool SceneDelete(string scene_name)
SceneObject GetSceneObjectByIndex(int index)
SceneObject Event_OnDoubleClick()
void SetDrawSelection(bool draw)
void SelectedObjectSetPosX(float value)
void PluginSceneManager()
SceneObject GetSceneObjectByEntity(EntityAI entity)
array< ref SceneObject > GetSceneObjects()
void SelectedObjectFocus()
void SceneEditorMenuCmdSave()
ref array< Shape > m_ShapesSceneObjects
static PluginSceneManager instance
void SelectedObjectSetPosY(float value)
ref array< Shape > m_RulerLines
void SceneEditorMenuCmdRefresh()
array< ref SceneObject > GetSceneObjectsAll()
void SelectObject(SceneObject obj)
void FreeCameraControlDisable()
void ExecuteEnforceScript(int index, SceneObject scene_object, string script)
float m_TimeLastClickRelease
vector GetMousePositionInScene()
float m_TimeLastClickPress
ref array< vector > m_RulerPoints
SceneObject GetSelectedSceneObject()
string m_ClassBrowserSelected
override void OnDestroy()
void SelectedObjectAddAttachment(string att_name)
void UnlinkSceneObjects(SceneObject scene_object1, SceneObject scene_object2)
PluginConfigScene m_ModuleConfigScene
SceneData GetLoadedScene()
bool AreSceneObjectsLinked(SceneObject scene_object1, SceneObject scene_object2)
void SceneRename(string scene_name, string new_name)
void DeleteSelectedObject()
void SetWeather(float overcast, float rain, float fog, float wind_force)
PluginConfigDebugProfile m_ModuleConfigDebugProfile
static PluginSceneManager GetInstance()
void FreeCameraControlEnable()
void SelectedObjectSetRot(float dir)
void SelectedObjectRemoveAttachment(EntityAI e)
void SelectClassName(string class_name)
void SetDate(int year, int month, int day, int hour, int minute)
ref array< Shape > m_RulerSpheres
ref map< int, KeyBinding > m_KeyBindings
void SceneEditorMenuCmdPopup(string message)
int GetSelectedSceneObjectIndex()
void EditorShapeDeselect()
array< SceneObject > GetLinkedSceneObjects()
void SetRotation(float rot)
void AddAttachment(string att_name)
void EditorLineAdd(SceneObject obj)
void EditorLineRemove(SceneObject obj)
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
const string STRING_EMPTY