Adds liquidbelly overlay max height setting (#6689)

This commit is contained in:
Verkister
2023-07-31 15:08:28 +03:00
committed by GitHub
parent 97769dbf9f
commit 05466fd498
5 changed files with 33 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
var/show_liquids = FALSE //Moved from vorepanel_ch to be a belly var
var/show_fullness_messages = FALSE //Moved from vorepanel_ch to be a belly var
var/liquid_overlay = TRUE //Belly-specific liquid overlay toggle
var/max_liquid_level = 100 //Custom max level for liquid overlay
var/mush_overlay = FALSE //Toggle for nutrition mush overlay
var/mush_color = "#664330" //Nutrition mush overlay color
var/mush_alpha = 255 //Mush overlay transparency.

View File

@@ -262,6 +262,7 @@
"reagentid",
"reagentcolor",
"liquid_overlay",
"max_liquid_level",
"mush_overlay",
"mush_color",
"mush_alpha",
@@ -551,7 +552,7 @@
I.alpha = custom_reagentalpha
else
I.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
I.pixel_y = -450 + (450 / custom_max_volume * reagents.total_volume)
I.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
F.add_overlay(I)
F.update_for_view(L.client.view)
else
@@ -585,7 +586,7 @@
I.alpha = custom_reagentalpha
else
I.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
I.pixel_y = -450 + (450 / custom_max_volume * reagents.total_volume)
I.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
F.add_overlay(I)
F.update_for_view(L.client.view)
//CHOMPEdit End
@@ -664,7 +665,7 @@
I.alpha = custom_reagentalpha
else
I.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
I.pixel_y = -450 + (450 / custom_max_volume * reagents.total_volume)
I.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
F.add_overlay(I)
F.update_for_view(L.client.view)
else
@@ -697,7 +698,7 @@
I.alpha = custom_reagentalpha
else
I.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
I.pixel_y = -450 + (450 / custom_max_volume * reagents.total_volume)
I.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
F.add_overlay(I)
F.update_for_view(L.client.view)
//CHOMPEdit End
@@ -1652,6 +1653,7 @@
dupe.reagentid = reagentid
dupe.reagentcolor = reagentcolor
dupe.liquid_overlay = liquid_overlay
dupe.max_liquid_level = max_liquid_level
dupe.mush_overlay = mush_overlay
dupe.mush_color = mush_color
dupe.mush_alpha = mush_alpha

View File

@@ -238,6 +238,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
"custom_reagentcolor" = selected.custom_reagentcolor,
"custom_reagentalpha" = selected.custom_reagentalpha,
"liquid_overlay" = selected.liquid_overlay,
"max_liquid_level" = selected.max_liquid_level,
"mush_overlay" = selected.mush_overlay,
"mush_color" = selected.mush_color,
"mush_alpha" = selected.mush_alpha,
@@ -378,6 +379,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
selected_list["liq_interacts"]["custom_reagentcolor"] = selected.custom_reagentcolor ? selected.custom_reagentcolor : selected.reagentcolor
selected_list["liq_interacts"]["custom_reagentalpha"] = selected.custom_reagentalpha ? selected.custom_reagentalpha : "Default"
selected_list["liq_interacts"]["liquid_overlay"] = selected.liquid_overlay
selected_list["liq_interacts"]["max_liquid_level"] = selected.max_liquid_level
selected_list["liq_interacts"]["mush_overlay"] = selected.mush_overlay
selected_list["liq_interacts"]["mush_color"] = selected.mush_color
selected_list["liq_interacts"]["mush_alpha"] = selected.mush_alpha
@@ -1283,6 +1285,10 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
if(new_liquid_overlay == 1)
new_belly.liquid_overlay = TRUE
if(isnum(belly_data["max_liquid_level"]))
var/max_liquid_level = belly_data["max_liquid_level"]
new_belly.max_liquid_level = CLAMP(max_liquid_level, 0, 100)
if(isnum(belly_data["mush_overlay"]))
var/new_mush_overlay = belly_data["mush_overlay"]
if(new_mush_overlay == 0)
@@ -2987,6 +2993,14 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
host.vore_selected.liquid_overlay = 0
to_chat(usr,"<span class='warning'>Your [lowertext(host.vore_selected.name)] no longer has liquid overlay enabled.</span>")
. = TRUE
if("b_max_liquid_level")
var/new_max_liquid_level = input(user, "Set custom maximum liquid level. 0-100%", "Set Custom Max Level.", host.vore_selected.max_liquid_level) as num|null
if(new_max_liquid_level == null)
return FALSE
var/new_new_max_liquid_level = CLAMP(new_max_liquid_level, 0, 100)
host.vore_selected.max_liquid_level = new_new_max_liquid_level
host.vore_selected.update_internal_overlay()
. = TRUE
if("b_custom_reagentcolor")
var/newcolor = input(usr, "Choose custom color for liquid overlay. Cancel for normal reagent color.", "", host.vore_selected.custom_reagentcolor) as color|null
if(newcolor)

View File

@@ -1707,6 +1707,7 @@ const VoreSelectedBellyLiquidOptions = (props, context) => {
custom_reagentcolor,
custom_reagentalpha,
liquid_overlay,
max_liquid_level,
mush_overlay,
mush_color,
mush_alpha,
@@ -1840,6 +1841,16 @@ const VoreSelectedBellyLiquidOptions = (props, context) => {
content={liq_interacts.liquid_overlay ? 'On' : 'Off'}
/>
</LabeledList.Item>
<LabeledList.Item label="Max Liquid Level">
<Button
onClick={() =>
act('liq_set_attribute', {
liq_attribute: 'b_max_liquid_level',
})
}
content={liq_interacts.max_liquid_level + '%'}
/>
</LabeledList.Item>
<LabeledList.Item label="Custom Liquid Alpha">
<Button
onClick={() =>

File diff suppressed because one or more lines are too long