move the internal preview to canvas (#18930)

* move the internal preview to canvas

* use a helper

* basic readme prep

* .

* .

* transform  better

* byond can't handle icon states of large files...

* move fully to the rust version

* fix typing

* just wtf. NO

* fix the legacy path

* keep it all centralized

* tiny oversight

* unit test rewrite

* rename

* fix bad layering

* fixes a bunch of layering issues

* artifact

* move crash to log_runtime

* missing overlay warning

* why not
This commit is contained in:
Kashargul
2025-12-24 05:28:39 +01:00
committed by GitHub
parent c4134dbf04
commit 92182e0946
79 changed files with 477 additions and 310 deletions
+2 -2
View File
@@ -828,9 +828,9 @@
if(new_disable_hud == 1)
new_belly.disable_hud = TRUE
var/possible_fullscreens = cached_icon_states('icons/mob/screen_full_vore_list.dmi')
var/possible_fullscreens = icon_states_fast('icons/mob/vore_fullscreens/ui_lists/screen_full_vore_list_base.dmi')
if(!new_belly.colorization_enabled)
possible_fullscreens = cached_icon_states('icons/mob/screen_full_vore.dmi')
possible_fullscreens = icon_states_fast('icons/mob/vore_fullscreens/ui_lists/screen_full_vore.dmi')
if(!(new_belly.belly_fullscreen in possible_fullscreens))
new_belly.belly_fullscreen = ""
@@ -39,11 +39,11 @@
continue
if(reagents.total_volume)
reagents.trans_to(I, affecting_amt, 1, FALSE)
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX, FALSE, reagents.total_volume) // Signals vore_fx() reagents updates.
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX, reagents.total_volume) // Signals vore_fx() reagents updates.
for(var/mob/living/L in contents)
vore_fx(L, FALSE, reagents.total_volume)
vore_fx(L, reagents.total_volume)
if(owner.previewing_belly == src)
vore_fx(owner, FALSE, reagents.total_volume)
vore_fx(owner, reagents.total_volume)
/obj/belly/proc/GenerateBellyReagents()
if(isrobot(owner))
@@ -57,7 +57,7 @@
if(count_liquid_for_sprite)
owner.handle_belly_update() //This is run whenever a belly's contents are changed.
if(LAZYLEN(belly_surrounding))
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX, FALSE, reagents.total_volume) // Signals vore_fx() reagents updates.
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX, reagents.total_volume) // Signals vore_fx() reagents updates.
//////////////////////////// REAGENT_DIGEST ////////////////////////
@@ -325,15 +325,15 @@
/obj/belly/proc/update_internal_overlay()
if(LAZYLEN(belly_surrounding))
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX, TRUE) // Signals vore_fx() to listening atoms. Atoms must handle appropriate isliving() checks.
SEND_SIGNAL(src, COMSIG_BELLY_UPDATE_VORE_FX) // Signals vore_fx() to listening atoms. Atoms must handle appropriate isliving() checks.
for(var/A in belly_surrounding)
if(isliving(A))
vore_fx(A,1)
vore_fx(A)
if(owner.previewing_belly == src)
if(isbelly(owner.loc))
owner.previewing_belly = null
return
vore_fx(owner,1)
vore_fx(owner)
/obj/belly/deserialize(var/list/data)
..()
+5 -7
View File
@@ -588,9 +588,9 @@
var/taste
if(can_taste && living_mob.loc == src && (taste = living_mob.get_taste_message(FALSE))) // Prevent indirect tasting
to_chat(owner, span_vnotice("[living_mob] tastes of [taste]."))
vore_fx(living_mob, TRUE)
vore_fx(living_mob)
if(owner.previewing_belly == src)
vore_fx(owner, TRUE)
vore_fx(owner)
//Stop AI processing in bellies
if(living_mob.ai_holder)
living_mob.ai_holder.go_sleep()
@@ -653,7 +653,7 @@
// SEND_SIGNAL(COMSIG_BELLY_UPDATE_VORE_FX) is sometimes used when calling vore_fx() to send belly visuals
// to certain non-belly atoms. Not called here as vore_fx() is usually only called if a mob is in the belly.
// Don't forget it if you need to rework vore_fx().
/obj/belly/proc/vore_fx(mob/living/L, var/update, var/severity = 0)
/obj/belly/proc/vore_fx(mob/living/L, var/severity = 0)
if(!istype(L))
return
if(!L.client)
@@ -667,8 +667,6 @@
L.clear_fullscreen("belly")
L.previewing_belly = null
return
if(update)
L.clear_fullscreen("belly")
if(belly_fullscreen)
if(colorization_enabled)
var/atom/movable/screen/fullscreen/F = L.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly, severity) // preserving save data
@@ -677,7 +675,7 @@
var/used_fullscreen = belly_fullscreen
to_chat(owner, span_warning("The belly overlay ([used_fullscreen]) you've selected for [src] no longer exists. Please reselect your overlay."))
belly_fullscreen = null
CRASH("Icon datum was not defined for [used_fullscreen]")
log_runtime("Icon datum was not defined for [used_fullscreen]")
var/alpha = min(belly_fullscreen_alpha, L.max_voreoverlay_alpha)
F.icon = initial(lookup_belly_path.belly_icon)
@@ -750,7 +748,7 @@
F.update_for_view(L.client.view)
else
var/atom/movable/screen/fullscreen/F = L.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly/fixed, severity) //preserving save data
F.icon = 'icons/mob/screen_full_vore.dmi'
F.icon = 'icons/mob/vore_fullscreens/ui_lists/screen_full_vore.dmi'
F.cut_overlays()
F.add_overlay(image(F.icon, belly_fullscreen))
F.add_overlay(image(F.icon, belly_fullscreen+"-2"))
-3
View File
@@ -1098,11 +1098,8 @@
// Full screen belly overlays!
/atom/movable/screen/fullscreen/belly
icon = 'icons/mob/vore_fullscreens/screen_full_vore_list.dmi'
/atom/movable/screen/fullscreen/belly/fixed
icon = 'icons/mob/screen_full_vore.dmi'
icon_state = ""
/mob/living/proc/vorebelly_printout() //Spew the vorepanel belly messages into chat window for copypasting.
set name = "X-Print Vorebelly Settings"
@@ -238,9 +238,9 @@
)
var/list/belly_fullscreens
if(selected.colorization_enabled)
belly_fullscreens = cached_icon_states('icons/mob/screen_full_vore_list.dmi') //Makes any icons inside of here selectable.
belly_fullscreens = icon_states_fast('icons/mob/vore_fullscreens/ui_lists/screen_full_vore_list_base.dmi') //Makes any icons inside of here selectable.
else
belly_fullscreens = cached_icon_states('icons/mob/screen_full_vore.dmi') //Non colorable
belly_fullscreens = icon_states_fast('icons/mob/vore_fullscreens/ui_lists/screen_full_vore.dmi') //Non colorable
var/list/vs_flags = list()
for(var/flag_name in selected.vore_sprite_flag_list)
+6 -6
View File
@@ -192,7 +192,7 @@
//Announce to host and other minds
notify_holder("New mind loaded: [brainmob.name]")
show_vore_fx(brainmob, TRUE)
show_vore_fx(brainmob)
brainmob.copy_from_prefs_vr(bellies = FALSE)
return TRUE
@@ -251,7 +251,7 @@
/obj/soulgem/proc/toggle_setting(var/flag)
setting_flags ^= flag
if(flag & SOULGEM_SHOW_VORE_SFX)
soulgem_show_vfx(TRUE)
soulgem_show_vfx()
soulgem_vfx()
if(flag & NIF_SC_BACKUPS)
soulgem_backup()
@@ -330,22 +330,22 @@
RegisterSignal(linked_belly, COMSIG_BELLY_UPDATE_VORE_FX, PROC_REF(soulgem_show_vfx))
// Handles the vore fx updates for the captured souls
/obj/soulgem/proc/soulgem_show_vfx(var/update, var/severity = 0)
/obj/soulgem/proc/soulgem_show_vfx(var/severity = 0)
SIGNAL_HANDLER
if(linked_belly)
for(var/mob/living/L in brainmobs)
if(flag_check(SOULGEM_SHOW_VORE_SFX))
show_vore_fx(L, update, severity)
show_vore_fx(L, severity)
else
clear_vore_fx(L)
// Function to show the vore fx overlay
/obj/soulgem/proc/show_vore_fx(var/mob/living/L, var/update, var/severity = 0)
/obj/soulgem/proc/show_vore_fx(var/mob/living/L, var/severity = 0)
if(!linked_belly || !flag_check(SOULGEM_SHOW_VORE_SFX))
return
if(!istype(L) || L.eyeobj)
return
linked_belly.vore_fx(L, update, severity)
linked_belly.vore_fx(L, severity)
// Function to clear the vore fx overlay
/obj/soulgem/proc/clear_vore_fx(var/mob/M)
+1 -1
View File
@@ -190,7 +190,7 @@
QDEL_NULL(eyeobj)
gem.notify_holder("[src] ended SR projection.")
gem.show_vore_fx(src, TRUE)
gem.show_vore_fx(src)
/mob/living/carbon/brain/caught_soul/vore/nsay_brain()
set name = "NSay"
+2 -7
View File
@@ -59,11 +59,6 @@
host = null
. = ..()
/datum/vore_look/ui_assets(mob/user)
. = ..()
. += get_asset_datum(/datum/asset/spritesheet/vore)
. += get_asset_datum(/datum/asset/spritesheet/vore_fixed) //Either this isn't working or my cache is corrupted and won't show them.
/datum/vore_look/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
@@ -530,7 +525,7 @@
host.client.prefs_vr.show_vore_fx = host.show_vore_fx
if (isbelly(host.loc))
var/obj/belly/B = host.loc
B.vore_fx(host, TRUE)
B.vore_fx(host)
else
host.clear_fullscreen("belly")
if(!host.hud_used.hud_shown)
@@ -548,7 +543,7 @@
host.client.prefs_vr.max_voreoverlay_alpha = host.max_voreoverlay_alpha
if (isbelly(host.loc))
var/obj/belly/B = host.loc
B.vore_fx(host, TRUE)
B.vore_fx(host)
unsaved_changes = TRUE
return TRUE
// liquid belly code