-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
782a150
commit 76ecffc
Showing
4 changed files
with
220 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
extends WindowDialog | ||
onready var oCfgLoader = Nodelist.list["oCfgLoader"] | ||
onready var oFileListGridA = Nodelist.list["oFileListGridA"] | ||
onready var oFileListGridB = Nodelist.list["oFileListGridB"] | ||
onready var oFileListGridC = Nodelist.list["oFileListGridC"] | ||
|
||
|
||
func _on_ConfigFilesListWindow_about_to_show(): | ||
update_everything() | ||
|
||
func update_everything(): | ||
print("update_everything") | ||
for gridParent in [oFileListGridA, oFileListGridB, oFileListGridC]: | ||
for child in gridParent.get_children(): | ||
child.queue_free() | ||
|
||
print(oCfgLoader.paths_loaded) | ||
|
||
for cfg_type in [oCfgLoader.LOAD_CFG_FXDATA, oCfgLoader.LOAD_CFG_CAMPAIGN, oCfgLoader.LOAD_CFG_CURRENT_MAP]: | ||
if oCfgLoader.paths_loaded.has(cfg_type) == false: | ||
continue | ||
|
||
var addToGrid | ||
|
||
match cfg_type: | ||
oCfgLoader.LOAD_CFG_FXDATA: | ||
addToGrid = oFileListGridA | ||
oCfgLoader.LOAD_CFG_CAMPAIGN: | ||
addToGrid = oFileListGridB | ||
oCfgLoader.LOAD_CFG_CURRENT_MAP: | ||
addToGrid = oFileListGridC | ||
|
||
for path in oCfgLoader.paths_loaded[cfg_type]: | ||
if path: | ||
add_linkbutton(path, addToGrid) | ||
|
||
func add_linkbutton(path, addToGrid): | ||
var id = LinkButton.new() | ||
id.connect("pressed", self, "_on_linkbutton_pressed", [path]) | ||
id.underline = LinkButton.UNDERLINE_MODE_ON_HOVER | ||
id.text = path | ||
addToGrid.add_child(id) | ||
|
||
func _on_linkbutton_pressed(path): | ||
OS.shell_open(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters