Skip to content

Commit 5cda671

Browse files
committed
'OnlyOwnership' icons update
1 parent f37a8cb commit 5cda671

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

Scenes/OnlyOwnership.gd

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ extends PanelContainer
22
onready var oSelection = Nodelist.list["oSelection"]
33
onready var oPickSlabWindow = Nodelist.list["oPickSlabWindow"]
44
onready var oCurrentFormat = Nodelist.list["oCurrentFormat"]
5+
onready var oSlabTabs = Nodelist.list["oSlabTabs"]
56

67
var scnOwnerButton = preload("res://Scenes/OnlyOwnershipButton.tscn")
78
onready var oSelectedRect = get_node("../../../../Clippy/SelectedRect")
89

9-
func initialize_grid_items():
10+
func update_grid_items():
1011
var oGridContainer = current_grid_container()
1112

13+
for i in oGridContainer.get_children():
14+
i.free()
15+
1216
var owner_order
1317
if oCurrentFormat.selected == 0: # Classic format
1418
owner_order = [0,1,2,3,4,5]
@@ -45,6 +49,13 @@ func initialize_grid_items():
4549
8: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_orange_std.png")
4650

4751
oGridContainer.add_child(id)
52+
53+
# Refresh tab by switching away then back
54+
if oSlabTabs.get_current_tab_control().name == "OnlyOwnership":
55+
var ontab = oSlabTabs.current_tab
56+
oSlabTabs.current_tab = ontab-1
57+
yield(get_tree(),'idle_frame')
58+
oSlabTabs.current_tab = ontab
4859

4960
func _on_OwnerButtonPressed(id):
5061

Scenes/OpenMap.gd

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ onready var oGuidelines = Nodelist.list["oGuidelines"]
4848
onready var oResizeCurrentMapSize = Nodelist.list["oResizeCurrentMapSize"]
4949
onready var oOwnerSelection = Nodelist.list["oOwnerSelection"]
5050
onready var oScriptGenerator = Nodelist.list["oScriptGenerator"]
51+
onready var oOnlyOwnership = Nodelist.list["oOnlyOwnership"]
5152

5253
var TOTAL_TIME_TO_OPEN_MAP
5354

@@ -251,6 +252,7 @@ func continue_load_openmap(map):
251252
oOwnerSelection.update_ownership_head_icons()
252253
oScriptGenerator.update_options_based_on_mapformat()
253254
oPickSlabWindow.add_slabs()
255+
oOnlyOwnership.update_grid_items()
254256
oDynamicMapTree.highlight_current_map()
255257
oCurrentMap.set_path_and_title(map)
256258
oCamera2D.reset_camera(M.xSize, M.ySize)

Scenes/PickSlabWindow.gd

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func update_selection_position():
7373
func add_slabs():
7474
var CODETIME_START = OS.get_ticks_msec()
7575
clear_grid()
76-
oOnlyOwnership.initialize_grid_items()
7776
oSlabStyle.initialize_grid_items()
7877

7978
var allSlabIDs = []

Scenes/Properties.gd

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ onready var oHBoxOptions = Nodelist.list["oHBoxOptions"]
3131
onready var oHBoxLandView = Nodelist.list["oHBoxLandView"]
3232
onready var oHBoxNameID = Nodelist.list["oHBoxNameID"]
3333
onready var oScriptGenerator = Nodelist.list["oScriptGenerator"]
34+
onready var oOnlyOwnership = Nodelist.list["oOnlyOwnership"]
3435

3536
const kind_options = {
3637
"Solo" : "FREE",
@@ -114,6 +115,7 @@ func set_format_selection(setFormat):
114115
oPlacingSettings.update_placing_tab()
115116
oInspector.deselect()
116117
oOwnerSelection.update_ownership_head_icons()
118+
oOnlyOwnership.update_grid_items()
117119
oScriptGenerator.update_options_based_on_mapformat()
118120

119121
func refresh_dungeon_style_options():

0 commit comments

Comments
 (0)