Files
Bubberstation/modular_zubbers/code/modules/bitrunning/disks.dm
2024-06-28 10:02:14 +02:00

52 lines
1.9 KiB
Plaintext

/obj/item/bitrunning_disk/prefs
name = "DeForest biological simulation disk"
desc = "A disk containing the biological simulation data necessary to load custom characters into bitrunning domains."
icon = 'icons/obj/devices/circuitry_n_data.dmi'
base_icon_state = "datadisk"
icon_state = "datadisk0"
w_class = WEIGHT_CLASS_SMALL
var/datum/preferences/loaded_preference
var/include_loadout = FALSE
/obj/item/bitrunning_disk/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/bitrunning_disk/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/bitrunning_disk/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/bitrunning_disk/prefs
/datum/orderable_item/bitrunning_tech/pref_item
cost_per_order = 500
item_path = /obj/item/bitrunning_disk/prefs
desc = "This disk contains a program that lets you load in custom characters."