Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 109 additions & 108 deletions src/.vuepress/sidebar/zh.ts
Original file line number Diff line number Diff line change
@@ -1,108 +1,109 @@
import { sidebar } from "vuepress-theme-hope";

export const zhSidebar = sidebar({
"/": [
{
text: "游戏开发指引",
// prefix: "/",
children: [
"getting-started",
"resources",
"config",
{
text: "部署或发布我的视觉小说?",
link: "publish/",
collapsible: true, // 是否可折叠
prefix: "publish/",
children: [
"web",
"desktop",
"android",
]
},
"faq",
"live2D",
"migration",
"derivative",
],
},
{
text: "WebGAL 脚本教程",
prefix: "webgal-script/",
children: [
"base",
"dialogue",
"bg-and-figure",
"audio",
"video",
"scenes",
"variable",
"animation",
"special-effect",
]
},
{
text: "开发信息",
children: [
"developers",
"tech",
"info",
"sponsor",
"developers/joinus",
"developers/terre",
]
},
{
text: "脚本参考",
prefix: "script-reference/",
children: [
{
text: "命令",
prefix: "commands/",
children:[
"global",
"say",
"changeBg",
"changeFigure",
"bgm",
"playVideo",
"pixiPerform",
"pixiInit",
"intro",
"miniAvatar",
"changeScene",
"choose",
"end",
"setComplexAnimation",
"label",
"jumpLabel",
"setVar",
"callScene",
"showVars",
"unlockCg",
"unlockBgm",
"filmMode",
"setTextbox",
"setAnimation",
"playEffect",
"setTempAnimation",
"comment",
"setTransform",
"setTransition",
"getUserInput",
"applyStyle",
"wait",
]
},
{
text: "其他",
prefix: "others/",
children:[
"transform-reference",
"animation-reference",
]
},
],
},
],
});
import { sidebar } from "vuepress-theme-hope";

export const zhSidebar = sidebar({
"/": [
{
text: "游戏开发指引",
// prefix: "/",
children: [
"getting-started",
"resources",
"config",
{
text: "部署或发布我的视觉小说?",
link: "publish/",
collapsible: true, // 是否可折叠
prefix: "publish/",
children: [
"web",
"desktop",
"android",
]
},
"faq",
"live2D",
"migration",
"derivative",
],
},
{
text: "WebGAL 脚本教程",
prefix: "webgal-script/",
children: [
"base",
"dialogue",
"bg-and-figure",
"audio",
"video",
"scenes",
"variable",
"animation",
"special-effect",
]
},
{
text: "开发信息",
children: [
"developers",
"tech",
"info",
"sponsor",
"developers/joinus",
"developers/terre",
]
},
{
text: "脚本参考",
prefix: "script-reference/",
children: [
{
text: "命令",
prefix: "commands/",
children:[
"global",
"say",
"changeBg",
"changeFigure",
"bgm",
"playVideo",
"pixiPerform",
"pixiInit",
"intro",
"miniAvatar",
"changeScene",
"choose",
"end",
"setComplexAnimation",
"label",
"jumpLabel",
"setVar",
"callScene",
"showVars",
"unlockCg",
"unlockBgm",
"filmMode",
"setTextbox",
"setAnimation",
"playEffect",
"setTempAnimation",
"comment",
"setTransform",
"setTransition",
"getUserInput",
"applyStyle",
"wait",
"callSteam",
]
},
{
text: "其他",
prefix: "others/",
children:[
"transform-reference",
"animation-reference",
]
},
],
},
],
});
1 change: 1 addition & 0 deletions src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| Legacy_Expression_Blend_Mode | 是否启用 Live2D 的旧表情混合模式,设置为 true 或 false |
| Max_line | 文本框的最大显示行数 |
| Line_height | 文本框的行高(单位:em) |
| Steam_AppID | Steam 应用 ID,用于初始化 Steam 集成,仅在 Electron 构建环境下有效 |

以下是配置文件示例:

Expand Down
54 changes: 35 additions & 19 deletions src/script-reference/commands/applyStyle.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
# applyStyle
# applyStyle

更换 UI 样式。

## 语句内容

首先需要在 UI 模板中新写一个样式,然后可以用 `applyStyle` 命令,将新样式替换原样式。
原样式名与新样式名之间用 `->` 连接,您可以同时替换多个样式,每个替换之间用英文逗号 `,` 分隔。
格式如:原样式名->新样式名,原样式名2->新样式名2,...

```webgal
; 将角色名背景替换为红色,前提是在 UI 模板里写了新样式
applyStyle:TextBox_ShowName_Background->TextBox_ShowName_Background_Red;
角色名:这是一句话;
; 同时替换多个样式
applyStyle:TextBox_ShowName_Background->TextBox_ShowName_Background_Green,TextBox_main->TextBox_main_Black;
```

无论原样式被替换为什么新样式,替换样式依旧是原样式名在前;

```webgal
applyStyle:原样式名->新样式名1;
applyStyle:新样式名1->新样式名2; 错误
applyStyle:原样式名->新样式名2;
```

更换 UI 样式。
## 常用可替换样式

## 语句内容
选择枝使用以下样式名:

首先需要在 UI 模板中新写一个样式,然后可以用 `applyStyle` 命令,将新样式替换原样式。
原样式名与新样式名之间用 `->` 连接,您可以同时替换多个样式,每个替换之间用英文逗号 `,` 分隔。
格式如:原样式名->新样式名,原样式名2->新样式名2,...
| 样式名 | 作用 |
| :--- | :--- |
| `Choose_Main` | 选项列表容器 |
| `Choose_item_outer` | 单个选项的外层容器 |
| `Choose_item` | 可点击选项 |
| `Choose_item_disabled` | 条件未满足、不可点击的选项 |

```webgal
; 将角色名背景替换为红色,前提是在 UI 模板里写了新样式
applyStyle:TextBox_ShowName_Background->TextBox_ShowName_Background_Red;
角色名:这是一句话;
; 同时替换多个样式
applyStyle:TextBox_ShowName_Background->TextBox_ShowName_Background_Green,TextBox_main->TextBox_main_Black;
```

无论原样式被替换为什么新样式,替换样式依旧是原样式名在前;

```webgal
applyStyle:原样式名->新样式名1;
applyStyle:新样式名1->新样式名2; 错误
applyStyle:原样式名->新样式名2;
; 将可点击选项替换成模板中定义的 Choose_item_Red
applyStyle:Choose_item->Choose_item_Red;
```
39 changes: 39 additions & 0 deletions src/script-reference/commands/callSteam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# callSteam

通过 Electron / Steam 桥接解锁 Steam 成就。

:::warning 平台限制
此命令仅在具备 Steam / Electron 桥接能力的构建环境下有效。普通网页部署(浏览器直接访问)无法使用此命令,引擎会跳过调用并返回失败结果。
:::

## 前置配置

在 `game/config.txt` 中填写 `Steam_AppID`,WebGAL 会在启动时初始化 Steam 集成。

```text
Steam_AppID:480;
```

详情请见[编辑游戏配置](../../config.md)。

## 语句内容

无语句内容,所有参数通过参数名传入。

## 参数

### achievementId
- 字符串

填写要解锁的 Steam 成就 ID,与 Steam 后台配置的成就 API 名称一致。

```webgal
callSteam: -achievementId=ACH_WIN_ONE_GAME;
```

## 示例

```webgal
; 解锁成就
callSteam: -achievementId=ACH_WIN_ONE_GAME;
```
Loading