Skip to content

Commit

Permalink
Updated docs. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Jan 19, 2025
1 parent 3f91e3e commit 8e869be
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Assets/Script/Lib/Dora/en/App.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ local record App
-- @return (boolean) Whether the log file was saved successfully.
saveLog: function(self: App, path: string): boolean

-- A function that opens a file dialog.
-- A function that opens a file dialog. Only works on Windows, macOS and Linux.
-- @param folderOnly (boolean) Whether the file dialog is only for selecting folders.
-- @param callback (function) The callback function to be called when the file dialog is closed. The callback function should accept a string parameter which is the path of the selected file or folder. Get empty string if the user canceled the dialog.
openFileDialog: function(self: App, folderOnly: boolean, callback: function(path: string))
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Lib/Dora/en/Dora.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ interface App {
saveLog(path: string): boolean;

/**
* A function that opens a file dialog.
* A function that opens a file dialog. Only works on Windows, macOS and Linux.
* @param folderOnly Whether the file dialog is only for selecting folders.
* @param callback The callback function to be called when the file dialog is closed. The callback function should accept a string parameter which is the path of the selected file or folder. Get empty string if the user canceled the dialog.
*/
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Lib/Dora/zh-Hans/App.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ local record App
-- @return (boolean) 日志文件是否保存成功。
saveLog: function(self: App, path: string): boolean

-- 打开一个文件对话框。
-- 打开一个文件对话框。仅在WindowsmacOSLinux平台上有效。
-- @param folderOnly (boolean) 是否仅允许选择文件夹。
-- @param callback (function) 当文件对话框关闭时调用的回调函数。回调函数应接受一个字符串参数,该参数为选中的文件或文件夹的路径。如果用户取消对话框,则返回空字符串。
openFileDialog: function(self: App, folderOnly: boolean, callback: function(path: string))
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Lib/Dora/zh-Hans/Dora.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ interface App {
saveLog(path: string): boolean;

/**
* 打开一个文件对话框。
* 打开一个文件对话框。仅在Windows、macOS和Linux平台上有效。
* @param folderOnly 是否仅允许选择文件夹。
* @param callback 当文件对话框关闭时调用的回调函数。回调函数应接受一个字符串参数,该参数为选中的文件或文件夹的路径。如果用户取消对话框,则返回空字符串。
*/
Expand Down
20 changes: 20 additions & 0 deletions Docs/docs/api/Class/App.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,26 @@ saveLog: function(self: App, path: string): boolean
| --- | --- |
| boolean | Whether the log file was saved successfully. |

## openFileDialog

**Type:** Function.

**Description:**

  A function that opens a file dialog. Only works on Windows, macOS and Linux.

**Signature:**
```tl
openFileDialog: function(self: App, folderOnly: boolean, callback: function(path: string))
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| folderOnly | boolean | Whether the file dialog is only for selecting folders. |
| callback | function | The callback function to be called when the file dialog is closed. The callback function should accept a string parameter which is the path of the selected file or folder. Get empty string if the user canceled the dialog. |

## shutdown

**Type:** Function.
Expand Down
25 changes: 19 additions & 6 deletions Docs/docs/api/Class/Content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,41 @@ searchPaths: {string}

## assetPath

**Type:** Readonly Field.
**Type:** Field.

**Description:**

  The path to the directory containing read-only resources.
  The path to the directory containing read-only resources. Can only be altered by the user on platform Windows, MacOS and Linux.

**Signature:**
```tl
const assetPath: string
assetPath: string
```

## writablePath

**Type:** Readonly Field.
**Type:** Field.

**Description:**

  The path to the directory where files can be written. Can only be altered by the user on platform Windows, MacOS and Linux. Default is the same as the `appPath`.

**Signature:**
```tl
writablePath: string
```

## appPath

**Type:** Field.

**Description:**

  The path to the directory where files can be written.
  The path to the directory for the application storage.

**Signature:**
```tl
const writablePath: string
appPath: string
```

## load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,26 @@ saveLog: function(self: App, path: string): boolean
| --- | --- |
| boolean | 日志文件是否保存成功。 |

## openFileDialog

**类型:** 函数。

**描述:**

  打开一个文件对话框。仅在Windows、macOS和Linux平台上有效。

**签名:**
```tl
openFileDialog: function(self: App, folderOnly: boolean, callback: function(path: string))
```

**参数:**

| 参数名 | 类型 | 描述 |
| --- | --- | --- |
| folderOnly | boolean | 是否仅允许选择文件夹。 |
| callback | function | 当文件对话框关闭时调用的回调函数。回调函数应接受一个字符串参数,该参数为选中的文件或文件夹的路径。如果用户取消对话框,则返回空字符串。 |

## shutdown

**类型:** 函数。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,41 @@ searchPaths: {string}

## assetPath

**类型:** 只读成员变量
**类型:** 成员变量

**描述:**

  游戏引擎只读资源所在目录的路径。
  游戏引擎只读资源所在目录的路径。只有在平台 Windows、MacOS 和 Linux 上能被设置为新路径。

**签名:**
```tl
const assetPath: string
assetPath: string
```

## writablePath

**类型:** 只读成员变量。
**类型:** 成员变量。

**描述:**

  游戏引擎可以做写入操作的文件路径。只有在平台 Windows、MacOS 和 Linux 上能被设置为新路径。默认与 `appPath` 相同。

**签名:**
```tl
writablePath: string
```

## appPath

**类型:** 成员变量。

**描述:**

  游戏引擎可以做写入操作的文件路径
  游戏引擎应用程序存储目录的路径

**签名:**
```tl
const writablePath: string
appPath: string
```

## load
Expand Down

0 comments on commit 8e869be

Please sign in to comment.