public string GetParameterStringById(int type, int paramId, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); if (baseTypeInformation == null) { return("Unused Parameter"); } switch (paramId) { case 1: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString1) ? baseTypeInformation.parameterString1 : "Unused Parameter"); case 2: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString2) ? baseTypeInformation.parameterString2 : "Unused Parameter"); case 3: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString3) ? baseTypeInformation.parameterString3 : "Unused Parameter"); case 4: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString4) ? baseTypeInformation.parameterString4 : "Unused Parameter"); case 5: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString5) ? baseTypeInformation.parameterString5 : "Unused Parameter"); case 6: return(!String.IsNullOrEmpty(baseTypeInformation.parameterString6) ? baseTypeInformation.parameterString6 : "Unused Parameter"); default: return("Unused Parameter"); } }
public string GetParameterTooltipById(int type, int paramId, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); switch (paramId) { case 1: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip1 : String.Empty); case 2: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip2 : String.Empty); case 3: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip3 : String.Empty); case 4: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip4 : String.Empty); case 5: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip5 : String.Empty); case 6: return(baseTypeInformation != null ? baseTypeInformation.parameterTooltip6 : String.Empty); default: return(String.Empty); } }
public string GetParameterStringById(int type, int paramId, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); switch (paramId) { case 1: return(baseTypeInformation != null ? baseTypeInformation.parameterString1 : "Unused Parameter"); case 2: return(baseTypeInformation != null ? baseTypeInformation.parameterString2 : "Unused Parameter"); case 3: return(baseTypeInformation != null ? baseTypeInformation.parameterString3 : "Unused Parameter"); case 4: return(baseTypeInformation != null ? baseTypeInformation.parameterString4 : "Unused Parameter"); case 5: return(baseTypeInformation != null ? baseTypeInformation.parameterString5 : "Unused Parameter"); case 6: return(baseTypeInformation != null ? baseTypeInformation.parameterString6 : "Unused Parameter"); default: return("Unused Parameter"); } }
private BaseTypeInformation GetTypeByScriptTypeId(int type, ScriptTypeId scriptTypeId) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: return GetEventTypeInformationById(type); case ScriptTypeId.ScriptTypeAction: return GetActionTypeInformationById(type); case ScriptTypeId.ScriptTypeTarget: return GetTargetTypeInformationById(type); default: return null; } }
private BaseTypeInformation GetTypeByScriptTypeId(int type, ScriptTypeId scriptTypeId) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: return(GetEventTypeInformationById(type)); case ScriptTypeId.ScriptTypeAction: return(GetActionTypeInformationById(type)); case ScriptTypeId.ScriptTypeTarget: return(GetTargetTypeInformationById(type)); default: return(null); } }
private async Task HandleComboBoxTypeIdSelectedIndexChanged(ComboBox comboBox, TextBox textBox, ScriptTypeId scriptTypeId) { textBox.Text = comboBox.SelectedIndex.ToString(); textBox.SelectionStart = 3; //! Set cursor to end of text if (!runningConstructor) { ChangeParameterFieldsBasedOnType(); UpdatePermanentTooltipOfTypes(comboBox, scriptTypeId); } if (listViewSmartScripts.SelectedItems.Count > 0) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: listViewSmartScripts.SelectedSmartScript.event_type = comboBox.SelectedIndex; break; case ScriptTypeId.ScriptTypeAction: listViewSmartScripts.SelectedSmartScript.action_type = comboBox.SelectedIndex; break; case ScriptTypeId.ScriptTypeTarget: listViewSmartScripts.SelectedSmartScript.target_type = comboBox.SelectedIndex; break; } listViewSmartScripts.ReplaceSmartScript(listViewSmartScripts.SelectedSmartScript); await GenerateCommentForSmartScript(listViewSmartScripts.SelectedSmartScript); } }
private void UpdatePermanentTooltipOfParameter(Label labelToTarget, int paramId, ComboBox comboBoxToTarget, ScriptTypeId scriptTypeId) { string toolTipOfType = SAI_Editor_Manager.Instance.GetParameterTooltipById(comboBoxToTarget.SelectedIndex, paramId, scriptTypeId); if (!String.IsNullOrWhiteSpace(toolTipOfType)) { labelPermanentTooltipTextParameters.Text = toolTipOfType; labelPermanentTooltipParameterTitleTypes.Text = comboBoxToTarget.SelectedItem + " - " + labelToTarget.Text; } }
private string GetSelectedItemByScriptTypeId(ScriptTypeId scriptTypeId) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: return comboBoxEventType.SelectedItem.ToString(); case ScriptTypeId.ScriptTypeAction: return comboBoxActionType.SelectedItem.ToString(); case ScriptTypeId.ScriptTypeTarget: return comboBoxTargetType.SelectedItem.ToString(); } return String.Empty; }
private int GetSelectedIndexByScriptTypeId(ScriptTypeId scriptTypeId) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: return comboBoxEventType.SelectedIndex; case ScriptTypeId.ScriptTypeAction: return comboBoxActionType.SelectedIndex; case ScriptTypeId.ScriptTypeTarget: return comboBoxTargetType.SelectedIndex; } return 0; }
private void UpdatePermanentTooltipOfTypes(ComboBox comboBoxToTarget, ScriptTypeId scriptTypeId) { string toolTipOfType = SAI_Editor_Manager.Instance.GetScriptTypeTooltipById(comboBoxToTarget.SelectedIndex, scriptTypeId); string toolTipTitleOfType = comboBoxToTarget.SelectedItem.ToString(); if (!String.IsNullOrWhiteSpace(toolTipOfType) && !String.IsNullOrWhiteSpace(toolTipTitleOfType)) { labelPermanentTooltipTextTypes.Text = toolTipOfType; labelPermanentTooltipTitleTypes.Text = toolTipTitleOfType; } }
public string GetParameterStringById(int type, int paramId, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); switch (paramId) { case 1: return baseTypeInformation != null ? baseTypeInformation.parameterString1 : String.Empty; case 2: return baseTypeInformation != null ? baseTypeInformation.parameterString2 : String.Empty; case 3: return baseTypeInformation != null ? baseTypeInformation.parameterString3 : String.Empty; case 4: return baseTypeInformation != null ? baseTypeInformation.parameterString4 : String.Empty; case 5: return baseTypeInformation != null ? baseTypeInformation.parameterString5 : String.Empty; case 6: return baseTypeInformation != null ? baseTypeInformation.parameterString6 : String.Empty; default: return String.Empty; } }
public string GetScriptTypeTooltipById(int type, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); return baseTypeInformation != null ? baseTypeInformation.tooltip : String.Empty; }
private async Task HandleComboBoxTypeIdSelectedIndexChanged(ComboBox comboBox, TextBox textBox, ScriptTypeId scriptTypeId) { try { textBox.Text = comboBox.SelectedIndex.ToString(); textBox.SelectionStart = 3; //! Set cursor to end of text if (!MainForm.runningConstructor) { ChangeParameterFieldsBasedOnType(); UpdateStaticTooltipOfTypes(comboBox, scriptTypeId); } SmartScriptList list = (SmartScriptList)customObjectListView.List; if (customObjectListView.SelectedObjects.Count > 0) { switch (scriptTypeId) { case ScriptTypeId.ScriptTypeEvent: list.SelectedScript.event_type = comboBox.SelectedIndex; break; case ScriptTypeId.ScriptTypeAction: list.SelectedScript.action_type = comboBox.SelectedIndex; break; case ScriptTypeId.ScriptTypeTarget: list.SelectedScript.target_type = comboBox.SelectedIndex; break; } customObjectListView.List.ReplaceScript(list.SelectedScript); await GenerateCommentForSmartScript(list.SelectedScript); } } catch (Exception) { } }
public string GetScriptTypeTooltipById(int type, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); return(baseTypeInformation != null ? baseTypeInformation.tooltip : String.Empty); }
public string GetParameterStringById(int type, int paramId, ScriptTypeId scriptTypeId) { BaseTypeInformation baseTypeInformation = GetTypeByScriptTypeId(type, scriptTypeId); if (baseTypeInformation == null) return "Unused Parameter"; switch (paramId) { case 1: return !String.IsNullOrEmpty(baseTypeInformation.parameterString1) ? baseTypeInformation.parameterString1 : "Unused Parameter"; case 2: return !String.IsNullOrEmpty(baseTypeInformation.parameterString2) ? baseTypeInformation.parameterString2 : "Unused Parameter"; case 3: return !String.IsNullOrEmpty(baseTypeInformation.parameterString3) ? baseTypeInformation.parameterString3 : "Unused Parameter"; case 4: return !String.IsNullOrEmpty(baseTypeInformation.parameterString4) ? baseTypeInformation.parameterString4 : "Unused Parameter"; case 5: return !String.IsNullOrEmpty(baseTypeInformation.parameterString5) ? baseTypeInformation.parameterString5 : "Unused Parameter"; case 6: return !String.IsNullOrEmpty(baseTypeInformation.parameterString6) ? baseTypeInformation.parameterString6 : "Unused Parameter"; default: return "Unused Parameter"; } }