#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.
Attachments (1)
Change History (7)
by , 10 years ago
comment:1 by , 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 |
comment:3 by , 10 years ago
Milestone: | Alpha 17 → Alpha 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 , 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.
I think this is trivial so we can check it before A17. I don't know if the request is valid though.