fix:修改代码块缩进、代码块、json格式
This commit is contained in:
@@ -248,20 +248,20 @@ shootButton的锚点,位移XY,尺寸XY的参考属性如下。按照这种
|
||||
3. 然后激活(显示)对应的界面预设
|
||||
|
||||
```python
|
||||
def InitClient(self):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
self.ListenForEngineEvent(UiInitFinishedEvent, self, self.OnUIInitFinished)
|
||||
def InitClient(self):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
self.ListenForEngineEvent(UiInitFinishedEvent, self, self.OnUIInitFinished)
|
||||
```
|
||||
|
||||
```python
|
||||
def OnUIInitFinished(self, args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
if clientApi.GetPlatform() == 0:
|
||||
uiNodePreset = self.GetParent().GetChildPresetsByName("PC版UI界面")[0]
|
||||
else:
|
||||
uiNodePreset = self.GetParent().GetChildPresetsByName("PE版UI界面")[0]
|
||||
if uiNodePreset:
|
||||
uiNodePreset.SetUiActive(True)
|
||||
def OnUIInitFinished(self, args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
if clientApi.GetPlatform() == 0:
|
||||
uiNodePreset = self.GetParent().GetChildPresetsByName("PC版UI界面")[0]
|
||||
else:
|
||||
uiNodePreset = self.GetParent().GetChildPresetsByName("PE版UI界面")[0]
|
||||
if uiNodePreset:
|
||||
uiNodePreset.SetUiActive(True)
|
||||
```
|
||||
|
||||
我们利用[UI API文档](40-UIAPI文档.html)中对各个控件的接口和游戏原生支持的格式化,可以在python代码中动态的改变界面的表现,具体可以参考[样式代码](https://minecraft-zh.gamepedia.com/index.php?title=%E6%A0%B7%E5%BC%8F%E4%BB%A3%E7%A0%81&variant=zh)
|
||||
|
||||
Reference in New Issue
Block a user