Hey all,
I was wondering if any of you would be interested in a new feature that would allow you to execute commands immediately when a config file is parsed.
That would be helpful as an alternative to missing features of the config format (such as in-value inheritance: ScreenResolution = (@Display.ScreenWidth, @Display.ScreenHeight, @Display.ScreenDepth), config operators: BufferSize = @Display.ScreenWidth * @Display.ScreenHeight, etc...).
The syntax would be something like:
[Display]
ScreenWidth = 1680
ScreenHeight = 1050
ScreenDepth = 32
; Sets value for MySection.ScreenResolution
! > Config.GetValue Display ScreenDepth
! > Config.GetValue Display ScreenHeight
! > Config.GetValue Display ScreenWidth
! Config.SetValue MySection ScreenResolution "(<, <, <)"
; Sets value for MySection.BufferSize
! > Config.GetValue Display ScreenWidth
! > Config.GetValue Display ScreenHeight
! > * < <
! Config.SetValue MySection BufferSize <
The issue is that if Display.* changes values over time, the value of MySection.* won't get updated as with standard inheritance. And of course you can use commands for doing conditional loading of config files or even create objects and code a whole game there if you feel that courageous. ;)
Any thoughts/comments?
Cheers,
Rom