mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-26 18:39:30 +01:00
Add experimental automation condition for gearsets.
This commit is contained in:
parent
c11bd629da
commit
dd42b7ab7f
7 changed files with 185 additions and 32 deletions
|
|
@ -27,6 +27,7 @@ public class AutoDesign
|
|||
public Design? Design;
|
||||
public JobGroup Jobs;
|
||||
public Type ApplicationType;
|
||||
public short GearsetIndex = -1;
|
||||
|
||||
public string Name(bool incognito)
|
||||
=> Revert ? RevertName : incognito ? Design!.Incognito : Design!.Name.Text;
|
||||
|
|
@ -43,10 +44,22 @@ public class AutoDesign
|
|||
Design = Design,
|
||||
ApplicationType = ApplicationType,
|
||||
Jobs = Jobs,
|
||||
GearsetIndex = GearsetIndex,
|
||||
};
|
||||
|
||||
public unsafe bool IsActive(Actor actor)
|
||||
=> actor.IsCharacter && Jobs.Fits(actor.AsCharacter->CharacterData.ClassJob);
|
||||
{
|
||||
if (!actor.IsCharacter)
|
||||
return false;
|
||||
|
||||
var ret = true;
|
||||
if (GearsetIndex < 0)
|
||||
ret &= Jobs.Fits(actor.AsCharacter->CharacterData.ClassJob);
|
||||
else
|
||||
ret &= AutoDesignApplier.CheckGearset(GearsetIndex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public JObject Serialize()
|
||||
=> new()
|
||||
|
|
@ -58,9 +71,12 @@ public class AutoDesign
|
|||
|
||||
private JObject CreateConditionObject()
|
||||
{
|
||||
var ret = new JObject();
|
||||
if (Jobs.Id != 0)
|
||||
ret["JobGroup"] = Jobs.Id;
|
||||
var ret = new JObject
|
||||
{
|
||||
["Gearset"] = GearsetIndex,
|
||||
["JobGroup"] = Jobs.Id,
|
||||
};
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue