Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2671 closed enhancement (fixed)

[PATCH] Change a scope in the Attack component for more modding flexibility

Reported by: Radagast Owned by: Itms
Priority: Should Have Milestone: Alpha 18
Component: UI & Simulation Keywords:
Cc: sanderd17 Patch:

Description

In simulation/components/Attack.js the Schema is already stored in the Attack.prototype.

It would be nice for mods (e.g. convert_attack on 0ADMods) if the other schemas (e.g. bonusSchema, preferredClassesSchema, ..) also were stored in the prototype to easily reuse those schema defintions without hurting the single source principle (currently the global var schema variables have to be copied over in the AttackConvertAttack.js).

Please comment if there are any issues we should address.

Could be generalized for all components.

Change History (7)

comment:1 by Itms, 10 years ago

Keywords: patch review added
Summary: [Patch] Attack.prototype scoped attributes instead of file scoped global variables for schema definition in Attack.js[PATCH] Change a scope in the Attack component for more modding flexibility

I think this is trivial so we can check it before A17. I don't know if the request is valid though.

comment:2 by Stan, 10 years ago

@Itms did you have time to check if the request was valid ?

comment:3 by Itms, 10 years ago

Milestone: Alpha 17Alpha 18

Stumbling across it again during the late release process, it's basically a feature so I'll commit it just after release. Sorry for forgetting it, rada :(

comment:4 by Radagast, 10 years ago

No problem, itms. Thanks for having a look at it.

At the moment it's only relevant for convert_attack, which has turned out to be a not so ideal approach and is deprecated. So don't worry.

Yet for later modders it might still be a hurdle if the schema can't be accessed. thanks for considering it for A18.

comment:5 by Itms, 10 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 15868:

Change a scope for a bunch of variables in the Attack component. This simple change allows modders to modify the whole attack schema.

Patch by Radagast, fixes #2671

comment:6 by Itms, 10 years ago

Keywords: patch review removed

Thanks for the patch, and good modding!

Note: See TracTickets for help on using tickets.