菜单功能

This commit is contained in:
Giao committed 2026-09-28 11:18:26 +08:00
1 parent a647878ac1
commit 3b63794fe4
42 files changed
+1627 -106

No files matched your search

@@ -1,5 +1,6 @@
# coding=utf-8
import time
from math import *
class GraduallySum(object):
@@ -72,7 +72,7 @@ class SystemTools(object):
"""
return self.ListenForEvent(namespace=MOD_NAME, systemName='BlueFoxClientSystem')
def ListenForEvent(self, eventName=None, namespace=MC_SYSTEM_NAMESPACE, systemName=MC_SYSTEM_NAME, priority=0):
def ListenForEvent(self, namespace=MC_SYSTEM_NAMESPACE, systemName=MC_SYSTEM_NAME, eventName=None, priority=0):
"""
监听事件,binding的服务端可监听服务端事件,binding的客户端则可监听客户端事件
:param eventName: 可选:事件名 or 不传入参数.若不传入参数,则将函数名称视为事件名称
@@ -99,13 +99,14 @@ class SystemTools(object):
self.bindingInstance.ListenForEvent(*eventName)
self.lastListened.add(eventName)
def FilterListener(self, eventName, namespace=MC_SYSTEM_NAMESPACE, systemName=MC_SYSTEM_NAME, priority=0):
def FilterListener(self, namespace=MC_SYSTEM_NAMESPACE, systemName=MC_SYSTEM_NAME, eventName=None, priority=0):
"""
滤过监听器, 通常用于优化代码可读性
"""
def Filter(*args):
# type:(Callable) -> Callable
def Listener(func):
_filter = EventFilter(func, self.bindingInstance, *args)
EventName = (namespace, systemName, eventName, _filter, _filter.Filter, priority)
@@ -5,7 +5,7 @@ import mod.client.extraClientApi as clientApi
import mod.server.extraServerApi as serverApi
if False:
pass
from typing import *
IsDebug = 1
@@ -155,4 +155,8 @@ if not serverApi.IsInServer():
nativeScreenManager = clientApi.GetNativeScreenManagerCls().instance() # type:clientApi.GetNativeScreenManagerCls()
viewBinder = clientApi.GetViewBinderCls()
baseScreen = clientApi.GetScreenNodeCls()
customUIScreenProxy = clientApi.GetUIScreenProxyCls()
customUIScreenProxy = clientApi.GetUIScreenProxyCls()
RootScreenPathHead = (
'variables_button_mappings_and_controls/safezone_screen_matrix/'
'inner_matrix/safezone_screen_panel/root_screen_panel'
)