mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +00:00
[MIRROR] Clean Up Global Tab (#9848)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3c0f30bf8b
commit
f68a9f4f1d
@@ -2,6 +2,8 @@
|
|||||||
name = "Basic"
|
name = "Basic"
|
||||||
sort_order = 1
|
sort_order = 1
|
||||||
|
|
||||||
|
var/datum/paiCandidate/candidate
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/antagonism/basic/load_character(list/save_data)
|
/datum/category_item/player_setup_item/antagonism/basic/load_character(list/save_data)
|
||||||
pref.exploit_record = save_data["exploit_record"]
|
pref.exploit_record = save_data["exploit_record"]
|
||||||
pref.antag_faction = save_data["antag_faction"]
|
pref.antag_faction = save_data["antag_faction"]
|
||||||
@@ -12,6 +14,29 @@
|
|||||||
save_data["antag_faction"] = pref.antag_faction
|
save_data["antag_faction"] = pref.antag_faction
|
||||||
save_data["antag_vis"] = pref.antag_vis
|
save_data["antag_vis"] = pref.antag_vis
|
||||||
|
|
||||||
|
/datum/category_item/player_setup_item/antagonism/basic/load_preferences(datum/json_savefile/savefile)
|
||||||
|
if(!candidate)
|
||||||
|
candidate = new()
|
||||||
|
var/preference_mob = preference_mob()
|
||||||
|
if(!preference_mob)// No preference mob - this happens when we're called from client/New() before it calls ..() (via datum/preferences/New())
|
||||||
|
spawn()
|
||||||
|
preference_mob = preference_mob()
|
||||||
|
if(!preference_mob)
|
||||||
|
return
|
||||||
|
candidate.savefile_load(preference_mob)
|
||||||
|
return
|
||||||
|
|
||||||
|
candidate.savefile_load(preference_mob)
|
||||||
|
|
||||||
|
/datum/category_item/player_setup_item/antagonism/basic/save_preferences(datum/json_savefile/savefile)
|
||||||
|
if(!candidate)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(!preference_mob())
|
||||||
|
return
|
||||||
|
|
||||||
|
candidate.savefile_save(preference_mob())
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/antagonism/basic/sanitize_character()
|
/datum/category_item/player_setup_item/antagonism/basic/sanitize_character()
|
||||||
if(!pref.antag_faction) pref.antag_faction = "None"
|
if(!pref.antag_faction) pref.antag_faction = "None"
|
||||||
if(!pref.antag_vis) pref.antag_vis = "Hidden"
|
if(!pref.antag_vis) pref.antag_vis = "Hidden"
|
||||||
@@ -32,6 +57,15 @@
|
|||||||
. += span_bold("You are banned from using character records.") + "<br>"
|
. += span_bold("You are banned from using character records.") + "<br>"
|
||||||
else
|
else
|
||||||
. +="<a href='byond://?src=\ref[src];exploitable_record=1'>[TextPreview(pref.exploit_record,40)]</a><br>"
|
. +="<a href='byond://?src=\ref[src];exploitable_record=1'>[TextPreview(pref.exploit_record,40)]</a><br>"
|
||||||
|
. += "<br>"
|
||||||
|
. += span_bold("pAI:") + "<br>"
|
||||||
|
if(!candidate)
|
||||||
|
log_debug("[user] pAI prefs have a null candidate var.")
|
||||||
|
return .
|
||||||
|
. += "Name: <a href='byond://?src=\ref[src];option=name'>[candidate.name ? candidate.name : "None Set"]</a><br>"
|
||||||
|
. += "Description: <a href='byond://?src=\ref[src];option=desc'>[candidate.description ? TextPreview(candidate.description, 40) : "None Set"]</a><br>"
|
||||||
|
. += "Role: <a href='byond://?src=\ref[src];option=role'>[candidate.role ? TextPreview(candidate.role, 40) : "None Set"]</a><br>"
|
||||||
|
. += "OOC Comments: <a href='byond://?src=\ref[src];option=ooc'>[candidate.comments ? TextPreview(candidate.comments, 40) : "None Set"]</a><br>"
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/antagonism/basic/OnTopic(var/href,var/list/href_list, var/mob/user)
|
/datum/category_item/player_setup_item/antagonism/basic/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||||
if(href_list["uplinklocation"])
|
if(href_list["uplinklocation"])
|
||||||
@@ -66,4 +100,25 @@
|
|||||||
pref.antag_vis = choice
|
pref.antag_vis = choice
|
||||||
return TOPIC_REFRESH
|
return TOPIC_REFRESH
|
||||||
|
|
||||||
|
if(href_list["option"])
|
||||||
|
var/t
|
||||||
|
switch(href_list["option"])
|
||||||
|
if("name")
|
||||||
|
t = sanitizeName(tgui_input_text(user, "Enter a name for your pAI", "Global Preference", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN, 1)
|
||||||
|
if(t && CanUseTopic(user))
|
||||||
|
candidate.name = t
|
||||||
|
if("desc")
|
||||||
|
t = tgui_input_text(user, "Enter a description for your pAI", "Global Preference", html_decode(candidate.description), multiline = TRUE, prevent_enter = TRUE)
|
||||||
|
if(!isnull(t) && CanUseTopic(user))
|
||||||
|
candidate.description = sanitize(t)
|
||||||
|
if("role")
|
||||||
|
t = tgui_input_text(user, "Enter a role for your pAI", "Global Preference", html_decode(candidate.role))
|
||||||
|
if(!isnull(t) && CanUseTopic(user))
|
||||||
|
candidate.role = sanitize(t)
|
||||||
|
if("ooc")
|
||||||
|
t = tgui_input_text(user, "Enter any OOC comments", "Global Preference", html_decode(candidate.comments), multiline = TRUE, prevent_enter = TRUE)
|
||||||
|
if(!isnull(t) && CanUseTopic(user))
|
||||||
|
candidate.comments = sanitize(t)
|
||||||
|
return TOPIC_REFRESH
|
||||||
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/datum/category_item/player_setup_item/player_global/pai
|
|
||||||
name = "pAI"
|
|
||||||
sort_order = 3
|
|
||||||
|
|
||||||
var/datum/paiCandidate/candidate
|
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/player_global/pai/load_preferences(datum/json_savefile/savefile)
|
|
||||||
if(!candidate)
|
|
||||||
candidate = new()
|
|
||||||
var/preference_mob = preference_mob()
|
|
||||||
if(!preference_mob)// No preference mob - this happens when we're called from client/New() before it calls ..() (via datum/preferences/New())
|
|
||||||
spawn()
|
|
||||||
preference_mob = preference_mob()
|
|
||||||
if(!preference_mob)
|
|
||||||
return
|
|
||||||
candidate.savefile_load(preference_mob)
|
|
||||||
return
|
|
||||||
|
|
||||||
candidate.savefile_load(preference_mob)
|
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/player_global/pai/save_preferences(datum/json_savefile/savefile)
|
|
||||||
if(!candidate)
|
|
||||||
return
|
|
||||||
|
|
||||||
if(!preference_mob())
|
|
||||||
return
|
|
||||||
|
|
||||||
candidate.savefile_save(preference_mob())
|
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/player_global/pai/content(var/mob/user)
|
|
||||||
. += span_bold("pAI:") + "<br>"
|
|
||||||
if(!candidate)
|
|
||||||
log_debug("[user] pAI prefs have a null candidate var.")
|
|
||||||
return .
|
|
||||||
. += "Name: <a href='byond://?src=\ref[src];option=name'>[candidate.name ? candidate.name : "None Set"]</a><br>"
|
|
||||||
. += "Description: <a href='byond://?src=\ref[src];option=desc'>[candidate.description ? TextPreview(candidate.description, 40) : "None Set"]</a><br>"
|
|
||||||
. += "Role: <a href='byond://?src=\ref[src];option=role'>[candidate.role ? TextPreview(candidate.role, 40) : "None Set"]</a><br>"
|
|
||||||
. += "OOC Comments: <a href='byond://?src=\ref[src];option=ooc'>[candidate.comments ? TextPreview(candidate.comments, 40) : "None Set"]</a><br>"
|
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/player_global/pai/OnTopic(var/href,var/list/href_list, var/mob/user)
|
|
||||||
if(href_list["option"])
|
|
||||||
var/t
|
|
||||||
switch(href_list["option"])
|
|
||||||
if("name")
|
|
||||||
t = sanitizeName(tgui_input_text(user, "Enter a name for your pAI", "Global Preference", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN, 1)
|
|
||||||
if(t && CanUseTopic(user))
|
|
||||||
candidate.name = t
|
|
||||||
if("desc")
|
|
||||||
t = tgui_input_text(user, "Enter a description for your pAI", "Global Preference", html_decode(candidate.description), multiline = TRUE, prevent_enter = TRUE)
|
|
||||||
if(!isnull(t) && CanUseTopic(user))
|
|
||||||
candidate.description = sanitize(t)
|
|
||||||
if("role")
|
|
||||||
t = tgui_input_text(user, "Enter a role for your pAI", "Global Preference", html_decode(candidate.role))
|
|
||||||
if(!isnull(t) && CanUseTopic(user))
|
|
||||||
candidate.role = sanitize(t)
|
|
||||||
if("ooc")
|
|
||||||
t = tgui_input_text(user, "Enter any OOC comments", "Global Preference", html_decode(candidate.comments), multiline = TRUE, prevent_enter = TRUE)
|
|
||||||
if(!isnull(t) && CanUseTopic(user))
|
|
||||||
candidate.comments = sanitize(t)
|
|
||||||
return TOPIC_REFRESH
|
|
||||||
|
|
||||||
return ..()
|
|
||||||
@@ -26,11 +26,13 @@
|
|||||||
name = "Traits"
|
name = "Traits"
|
||||||
sort_order = 6
|
sort_order = 6
|
||||||
category_item_type = /datum/category_item/player_setup_item/traits
|
category_item_type = /datum/category_item/player_setup_item/traits
|
||||||
*/ //VOREStation Removal End
|
|
||||||
|
//redundant due to having most of its content stripped out, merged into special roles
|
||||||
/datum/category_group/player_setup_category/global_preferences
|
/datum/category_group/player_setup_category/global_preferences
|
||||||
name = "Global"
|
name = "Global"
|
||||||
sort_order = 6 //VOREStation Edit due to above commented out
|
sort_order = 6 //VOREStation Edit due to above commented out
|
||||||
category_item_type = /datum/category_item/player_setup_item/player_global
|
category_item_type = /datum/category_item/player_setup_item/player_global
|
||||||
|
*/ //VOREStation Removal End
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* Category Collection Setup *
|
* Category Collection Setup *
|
||||||
|
|||||||
@@ -2220,7 +2220,6 @@
|
|||||||
#include "code\modules\client\preference_setup\general\04_equipment.dm"
|
#include "code\modules\client\preference_setup\general\04_equipment.dm"
|
||||||
#include "code\modules\client\preference_setup\general\05_background.dm"
|
#include "code\modules\client\preference_setup\general\05_background.dm"
|
||||||
#include "code\modules\client\preference_setup\general\06_flavor.dm"
|
#include "code\modules\client\preference_setup\general\06_flavor.dm"
|
||||||
#include "code\modules\client\preference_setup\global\03_pai.dm"
|
|
||||||
#include "code\modules\client\preference_setup\loadout\gear_tweaks.dm"
|
#include "code\modules\client\preference_setup\loadout\gear_tweaks.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\gear_tweaks_vr.dm"
|
#include "code\modules\client\preference_setup\loadout\gear_tweaks_vr.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\loadout.dm"
|
#include "code\modules\client\preference_setup\loadout\loadout.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user