mirror of
https://github.com/tonytins/citylimits
synced 2025-12-15 20:54:43 -05:00
Decoupling more hardcoded data
- Created a json helper to streamline decoupling of hardcoded data - Removed non-existent VR bridge reference - News ticker files are no longer hardcoded to the game. - Removed hardcoded city and mayor names using Json helper
This commit is contained in:
parent
f8a0f97767
commit
65cc08fab6
13 changed files with 309 additions and 417 deletions
11
scripts/autoload/jsonhelper.gd
Normal file
11
scripts/autoload/jsonhelper.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends Node
|
||||
|
||||
func key_value(json_path, json_file, key, is_dictionary = false):
|
||||
var file = File.new()
|
||||
var news_outlets_path = str(json_path + json_file);
|
||||
if file.file_exists(news_outlets_path):
|
||||
file.open(news_outlets_path, File.READ)
|
||||
var result = parse_json(file.get_as_text())
|
||||
if is_dictionary == true:
|
||||
result.clear()
|
||||
return result[key]
|
||||
Loading…
Add table
Add a link
Reference in a new issue