Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make global classes usable #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Make global classes usable #139

wants to merge 2 commits into from

Conversation

oskarkk
Copy link

@oskarkk oskarkk commented Apr 6, 2022

This PR:

  • changes the main yaml node in classes.yml from classes to classitems, to be consistent with arena config files (we don't have to worry about backwards compatibility, because classes.yml wasn't working at all before my previous PR, wasn't usable before this PR, and right now it's entirely undocumented anyway)
  • adds new configuration option to arena config: general.useGlobalClasses, which defaults to false (so, global classes are opt-in)
  • generates the default classes in classes.yml if the file is empty
  • if general.useGlobalClasses is set to true, classitems node can be removed and no longer is automatically populated with the default classes. Nothing changes for classes that have useGlobalClasses set to false (the default). If there are classes in classitems and useGlobalClasses is set to true, players can use both the global classes and the arena classes, with arena classes overwriting global classes in case of name conflicts

Some code was refactored. There was code in two methods that parsed class configuration, and they both were trying to do the same thing. One was for classes.yml (it wasn't working at all), the other was for arena config. Now instead of them there's one good method used both for classes.yml and arena configs. That's why there's more lines removed than added even though I've added a feature.

To do in a separate PR: commands for editing global classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant