|
|
@@ -1,5 +1,6 @@ |
|
|
|
import arcade |
|
|
|
from cfg_aux import * |
|
|
|
from cld import * |
|
|
|
from desktop_aux import * |
|
|
|
from desktop_Platform import * |
|
|
|
|
|
|
|
# Pass config init key-value pairs to context controller |
|
|
@@ -8,23 +9,29 @@ from desktop_Platform import * |
|
|
|
# 1. Config tree has just been parsed |
|
|
|
def desktop_applyConfigInit(p): |
|
|
|
if ( |
|
|
|
p.c.recentField == "cfgTree" |
|
|
|
p.c.recentField != "cfgTree" |
|
|
|
): |
|
|
|
for key in p.c.cfgTree["init"]: |
|
|
|
value = p.c.cfgTree["init"][key] |
|
|
|
# Boolean. |
|
|
|
if ( |
|
|
|
value == "false" |
|
|
|
): |
|
|
|
value = False |
|
|
|
elif ( |
|
|
|
value == "true" |
|
|
|
): |
|
|
|
value = True |
|
|
|
# Float. |
|
|
|
elif ( |
|
|
|
cld_isdigit(value) |
|
|
|
): |
|
|
|
value = float(value) |
|
|
|
return |
|
|
|
|
|
|
|
p.ctrl.set(key, value) |
|
|
|
for key in p.c.cfgTree["init"]: |
|
|
|
val = p.c.cfgTree["init"][key] |
|
|
|
value = desktop_aux_convertValue(val) |
|
|
|
p.ctrl.set(key, value) |
|
|
|
|
|
|
|
# Load textures |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|
# 1. Config tree has just been parsed |
|
|
|
def desktop_loadConfigTextures(p): |
|
|
|
if ( |
|
|
|
p.c.recentField != "cfgTree" |
|
|
|
): |
|
|
|
return |
|
|
|
|
|
|
|
for key in p.c.cfgTree: |
|
|
|
if ( |
|
|
|
cld_startswith(key, "texture ") |
|
|
|
): |
|
|
|
name = cfg_aux_textureName(key) |
|
|
|
tex = desktop_aux_loadTexture(p.c.cfgDir, p.c.cfgTree[key]) |
|
|
|
p.textures[name] = tex |