aliceadv 0.1.0__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.
Files changed (73) hide show
  1. aliceadv-0.1.0/LICENSE +21 -0
  2. aliceadv-0.1.0/MANIFEST.in +15 -0
  3. aliceadv-0.1.0/PKG-INFO +128 -0
  4. aliceadv-0.1.0/README.md +71 -0
  5. aliceadv-0.1.0/pyproject.toml +63 -0
  6. aliceadv-0.1.0/setup.cfg +4 -0
  7. aliceadv-0.1.0/src/aliceadv/__init__.py +50 -0
  8. aliceadv-0.1.0/src/aliceadv/__main__.py +5 -0
  9. aliceadv-0.1.0/src/aliceadv/builder.py +392 -0
  10. aliceadv-0.1.0/src/aliceadv/cli.py +87 -0
  11. aliceadv-0.1.0/src/aliceadv/creator.py +93 -0
  12. aliceadv-0.1.0/src/aliceadv/cssutil.py +76 -0
  13. aliceadv-0.1.0/src/aliceadv/template/.aliceadv_engine +0 -0
  14. aliceadv-0.1.0/src/aliceadv/template/about.txt +0 -0
  15. aliceadv-0.1.0/src/aliceadv/template/audio/rooftop.wav +0 -0
  16. aliceadv-0.1.0/src/aliceadv/template/documents//345/211/247/346/234/254/346/240/274/345/274/217/350/257/264/346/230/216.md +543 -0
  17. aliceadv-0.1.0/src/aliceadv/template/documents//346/240/267/345/274/217/346/216/247/345/210/266.md +612 -0
  18. aliceadv-0.1.0/src/aliceadv/template/gui/button/choice_hover_background.png +0 -0
  19. aliceadv-0.1.0/src/aliceadv/template/gui/button/choice_idle_background.png +0 -0
  20. aliceadv-0.1.0/src/aliceadv/template/gui/button/hover_background.png +0 -0
  21. aliceadv-0.1.0/src/aliceadv/template/gui/button/idle_background.png +0 -0
  22. aliceadv-0.1.0/src/aliceadv/template/gui/frame.png +0 -0
  23. aliceadv-0.1.0/src/aliceadv/template/gui/game_menu.png +0 -0
  24. aliceadv-0.1.0/src/aliceadv/template/gui/main_menu.png +0 -0
  25. aliceadv-0.1.0/src/aliceadv/template/gui/namebox.png +0 -0
  26. aliceadv-0.1.0/src/aliceadv/template/gui/overlay/confirm.png +0 -0
  27. aliceadv-0.1.0/src/aliceadv/template/gui/overlay/game_menu.png +0 -0
  28. aliceadv-0.1.0/src/aliceadv/template/gui/overlay/main_menu.png +0 -0
  29. aliceadv-0.1.0/src/aliceadv/template/gui/sample_character.png +0 -0
  30. aliceadv-0.1.0/src/aliceadv/template/gui/sample_thumb.png +0 -0
  31. aliceadv-0.1.0/src/aliceadv/template/gui/textbox.png +0 -0
  32. aliceadv-0.1.0/src/aliceadv/template/gui/textbox_dark.png +0 -0
  33. aliceadv-0.1.0/src/aliceadv/template/images/bg/classroom.png +0 -0
  34. aliceadv-0.1.0/src/aliceadv/template/images/bg/roof.png +0 -0
  35. aliceadv-0.1.0/src/aliceadv/template/images/char/elin/normal.png +0 -0
  36. aliceadv-0.1.0/src/aliceadv/template/images/char/elin/smile.png +0 -0
  37. aliceadv-0.1.0/src/aliceadv/template/images/char/elin/surprise.png +0 -0
  38. aliceadv-0.1.0/src/aliceadv/template/index.html +106 -0
  39. aliceadv-0.1.0/src/aliceadv/template/info.json +10 -0
  40. aliceadv-0.1.0/src/aliceadv/template/story/ch1.json +56 -0
  41. aliceadv-0.1.0/src/aliceadv/template/story/ch2.json +22 -0
  42. aliceadv-0.1.0/src/aliceadv/template/story/chapters.json +32 -0
  43. aliceadv-0.1.0/src/aliceadv/template/story/characters.json +28 -0
  44. aliceadv-0.1.0/src/aliceadv/template/style/base.css +467 -0
  45. aliceadv-0.1.0/src/aliceadv/template/style/engine.js +296 -0
  46. aliceadv-0.1.0/src/aliceadv/template/style/pages/about.css +22 -0
  47. aliceadv-0.1.0/src/aliceadv/template/style/pages/branches.css +35 -0
  48. aliceadv-0.1.0/src/aliceadv/template/style/pages/chapters.css +35 -0
  49. aliceadv-0.1.0/src/aliceadv/template/style/pages/gallery.css +41 -0
  50. aliceadv-0.1.0/src/aliceadv/template/style/pages/game-menu.css +94 -0
  51. aliceadv-0.1.0/src/aliceadv/template/style/pages/history.css +73 -0
  52. aliceadv-0.1.0/src/aliceadv/template/style/pages/load.css +14 -0
  53. aliceadv-0.1.0/src/aliceadv/template/style/pages/menu.css +68 -0
  54. aliceadv-0.1.0/src/aliceadv/template/style/pages/popup.css +51 -0
  55. aliceadv-0.1.0/src/aliceadv/template/style/pages/save.css +12 -0
  56. aliceadv-0.1.0/src/aliceadv/template/style/pages/settings.css +33 -0
  57. aliceadv-0.1.0/src/aliceadv/template/style/pages/stage.css +285 -0
  58. aliceadv-0.1.0/src/aliceadv/template/style/pages/title.css +225 -0
  59. aliceadv-0.1.0/src/aliceadv/template/style/preload.css +54 -0
  60. aliceadv-0.1.0/src/aliceadv/template/style/preload.js +300 -0
  61. aliceadv-0.1.0/src/aliceadv/template/style/script.js +1348 -0
  62. aliceadv-0.1.0/src/aliceadv/template/style/theme.js +809 -0
  63. aliceadv-0.1.0/src/aliceadv/template/theme.json +200 -0
  64. aliceadv-0.1.0/src/aliceadv/tools/__init__.py +1 -0
  65. aliceadv-0.1.0/src/aliceadv/tools/gui2theme.py +190 -0
  66. aliceadv-0.1.0/src/aliceadv/tools/rpy2adv.py +575 -0
  67. aliceadv-0.1.0/src/aliceadv.egg-info/PKG-INFO +128 -0
  68. aliceadv-0.1.0/src/aliceadv.egg-info/SOURCES.txt +71 -0
  69. aliceadv-0.1.0/src/aliceadv.egg-info/dependency_links.txt +1 -0
  70. aliceadv-0.1.0/src/aliceadv.egg-info/entry_points.txt +2 -0
  71. aliceadv-0.1.0/src/aliceadv.egg-info/requires.txt +5 -0
  72. aliceadv-0.1.0/src/aliceadv.egg-info/top_level.txt +1 -0
  73. aliceadv-0.1.0/tests/test_dialogue_layout.py +159 -0
aliceadv-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aliceADV authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,15 @@
1
+ # aliceADV 打包清单(sdist 包含项)
2
+ # 引擎运行时模板是纯数据,必须与编译器一起发布,供 `aliceadv create` 复制。
3
+
4
+ # 模板目录(index.html / style / gui / images / audio / story / documents 等)
5
+ recursive-include src/aliceadv/template *
6
+
7
+ # 引擎模板标记文件(隐藏文件,recursive-include 的 * 不会匹配点文件,需单独声明)
8
+ include src/aliceadv/template/.aliceadv_engine
9
+
10
+ # 许可证与说明(PyPI 元数据引用)
11
+ include LICENSE
12
+ include README.md
13
+
14
+ # 测试(仅进入 sdist,不进入 wheel)
15
+ recursive-include tests *.py
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: aliceadv
3
+ Version: 0.1.0
4
+ Summary: aliceADV — a Ren'Py-style web ADV (visual novel) game engine: project template + create/build compiler
5
+ Author: AliceDrop
6
+ Maintainer: AliceDrop
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 aliceADV authors
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://github.com/aliceadv/engine
30
+ Project-URL: Repository, https://github.com/aliceadv/engine
31
+ Project-URL: Documentation, https://github.com/aliceadv/engine#readme
32
+ Keywords: adv,visual-novel,renpy,game-engine,web,visual-novel-engine
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Environment :: Web Environment
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.6
40
+ Classifier: Programming Language :: Python :: 3.7
41
+ Classifier: Programming Language :: Python :: 3.8
42
+ Classifier: Programming Language :: Python :: 3.9
43
+ Classifier: Programming Language :: Python :: 3.10
44
+ Classifier: Programming Language :: Python :: 3.11
45
+ Classifier: Programming Language :: Python :: 3.12
46
+ Classifier: Programming Language :: Python :: 3.13
47
+ Classifier: Topic :: Games/Entertainment
48
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
49
+ Requires-Python: >=3.6
50
+ Description-Content-Type: text/markdown
51
+ License-File: LICENSE
52
+ Provides-Extra: dev
53
+ Requires-Dist: pytest; extra == "dev"
54
+ Requires-Dist: build; extra == "dev"
55
+ Requires-Dist: twine; extra == "dev"
56
+ Dynamic: license-file
57
+
58
+ # AliceADV
59
+
60
+ aliceADV is a web-based ADV (visual novel) game engine that follows the design
61
+ language of Ren'Py. Scenes, dialogue, characters, and branching are described in
62
+ JSON, and the engine compiles them into a static web game that runs in any browser
63
+ with no server or runtime dependency — you can open `index.html` directly over
64
+ `file://` or host it as a static site.
65
+
66
+ The engine ships as a Python package providing a `create` / `build` command-line
67
+ tool, plus the engine template (HTML/CSS/JS) that is assembled into each project
68
+ at build time.
69
+
70
+ > 中文说明见仓库根目录 `README_zh-CN.md`。
71
+
72
+ ## Installation
73
+
74
+ Requires Python >= 3.9.
75
+
76
+ ```bash
77
+ pip install aliceadv # from PyPI
78
+ # or, from a local checkout of this package directory:
79
+ pip install ./aliceadv
80
+ ```
81
+
82
+ Verify:
83
+
84
+ ```bash
85
+ aliceadv --version
86
+ # aliceADV 0.1.0 (engine v0.1)
87
+ ```
88
+
89
+ ## Quick start
90
+
91
+ ```bash
92
+ # 1. Create a project (copies the engine template into a new directory)
93
+ aliceadv create my_game --name "My Game"
94
+
95
+ # 2. Edit theme.json (styling) and story/*.json (script)
96
+
97
+ # 3. Build → <project>/dist/web/
98
+ aliceadv build my_game
99
+
100
+ # 4. Play: open my_game/dist/web/index.html, or serve it
101
+ python3 -m http.server -d my_game/dist/web 8000
102
+ ```
103
+
104
+ ## Game version & engine version
105
+
106
+ The game version comes from your project's `info.json` (`version` field, authored by
107
+ you). The **engine version** is stamped by the packaged engine itself at build time
108
+ (`aliceadv/__init__.py` → `ENGINE_NAME` / `ENGINE_VERSION`) and injected into the
109
+ built `index.html` as `window.__ENGINE__`. Both are shown on the title page and the
110
+ About page after a build — so you no longer maintain the engine version by hand.
111
+
112
+ ## Command-line reference
113
+
114
+ | Command | Purpose |
115
+ |---|---|
116
+ | `aliceadv create <dir> [--name NAME] [--force]` | Create a project by copying the engine template. |
117
+ | `aliceadv build <dir>` | Build a project into `<dir>/dist/web/`. |
118
+ | `aliceadv rpy2adv <script.rpy> <images_dir> <out_dir>` | Convert a Ren'Py script into `story/` JSON. |
119
+ | `aliceadv gui2theme <gui.rpy> <theme.json> [--apply]` | Convert Ren'Py `gui.rpy` layout into `theme.json`. |
120
+
121
+ The build command refuses to run against the engine template directory itself (it
122
+ contains the `.aliceadv_engine` marker). The engine runtime (`index.html`, `style/`)
123
+ is **not** stored in your project — it is assembled from the engine template on every
124
+ build, so upgrading the engine takes effect by simply rebuilding.
125
+
126
+ ## License
127
+
128
+ Released under the [MIT License](./LICENSE).
@@ -0,0 +1,71 @@
1
+ # AliceADV
2
+
3
+ aliceADV is a web-based ADV (visual novel) game engine that follows the design
4
+ language of Ren'Py. Scenes, dialogue, characters, and branching are described in
5
+ JSON, and the engine compiles them into a static web game that runs in any browser
6
+ with no server or runtime dependency — you can open `index.html` directly over
7
+ `file://` or host it as a static site.
8
+
9
+ The engine ships as a Python package providing a `create` / `build` command-line
10
+ tool, plus the engine template (HTML/CSS/JS) that is assembled into each project
11
+ at build time.
12
+
13
+ > 中文说明见仓库根目录 `README_zh-CN.md`。
14
+
15
+ ## Installation
16
+
17
+ Requires Python >= 3.9.
18
+
19
+ ```bash
20
+ pip install aliceadv # from PyPI
21
+ # or, from a local checkout of this package directory:
22
+ pip install ./aliceadv
23
+ ```
24
+
25
+ Verify:
26
+
27
+ ```bash
28
+ aliceadv --version
29
+ # aliceADV 0.1.0 (engine v0.1)
30
+ ```
31
+
32
+ ## Quick start
33
+
34
+ ```bash
35
+ # 1. Create a project (copies the engine template into a new directory)
36
+ aliceadv create my_game --name "My Game"
37
+
38
+ # 2. Edit theme.json (styling) and story/*.json (script)
39
+
40
+ # 3. Build → <project>/dist/web/
41
+ aliceadv build my_game
42
+
43
+ # 4. Play: open my_game/dist/web/index.html, or serve it
44
+ python3 -m http.server -d my_game/dist/web 8000
45
+ ```
46
+
47
+ ## Game version & engine version
48
+
49
+ The game version comes from your project's `info.json` (`version` field, authored by
50
+ you). The **engine version** is stamped by the packaged engine itself at build time
51
+ (`aliceadv/__init__.py` → `ENGINE_NAME` / `ENGINE_VERSION`) and injected into the
52
+ built `index.html` as `window.__ENGINE__`. Both are shown on the title page and the
53
+ About page after a build — so you no longer maintain the engine version by hand.
54
+
55
+ ## Command-line reference
56
+
57
+ | Command | Purpose |
58
+ |---|---|
59
+ | `aliceadv create <dir> [--name NAME] [--force]` | Create a project by copying the engine template. |
60
+ | `aliceadv build <dir>` | Build a project into `<dir>/dist/web/`. |
61
+ | `aliceadv rpy2adv <script.rpy> <images_dir> <out_dir>` | Convert a Ren'Py script into `story/` JSON. |
62
+ | `aliceadv gui2theme <gui.rpy> <theme.json> [--apply]` | Convert Ren'Py `gui.rpy` layout into `theme.json`. |
63
+
64
+ The build command refuses to run against the engine template directory itself (it
65
+ contains the `.aliceadv_engine` marker). The engine runtime (`index.html`, `style/`)
66
+ is **not** stored in your project — it is assembled from the engine template on every
67
+ build, so upgrading the engine takes effect by simply rebuilding.
68
+
69
+ ## License
70
+
71
+ Released under the [MIT License](./LICENSE).
@@ -0,0 +1,63 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "aliceadv"
7
+ version = "0.1.0"
8
+ description = "aliceADV — a Ren'Py-style web ADV (visual novel) game engine: project template + create/build compiler"
9
+ readme = "README.md"
10
+ requires-python = ">=3.6"
11
+ license = { file = "LICENSE" }
12
+ keywords = ["adv", "visual-novel", "renpy", "game-engine", "web", "visual-novel-engine"]
13
+ authors = [
14
+ { name = "AliceDrop" },
15
+ ]
16
+ maintainers = [
17
+ { name = "AliceDrop" },
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Environment :: Web Environment",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.6",
27
+ "Programming Language :: Python :: 3.7",
28
+ "Programming Language :: Python :: 3.8",
29
+ "Programming Language :: Python :: 3.9",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Topic :: Games/Entertainment",
35
+ "Topic :: Software Development :: Libraries :: Python Modules",
36
+ ]
37
+ dependencies = []
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/aliceadv/engine"
41
+ Repository = "https://github.com/aliceadv/engine"
42
+ Documentation = "https://github.com/aliceadv/engine#readme"
43
+
44
+ [project.optional-dependencies]
45
+ dev = ["pytest", "build", "twine"]
46
+
47
+ [project.scripts]
48
+ aliceadv = "aliceadv.cli:main"
49
+
50
+ # 模板(index.html / style / gui / images / audio / story / documents 等)
51
+ # 是纯数据,与编译器实现解耦:将来用其他语言重写编译器时直接复用该目录。
52
+ [tool.setuptools.packages.find]
53
+ where = ["src"]
54
+
55
+ [tool.setuptools]
56
+ include-package-data = true
57
+
58
+ # 显式声明包内数据文件,确保 wheel 与 sdist 都带上模板(含隐藏标记文件)。
59
+ [tool.setuptools.package-data]
60
+ aliceadv = [
61
+ "template/**/*",
62
+ "template/.aliceadv_engine",
63
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,50 @@
1
+ # =========================================================
2
+ # aliceADV — 网页 ADV 游戏引擎(工程模板 + 创建/构建编译器)
3
+ #
4
+ # 包结构(模板与编译器实现分离):
5
+ # aliceadv/template/ 引擎模板(纯数据:index.html / style / gui / story / ...)
6
+ # aliceadv/creator.py 工程创建:模板 → 用户工程目录
7
+ # aliceadv/builder.py 构建:工程目录 → <工程>/dist/web/
8
+ # aliceadv/cli.py `aliceadv` 命令行入口(create / build / rpy2adv / gui2theme)
9
+ #
10
+ # 模板目录单独存放、不含任何 Python 代码:将来若把编译器移植到其他语言,
11
+ # 只需复用 template/ 目录与同一套 CLI 语义,不必动模板内容。
12
+ # 模板位置可通过环境变量 ALICEADV_TEMPLATE 覆盖(指向任意的模板目录)。
13
+ # =========================================================
14
+ import os
15
+
16
+ __version__ = "0.1.0"
17
+ ENGINE_VERSION = "v0.1"
18
+ ENGINE_NAME = "aliceADV"
19
+
20
+ # 引擎(模板)目录标记:存在该文件的目录是引擎模板本身,禁止对其直接 build。
21
+ ENGINE_MARKER = ".aliceadv_engine"
22
+
23
+ # 引擎运行时文件:只存在于模板中,不复制进用户工程目录。
24
+ # 构建时由 builder 从模板装配到 dist/web/。
25
+ ENGINE_RUNTIME = ("index.html", "style")
26
+
27
+
28
+ def template_path():
29
+ """返回引擎模板目录。
30
+
31
+ 优先读环境变量 ALICEADV_TEMPLATE(允许外部指定另一份模板,
32
+ 供其他语言实现的编译器或自定义模板复用);缺省用包内 template/。
33
+ """
34
+ env = os.environ.get("ALICEADV_TEMPLATE")
35
+ if env:
36
+ return os.path.abspath(env)
37
+ return os.path.join(os.path.dirname(os.path.abspath(__file__)), "template")
38
+
39
+
40
+ from .creator import create_project
41
+ from .builder import build_project
42
+
43
+ __all__ = [
44
+ "create_project",
45
+ "build_project",
46
+ "template_path",
47
+ "__version__",
48
+ "ENGINE_VERSION",
49
+ "ENGINE_NAME",
50
+ ]
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())