diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm
index 76f11b8768..0570744028 100644
--- a/code/modules/vore/eating/living_vr.dm
+++ b/code/modules/vore/eating/living_vr.dm
@@ -43,7 +43,7 @@
M.verbs += /mob/living/proc/switch_scaling
if(M.no_vore) //If the mob isn't supposed to have a stomach, let's not give it an insidepanel so it can make one for itself, or a stomach.
return TRUE
- M.vorePanel = new
+ M.vorePanel = new(M)
M.verbs += /mob/living/proc/insidePanel
//Tries to load prefs if a client is present otherwise gives freebie stomach
diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm
index 709138c47e..de776e002b 100644
--- a/code/modules/vore/eating/vorepanel_vr.dm
+++ b/code/modules/vore/eating/vorepanel_vr.dm
@@ -17,1026 +17,804 @@
if(!vorePanel)
log_debug("[src] ([type], \ref[src]) didn't have a vorePanel and tried to use the verb.")
- vorePanel = new
+ vorePanel = new(src)
- vorePanel.selected = vore_selected
- vorePanel.show(src)
+ vorePanel.tgui_interact(src)
/mob/living/proc/updateVRPanel() //Panel popup update call from belly events.
- if(!vorePanel)
- log_debug("[src] ([type], \ref[src]) didn't have a vorePanel and something tried to update it.")
- vorePanel = new
-
- if(vorePanel.open)
- vorePanel.selected = vore_selected
- vorePanel.show(src)
+ SStgui.update_uis(vorePanel)
//
// Callback Handler for the Inside form
//
/datum/vore_look
- var/datum/browser/popup
- var/obj/belly/selected
- var/show_interacts = 0
- var/open = FALSE
+ var/mob/living/host // Note, we do this in case we ever want to allow people to view others vore panels
+ var/unsaved_changes = FALSE
-/datum/vore_look/Destroy()
- selected = null
- QDEL_NULL(popup)
+/datum/vore_look/New(mob/living/new_host)
+ if(istype(new_host))
+ host = new_host
. = ..()
-/datum/vore_look/Topic(href,href_list[])
- if(vp_interact(href, href_list) && popup)
- popup.set_content(gen_ui(usr))
- usr << output(popup.get_content(), "insidePanel.browser")
+/datum/vore_look/Destroy()
+ host = null
+ . = ..()
-/datum/vore_look/proc/show(mob/living/user)
- if(popup)
- QDEL_NULL(popup)
- popup = new(user, "insidePanel", "Inside!", 450, 700, src)
- popup.set_content(gen_ui(user))
- popup.open()
- open = TRUE
+/datum/vore_look/tgui_interact(mob/user, datum/tgui/ui)
+ ui = SStgui.try_update_ui(user, src, ui)
+ if(!ui)
+ ui = new(user, src, "VorePanel", "Inside!")
+ ui.open()
-/datum/vore_look/proc/gen_ui(var/mob/living/user)
- var/list/dat = list()
+// This looks weird, but all tgui_host is used for is state checking
+// So this allows us to use the self_state just fine.
+/datum/vore_look/tgui_host(mob/user)
+ return host
- var/atom/userloc = user.loc
- if(isbelly(userloc))
- var/obj/belly/inside_belly = userloc
- var/mob/living/eater = inside_belly.owner
+// Note, in order to allow others to look at others vore panels, this state would need
+// to be changed to tgui_always_state, and a custom tgui_status() implemented for true "rights" management.
+/datum/vore_look/tgui_state(mob/user)
+ return GLOB.tgui_self_state
- dat += "You are currently [user.absorbed ? "absorbed into " : "inside "] [eater]'s [inside_belly.name]!
"
+/datum/vore_look/var/static/list/nom_icons
+/datum/vore_look/proc/cached_nom_icon(atom/target)
+ LAZYINITLIST(nom_icons)
- if(inside_belly.desc)
- dat += "[inside_belly.desc]
" //Extra br
-
- if(inside_belly.contents.len > 1)
- dat += "You can see the following around you:
"
- var/list/belly_contents = list()
- for (var/atom/movable/O in inside_belly)
- if(istype(O,/mob/living))
- var/mob/living/M = O
- //That's just you
- if(M == user)
- continue
-
- //That's an absorbed person you're checking
- if(M.absorbed)
- if(user.absorbed)
- belly_contents += "[O]"
- continue
- else
- continue
-
- //Anything else
- dat += "[O]"
-
- //Zero-width space, for wrapping
- dat += ""
-
- dat += jointext(belly_contents, null) //Add in belly contents to main running list
+ var/key = ""
+ if(isobj(target))
+ key = "[target.type]"
+ else if(ismob(target))
+ var/mob/M = target
+ key = "\ref[target][M.real_name]"
+ if(nom_icons[key])
+ . = nom_icons[key]
else
- dat += "You aren't inside anyone."
+ . = icon2base64(getFlatIcon(target,defdir=SOUTH,no_anim=TRUE))
+ nom_icons[key] = .
- var/list/belly_list = list("