public PopulaceStandard() { ClassPath = "/chara/npc/populace/"; ClassName = "PopulaceStandard"; ClassCode = 0x30400000; EventConditions.Add(new EventCondition { Opcode = ServerOpcode.TalkEvent, EventName = "talkDefault", Priority = 0x04 }); EventConditions.Add(new EventCondition { Opcode = ServerOpcode.NoticeEvent, EventName = "noticeEvent", IsDisabled = 0x01 }); }
/// <summary> /// Création d'une Nouvelle page dans l'EventManager /// </summary> private void EventManager_NewPage(object sender, EventArgs e) { // Instanciation d'une nouvelle Page et d'un VO_Page correspondant, puis sélection de la page int TabPageIndex = PagesManager.TabPages.Count; VO_Page NewPage = null; if (CurrentEvent.PageList[0].PageEventType == Enums.EventType.Character) { NewPage = ObjectsFactory.CreatePage(CurrentEvent.PageList[0].PageEventType, CurrentEvent.PageList.Count + 1, ((VO_StageCharacter)CurrentStageObject).CharacterId); } else { NewPage = ObjectsFactory.CreatePage(CurrentEvent.PageList[0].PageEventType, CurrentEvent.PageList.Count + 1, Guid.Empty); } CurrentEvent.PageList.Add(NewPage); TabPage NewTabPage = new TabPage(Convert.ToString(TabPageIndex + 1)); foreach (Control CurrentControl in CurrentControlList) { NewTabPage.Controls.Add(CurrentControl); } PagesManager.TabPages.Add(NewTabPage); PagesManager.SelectedIndex = TabPageIndex; PageIndex = TabPageIndex; //Selection de la valeur par défaut la nouvelle page dans la ComboBox des Types d'execution de Trigger if (CurrentStageObject is VO_StageAnimation) { AnimationConditions.LoadControls(NewPage, ((VO_StageAnimation)CurrentStageObject).AnimationId); } else if (CurrentStageObject is VO_StageHotSpot) { EventConditions.LoadControls(NewPage); } else if (CurrentStageObject is VO_StageCharacter) { CharacterConditions.LoadControls(NewPage, ((VO_StageCharacter)CurrentStageObject).CharacterId); } }
/// <summary> /// Fonction Générique d'EventManager de mise à jour des champs selon la valeur de Page /// </summary> private void UpdateEventManagerControlFromPage(VO_Page CurrentPage) { //Actions chkAction.CheckedChanged -= new EventHandler(EventManager_ActivateAction); chkAction.Checked = CurrentPage.ActionActivated; CheckActionState(); chkAction.CheckedChanged += new EventHandler(EventManager_ActivateAction); ddpAction.SelectedValueChanged -= new EventHandler(EventManager_ActionSelectionChanged); ddpAction.DataSource = GameCore.Instance.GetActions(); ddpAction.DisplayMember = "Title"; ddpAction.ValueMember = "Id"; ddpAction.SelectedValue = CurrentPage.ActionId; ddpAction.SelectedValueChanged += new EventHandler(EventManager_ActionSelectionChanged); //Boutons chkTrigger.CheckedChanged -= new EventHandler(EventManager_ActivateTrigger); chkTrigger.Checked = CurrentPage.TriggerActivated; CheckTriggerState(); chkTrigger.CheckedChanged += new EventHandler(EventManager_ActivateTrigger); triggerButton1.ValueChanged -= new EventHandler(EventManager_TriggerSelectedChanged); triggerButton1.TriggerGuid = CurrentPage.TriggerId; triggerButton1.ValueChanged += new EventHandler(EventManager_TriggerSelectedChanged); //Variables chkVariable.CheckedChanged -= new EventHandler(EventManager_ActivateVariable); chkVariable.Checked = CurrentPage.VariableActivated; CheckVariableState(); chkVariable.CheckedChanged += new EventHandler(EventManager_ActivateVariable); txtVariableValue.TextChanged -= new EventHandler(EventManager_VariableValue_Changed); txtVariableValue.Text = Convert.ToString(CurrentPage.VariableValue); txtVariableValue.TextChanged += new EventHandler(EventManager_VariableValue_Changed); variableButton1.ValueChanged -= new EventHandler(EventManager_VariableSelectedChanged); variableButton1.VariableGuid = CurrentPage.VariableId; variableButton1.ValueChanged += new EventHandler(EventManager_VariableSelectedChanged); //Charaters chkCharacter.CheckedChanged -= new EventHandler(EventManager_ActivateCharacter); chkCharacter.Checked = CurrentPage.CharacterActivated; CheckCharacterState(); chkCharacter.CheckedChanged += new EventHandler(EventManager_ActivateCharacter); characterButton1.ValueChanged -= new EventHandler(EventManager_CharacterSelectedChanged); characterButton1.CharacterGuid = CurrentPage.CharacterId; characterButton1.ValueChanged += new EventHandler(EventManager_CharacterSelectedChanged); //Items chkItem.CheckedChanged -= new EventHandler(EventManager_ActivateItem); chkItem.Checked = CurrentPage.ItemActivated; CheckItemState(); chkItem.CheckedChanged += new EventHandler(EventManager_ActivateItem); itemButton1.ValueChanged -= new EventHandler(EventManager_ItemSelectedChanged); itemButton1.ItemGuid = CurrentPage.ItemId; itemButton1.ValueChanged += new EventHandler(EventManager_ItemSelectedChanged); //Sous controles if (CurrentStageObject is VO_StageAnimation) { AnimationConditions.LoadControls(CurrentPage, ((VO_StageAnimation)CurrentStageObject).AnimationId); } else if (CurrentStageObject is VO_StageHotSpot) { EventConditions.LoadControls(CurrentPage); } else if (CurrentStageObject is VO_StageCharacter) { CharacterConditions.LoadControls(CurrentPage, ((VO_StageCharacter)CurrentStageObject).CharacterId); } ScriptManager.LoadScript(CurrentPage.Script); }