private void ForbidPlayerListBox_SelectedIndexChanged(object sender, EventArgs e) { int selectedPlayer = System.Convert.ToInt32(ForbidPlayerListBox.SelectedItem.ToString()) - 1; //foreach (PlayersPlayer p in mSimMain.PlayerData.Player) //{ // if(p. //} PlayersPlayer p = mSimMain.PlayerData.Player[selectedPlayer]; this.ForbidSquadOptionChooser.Enabled = true; this.ForbidTechsOptionChooser.Enabled = true; this.ForbidUnitsOptionChooser.Enabled = true; TriggerSystemMain.Init(); ForbidSquadOptionChooser.SetOptions(TriggerSystemMain.mSimResources.mProtoSquadData.mProtoSquadList); ForbidSquadOptionChooser.BoundSelectionList = p.mForbidSquads; ForbidUnitsOptionChooser.SetOptions(TriggerSystemMain.mSimResources.mObjectTypeData.mObjectTypeList); ForbidUnitsOptionChooser.BoundSelectionList = p.mForbidObjects; ForbidTechsOptionChooser.SetOptions(TriggerSystemMain.mSimResources.mTechData.mTechList); ForbidTechsOptionChooser.BoundSelectionList = p.mForbidTechs; ForbidSquadOptionChooser.AllowRepeats = false; ForbidSquadOptionChooser.AutoSort = true; ForbidUnitsOptionChooser.AllowRepeats = false; ForbidUnitsOptionChooser.AutoSort = true; ForbidTechsOptionChooser.AllowRepeats = false; ForbidTechsOptionChooser.AutoSort = true; PlayerSettingsChanged(); }
public PlayerSettings() { TriggerSystemMain.Init(); InitializeComponent(); this.PopSettingsList.mListDataObjectType = typeof(PlayerPop); PopSettingsList.AddMetaDataForProp("PlayerPop", "PopType", "SimpleEnumeration", TriggerSystemMain.mSimResources.mGameData.mPopTypes.ToArray()); PopSettingsList.SetTypeEditor("PlayerPop", "PopType", typeof(EnumeratedProperty)); PopSettingsList.AddMetaDataForProp("PlayerPop", "Max", "Min", 0); PopSettingsList.AddMetaDataForProp("PlayerPop", "Max", "Max", 1000); PopSettingsList.AddMetaDataForProp("PlayerPop", "Pop", "Min", 0); PopSettingsList.AddMetaDataForProp("PlayerPop", "Pop", "Max", 1000); PopSettingsList.WrapContents = false; PopSettingsList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(PopSettingsList_AnyObjectPropertyChanged); }
public ScriptPage() { InitializeComponent(); TriggerSystemMain.Init(); //this.previewNavWindow1.MasterControl = triggerHostArea1; triggerHostArea1.ViewChanged += new EventHandler(triggerHostArea1_ViewChanged); previewNavWindow1.BorderStyle = BorderStyle.FixedSingle; TriggerData = new TriggerRoot(); triggerHostArea1.ScanComplete += new EventHandler(triggerHostArea1_ScanComplete); ErrorPanel.Click += new EventHandler(ErrorPanel_Click); buildMode.Items.AddRange(Enum.GetNames(typeof(TriggerFinalBake.eBuildMode))); buildMode.SelectedIndex = 0; }
public TriggerEditor() { try { InitializeComponent(); triggerHostArea1.ViewChanged += new EventHandler(triggerHostArea1_ViewChanged); TriggerSystemMain.Init(); previewNavWindow1.BorderStyle = BorderStyle.FixedSingle; mMinPanelSize = panel1.Size; mMaxPanelSize = new Size(mMinPanelSize.Width + 800, mMaxPanelSize.Height + 600); this.Resize += new EventHandler(TriggerEditor_Resize); } catch (System.Exception ex) { } triggerHostArea1.ScanComplete += new EventHandler(triggerHostArea1_ScanComplete); ErrorPanel.Click += new EventHandler(ErrorPanel_Click); }
public TriggerDataDefinitionPage() { InitializeComponent(); TriggerSystemMain.Init(); mTriggerDefinitionFilename = CoreGlobals.getWorkPaths().mEditorSettings + "\\triggerDescription.xml"; mTriggerDefinitionDBIDs = CoreGlobals.getWorkPaths().mEditorSettings + "\\triggerDBIDs.xml"; ConditionsListBox.SelectedIndexChanged += new EventHandler(EffectsConditionsListBox_SelectedIndexChanged); EffectsListBox.SelectedIndexChanged += new EventHandler(EffectsListBox_SelectedIndexChanged); VersionListBox.SelectedIndexChanged += new EventHandler(VersionListBox_SelectedIndexChanged); ItemPropertyGrid.AddMetaDataForProp("ConditionDefinition", "Documentation", "Multiline", true); ItemPropertyGrid.AddMetaDataForProp("EffectDefinition", "Documentation", "Multiline", true); ItemPropertyGrid.IgnoreProperties("ConditionDefinition", new string[] { "Type", "InParameterDefinitions", "OutParameterDefinitions", "ParameterConversionOverrides" }); ItemPropertyGrid.IgnoreProperties("EffectDefinition", new string[] { "Type", "InParameterDefinitions", "OutParameterDefinitions", "ParameterConversionOverrides" }); ItemPropertyGrid.AddMetaDataForProps("ConditionDefinition", new string[] { "Version", "DBID", "MaxVarID" }, "ReadOnly", true); ItemPropertyGrid.AddMetaDataForProps("EffectDefinition", new string[] { "Version", "DBID", "MaxVarID" }, "ReadOnly", true); ItemPropertyGrid.AnyPropertyChanged += new ObjectEditorControl.PropertyChanged(On_AnyPropertyChanged); InVariblesList.AddMetaDataForProp("InParameterDefintion", "Type", "SimpleEnumeration", TriggerSystemMain.mTriggerDefinitions.GetTypeNames()); InVariblesList.SetTypeEditor("InParameterDefintion", "Type", typeof(EnumeratedProperty)); InVariblesList.AddMetaDataForProp("InParameterDefintion", "SigID", "ReadOnly", true); InVariblesList.AddMetaDataForProp("InParameterDefintion", "Type", "UpdateEvent", true); InVariblesList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(InVariblesList_SelectedObjectPropertyChanged); InVariblesList.NewObjectAdded += new BasicTypedSuperList.ObjectChanged(InVariblesList_NewObjectAdded); InVariblesList.mListDataObjectType = typeof(InParameterDefintion); InVariblesList.AutoScroll = true; InVariblesList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(On_AnyPropertyChanged); OutVariablesList.AddMetaDataForProp("OutParameterDefition", "Type", "SimpleEnumeration", TriggerSystemMain.mTriggerDefinitions.GetTypeNames()); OutVariablesList.SetTypeEditor("OutParameterDefition", "Type", typeof(EnumeratedProperty)); OutVariablesList.AddMetaDataForProp("OutParameterDefition", "SigID", "ReadOnly", true); OutVariablesList.AddMetaDataForProp("OutParameterDefition", "Type", "UpdateEvent", true); OutVariablesList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(OutVariablesList_SelectedObjectPropertyChanged); OutVariablesList.NewObjectAdded += new BasicTypedSuperList.ObjectChanged(OutVariablesList_NewObjectAdded); OutVariablesList.mListDataObjectType = typeof(OutParameterDefition); OutVariablesList.AutoScroll = true; OutVariablesList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(On_AnyPropertyChanged); ConversionList.AutoScroll = true; ConversionList.AddMetaDataForProp("ParameterConversionOverride", "OldParameter", "StringIntEnumeration", new Pair <List <int>, List <string> >()); ConversionList.AddMetaDataForProp("ParameterConversionOverride", "NewParameter", "StringIntEnumeration", new Pair <List <int>, List <string> >()); ConversionList.SetTypeEditor("ParameterConversionOverride", "OldParameter", typeof(EnumeratedProperty)); ConversionList.SetTypeEditor("ParameterConversionOverride", "NewParameter", typeof(EnumeratedProperty)); ConversionList.mListDataObjectType = typeof(ParameterConversionOverride); LoadData(); LoadUI(); UpdateVersionsButton.Visible = false; SaveToNewVersionButton.Enabled = false; SaveToSelectedButton.Enabled = false; this.SaveButton.Visible = false; this.SaveNewNameButton.Click += new EventHandler(SaveNewNameButton_Click); NameTextBox.TextChanged += new EventHandler(NameTextBox_TextChanged); SaveNewNameButton.Enabled = false; //add in the template editor //TemplateVersionControl tvc = new TemplateVersionControl(); //tabPage2.Controls.Add(tvc); //tvc.Dock = DockStyle.Fill; }
public TriggerTemplatePage() { InitializeComponent(); TriggerSystemMain.Init(); triggerHostArea1.ViewChanged += new EventHandler(triggerHostArea1_ViewChanged); previewNavWindow1.BorderStyle = BorderStyle.FixedSingle; TemplateAttributesPropertyGrid.IgnoreProperties("TriggerTemplateMapping", new string[] { "InputMappings", "OutputMappings", "TriggerInputs", "TriggerOutputs", "GroupID", "ID", "X", "Y", "Name", "CommentOut" }); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeX", "Min", 30); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeX", "Max", 800); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeY", "Min", 30); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeY", "Max", 500); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "FileFilter", "Images (*.bmp)|*.bmp"); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "RootDirectory", CoreGlobals.getWorkPaths().mBaseDirectory); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "StartingDirectory", Path.Combine(CoreGlobals.getWorkPaths().mAppIconDir, "TriggerEditor")); TemplateAttributesPropertyGrid.SetTypeEditor("TriggerTemplateMapping", "Image", typeof(FileNameProperty)); TemplateAttributesPropertyGrid.AnyPropertyChanged += new ObjectEditorControl.PropertyChanged(onAnyPropertyChanged); InputVarsBasicTypedSuperList.UseLabels = false; OutputVarsBasicTypedSuperList.UseLabels = false; InputTriggersBasicTypedSuperList.UseLabels = false; OutputTriggersBasicTypedSuperList.UseLabels = false; InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "Type", "ReadOnly", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "ID", "Ignore", true); //InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "Optional", "Ignore", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "SigID", "Ignore", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "BindID", "TriggerNamespace", mMainTriggerSystem.MainNamespace); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "BindID", "UpdateEvent", true); InputVarsBasicTypedSuperList.SetTypeEditor("TriggersTemplateInputVariable", "BindID", typeof(VariableIDProperty)); InputVarsBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateInputVariable); InputVarsBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(basicTypedSuperList1_SelectedObjectPropertyChanged); InputVarsBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); InputVarsBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "Type", "ReadOnly", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "ID", "Ignore", true); //OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "Optional", "Ignore", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "SigID", "Ignore", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "BindID", "TriggerNamespace", mMainTriggerSystem.MainNamespace); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "BindID", "UpdateEvent", true); OutputVarsBasicTypedSuperList.SetTypeEditor("TriggersTemplateOutputVariable", "BindID", typeof(VariableIDProperty)); OutputVarsBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateOutputVariable); OutputVarsBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(basicTypedSuperList1_SelectedObjectPropertyChanged); OutputVarsBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); OutputVarsBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); InputTriggersBasicTypedSuperList.IgnoreProperties("TriggersTemplateInputActionBinder", new string[] { "Color", "TargetIDs", "_TargetID", "BindID" }); InputTriggersBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputActionBinder", "_BindID", "ReadOnly", true); InputTriggersBasicTypedSuperList.SetTypeEditor("TriggersTemplateInputActionBinder", "_BindID", typeof(TriggerBindIDProperty)); InputTriggersBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(InputTriggersBasicTypedSuperList_SelectedObjectPropertyChanged); InputTriggersBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateInputActionBinder); InputTriggersBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); InputTriggersBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); OutputTriggersBasicTypedSuperList.IgnoreProperties("TriggersTemplateOutputActionBinder", new string[] { "Color", "TargetIDs", "_TargetID", "BindID" }); OutputTriggersBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputActionBinder", "_BindID", "ReadOnly", true); OutputTriggersBasicTypedSuperList.SetTypeEditor("TriggersTemplateOutputActionBinder", "_BindID", typeof(TriggerBindIDProperty)); OutputTriggersBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(OutputTriggersBasicTypedSuperList_SelectedObjectPropertyChanged); OutputTriggersBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateOutputActionBinder); OutputTriggersBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); OutputTriggersBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); TriggerRoot trigroot = new TriggerRoot(); mFakeTriggerSystem.TriggerData = trigroot; triggerHostArea2.CurrentTriggerNamespace = mFakeTriggerSystem.MainNamespace; TemplateDefinition = new TriggerTemplateDefinition(); }