Replace FxAI-references

The hardcoded references make renaming the effect later a huge problem.
install-platforms
Mark 2017-06-08 21:15:31 +02:00
parent f204b959e7
commit a87eed5de1
4 changed files with 10 additions and 10 deletions

View File

@ -123,7 +123,7 @@ public func OnDefineAI(proplist def)
auto_search_target = { Name = "$AutoSearchTarget$", EditorHelp = "$AutoSearchTargetHelp$", Type = "bool" },
};
AddProperties(def.FxAI.EditorProps, additional_props);
AddProperties(def->GetControlEffect().EditorProps, additional_props);
}

View File

@ -35,7 +35,7 @@ public func OnDefineAI(proplist def)
{
_inherited(def);
def.FxAI.SetAttackMode = this.EditorDelegate_SetAttackMode;
def->GetControlEffect().SetAttackMode = this.EditorDelegate_SetAttackMode;
// Set the other options
def->DefinitionAttackModes(def);
@ -151,9 +151,9 @@ private func InitAttackModes()
// First-time init of attack mode editor prop structures
// All attack modes structures point to the base AI
this.AttackModes = AI.AttackModes;
if (!AI.FxAI.EditorProps.attack_mode)
if (!AI->GetControlEffect().EditorProps.attack_mode)
{
AI.FxAI.EditorProps.attack_mode = {
AI->GetControlEffect().EditorProps.attack_mode = {
Name="$AttackMode$",
EditorHelp="$AttackModeHelp$",
Type="enum",
@ -162,7 +162,7 @@ private func InitAttackModes()
Set="SetAttackMode"
};
}
this.FxAI.EditorProps.attack_mode = AI.FxAI.EditorProps.attack_mode;
this->GetControlEffect().EditorProps.attack_mode = AI->GetControlEffect().EditorProps.attack_mode;
}
public func RegisterAttackMode(string identifier, proplist am, proplist am_default_values)
@ -181,7 +181,7 @@ public func RegisterAttackMode(string identifier, proplist am, proplist am_defau
Value = am_default_values
};
if (!am_option.EditorHelp && am.GetEditorHelp) am_option.EditorHelp = am->GetEditorHelp();
var editor_opts = this.FxAI.EditorProps.attack_mode.Options;
var editor_opts = this->GetControlEffect().EditorProps.attack_mode.Options;
editor_opts[GetLength(editor_opts)] = am_option;
}

View File

@ -41,7 +41,7 @@ public func OnDefineAI(proplist def)
{
_inherited(def);
def.FxAI.SetAttackPath = this.EditorDelegate_SetAttackPath;
def->GetControlEffect().SetAttackPath = this.EditorDelegate_SetAttackPath;
// Set the additional editor properties
var additional_props =
@ -54,7 +54,7 @@ public func OnDefineAI(proplist def)
] },
};
AddProperties(def.FxAI.EditorProps, additional_props);
AddProperties(def->GetControlEffect().EditorProps, additional_props);
}

View File

@ -549,10 +549,10 @@ public func GetAIClonkEditorProps()
if (!this.AIClonkEditorProps)
{
var props = {};
props.AttackMode = new AI.FxAI.EditorProps.attack_mode { Set=nil, Priority=100 };
props.AttackMode = new AI->GetControlEffect().EditorProps.attack_mode { Set=nil, Priority=100 };
props.GuardRange = { Name="$AttackRange$", EditorHelp="$AttackRangeHelp$", Type="enum", Options = [
{ Name="$Automatic$", EditorHelp="$AutomaticGuardRangeHelp$"},
{ Name="$Custom$", Type=C4V_PropList, Value={}, DefaultValueFunction=this.GetDefaultAIRect, Delegate=AI.FxAI.EditorProps.guard_range }
{ Name="$Custom$", Type=C4V_PropList, Value={}, DefaultValueFunction=this.GetDefaultAIRect, Delegate=AI->GetControlEffect().EditorProps.guard_range }
] };
props.Color = { Name="$Color$", Type="color" };
props.Bounty = { Name="$Bounty$", EditorHelp="$BountyHelp$", Type="int", Min=0, Max=100000 };