Skip to content

Commit

Permalink
牌堆市场支持资源包下载与多种牌堆
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Oct 26, 2023
1 parent 97f1850 commit 477a772
Showing 1 changed file with 50 additions and 38 deletions.
88 changes: 50 additions & 38 deletions OlivaDiceNativeGUI/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,25 +1213,36 @@ def reload_deck_info(self):
tmp_dataList = OlivaDiceOdyssey.webTool.gExtiverseDeck
tmp_deckName = self.UIData['deck_remote_now']
self.UIObject['label_deck_note'].delete('1.0', tkinter.END)
if type(tmp_dataList) is dict \
and 'classic' in tmp_dataList \
and type(tmp_dataList['classic']) is list:
for deck_this in tmp_dataList['classic']:
if 'name' in deck_this \
and 'desc' in deck_this \
and 'version' in deck_this \
and 'version_code' in deck_this \
and 'author' in deck_this \
and deck_this['name'] == tmp_deckName:
tmp_text = '%s\n\n作者: %s\n版本: %s(%s)\n\n%s' % (
str(deck_this['name']),
str(deck_this['author']),
str(deck_this['version']),
str(deck_this['version_code']),
str(deck_this['desc'])
)
self.UIObject['label_deck_note'].insert('1.0', tmp_text)
break
for deck_type_this in ['classic', 'yaml', 'excel']:
if type(tmp_dataList) is dict \
and deck_type_this in tmp_dataList \
and type(tmp_dataList[deck_type_this]) is list:
for deck_this in tmp_dataList[deck_type_this]:
if 'name' in deck_this \
and 'desc' in deck_this \
and 'version' in deck_this \
and 'version_code' in deck_this \
and 'author' in deck_this \
and 'type' in deck_this \
and 'sub_type' in deck_this \
and deck_this['name'] == tmp_deckName:
tmp_text = '%s\n\n%s\n作者: %s\n版本: %s(%s)\n\n%s' % (
str(deck_this['name']),
str({
'classic': '青果系JSON',
'yaml': '塔系YAML',
'excel': '梨系Excel'
}.get(deck_this['sub_type'], '新型')
) + str({
'deck': '牌堆',
}.get(deck_this['type'], '未知扩展')),
str(deck_this['author']),
str(deck_this['version']),
str(deck_this['version_code']),
str(deck_this['desc'])
)
self.UIObject['label_deck_note'].insert('1.0', tmp_text)
break
self.UIObject['label_deck_note'].configure(state=tkinter.DISABLED)

def reloadDeck_local_gen(self):
Expand Down Expand Up @@ -1770,23 +1781,24 @@ def init_data_deck_remote(self):
for tmp_tree_item_this in tmp_tree_item_children:
self.UIObject['tree_deck_remote'].delete(tmp_tree_item_this)
tmp_dataList = OlivaDiceOdyssey.webTool.gExtiverseDeck
if type(tmp_dataList) is dict \
and 'classic' in tmp_dataList \
and type(tmp_dataList['classic']) is list:
for deck_this in tmp_dataList['classic']:
if 'name' in deck_this \
and 'author' in deck_this:
deckName_this = deck_this['name']
deckAuthor_this = deck_this['author']
try:
self.UIObject['tree_deck_remote'].insert(
'',
tkinter.END,
text = deckName_this,
values=(
deckName_this,
deckAuthor_this
for deck_type_this in ['classic', 'yaml', 'excel']:
if type(tmp_dataList) is dict \
and deck_type_this in tmp_dataList \
and type(tmp_dataList[deck_type_this]) is list:
for deck_this in tmp_dataList[deck_type_this]:
if 'name' in deck_this \
and 'author' in deck_this:
deckName_this = deck_this['name']
deckAuthor_this = deck_this['author']
try:
self.UIObject['tree_deck_remote'].insert(
'',
tkinter.END,
text = deckName_this,
values=(
deckName_this,
deckAuthor_this
)
)
)
except:
pass
except:
pass

0 comments on commit 477a772

Please sign in to comment.