Skip to content

Commit 1520a05

Browse files
committed
Added support of game.droid and game.ios
1 parent 3135480 commit 1520a05

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

main_window.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,24 @@ def open_file(self, rel_path):
193193
self.tabs.setCurrentWidget(tab)
194194

195195
if type == "gm":
196-
data_path, ext = rel_path.split('.win/',1)
196+
ext_using = ".win"
197+
if (rel_path.contains(".droid")):
198+
ext_using = ".droid"
199+
elif (rel_path.contains(".ios")):
200+
ext_using = ".ios"
201+
data_path, ext = rel_path.split(ext_using+'/',1)
197202
ext, id = ext.split('/',1)
198203
editor_class = self.editor_types.get(ext)
199204
if rel_path in self.current_editors:
200205
self.tabs.setCurrentWidget(self.current_editors[rel_path])
201206
return
202-
data_path = data_path + ".win"
207+
data_path = data_path + ext_using
203208
editor = editor_class(self.file_explorer.data[0][data_path], self.file_explorer.data[1][data_path], id)
204209
tab = QWidget()
205210
tab.rel_path = rel_path
206211
layout = QVBoxLayout(tab)
207212
layout.addWidget(editor)
208-
save_btn = QPushButton("写入 data.win")
213+
save_btn = QPushButton("写入 data")
209214
target_path = os.path.join(self.project_manager.current_project['target'], data_path)
210215
save_btn.clicked.connect(lambda: fs.save_file_gm(self, target_path, self.file_explorer.data[1][data_path]))
211216
layout.addWidget(save_btn)

widgets/file_explorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _populate_tree(self, parent, path, base_data):
108108
node.setText(0, item_name)
109109
if os.path.isdir(item_path):
110110
self._populate_tree(node, item_path, base_data)
111-
elif item_name.endswith('.win'):
111+
elif item_name.endswith('.win') or item_name.endswith('.droid') or item_name.endswith('.ios'):
112112
self._populate_tree_gm(node, item_path, base_data)
113113
else:
114114
rel_path = os.path.relpath(item_path, base_data['source'])

0 commit comments

Comments
 (0)