public void Init(Game_Interface Interface, SceneObject CurrentSceneObject) { this._Interface = Interface; this._CurrentSceneObject = CurrentSceneObject; string SceneObjectTypeString = ""; if (CurrentSceneObject.Type == SceneObjectType.DrawnSceneObject) { SceneObjectTypeString = "DrawnSceneObject"; } else if (CurrentSceneObject.Type == SceneObjectType.ScriptSceneObject) { SceneObjectTypeString = "ScriptSceneObject"; } else { SceneObjectTypeString = "Undefined"; } _Name = new PropertiesInput_String("Name", CurrentSceneObject.Name, new EventHandler(NameChanged)); this.AddControl(_Name); PropertiesInput_Label Type = new PropertiesInput_Label("Type", SceneObjectTypeString); this.AddControl(Type); for (int i = 0; i < CurrentSceneObject.Events.EventList.Count; i++) { for (int j = 0; j < CurrentSceneObject.Events.EventList[i].Events.Count; j++) { Properties_Event NewEvent = new Properties_Event(); NewEvent.Init(_Interface, _CurrentSceneObject, Scene_Interface.GetPossibleEventNames(_Interface.CurrentScene, _Interface.CurrentScene.Events.EventList[i].ID).IndexOf(_Interface.CurrentScene.Events.EventList[i].Events[j].ID), i, true); this.AddControl(NewEvent); } } _AddNewEvent = new PropertiesInput_Button("", "Add New Event", new EventHandler(AddNewEvent_Click)); this.AddControl(_AddNewEvent); }
private void RemoveEvent(object sender, EventArgs e) { if (_Scene != null) { _Scene.Events.Events(_EventTypeString[_Type]).RemoveAt(_Scene.Events.Events(_EventTypeString[_Type]).IndexOf( Scene_Interface.GetPossibleEvents(_Scene, _EventTypeString[_Type])[_Index])); } else { _SceneObject.Events.Events(_EventTypeString[_Type]).RemoveAt(_SceneObject.Events.Events(_EventTypeString[_Type]).IndexOf( Scene_Interface.GetPossibleEvents(_SceneObject.ParentScene, _EventTypeString[_Type])[_Index])); } this.Visible = false; }
private void LockEvent(object sender, EventArgs e) { if (_Index == -1) { return; } if (_Scene != null) { _Scene.Events.Events(_EventTypeString[_Type]).Add(Scene_Interface.GetPossibleEvents(_Scene, _EventTypeString[_Type])[_Index]); Init(_Interface, _Scene, _Type, _Index, true); } else { _SceneObject.Events.Events(_EventTypeString[_Type]).Add(Scene_Interface.GetPossibleEvents(_SceneObject.ParentScene, _EventTypeString[_Type])[_Index]); Init(_Interface, _SceneObject, _Type, _Index, true); } }
public void Init(Game_Interface Interface, object EventCaller, int Type, int Index, bool Locked) { this._Type = Type; this._Index = Index; this._Interface = Interface; _EventTypeString = new List <string>(); List <string> EventScriptString = new List <string>(); if (EventCaller.GetType().IsSubclassOf(typeof(Scene))) { this._Scene = (Scene)EventCaller; for (int i = 0; i < _Scene.Events.EventList.Count; i++) { _EventTypeString.Add(_Scene.Events.EventList[i].ID); } EventScriptString = Scene_Interface.GetPossibleEventNames(_Scene, _Scene.Events.EventList[Type].ID); } else if (EventCaller.GetType().IsSubclassOf(typeof(SceneObject))) { this._SceneObject = (SceneObject)EventCaller; for (int i = 0; i < _SceneObject.Events.EventList.Count; i++) { _EventTypeString.Add(_SceneObject.Events.EventList[i].ID); } EventScriptString = Scene_Interface.GetPossibleEventNames(_SceneObject.ParentScene, _SceneObject.Events.EventList[Type].ID); } this.ClearControls(); _EventTypes = new PropertiesInput_Combo("Type", _EventTypeString, Type, new EventHandler(EventTypeUpdate)); this.AddControl(_EventTypes); _PossibleEvents = new PropertiesInput_Combo("Event", EventScriptString, Index, new EventHandler(EventScriptUpdate)); this.AddControl(_PossibleEvents); if (Locked) { _EventTypes.Lock(); _PossibleEvents.Lock(); PropertiesInput_Button Delete = new PropertiesInput_Button("", "Remove Event", new EventHandler(RemoveEvent)); this.AddControl(Delete); } else { PropertiesInput_Button Lock = new PropertiesInput_Button("", "Lock", new EventHandler(LockEvent)); this.AddControl(Lock); } this.SetTitleColor(Color.FromArgb(80, 80, 80)); }
public void Init(Game_Interface Interface, Scene CurrentScene) { this._Scene = CurrentScene; this._Interface = Interface; _SceneName = new PropertiesInput_String("Name", CurrentScene.Name, new EventHandler(Name_Update)); this.AddControl(_SceneName); for (int i = 0; i < _Scene.Events.EventList.Count; i++) { for (int j = 0; j < _Scene.Events.EventList[i].Events.Count; j++) { Properties_Event NewEvent = new Properties_Event(_Interface, _Scene, i, Scene_Interface.GetPossibleEventNames(_Scene, _Scene.Events.EventList[i].ID).IndexOf(_Scene.Events.EventList[i].Events[j].ID), true); this.AddControl(NewEvent); } } _AddNewEvent = new PropertiesInput_Button("", "Add New Event", new EventHandler(AddNewEvent_Click)); this.AddControl(_AddNewEvent); }