Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf6b1da

Browse filesBrowse files
authored
Fix XL beakers not showing reagent fill state (yogstation13#20952)
1 parent 4e3cff3 commit cf6b1da
Copy full SHA for cf6b1da

1 file changed

+14-13Lines changed: 14 additions & 13 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • code/modules/reagents/reagent_containers
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/modules/reagents/reagent_containers/glass.dm‎

Copy file name to clipboardExpand all lines: code/modules/reagents/reagent_containers/glass.dm
+14-13Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,28 @@
127127
. = ..()
128128
if(!reagents.total_volume)
129129
return
130-
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]10")
130+
var/base_state = base_icon_state
131+
if(isnull(base_state))
132+
base_state = icon_state
133+
134+
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[base_state]10")
131135

132136
var/percent = round((reagents.total_volume / volume) * 100)
133137
switch(percent)
134138
if(0 to 9)
135-
filling.icon_state = "[icon_state]-10"
139+
filling.icon_state = "[base_state]-10"
136140
if(10 to 24)
137-
filling.icon_state = "[icon_state]10"
141+
filling.icon_state = "[base_state]10"
138142
if(25 to 49)
139-
filling.icon_state = "[icon_state]25"
143+
filling.icon_state = "[base_state]25"
140144
if(50 to 74)
141-
filling.icon_state = "[icon_state]50"
145+
filling.icon_state = "[base_state]50"
142146
if(75 to 79)
143-
filling.icon_state = "[icon_state]75"
147+
filling.icon_state = "[base_state]75"
144148
if(80 to 90)
145-
filling.icon_state = "[icon_state]80"
149+
filling.icon_state = "[base_state]80"
146150
if(91 to INFINITY)
147-
filling.icon_state = "[icon_state]100"
151+
filling.icon_state = "[base_state]100"
148152

149153
filling.color = mix_color_from_reagents(reagents.reagent_list)
150154
. += filling
@@ -168,16 +172,13 @@
168172
name = "x-large beaker"
169173
desc = "An extra-large beaker. Can hold up to 120 units."
170174
icon_state = "beakerwhite"
175+
/// Overrides the base state used for the fill overlay
176+
base_icon_state = "beakerlarge"
171177
materials = list(/datum/material/glass=2500, /datum/material/plastic=3000)
172178
volume = 120
173179
amount_per_transfer_from_this = 10
174180
possible_transfer_amounts = list(5,10,15,20,25,30,60,120)
175181

176-
/obj/item/reagent_containers/glass/beaker/plastic/update_icon_state()
177-
icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
178-
. = ..()
179-
icon_state = "beakerwhite"
180-
181182
/obj/item/reagent_containers/glass/beaker/meta
182183
name = "metamaterial beaker"
183184
desc = "A large beaker. Can hold up to 180 units."

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.