Hey there!
I want to store all of my relevant data like localization, ui position, button sizes for the mobile or pc version in a single JSON object.
Is there a way how I can parse/load multiple .json project files into a single JSON object?
For example load english_localization.json & interface_data.json & variables.json into Data (name of JSON object).
So that I can do things like:
Data.localization.main_menu.header
Data.ui.pc.main_menu.header.x
Data.ui.pc.main_menu.header.y
Data.ui.pc.main_menu.header.font_size
Data.ui.mobile.main_menu.header.x
Data.ui.mobile.main_menu.header.y
Data.ui.mobile.main_menu.header.font_size
Data.Get(".ui.mobile.main_menu.header.font_size")
So for example a menus header text position could be set to:
x:
Data.Get(".ui." & platform & ".main_menu.header.x")
Data.Get(".ui." & platform & ".main_menu.header.x")
Where platform is either pc or mobile.
Oh and my other question is: Is that a good practice?
I imagine it being handy to have every data at one place instead of mixing json and global variables. I want to have a modular interface where I can use the same events with different pc/mobile values instead of having double the event count.