mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-12 00:20:55 +01:00
Whitelisting on jobs framework.
This commit is contained in:
@@ -53,3 +53,4 @@
|
||||
#define JOB_UNAVAILABLE_PLAYTIME 3
|
||||
#define JOB_UNAVAILABLE_ACCOUNTAGE 4
|
||||
#define JOB_UNAVAILABLE_SLOTFULL 5
|
||||
#define JOB_UNAVAILABLE_WHITELIST 6
|
||||
@@ -199,8 +199,11 @@
|
||||
body += "<A href='?_src_=holder;[HrefToken()];tdomeadmin=[REF(M)]'>Thunderdome Admin</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];tdomeobserve=[REF(M)]'>Thunderdome Observer</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];makementor=[M.ckey]'>Make mentor</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];removementor=[M.ckey]'>Remove mentor</A>"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];makeeligible=[REF(M)]'>Allow reentering round</A>"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];removementor=[M.ckey]'>Remove mentor</A> |"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];makeeligible=[REF(M)]'>Allow reentering round</A> |"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];sillyroles=[M.ckey]'>Toggle Silly Roles</A> |"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];roleplayroles=[M.ckey]'>Toggle Roleplay Roles</A> |"
|
||||
body += "<A href='?_src_=holder;[HrefToken()];importantroles=[M.ckey]'>Toggle Important Roles</A> |"
|
||||
body += "<br>"
|
||||
body += "</body></html>"
|
||||
|
||||
|
||||
@@ -22,6 +22,16 @@
|
||||
if(!CheckAdminHref(href, href_list))
|
||||
return
|
||||
|
||||
|
||||
if(href_list["sillyroles"]) //toggle, clown and mime.
|
||||
togglesilly(href_list["sillyroles"])
|
||||
|
||||
if(href_list["roleplayroles"]) //toggle, roleplay jobs
|
||||
toggleroleplay(href_list["roleplayroles"])
|
||||
|
||||
if(href_list["importantroles"]) //toggle, roleplay jobs
|
||||
toggleimportant(href_list["importantroles"])
|
||||
|
||||
if(href_list["makementor"])
|
||||
makeMentor(href_list["makementor"])
|
||||
else if(href_list["removementor"])
|
||||
@@ -1359,7 +1369,7 @@
|
||||
|
||||
else if(href_list["f_secret"])
|
||||
return HandleFSecret()
|
||||
|
||||
|
||||
//Dynamic mode
|
||||
else if(href_list["f_dynamic_roundstart"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -2991,3 +3001,54 @@
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection. The changes will last only for the current round.</span>")
|
||||
to_chat(usr, "<span class='adminnotice'>Mentor removed.</span>")
|
||||
|
||||
/datum/admins/proc/togglesilly(ckey)
|
||||
if(!usr.client)
|
||||
return
|
||||
if (!check_rights(0))
|
||||
return
|
||||
if(!ckey)
|
||||
return
|
||||
var/client/C = GLOB.directory[ckey]
|
||||
if(!C)
|
||||
return
|
||||
C.prefs.sillyroles = !C.prefs.sillyroles
|
||||
if(C.prefs.sillyroles)
|
||||
to_chat(usr, "<span class='adminnotice'>Silly roles have been allowed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='adminnotice'>Silly roles have been disabled.</span>")
|
||||
C.prefs.save_preferences()
|
||||
|
||||
|
||||
/datum/admins/proc/toggleroleplay(ckey)
|
||||
if(!usr.client)
|
||||
return
|
||||
if (!check_rights(0))
|
||||
return
|
||||
if(!ckey)
|
||||
return
|
||||
var/client/C = GLOB.directory[ckey]
|
||||
if(!C)
|
||||
return
|
||||
C.prefs.roleplayroles = !C.prefs.roleplayroles
|
||||
if(C.prefs.roleplayroles)
|
||||
to_chat(usr, "<span class='adminnotice'>Roleplay roles have been allowed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='adminnotice'>Roleplay roles have been disabled.</span>")
|
||||
C.prefs.save_preferences()
|
||||
|
||||
/datum/admins/proc/toggleimportant(ckey)
|
||||
if(!usr.client)
|
||||
return
|
||||
if (!check_rights(0))
|
||||
return
|
||||
if(!ckey)
|
||||
return
|
||||
var/client/C = GLOB.directory[ckey]
|
||||
if(!C)
|
||||
return
|
||||
C.prefs.importantroles = !C.prefs.importantroles
|
||||
if(C.prefs.importantroles)
|
||||
to_chat(usr, "<span class='adminnotice'>Important roles have been allowed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='adminnotice'>Important roles have been disabled.</span>")
|
||||
C.prefs.save_preferences()
|
||||
@@ -96,10 +96,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/eye_color = "000" //Eye color
|
||||
var/wing_color = "fff" //Wing color
|
||||
|
||||
//H13
|
||||
//HS13
|
||||
var/body_size = 100 //Body Size in percent
|
||||
var/can_get_preg = 0 //if they can get preggers
|
||||
|
||||
//HS13 jobs
|
||||
var/sillyroles = FALSE //for clown and mime
|
||||
var/roleplayroles = FALSE //for the roleplay roles
|
||||
var/importantroles = FALSE //for things that define as important.
|
||||
|
||||
var/datum/species/pref_species = new /datum/species/human() //Mutant race
|
||||
var/list/features = list("mcolor" = "FFF",
|
||||
|
||||
@@ -141,6 +141,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
//Hyper code
|
||||
S["noncon"] >> noncon
|
||||
S["sillyroles"] >> sillyroles
|
||||
S["roleplayroles"] >> roleplayroles
|
||||
S["importantroles"] >> importantroles
|
||||
|
||||
//try to fix any outdated data if necessfary
|
||||
if(needs_update >= 0)
|
||||
@@ -152,6 +155,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
|
||||
hotkeys = sanitize_integer(hotkeys, 0, 1, initial(hotkeys))
|
||||
autocorrect = sanitize_integer(autocorrect, 0, 1, initial(autocorrect))
|
||||
sillyroles = sanitize_integer(sillyroles, 0, 1, initial(sillyroles))
|
||||
roleplayroles = sanitize_integer(roleplayroles, 0, 1, initial(roleplayroles))
|
||||
importantroles = sanitize_integer(importantroles, 0, 1, initial(importantroles))
|
||||
chat_on_map = sanitize_integer(chat_on_map, 0, 1, initial(chat_on_map))
|
||||
radiosounds = sanitize_integer(radiosounds, 0, 1, initial(radiosounds))
|
||||
max_chat_length = sanitize_integer(max_chat_length, 1, CHAT_MESSAGE_MAX_LENGTH, initial(max_chat_length))
|
||||
@@ -212,6 +218,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["hotkeys"], hotkeys)
|
||||
WRITE_FILE(S["chat_on_map"], chat_on_map)
|
||||
WRITE_FILE(S["autocorrect"], autocorrect)
|
||||
WRITE_FILE(S["sillyroles"], sillyroles)
|
||||
WRITE_FILE(S["roleplayroles"], roleplayroles)
|
||||
WRITE_FILE(S["importantroles"], importantroles)
|
||||
WRITE_FILE(S["radiosounds"], radiosounds)
|
||||
WRITE_FILE(S["max_chat_length"], max_chat_length)
|
||||
WRITE_FILE(S["see_chat_non_mob"], see_chat_non_mob)
|
||||
|
||||
@@ -17,6 +17,8 @@ Clown
|
||||
access = list(ACCESS_THEATRE)
|
||||
minimal_access = list(ACCESS_THEATRE)
|
||||
|
||||
whitelist_type = "silly"
|
||||
|
||||
/datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M)
|
||||
..()
|
||||
H.apply_pref_name("clown", M.client)
|
||||
@@ -81,6 +83,7 @@ Mime
|
||||
|
||||
access = list(ACCESS_THEATRE)
|
||||
minimal_access = list(ACCESS_THEATRE)
|
||||
whitelist_type = "silly"
|
||||
|
||||
/datum/job/mime/after_spawn(mob/living/carbon/human/H, mob/M)
|
||||
..()
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
|
||||
var/override_roundstart_spawn = null //Where the player spawns at roundstart if defined
|
||||
|
||||
//whitelisting
|
||||
var/whitelist_type = ""
|
||||
|
||||
//Only override this proc
|
||||
//H is usually a human unless an /equip override transformed it
|
||||
/datum/job/proc/after_spawn(mob/living/H, mob/M, latejoin = FALSE)
|
||||
|
||||
@@ -55,7 +55,6 @@ GLOBAL_LIST_INIT(security_positions, list(
|
||||
"Security Officer",
|
||||
"Rookie"))
|
||||
|
||||
|
||||
GLOBAL_LIST_INIT(nonhuman_positions, list(
|
||||
"AI",
|
||||
"Cyborg",
|
||||
|
||||
@@ -318,6 +318,8 @@
|
||||
return "[jobtitle] is unavailable."
|
||||
if(JOB_UNAVAILABLE_BANNED)
|
||||
return "You are currently banned from [jobtitle]."
|
||||
if(JOB_UNAVAILABLE_WHITELIST)
|
||||
return "You are not whitelisted for [jobtitle]."
|
||||
if(JOB_UNAVAILABLE_PLAYTIME)
|
||||
return "You do not have enough relevant playtime for [jobtitle]."
|
||||
if(JOB_UNAVAILABLE_ACCOUNTAGE)
|
||||
@@ -341,6 +343,13 @@
|
||||
return JOB_UNAVAILABLE_SLOTFULL
|
||||
if(jobban_isbanned(src,rank))
|
||||
return JOB_UNAVAILABLE_BANNED
|
||||
if(job.whitelist_type) //whitelisting
|
||||
if(job.whitelist_type == "roleplay" && !client.prefs.roleplayroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(job.whitelist_type == "important" && !client.prefs.importantroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(job.whitelist_type == "silly" && !client.prefs.sillyroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(QDELETED(src))
|
||||
return JOB_UNAVAILABLE_GENERIC
|
||||
if(!job.player_old_enough(client))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
Roleplay Jobs, Currently borked.
|
||||
|
||||
/datum/job/rpcentral
|
||||
title = "Central Command Inspector"
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
minimal_player_age = 1
|
||||
supervisors = "central command"
|
||||
selection_color = "#ffeef0"
|
||||
custom_spawn_text = "You are from central command doing a routine inspection of the station, please fill out the provided information and submit it to central command by the end of the shift."
|
||||
*/
|
||||
@@ -3126,6 +3126,7 @@
|
||||
#include "hyperstation\code\modules\economy\account.dm"
|
||||
#include "hyperstation\code\modules\events\crystalline_reentry.dm"
|
||||
#include "hyperstation\code\modules\integrated_electronics\input.dm"
|
||||
#include "hyperstation\code\modules\jobs\job_types\roleplay.dm"
|
||||
#include "hyperstation\code\modules\mining\shelters.dm"
|
||||
#include "hyperstation\code\modules\mining\equipment\survival_pod.dm"
|
||||
#include "hyperstation\code\modules\mob\mob_helpers.dm"
|
||||
|
||||
Reference in New Issue
Block a user