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.

3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
3 月之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import os
  2. import sys
  3. if len(sys.argv) < 2:
  4. print("Usage: python3 /path/to/main.py /path/to/ht.config")
  5. sys.exit(1)
  6. CFG = os.path.realpath(sys.argv[1])
  7. SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
  8. sys.path.append(f"{SCRIPT_DIR}/../cross-language-dialect/ctx")
  9. sys.path.append(f"{SCRIPT_DIR}/../cross-language-dialect/lib")
  10. sys.path.append(f"{SCRIPT_DIR}/py")
  11. import arcade
  12. from cfg import *
  13. from cld import *
  14. from ctx import *
  15. from fs import *
  16. from desktop_Platform import *
  17. from desktop_Window import *
  18. from ht_Context import *
  19. ctrl = ctx_Controller(ht_createContext())
  20. ctrl.registerFunctions([
  21. cfg_parseConfigTree,
  22. fs_locateConfigDir,
  23. fs_readConfig,
  24. ])
  25. def printDbg(c):
  26. print(f"Dbg key/value: '{c.recentField}'/'{c.field(c.recentField)}'")
  27. ctrl.registerCallback(printDbg)
  28. p = desktop_Platform()
  29. p.ctrl = ctrl
  30. # Bind platform to context changes.
  31. def process(c):
  32. # Copy context to platform.
  33. p.c = c
  34. # Perform context dependent calls of desktop functions.
  35. # Similar to context functions, but no platform is returned.
  36. ### desktop_deselectMismatchedTiles(p)
  37. ctrl.registerCallback(process)
  38. ctrl.set("cfgPath", CFG)
  39. ctrl.set("scriptDir", SCRIPT_DIR)
  40. ctrl.set("windowWidth", 900)
  41. ctrl.set("windowHeight", 600)
  42. ctrl.set("windowAntialiasing", False)
  43. ctrl.set("windowBackgroundColor", "#ffffff")
  44. ctrl.set("windowTitle", "Прототип: Отель")
  45. #desktop_loadTextures(p)
  46. wnd = desktop_Window(p)
  47. ctrl.set("didLaunch", True)
  48. arcade.run()