allows soulcatcher import and export (#17391)

* allows soulcatcher import and export

* .

* vore pref transfer to define

* order them

* fix button issue on tgpanel

* Update vore_prefs.dm

* Update VorePanelExportSoulcatcherString.tsx
This commit is contained in:
Kashargul
2025-03-22 17:10:02 -04:00
committed by GitHub
parent eda524a0e8
commit 2a83d9da7f
14 changed files with 262 additions and 163 deletions
+26 -2
View File
@@ -1,8 +1,13 @@
#define IMPORT_ALL_BELLIES "Import all bellies from VRDB"
#define IMPORT_ONE_BELLY "Import one belly from VRDB"
#define IMPORT_SOULCATCHER "Import Soulcatcher from VRDB"
/datum/vore_look/proc/import_belly(mob/host)
var/panel_choice = tgui_input_list(host, "Belly Import", "Pick an option", list("Import all bellies from VRDB","Import one belly from VRDB"))
var/panel_choice = tgui_input_list(host, "Belly Import", "Pick an option", list(IMPORT_ALL_BELLIES, IMPORT_ONE_BELLY, IMPORT_SOULCATCHER))
if(!panel_choice) return
var/pickOne = FALSE
if(panel_choice == "Import one belly from VRDB")
if(panel_choice == IMPORT_ONE_BELLY)
pickOne = TRUE
var/input_file = input(host,"Please choose a valid VRDB file to import from.","Belly Import") as file
var/input_data
@@ -12,6 +17,21 @@
tgui_alert_async(host, "The supplied file contains errors: [e]", "Error!")
return FALSE
if(panel_choice == IMPORT_SOULCATCHER)
if(!islist(input_data["soulcatcher"]))
tgui_alert_async(host, "The supplied file was not a valid VRDB >= v0.2 file.", "Error!")
return FALSE
var/list/soulcatcher_data = input_data["soulcatcher"]
var/return_val = import_soulcatcher(host, soulcatcher_data)
if(return_val)
host.updateVRPanel()
unsaved_changes = TRUE
return return_val
if(islist(input_data["bellies"]))
input_data = input_data["bellies"]
if(!islist(input_data))
tgui_alert_async(host, "The supplied file was not a valid VRDB file.", "Error!")
return FALSE
@@ -1155,3 +1175,7 @@
host.handle_belly_update()
host.updateVRPanel()
unsaved_changes = TRUE
#undef IMPORT_ALL_BELLIES
#undef IMPORT_ONE_BELLY
#undef IMPORT_SOULCATCHER
+17 -1
View File
@@ -27,7 +27,7 @@
var/list/data = list()
var/mob/living/host = user
data["db_version"] = "0.1"
data["db_version"] = "0.2"
data["db_repo"] = "vorestation"
data["mob_name"] = host.real_name
@@ -481,4 +481,20 @@
for(var/msg in B.fullness5_messages)
belly_data["fullness5_messages"] += msg
// Soulcatcher export
if(user.soulgem)
var/obj/soulgem/gem = user.soulgem
var/list/soulcatcher_data = list()
soulcatcher_data["name"] = gem.name
soulcatcher_data["setting_flags"] = gem.setting_flags
soulcatcher_data["inside_flavor"] = gem.inside_flavor
soulcatcher_data["capture_message"] = gem.capture_message
soulcatcher_data["transit_message"] = gem.transit_message
soulcatcher_data["release_message"] = gem.release_message
soulcatcher_data["transfer_message"] = gem.transfer_message
soulcatcher_data["delete_message"] = gem.delete_message
soulcatcher_data["linked_belly"] = gem.linked_belly
data["soulcatcher"] = soulcatcher_data
return data
+2 -106
View File
@@ -250,59 +250,7 @@
var/datum/vore_preferences/P = client.prefs_vr
P.digestable = src.digestable
P.devourable = src.devourable
P.feeding = src.feeding
P.absorbable = src.absorbable
P.resizable = src.resizable
P.digest_leave_remains = src.digest_leave_remains
P.allowmobvore = src.allowmobvore
P.vore_taste = src.vore_taste
P.vore_smell = src.vore_smell
P.permit_healbelly = src.permit_healbelly
P.noisy = src.noisy
P.selective_preference = src.selective_preference
P.show_vore_fx = src.show_vore_fx
P.can_be_drop_prey = src.can_be_drop_prey
P.can_be_drop_pred = src.can_be_drop_pred
P.allow_spontaneous_tf = src.allow_spontaneous_tf
P.step_mechanics_pref = src.step_mechanics_pref
P.pickup_pref = src.pickup_pref
P.drop_vore = src.drop_vore
P.slip_vore = src.slip_vore
P.throw_vore = src.throw_vore
P.food_vore = src.food_vore
P.consume_liquid_belly = src.consume_liquid_belly
P.digest_pain = src.digest_pain
P.stumble_vore = src.stumble_vore
P.eating_privacy_global = src.eating_privacy_global
P.allow_mimicry = src.allow_mimicry
P.nutrition_message_visible = src.nutrition_message_visible
P.nutrition_messages = src.nutrition_messages
P.weight_message_visible = src.weight_message_visible
P.weight_messages = src.weight_messages
P.vore_sprite_color = src.vore_sprite_color
P.allow_mind_transfer = src.allow_mind_transfer
P.phase_vore = src.phase_vore
P.noisy_full = src.noisy_full
P.latejoin_vore = src.latejoin_vore
P.latejoin_prey = src.latejoin_prey
P.receive_reagents = src.receive_reagents
P.give_reagents = src.give_reagents
P.apply_reagents = src.apply_reagents
P.autotransferable = src.autotransferable
P.strip_pref = src.strip_pref
P.vore_sprite_multiply = src.vore_sprite_multiply
P.no_latejoin_vore_warning = src.no_latejoin_vore_warning
P.no_latejoin_prey_warning = src.no_latejoin_prey_warning
P.no_latejoin_vore_warning_time = src.no_latejoin_vore_warning_time
P.no_latejoin_prey_warning_time = src.no_latejoin_prey_warning_time
P.no_latejoin_vore_warning_persists = src.no_latejoin_vore_warning_persists
P.no_latejoin_prey_warning_persists = src.no_latejoin_prey_warning_persists
P.belly_rub_target = src.belly_rub_target
P.soulcatcher_pref_flags = src.soulcatcher_pref_flags
VORE_PREF_TRANSFER(P, src)
var/list/serialized = list()
for(var/obj/belly/B as anything in src.vore_organs)
@@ -323,59 +271,7 @@
var/datum/vore_preferences/P = client.prefs_vr
digestable = P.digestable
devourable = P.devourable
feeding = P.feeding
absorbable = P.absorbable
resizable = P.resizable
digest_leave_remains = P.digest_leave_remains
allowmobvore = P.allowmobvore
vore_taste = P.vore_taste
vore_smell = P.vore_smell
permit_healbelly = P.permit_healbelly
selective_preference = P.selective_preference
noisy = P.noisy
show_vore_fx = P.show_vore_fx
can_be_drop_prey = P.can_be_drop_prey
can_be_drop_pred = P.can_be_drop_pred
allow_spontaneous_tf = P.allow_spontaneous_tf
step_mechanics_pref = P.step_mechanics_pref
pickup_pref = P.pickup_pref
drop_vore = P.drop_vore
slip_vore = P.slip_vore
throw_vore = P.throw_vore
stumble_vore = P.stumble_vore
food_vore = P.food_vore
consume_liquid_belly = P.consume_liquid_belly
digest_pain = P.digest_pain
eating_privacy_global = P.eating_privacy_global
allow_mimicry = P.allow_mimicry
nutrition_message_visible = P.nutrition_message_visible
nutrition_messages = P.nutrition_messages
weight_message_visible = P.weight_message_visible
weight_messages = P.weight_messages
vore_sprite_color = P.vore_sprite_color
allow_mind_transfer = P.allow_mind_transfer
phase_vore = P.phase_vore
noisy_full = P.noisy_full
latejoin_vore = P.latejoin_vore
latejoin_prey = P.latejoin_prey
receive_reagents = P.receive_reagents
give_reagents = P.give_reagents
apply_reagents = P.apply_reagents
autotransferable = P.autotransferable
strip_pref = P.strip_pref
vore_sprite_multiply = P.vore_sprite_multiply
no_latejoin_vore_warning = P.no_latejoin_vore_warning
no_latejoin_prey_warning = P.no_latejoin_prey_warning
no_latejoin_vore_warning_time = P.no_latejoin_vore_warning_time
no_latejoin_prey_warning_time = P.no_latejoin_prey_warning_time
no_latejoin_vore_warning_persists = P.no_latejoin_vore_warning_persists
no_latejoin_prey_warning_persists = P.no_latejoin_prey_warning_persists
belly_rub_target = P.belly_rub_target
soulcatcher_pref_flags = P.soulcatcher_pref_flags
VORE_PREF_TRANSFER(src, P)
if(bellies)
if(isliving(src))
+9 -4
View File
@@ -40,12 +40,17 @@
// Store the vars_to_save into the save file
/obj/soulgem/deserialize(list/data)
. = ..()
for(var/obj/belly in owner.vore_organs)
if(belly.name == data["linked_belly"])
update_linked_belly(belly, TRUE)
return
if(apply_stored_belly(data["linked_belly"], TRUE))
return
linked_belly = null
/obj/soulgem/proc/apply_stored_belly(var/belly_string, var/skip_unreg = FALSE)
for(var/obj/belly in owner.vore_organs)
if(belly.name == belly_string)
update_linked_belly(belly, TRUE)
return TRUE
return FALSE
// Allows to transfer the soulgem to the given mob
/obj/soulgem/proc/transfer_self(var/mob/target)
QDEL_NULL(target.soulgem)
@@ -0,0 +1,47 @@
/datum/vore_look/proc/import_soulcatcher(mob/host, var/list/soulcatcher_data)
if(!host.soulgem)
return FALSE
if(!islist(soulcatcher_data))
tgui_alert_async(host, "The supplied file was not a valid VRDB file.", "Error!")
return FALSE
if(LAZYLEN(soulcatcher_data) == 0)
return FALSE
var/confirm = tgui_alert(host, "WARNING: This will override your current soulcatcher settings!","Import soulcatcher?",list("Yes","Cancel"))
if(confirm != "Yes")
return FALSE
var/obj/soulgem/gem = host.soulgem
if(istext(soulcatcher_data["name"]))
gem.rename(soulcatcher_data["name"])
if(istext(soulcatcher_data["inside_flavor"]))
gem.adjust_interior(soulcatcher_data["inside_flavor"])
if(istext(soulcatcher_data["capture_message"]))
gem.set_custom_message("capture", soulcatcher_data["capture_message"])
if(istext(soulcatcher_data["transit_message"]))
gem.set_custom_message("transit", soulcatcher_data["transit_message"])
if(istext(soulcatcher_data["release_message"]))
gem.set_custom_message("release", soulcatcher_data["release_message"])
if(istext(soulcatcher_data["transfer_message"]))
gem.set_custom_message("transfer", soulcatcher_data["transfer_message"])
if(istext(soulcatcher_data["delete_message"]))
gem.set_custom_message("delete", soulcatcher_data["delete_message"])
if(istext(soulcatcher_data["linked_belly"]))
gem.apply_stored_belly(soulcatcher_data["linked_belly"])
if(isnum(soulcatcher_data["setting_flags"]))
gem.setting_flags = NONE
gem.toggle_setting(soulcatcher_data["setting_flags"])
return TRUE