Add Config Node wrapper for easier config value access#168
Add Config Node wrapper for easier config value access#168thelivingdiamond wants to merge 10 commits intomainfrom
Conversation
|
Did a refactor to see what it would look like if we completely removed the old config system and switched to the this one. would be mod SDK/API breaking. Some unit tests would also be a good idea for this implementation just to make sure everything works |
6040d61 to
54e46e6
Compare
|
The new API is so much better. For future-proofing, this implementation can be split into two parts:
Mod SDK interfaces will be wrappers around actual implementation. We can change the implementation in any way and not break mods. That will require returning something like |
|
Is the |
|
Correct. Both 001 and 002 would need to be implemented to support old mods |
|
from what I can tell, switching to the interface breaks the cool [] operator and also means no more as() type functions bc virtual templated functions aren't a thing in c++. Am I missing something obvious to make that stuff work or is that just the tradeoff for oop here |
|
Yeah, it'll get ugly For For |
|
I managed to get everything mostly as it was with some shenanigans. Need to run through and add documentation once we're generally happy with it |
|
Still not sure if we should use 64 bit types for numbers instead of int/uint/float |
I wanted to simplify the DX for accessing config node values after actually trying to use the old system in a mod.
I still am not sure if is this enough of an improvement to make breaking changes to the old config access system. It's basically just a structured wrapper around the pugi xml node. One more downside with the new implementation is it doesn't currently provide a way to notify the config manager that a config is dirty.