Files
2026-04-11 08:57:59 -06:00

49 lines
1.8 KiB
Plaintext

/obj/item/disk/bitrunning/prefs
name = "DeForest biological simulation disk"
desc = "A disk containing the biological simulation data necessary to load custom characters into bitrunning domains."
w_class = WEIGHT_CLASS_SMALL
var/datum/preferences/loaded_preference
var/include_loadout = FALSE
/obj/item/disk/bitrunning/prefs/examine(mob/user)
. = ..()
if(!isnull(loaded_preference))
var/name = loaded_preference.read_preference(/datum/preference/name/real_name)
. += "It currently has the character [name] loaded, with loadouts [(include_loadout ? "enabled" : "disabled")]"
. += span_notice("Ctrl-Click to change loadout loading")
/obj/item/disk/bitrunning/prefs/item_ctrl_click(mob/user)
include_loadout = !include_loadout // We just switch this around. Elegant!
balloon_alert(user, include_loadout ? "Loadout enabled" : "Loadout disabled")
/obj/item/disk/bitrunning/prefs/attack_self(mob/user, modifiers)
. = ..()
var/list/prefdata_names = user.client.prefs?.create_character_profiles()
if(isnull(prefdata_names))
return
var/response = tgui_alert(user, message = "Change selected prefs?", title = "Prefchange", buttons = list("Yes", "No"))
if(isnull(response) || response == "No")
return
var/choice = tgui_input_list(user, message = "Select a character", title = "Character selection", items = prefdata_names)
if(isnull(choice) || !user.is_holding(src))
return
loaded_preference = new(user.client)
loaded_preference.load_character(prefdata_names.Find(choice))
balloon_alert(user, "character set")
to_chat(user, span_notice("Character set to [choice] sucessfully!"))
/datum/outfit/job/bitrunner
r_pocket = /obj/item/disk/bitrunning/prefs
/datum/orderable_item/bitrunning_tech/pref_item
cost_per_order = 500
purchase_path = /obj/item/disk/bitrunning/prefs
desc = "This disk contains a program that lets you load in custom characters."