--- sidebarDepth: 1 --- # 游戏设置 # 索引 暂停菜单->设置 页面的相关接口 --- | 接口 |
| 描述 | | --- | --- | --- | | [GetToggleOption](游戏设置.md#gettoggleoption) | 客户端 | 获得某个开关设置值的接口 | | [GetUIProfile](游戏设置.md#getuiprofile) | 客户端 | 获取"UI 档案"模式 | | [HighlightBoxSelection](游戏设置.md#highlightboxselection) | 客户端 | 镜头移动时高亮当前视角中心所指的方块 | | [SetSplitControlCanChange](游戏设置.md#setsplitcontrolcanchange) | 客户端 | 设置是否允许使用准星瞄准按钮 | | [SetToggleOption](游戏设置.md#settoggleoption) | 客户端 | 修改开关型设置的接口 | | [SetUIProfile](游戏设置.md#setuiprofile) | 客户端 | 设置"UI 档案"模式 | ## GetToggleOption 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 获得某个开关设置值的接口 - 参数 | 参数名 |
数据类型
| 说明 | | :--- | :--- | :--- | | optionId | str | [OptionId枚举](../枚举值/OptionId.md) | - 返回值 |
数据类型
| 说明 | | :--- | :--- | | int | -1:类型不支持;0:开关关闭; 1: 开关打开; | - 备注 - 选择INPUT_MODE时,返回值为 [InputMode枚举](../枚举值/InputMode.md) - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) print(comp.GetToggleOption(clientApi.GetMinecraftEnum().OptionId.HIDE_PAPERDOLL)) ``` ## GetUIProfile 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 获取"UI 档案"模式 - 参数 无 - 返回值 |
数据类型
| 说明 | | :--- | :--- | | int | 0表示经典模式,1表示Pocket模式 | - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) profile = comp.GetUIProfile() ``` ## HighlightBoxSelection 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 镜头移动时高亮当前视角中心所指的方块 - 参数 | 参数名 |
数据类型
| 说明 | | :--- | :--- | :--- | | isHighlight | bool | 是否高亮,True为高亮,False为不高亮,默认为不高亮 | - 返回值 无 - 备注 - 功能实现上面其实是 设置->视频->轮廓 这一设置的一层代码封装,但不会影响到原本轮廓设置的值,可在开启轮廓选择的情况下,用此接口开关高亮效果,如果在游戏中已经关闭了轮廓选择,则方块只会高亮显示。 - 重启后设置失效 - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) #设置为高亮 comp.HighlightBoxSelection(True) ``` ## SetSplitControlCanChange 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 设置是否允许使用准星瞄准按钮 - 参数 | 参数名 |
数据类型
| 说明 | | :--- | :--- | :--- | | canChange | bool | 是否允许 | - 返回值 |
数据类型
| 说明 | | :--- | :--- | | bool | 是否设置成功 | - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) print(comp.SetSplitControlCanChange(True)) ``` ## SetToggleOption 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 修改开关型设置的接口 - 参数 | 参数名 |
数据类型
| 说明 | | :--- | :--- | :--- | | optionId | str | [OptionId枚举](../枚举值/OptionId.md) | | isOn | bool | 是否打开开关,True为开,False为关 | - 返回值 |
数据类型
| 说明 | | :--- | :--- | | bool | 是否设置成功 | - 备注 - INPUT_MODE为控制器模式,不支持设置 - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) #设置隐藏纸娃娃选项为打开 print(comp.SetToggleOption(clientApi.GetMinecraftEnum().OptionId.HIDE_PAPERDOLL, True)) ``` ## SetUIProfile 客户端 method in mod.client.component.playerViewCompClient.PlayerViewCompClient - 描述 设置"UI 档案"模式 - 参数 | 参数名 |
数据类型
| 说明 | | :--- | :--- | :--- | | profileType | int | 0表示经典模式,1表示Pocket模式 | - 返回值 |
数据类型
| 说明 | | :--- | :--- | | bool | 是否设置成功 | - 示例 ```python import mod.client.extraClientApi as clientApi comp = clientApi.GetEngineCompFactory().CreatePlayerView(levelId) #设置为Pocket模式 print(comp.SetUIProfile(1)) ```