pyscreeps-arena 0.5.7b0__tar.gz → 0.5.7.1__tar.gz
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-0.5.7b0 → pyscreeps_arena-0.5.7.1}/PKG-INFO +1 -1
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/__init__.py +88 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/const.py +1 -1
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/project.7z +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/__init__.py +3 -1
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/map_render.py +705 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/mapviewer.py +14 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qcreeplogic/qcreeplogic.py +82 -21
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/__init__.py +3 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/qcinfo.py +567 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/qco.py +441 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/qmapv.py +728 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_array_drag.py +191 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_drag.py +107 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_qcinfo.py +169 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_qco_drag.py +7 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_qmapv.py +224 -0
- pyscreeps_arena-0.5.7.1/pyscreeps_arena/ui/qmapv/test_simple_array.py +303 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/PKG-INFO +1 -1
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/SOURCES.txt +12 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/setup.py +1 -1
- pyscreeps_arena-0.5.7b0/pyscreeps_arena/__init__.py +0 -56
- pyscreeps_arena-0.5.7b0/pyscreeps_arena/project.7z +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/build.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/compiler.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/__init__.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/basic.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/config.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/core.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/main.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/core/utils.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/localization.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/P2PY.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/creeplogic_edit.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/project_ui.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qcreeplogic/__init__.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qcreeplogic/model.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qrecipe/__init__.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qrecipe/model.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/qrecipe/qrecipe.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena/ui/rs_icon.py +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/dependency_links.txt +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/entry_points.txt +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/requires.txt +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/pyscreeps_arena.egg-info/top_level.txt +0 -0
- {pyscreeps_arena-0.5.7b0 → pyscreeps_arena-0.5.7.1}/setup.cfg +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import shutil
|
|
4
|
+
import py7zr
|
|
5
|
+
from pyscreeps_arena.core import const, config
|
|
6
|
+
def CMD_NewProject():
|
|
7
|
+
"""
|
|
8
|
+
cmd:
|
|
9
|
+
pyscreeps-arena [project_path]
|
|
10
|
+
arena [project_path]
|
|
11
|
+
|
|
12
|
+
* 复制"src" "game" "build.py" 到指定目录
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
if len(sys.argv) < 2:
|
|
18
|
+
print("Usage: pyarena new [project_path]\n# or\narena new [project_path]")
|
|
19
|
+
return
|
|
20
|
+
project_path = sys.argv[1]
|
|
21
|
+
if not os.path.exists(project_path):
|
|
22
|
+
os.makedirs(project_path)
|
|
23
|
+
this_path = os.path.dirname(os.path.abspath(__file__))
|
|
24
|
+
extract_7z(os.path.join(this_path, 'project.7z'), project_path)
|
|
25
|
+
print("Project created at", project_path)
|
|
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}")
|
|
82
|
+
|
|
83
|
+
def extract_7z(file_path, output_dir):
|
|
84
|
+
with py7zr.SevenZipFile(file_path, mode='r') as archive:
|
|
85
|
+
archive.extractall(path=output_dir)
|
|
86
|
+
|
|
87
|
+
if __name__ == '__main__':
|
|
88
|
+
CMD_OpenUI()
|
|
Binary file
|
|
@@ -6,5 +6,7 @@ PyScreeps Arena UI模块
|
|
|
6
6
|
from .rs_icon import get_icon, get_pixmap
|
|
7
7
|
from .project_ui import ProjectCreatorUI, run_project_creator
|
|
8
8
|
from .P2PY import png_to_py
|
|
9
|
+
from .qmapv import QPSAMapViewer, CellInfo
|
|
9
10
|
|
|
10
|
-
__all__ = ['get_icon', 'get_pixmap', 'ProjectCreatorUI', 'run_project_creator',
|
|
11
|
+
__all__ = ['get_icon', 'get_pixmap', 'ProjectCreatorUI', 'run_project_creator',
|
|
12
|
+
'png_to_py', 'QPSAMapViewer', 'CellInfo']
|