Skip to content

Commit

Permalink
版本推进至3.0.9
Browse files Browse the repository at this point in the history
+ 适配OlivOS 0.10.10 的新Tcl事件循环机制
  • Loading branch information
lunzhiPenxil committed Sep 19, 2022
1 parent b82dd39 commit 5a40b71
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
11 changes: 7 additions & 4 deletions OlivaDiceNativeGUI/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, Model_name, logger_proc = None):
self.UIConfig.update(dictColorContext)

def start(self):
self.UIObject['root'] = tkinter.Tk()
self.UIObject['root'] = tkinter.Toplevel()
self.UIObject['root'].title('OlivaDice 设置面板')
self.UIObject['root'].geometry('800x600')
self.UIObject['root'].minsize(800, 600)
Expand Down Expand Up @@ -98,7 +98,7 @@ def start(self):

self.UIObject['root'].iconbitmap('./resource/tmp_favoricon.ico')
self.UIObject['root'].mainloop()
OlivaDiceNativeGUI.load.flag_open = False
#OlivaDiceNativeGUI.load.flag_open = False

def init_hash_Combobox(self):
self.UIData['hash_Combobox_root_StringVar'] = tkinter.StringVar()
Expand Down Expand Up @@ -150,8 +150,11 @@ def Combobox_ComboboxSelected(self, action, event, target):
self.init_data_total()

def init_notebook(self):
self.UIData['style'] = ttk.Style()
self.UIData['style'].element_create('Plain.Notebook.tab', "from", 'default')
self.UIData['style'] = ttk.Style(self.UIObject['root'])
try:
self.UIData['style'].element_create('Plain.Notebook.tab', "from", 'default')
except:
pass
self.UIData['style'].layout(
"TNotebook.Tab",
[('Plain.Notebook.tab', {'children':
Expand Down
4 changes: 2 additions & 2 deletions OlivaDiceNativeGUI/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"namespace" : "OlivaDiceNativeGUI",
"info" : "本模块为OlivaDice的传统UI模块,可以对骰子进行简单的可视化设置。",
"priority" : 20050,
"version" : "3.0.8",
"svn" : 9,
"version" : "3.0.9",
"svn" : 10,
"compatible_svn" : 101,
"message_mode" : "old_string",
"support" : [
Expand Down
4 changes: 2 additions & 2 deletions OlivaDiceNativeGUI/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
'''


OlivaDiceNativeGUI_ver = '3.0.8'
OlivaDiceNativeGUI_svn = 9
OlivaDiceNativeGUI_ver = '3.0.9'
OlivaDiceNativeGUI_svn = 10
OlivaDiceNativeGUI_ver_short = '%s(%s)' % (str(OlivaDiceNativeGUI_ver), str(OlivaDiceNativeGUI_svn))
2 changes: 2 additions & 0 deletions OlivaDiceNativeGUI/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

listPlugin = []

globalProc = None

def releaseDir(dir_path):
if not os.path.exists(dir_path):
os.makedirs(dir_path)
4 changes: 2 additions & 2 deletions OlivaDiceNativeGUI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def init(plugin_event:OlivOS.API.Event, Proc:OlivOS.pluginAPI.shallow):
pass

def init_after(plugin_event:OlivOS.API.Event, Proc:OlivOS.pluginAPI.shallow):
OlivaDiceNativeGUI.load.globalProc = Proc
OlivaDiceCore.crossHook.dictHookList['model'].append(['OlivaDiceNativeGUI', OlivaDiceNativeGUI.data.OlivaDiceNativeGUI_ver_short])
OlivaDiceNativeGUI.load.listPlugin = Proc.get_plugin_list()
OlivaDiceNativeGUI.load.dictBotInfo = Proc.Proc_data['bot_info_dict']
Expand All @@ -37,10 +38,9 @@ def save(plugin_event:OlivOS.API.Event, Proc:OlivOS.pluginAPI.shallow):
def menu(plugin_event:OlivOS.API.Event, Proc:OlivOS.pluginAPI.shallow):
if(platform.system() == 'Windows'):
if plugin_event.data.event == 'OlivaDiceNativeGUI_001':
if not OlivaDiceNativeGUI.load.flag_open:
if not OlivaDiceNativeGUI.load.flag_open or True:
OlivaDiceNativeGUI.load.flag_open = True
OlivaDiceNativeGUI.GUI.ConfigUI(
Model_name = 'OlivaDiceNativeGUI_manage',
logger_proc = Proc.Proc_info.logger_proc.log
).start()
pass

0 comments on commit 5a40b71

Please sign in to comment.