@@ -115,17 +115,22 @@ func transition_overlay(to_visible:bool)->void:
115
115
func fill_catalog ():
116
116
# Get girl paths
117
117
var all_paths :Dictionary = all_girl_paths ()
118
- var seen_paths :Dictionary = seen_girl_paths ()
118
+ var seen_pathnames :Dictionary = seen_girl_pathnames ()
119
119
120
- # Get catalog container
120
+ # Get catalog nodes
121
121
var flow :FlowContainer = catalog_dock .get_node ("Background/Scroll/Flow" )
122
122
var portrait_template :TextureRect = flow .get_node ("Portrait" )
123
+ var counter_label :Label = catalog_dock .get_node ("Background/Counter" )
123
124
124
125
# Clear existing girls
125
126
for portrait :Node in flow .get_children ():
126
127
if portrait != portrait_template :
127
128
portrait .queue_free ()
128
129
130
+ # Count girls
131
+ var unseen_count :int = 0
132
+ var seen_count :int = 0
133
+
129
134
# Add each girl to catalog
130
135
for type :String in all_paths :
131
136
for girl_path :String in all_paths [type ]:
@@ -137,12 +142,14 @@ func fill_catalog():
137
142
portrait .texture = load (addon_path .path_join ("Images/Girls" ).path_join (type ).path_join (girl_path ))
138
143
139
144
# Show girl if seen
140
- if seen_paths .has (girl_pathname ):
145
+ if seen_pathnames .has (girl_pathname ):
146
+ seen_count += 1
141
147
portrait .tooltip_text = girl_pathname \
142
- + "\n Type: " + type \
143
- + "\n Seen: " + str ( seen_paths [ girl_pathname ]) + " times"
148
+ + "\n Type: {0} " . format ([ type ]) \
149
+ + "\n Seen: {0} times" . format ([ seen_pathnames [ girl_pathname ]])
144
150
# Lock girl if not seen
145
151
else :
152
+ unseen_count += 1
146
153
portrait .self_modulate = Color .BLACK
147
154
portrait .tooltip_text = "Locked"
148
155
@@ -152,6 +159,9 @@ func fill_catalog():
152
159
153
160
# Wait to prevent freezing
154
161
await get_tree ().process_frame
162
+
163
+ # Render counter
164
+ counter_label .text = "Seen: {0} /{1} " .format ([seen_count , seen_count + unseen_count ])
155
165
156
166
func save_progress (progress :Dictionary )-> void :
157
167
var save_file :FileAccess = FileAccess .open (save_path , FileAccess .WRITE )
@@ -171,7 +181,7 @@ func save_seen_girl(girl_pathname:String)->void:
171
181
save_progress (progress )
172
182
fill_catalog ()
173
183
174
- func seen_girl_paths ()-> Dictionary :
184
+ func seen_girl_pathnames ()-> Dictionary :
175
185
var progress :Dictionary = load_progress ()
176
186
return progress .get_or_add ("seen" , {})
177
187
0 commit comments