pyscreeps-arena 0.3.6__py3-none-any.whl → 0.5.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyscreeps_arena/__init__.py +59 -2
- pyscreeps_arena/compiler.py +568 -60
- pyscreeps_arena/core/config.py +1 -1
- pyscreeps_arena/core/const.py +6 -5
- pyscreeps_arena/localization.py +10 -0
- pyscreeps_arena/project.7z +0 -0
- pyscreeps_arena/ui/P2PY.py +108 -0
- pyscreeps_arena/ui/__init__.py +12 -0
- pyscreeps_arena/ui/creeplogic_edit.py +14 -0
- pyscreeps_arena/ui/map_render.py +705 -0
- pyscreeps_arena/ui/mapviewer.py +14 -0
- pyscreeps_arena/ui/project_ui.py +215 -0
- pyscreeps_arena/ui/qcreeplogic/__init__.py +3 -0
- pyscreeps_arena/ui/qcreeplogic/model.py +72 -0
- pyscreeps_arena/ui/qcreeplogic/qcreeplogic.py +770 -0
- pyscreeps_arena/ui/qmapv/__init__.py +3 -0
- pyscreeps_arena/ui/qmapv/qcinfo.py +567 -0
- pyscreeps_arena/ui/qmapv/qco.py +441 -0
- pyscreeps_arena/ui/qmapv/qmapv.py +728 -0
- pyscreeps_arena/ui/qmapv/test_array_drag.py +191 -0
- pyscreeps_arena/ui/qmapv/test_drag.py +107 -0
- pyscreeps_arena/ui/qmapv/test_qcinfo.py +169 -0
- pyscreeps_arena/ui/qmapv/test_qco_drag.py +7 -0
- pyscreeps_arena/ui/qmapv/test_qmapv.py +224 -0
- pyscreeps_arena/ui/qmapv/test_simple_array.py +303 -0
- pyscreeps_arena/ui/qrecipe/__init__.py +1 -0
- pyscreeps_arena/ui/qrecipe/model.py +434 -0
- pyscreeps_arena/ui/qrecipe/qrecipe.py +914 -0
- pyscreeps_arena/ui/rs_icon.py +43 -0
- {pyscreeps_arena-0.3.6.dist-info → pyscreeps_arena-0.5.7.1.dist-info}/METADATA +15 -3
- pyscreeps_arena-0.5.7.1.dist-info/RECORD +40 -0
- {pyscreeps_arena-0.3.6.dist-info → pyscreeps_arena-0.5.7.1.dist-info}/WHEEL +1 -1
- pyscreeps_arena-0.5.7.1.dist-info/entry_points.txt +4 -0
- pyscreeps_arena-0.3.6.dist-info/RECORD +0 -17
- pyscreeps_arena-0.3.6.dist-info/entry_points.txt +0 -2
- {pyscreeps_arena-0.3.6.dist-info → pyscreeps_arena-0.5.7.1.dist-info}/top_level.txt +0 -0
pyscreeps_arena/__init__.py
CHANGED
|
@@ -7,6 +7,7 @@ def CMD_NewProject():
|
|
|
7
7
|
"""
|
|
8
8
|
cmd:
|
|
9
9
|
pyscreeps-arena [project_path]
|
|
10
|
+
arena [project_path]
|
|
10
11
|
|
|
11
12
|
* 复制"src" "game" "build.py" 到指定目录
|
|
12
13
|
|
|
@@ -14,7 +15,7 @@ def CMD_NewProject():
|
|
|
14
15
|
|
|
15
16
|
"""
|
|
16
17
|
if len(sys.argv) < 2:
|
|
17
|
-
print("Usage: pyarena new [project_path]")
|
|
18
|
+
print("Usage: pyarena new [project_path]\n# or\narena new [project_path]")
|
|
18
19
|
return
|
|
19
20
|
project_path = sys.argv[1]
|
|
20
21
|
if not os.path.exists(project_path):
|
|
@@ -23,9 +24,65 @@ def CMD_NewProject():
|
|
|
23
24
|
extract_7z(os.path.join(this_path, 'project.7z'), project_path)
|
|
24
25
|
print("Project created at", project_path)
|
|
25
26
|
|
|
27
|
+
def CMD_OpenUI():
|
|
28
|
+
"""
|
|
29
|
+
cmd:
|
|
30
|
+
psaui 无参数,启用project ui
|
|
31
|
+
psaui -c/-e 启用creeplogic edit
|
|
32
|
+
psaui -m [-c/-e] 启用mapviewer. 默认cn,可以指定-c/-e
|
|
33
|
+
psaui -h 显示帮助信息
|
|
34
|
+
|
|
35
|
+
* 打开UI界面
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
try:
|
|
41
|
+
# 显示帮助信息
|
|
42
|
+
if len(sys.argv) > 1 and sys.argv[1] == '-h':
|
|
43
|
+
print("Usage:")
|
|
44
|
+
print(" psaui 启用project ui")
|
|
45
|
+
print(" psaui -c/-e 启用creeplogic edit (-c: 中文, -e: 英文)")
|
|
46
|
+
print(" psaui -m [-c/-e] 启用mapviewer (-c: 中文, -e: 英文, 默认: 中文)")
|
|
47
|
+
print(" psaui -h 显示帮助信息")
|
|
48
|
+
print(" --------------------------------------------------------------")
|
|
49
|
+
print(" psaui run `project ui`")
|
|
50
|
+
print(" psaui -c/-e run `creeplogic edit` (-c: chinese, -e: english)")
|
|
51
|
+
print(" psaui -m [-c/-e] run `mapviewer` (-c: chinese, -e: english, default: chinese)")
|
|
52
|
+
print(" psaui -h Show this help message")
|
|
53
|
+
|
|
54
|
+
return
|
|
55
|
+
|
|
56
|
+
# 检查是否使用mapviewer
|
|
57
|
+
if len(sys.argv) > 1 and sys.argv[1] == '-m':
|
|
58
|
+
from pyscreeps_arena.ui.mapviewer import run_mapviewer
|
|
59
|
+
# 检查语言参数
|
|
60
|
+
if len(sys.argv) > 2 and sys.argv[2] == '-e':
|
|
61
|
+
from pyscreeps_arena.core import config
|
|
62
|
+
config.language = 'en'
|
|
63
|
+
run_mapviewer()
|
|
64
|
+
# 检查是否使用creeplogic edit
|
|
65
|
+
elif len(sys.argv) > 1 and sys.argv[1] == '-c':
|
|
66
|
+
from pyscreeps_arena.ui.creeplogic_edit import run_creeplogic_edit
|
|
67
|
+
run_creeplogic_edit()
|
|
68
|
+
elif len(sys.argv) > 1 and sys.argv[1] == '-e':
|
|
69
|
+
from pyscreeps_arena.ui.creeplogic_edit import run_creeplogic_edit
|
|
70
|
+
from pyscreeps_arena.core import config
|
|
71
|
+
config.language = 'en'
|
|
72
|
+
run_creeplogic_edit()
|
|
73
|
+
# 默认启用project ui
|
|
74
|
+
else:
|
|
75
|
+
from pyscreeps_arena.ui.project_ui import run_project_creator
|
|
76
|
+
run_project_creator()
|
|
77
|
+
except ImportError as e:
|
|
78
|
+
print(f"错误: 无法导入UI模块 - {e}")
|
|
79
|
+
print("请确保已安装PyQt6: pip install PyQt6")
|
|
80
|
+
except Exception as e:
|
|
81
|
+
print(f"错误: 打开UI界面失败 - {e}")
|
|
26
82
|
|
|
27
83
|
def extract_7z(file_path, output_dir):
|
|
28
84
|
with py7zr.SevenZipFile(file_path, mode='r') as archive:
|
|
29
85
|
archive.extractall(path=output_dir)
|
|
30
86
|
|
|
31
|
-
|
|
87
|
+
if __name__ == '__main__':
|
|
88
|
+
CMD_OpenUI()
|