|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- from cfg_aux import *
- from cld import *
- from desktop_aux import *
- from desktop_Platform import *
-
- # Pass config init key-value pairs to context controller
- #
- # Conditions:
- # 1. Config tree has just been parsed
- def desktop_applyConfigInit(p):
- if (
- p.c.recentField != "cfgTree"
- ):
- return
-
- for key in p.c.cfgTree["init"]:
- val = p.c.cfgTree["init"][key]
- value = desktop_aux_convertValue(val)
- p.ctrl.set(key, value)
-
- # Create static sprites
- #
- # Conditions:
- # 1. Config textures has just been loaded
- def desktop_createConfigStaticSprites(p):
- if (
- p.c.recentField != "didLoadConfigTextures"
- ):
- return
-
- for key in p.c.cfgTree:
- if (
- cld_startswith(key, "static ")
- ):
- name = cfg_aux_staticSpriteName(key)
- sprite = desktop_aux_createStaticSprite(p, name, p.c.cfgTree[key])
- p.statics[name] = sprite
- p.staticSprites.append(sprite)
- # Report finish.
- p.ctrl.set("didCreateConfigStaticSprites", True)
-
- # 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
- # Report finish.
- p.ctrl.set("didLoadConfigTextures", True)
|