You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 line
884B

  1. from cfg_aux import *
  2. from cld import *
  3. from desktop_aux import *
  4. from desktop_Platform import *
  5. # Pass config init key-value pairs to context controller
  6. #
  7. # Conditions:
  8. # 1. Config tree has just been parsed
  9. def desktop_applyConfigInit(p):
  10. if (
  11. p.c.recentField != "cfgTree"
  12. ):
  13. return
  14. for key in p.c.cfgTree["init"]:
  15. val = p.c.cfgTree["init"][key]
  16. value = desktop_aux_convertValue(val)
  17. p.ctrl.set(key, value)
  18. # Load textures
  19. #
  20. # Conditions:
  21. # 1. Config tree has just been parsed
  22. def desktop_loadConfigTextures(p):
  23. if (
  24. p.c.recentField != "cfgTree"
  25. ):
  26. return
  27. for key in p.c.cfgTree:
  28. if (
  29. cld_startswith(key, "texture ")
  30. ):
  31. name = cfg_aux_textureName(key)
  32. tex = desktop_aux_loadTexture(p.c.cfgDir, p.c.cfgTree[key])
  33. p.textures[name] = tex