/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == "<OBSOLETE_COUNTECM>") { // Convert countECM to countEMP. value = "<DEFAULT>"; container.SetAttribute("property", "countEMP"); } if (value == "<OBSOLETE_MISSILESTORESECM>") { // Convert missileStoresECM to missileStoresEMP. value = "<DEFAULT>"; container.SetAttribute("property", "missileStoresEMP"); } //if (value == "<INVALID_PROPERTY>") //{ // value = "<DEFAULT>"; // container.SetAttribute("property", "positionX"); //} if (Mission.Current.Loading && value == "<READ_ONLY>") { Log.Add("Warning! Attempt to add to read-only property " + container.GetAttribute("property") + " detected in event: " + container.Statement.Parent.Name + "!"); } if (Mission.Current.Loading && value == "<UNKNOWN_PROPERTY>") { Log.Add("Warning! Unknown property " + container.GetAttribute("property") + " detected in event: " + container.Statement.Parent.Name + "!"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //name { container.SetAttribute("use_gm_selection", null); } else if (container.GetAttribute("use_gm_selection") == null) // use_gm_sel { container.SetAttribute("use_gm_selection", ""); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == "<OBSOLETE_COUNTECM>") { // Convert countECM to countEMP. value = "<INT0...+INF>"; container.SetAttribute("property", "countEMP"); } if (value == "<OBSOLETE_MISSILESTORESECM>") { // Convert missileStoresECM to missileStoresEMP. value = "<INT0...+INF>"; container.SetAttribute("property", "missileStoresEMP"); } if (value == "<BOOLYESNO>") { string flag = container.GetAttribute("value"); if (flag == null || !Helper.IntTryParse(flag)) { container.SetAttribute("value", "0"); } else if (Helper.StringToInt(flag) == 1) { container.SetAttribute("value", "1"); } else { container.SetAttribute("value", "0"); } } //if (value == "<INVALID_PROPERTY>") //{ // value = "<DEFAULT>"; // container.SetAttribute("property", "positionX"); //} if (Mission.Current.Loading && value == "<READ_ONLY>") { Log.Add("Warning! Attempt to set read-only property " + container.GetAttribute("property") + " detected in event: " + container.Statement.Parent.Name + "!"); } if (Mission.Current.Loading && value == "<UNKNOWN_PROPERTY>") { Log.Add("Warning! Unknown property " + container.GetAttribute("property") + " detected in event: " + container.Statement.Parent.Name + "!"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == "<INVALID_TYPE>") { value = "<NOTHING>"; container.SetAttribute("type", "PROCEED_TO_EXIT"); } else if (value == "<OBSOLETE_ELITE_AI>") { // Convert ELITE_AI to SPCL_AI. value = "<NOTHING>"; container.SetAttribute("type", "SPCL_AI"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[HullID]) //hullID { container.SetAttributeIfNull("hullID", ""); container.SetAttribute("hullKeys", null); container.SetAttribute("raceKeys", null); } if (value == Choices[HullRaceKey]) //hullKeys / raceKeys { container.SetAttribute("hullID", null); container.SetAttributeIfNull("hullKeys", ""); container.SetAttributeIfNull("raceKeys", ""); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[1]) //convert { string msg = "Whale statement (name: \"" + (container.GetAttribute("name") ?? "<null>") + "\" "; value = "Monster"; container.Statement.Name = value; if (!String.IsNullOrEmpty(container.GetAttribute("targetName"))) { //ATTACK container.SetAttribute("type", "TARGET_THROTTLE"); container.SetAttribute("value1", container.GetAttribute("scriptThrottle")); msg += "targetName: \"" + container.GetAttribute("targetName") + "\" scriptThrottle \"" + container.GetAttribute("scriptThrottle") + ") was converted to add_ai \"TARGET_THROTTLE\" statement"; } else { //POINT_THROTTLE container.SetAttribute("type", "POINT_THROTTLE"); container.SetAttribute("value1", container.GetAttribute("pointX")); container.SetAttribute("value2", container.GetAttribute("pointY")); container.SetAttribute("value3", container.GetAttribute("pointZ")); container.SetAttribute("value4", container.GetAttribute("scriptThrottle")); msg += "target point: \"" + container.GetAttribute("pointX") + ", " + container.GetAttribute("pointY") + ", " + container.GetAttribute("pointZ") + "\" scriptThrottle: \"" + container.GetAttribute("scriptThrottle") + ") was converted to add_ai \"POINT_THROTTLE\" statement"; } Log.Add(msg); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to "" if it was null</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //name { container.SetAttribute("use_gm_selection", null); container.SetAttribute("player_slot", null); container.SetAttributeIfNull("name", ""); } if (value == Choices[1]) //usegm { if (container.GetAttribute("use_gm_selection") == null) { container.SetAttribute("use_gm_selection", ""); } container.SetAttribute("name", null); container.SetAttribute("player_slot", null); } if (value == Choices[2]) //useslot { container.SetAttribute("use_gm_selection", null); container.SetAttribute("name", null); container.SetAttributeIfNull("player_slot", ""); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) // anywhere/anywhere { container.SetAttribute("value1", null); container.SetAttribute("value2", null); } if (value == Choices[1]) // anywhere/limited { container.SetAttribute("value1", null); container.SetAttributeIfNull("value2", "0"); } if (value == Choices[2]) // limited/limited { container.SetAttributeIfNull("value1", "0"); container.SetAttributeIfNull("value2", "0"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == "<OBSOLETE_SIDE>") { // Convert "side" attribute to "sideValue" attribute. value = Choices[1]; // "... side #" container.SetAttribute("sideValue", container.GetAttribute("side")); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //id { container.SetAttribute("value", null); } else //text { container.SetAttributeIfNull("value", "0"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //point { container.SetAttribute("targetName", null); } if (value == Choices[1]) // name { container.SetAttributeIfNull("targetName", " "); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //point { container.SetAttribute("fleetnumber", null); } else { container.SetAttributeIfNull("fleetnumber", "0.0"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == "<NULL>") { container.SetAttribute("type", "enemy"); value = "enemy"; } if (value == "<INVALID_TYPE>") { Log.Add("Warning! Unknown create type " + container.GetAttribute("type") + " detected in event: " + container.Statement.Parent.Name + "!"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //no fake shields { container.SetAttribute("fakeShieldsFront", null); container.SetAttribute("fakeShieldsRear", null); } if (value == Choices[1]) //fake front shields { container.SetAttributeIfNull("fakeShieldsFront", "0"); container.SetAttribute("fakeShieldsRear", null); } if (value == Choices[2]) //fake rear shields { container.SetAttribute("fakeShieldsFront", null); container.SetAttributeIfNull("fakeShieldsRear", "0"); } if (value == Choices[3]) //fake front shields { container.SetAttributeIfNull("fakeShieldsFront", "0"); container.SetAttributeIfNull("fakeShieldsRear", "0"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //line { container.SetAttribute("radius", null); } else //circle { container.SetAttributeIfNull("radius", "1"); } if (value == Choices[2]) { container.SetAttributeIfNull("startAngle", "0"); container.SetAttributeIfNull("endAngle", "0"); } if (value == Choices[1]) { container.SetAttribute("startAngle", null); container.SetAttribute("endAngle", null); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[0]) //destroy named object { container.Statement.Name = "destroy"; } else // destroy_near { container.Statement.Name = "destroy_near"; } if (value == Choices[1]) // destroy asteroids { container.SetAttribute("type", "asteroids"); } if (value == Choices[2]) // destroy mines { container.SetAttribute("type", "mines"); } if (value == Choices[3]) // destroy nebulas { container.SetAttribute("type", "nebulas"); } if (value == Choices[4]) // destroy whales { container.SetAttribute("type", "whales"); } if (value == Choices[5]) // destroy drones { container.SetAttribute("type", "drones"); } if (value == Choices[6]) // destroy all { container.SetAttribute("type", "all"); } base.SetValueInternal(container, value); }
/// <summary> /// Called after Decide has made its choice, or, as usual for ExpressionMembers, after user edited the value through a Dialog. /// For checks, SetValue must change the attributes/etc of the statement according to the newly chosen value /// <example>If you chose "Use GM ...", SetValue will set "use_gm_..." attribute to ""</example> /// </summary> protected override void SetValueInternal(ExpressionMemberContainer container, string value) { if (value == Choices[(int)Choice.RandomInt]) { container.SetAttributeIfNull("randomIntLow", "0"); container.SetAttributeIfNull("randomIntHigh", "0"); container.SetAttribute("randomFloatLow", null); container.SetAttribute("randomFloatHigh", null); container.SetAttribute("value", null); } if (value == Choices[(int)Choice.RandomFloat]) { container.SetAttribute("randomIntLow", null); container.SetAttribute("randomIntHigh", null); container.SetAttributeIfNull("randomFloatLow", "0.0"); container.SetAttributeIfNull("randomFloatHigh", "0.0"); container.SetAttribute("value", null); } if (value == Choices[(int)Choice.Exact]) { container.SetAttribute("randomIntLow", null); container.SetAttribute("randomIntHigh", null); container.SetAttribute("randomFloatLow", null); container.SetAttribute("randomFloatHigh", null); container.SetAttributeIfNull("value", "0.0"); } base.SetValueInternal(container, value); if (container.GetAttribute("integer") != null && container.GetAttribute("integer") != "yes") { container.SetAttribute("integer", null); } }
/// <summary> /// Set value of the current member, including all checks (like, sets to null if this is a "store only if filled" value etc...) /// </summary> protected virtual void SetValueInternal(ExpressionMemberContainer container, string value) { container.SetAttribute(value); }