Skip to content

Commit

Permalink
Upgrade to Fullscreen Edition (#8461)
Browse files Browse the repository at this point in the history
* Add fullscreen mode and old TG browser stat panel

* Basic RIG support for statpanel

* Extended RIG support for statpanel and bugfixes

* Remove obsolete RIG verbs

* bag-o-fixes

* fix_for_a_fix

* Update code/modules/mechs/mech.dm

* fix_merge_conflict
  • Loading branch information
SirRichardFrancis authored Apr 19, 2024
1 parent b63f1c2 commit e2f39a3
Show file tree
Hide file tree
Showing 378 changed files with 5,448 additions and 4,853 deletions.
5 changes: 3 additions & 2 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\vector.dm"
#include "code\__HELPERS\verbs.dm"
#include "code\__HELPERS\view.dm"
#include "code\__HELPERS\sorting\__main.dm"
#include "code\__HELPERS\sorting\cmp.dm"
Expand Down Expand Up @@ -247,6 +248,7 @@
#include "code\controllers\subsystems\research.dm"
#include "code\controllers\subsystems\shuttle.dm"
#include "code\controllers\subsystems\spawn_data.dm"
#include "code\controllers\subsystems\statpanel.dm"
#include "code\controllers\subsystems\staverbs.dm"
#include "code\controllers\subsystems\sun.dm"
#include "code\controllers\subsystems\tgui.dm"
Expand Down Expand Up @@ -1410,7 +1412,6 @@
#include "code\modules\admin\secrets\fun_secrets\triple_ai_mode.dm"
#include "code\modules\admin\secrets\random_events\gravity.dm"
#include "code\modules\admin\tickets\adminticketsverbs.dm"
#include "code\modules\admin\tickets\mentorticketsverbs.dm"
#include "code\modules\admin\verbs\adminhelp.dm"
#include "code\modules\admin\verbs\adminjump.dm"
#include "code\modules\admin\verbs\adminpm.dm"
Expand Down Expand Up @@ -1588,7 +1589,6 @@
#include "code\modules\clothing\spacesuits\rig\rig_attackby.dm"
#include "code\modules\clothing\spacesuits\rig\rig_modules.dm"
#include "code\modules\clothing\spacesuits\rig\rig_pieces.dm"
#include "code\modules\clothing\spacesuits\rig\rig_verbs.dm"
#include "code\modules\clothing\spacesuits\rig\rig_wiring.dm"
#include "code\modules\clothing\spacesuits\rig\modules\combat.dm"
#include "code\modules\clothing\spacesuits\rig\modules\computer.dm"
Expand Down Expand Up @@ -2820,6 +2820,7 @@
#include "code\ZAS\Variable Settings.dm"
#include "code\ZAS\Zone.dm"
#include "interface\interface.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"
#include "maps\_map_shims.dm"
#include "maps\CEVEris\_Eris_areas.dm"
Expand Down
6 changes: 2 additions & 4 deletions code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@
if(frequency)
set_frequency(frequency)

/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
if(..(user, 1))
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")

/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user, extra_description = "")
..(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")

/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
Expand Down
13 changes: 4 additions & 9 deletions code/ATMOSPHERICS/components/unary/cold_sink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,16 @@
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
set_power_level(power_setting)

/obj/machinery/atmospherics/unary/freezer/proc/set_power_level(var/new_power_setting)
/obj/machinery/atmospherics/unary/freezer/proc/set_power_level(new_power_setting)
power_setting = new_power_setting
power_rating = max_power_rating * (power_setting/100)

/obj/machinery/atmospherics/unary/freezer/attackby(var/obj/item/I, var/mob/user as mob)

/obj/machinery/atmospherics/unary/freezer/attackby(obj/item/I, mob/user)
if(default_deconstruction(I, user))
return

if(default_part_replacement(I, user))
return

return

/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
..(user)
if(panel_open)
to_chat(user, "The maintenance hatch is open.")
/obj/machinery/atmospherics/unary/freezer/examine(mob/user, extra_description = "")
..(user, "The maintenance hatch is [panel_open ? "open" : "closed"].")
12 changes: 4 additions & 8 deletions code/ATMOSPHERICS/components/unary/heat_source.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,17 @@
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
set_power_level(power_setting)

/obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting)
/obj/machinery/atmospherics/unary/heater/proc/set_power_level(new_power_setting)
power_setting = new_power_setting
power_rating = max_power_rating * (power_setting/100)

/obj/machinery/atmospherics/unary/heater/attackby(var/obj/item/I as obj, var/mob/user as mob)
/obj/machinery/atmospherics/unary/heater/attackby(obj/item/I, mob/user)

if(default_deconstruction(I, user))
return

if(default_part_replacement(I, user))
return

return

/obj/machinery/atmospherics/unary/heater/examine(mob/user)
..(user)
if(panel_open)
to_chat(user, "The maintenance hatch is open.")
/obj/machinery/atmospherics/unary/heater/examine(mob/user, extra_description = "")
..(user, "The maintenance hatch is [panel_open ? "open" : "closed"].")
11 changes: 6 additions & 5 deletions code/ATMOSPHERICS/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,14 @@

return

/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
if(..(user, 1))
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user, extra_description = "")
if(get_dist(user, src) < 2)
extra_description += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
to_chat(user, "You are too far away to read the gauge.")
extra_description += "You are too far away to read the gauge."
if(welded)
to_chat(user, "It seems welded shut.")
extra_description += "\nIt seems welded shut."
..(user, extra_description)

/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
Expand Down
9 changes: 5 additions & 4 deletions code/ATMOSPHERICS/components/unary/vent_scrubber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,12 @@
else
return ..()

/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
if(..(user, 1))
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user, extra_description = "")
if(get_dist(user, src) < 2)
extra_description += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
to_chat(user, "You are too far away to read the gauge.")
extra_description += "You are too far away to read the gauge."
..(user, extra_description)

/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
if(initial_loc)
Expand Down
5 changes: 2 additions & 3 deletions code/ATMOSPHERICS/components/valve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,5 @@
new /obj/item/pipe(loc, make_from=src)
qdel(src)

/obj/machinery/atmospherics/valve/examine(mob/user)
..()
to_chat(user, "It is [open ? "open" : "closed"].")
/obj/machinery/atmospherics/valve/examine(mob/user, extra_description = "")
..(user, "It is [open ? "open" : "closed"].")
2 changes: 0 additions & 2 deletions code/ZAS/Diagnostic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf)
else
to_chat(mob, "both turfs can merge.")


ADMIN_VERB_ADD(/client/proc/ZASSettings, R_DEBUG, FALSE)
/client/proc/ZASSettings()
set category = "Debug"

Expand Down
22 changes: 8 additions & 14 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,15 @@
#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 // Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued.

// Admin permissions.
#define R_FUN 0x1
#define R_SERVER 0x2
#define R_DEBUG 0x4
#define R_PERMISSIONS 0x8
#define R_MENTOR 0x10
#define R_MOD 0x20
#define R_ADMIN 0x40
#define R_FUN (1<<0)
#define R_SERVER (1<<1)
#define R_DEBUG (1<<2)
#define R_PERMISSIONS (1<<3)
#define R_MENTOR (1<<4)
#define R_MOD (1<<5)
#define R_ADMIN (1<<6)

// Host permission (sum of all permissions above) is equal to 127 or 0x7F
#define R_HOST 0x7F // Used for debug/mock only

#define R_MAXPERMISSION 0x40 // This holds the maximum value for a permission. It is used in iteration, so keep it updated.

#define ADMIN_VERB_ADD(path, rights, keep)\
world/registrate_verbs() {..(); cmd_registrate_verb(path, rights, keep);}
#define R_HOST 127 // All of the permissions above

#define ADMIN_QUE(user) "(<a href='?_src_=holder;adminmoreinfo=[REF(user)]'>?</a>)"
#define ADMIN_FLW(user) "(<a href='?_src_=holder;adminplayerobservefollow=[REF(user)]'>FLW</a>)"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#define COMSIG_OBJ_TECHNO_TRIBALISM "techno_tribalism"
#define COMSIG_OBJ_FACTION_ITEM_DESTROY "faction_item_destroy"
#define SWORD_OF_TRUTH_OF_DESTRUCTION "sword_of_truth"
#define COMSIG_EXTRA_EXAMINE "send_extra_examine"

//machinery
#define COMSIG_AREA_APC_OPERATING "area_operating" //from apc process()
Expand Down
4 changes: 1 addition & 3 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#define INIT_ORDER_GARBAGE 99
#define INIT_ORDER_CHUNKS 98
#define INIT_ORDER_EXPLOSIONS 97
#define INIT_ORDER_STATPANELS 96
#define INIT_ORDER_SKYBOX 20
#define INIT_ORDER_DBCORE 19
#define INIT_ORDER_BLACKBOX 18
Expand Down Expand Up @@ -120,9 +121,6 @@
#define INIT_ORDER_LIGHTING -20
#define INIT_ORDER_SHUTTLE -21
#define INIT_ORDER_JAMMING -22
#define INIT_ORDER_SQUEAK -40
#define INIT_ORDER_XENOARCH -50
#define INIT_ORDER_PERSISTENCE -100
#define INIT_OPEN_SPACE -150
#define INIT_ORDER_LATELOAD -180
#define INIT_ORDER_CHAT -185
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var/syndicate_code_response//Code response for contractors.
if(2)
code_phrase += pick(GLOB.adjectives)
if(3)
code_phrase += pick(GLOB.verbs)
code_phrase += pick(GLOB.verb_names)
if(words==1)
code_phrase += "."
else
Expand Down
119 changes: 119 additions & 0 deletions code/__HELPERS/verbs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/// Represents a proc or verb path.
///
/// Despite having no DM-defined static type, proc paths have some variables,
/// listed below. These are not modifiable, but for a given procpath P,
/// `new P(null, "Name", "Desc")` can be used to create a new procpath with the
/// same code but new `name` and `desc` values. The other variables cannot be
/// changed in this way.
///
/// This type exists only to act as an annotation, providing reasonable static
/// typing for procpaths. Previously, types like `/atom/verb` were used, with
/// the `name` and `desc` vars of `/atom` thus being accessible. Proc and verb
/// paths will fail `istype` and `ispath` checks against `/procpath`.
/procpath
// Although these variables are effectively const, if they are marked const
// below, their accesses are optimized away.

/// A text string of the verb's name.
var/name as text
/// The verb's help text or description.
var/desc as text
/// The category or tab the verb will appear in.
var/category as text
/// Only clients/mobs with `see_invisibility` higher can use the verb.
var/invisibility as num
/// Whether or not the verb appears in statpanel and commandbar when you press space
var/hidden as num

/**
* handles adding verbs and updating the stat panel browser
*
* pass the verb type path to this instead of adding it directly to verbs so the statpanel can update
* Arguments:
* * target - Who the verb is being added to, client or mob typepath
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
*/
/proc/add_verb(client/target, verb_or_list_to_add)
if(!target)
CRASH("add_verb called without a target")

var/mob/mob_target = null
if(ismob(target))
mob_target = target
target = mob_target.client
else if(!istype(target, /client))
CRASH("add_verb called on a non-mob and non-client")

var/list/verbs_list = list()
if(!islist(verb_or_list_to_add))
verbs_list += verb_or_list_to_add
else
var/list/verb_listref = verb_or_list_to_add
var/list/elements_to_process = verb_listref.Copy()
while(LAZYLEN(elements_to_process))
var/element_or_list = elements_to_process[LAZYLEN(elements_to_process)] //Last element
elements_to_process.len--
if(islist(element_or_list))
elements_to_process += element_or_list //list/a += list/b adds the contents of b into a, not the reference to the list itself
else
verbs_list += element_or_list

if(mob_target)
mob_target.verbs += verbs_list
if(!target)
return //Our work is done.
else
target.verbs += verbs_list

var/list/output_list = list()
for(var/thing in verbs_list)
var/procpath/verb_to_add = thing
output_list[++output_list.len] = list(verb_to_add.category, verb_to_add.name)
output_list = url_encode(json_encode(output_list))

target << output("[output_list];", "statbrowser:add_verb_list")

/**
* handles removing verb and sending it to browser to update, use this for removing verbs
*
* pass the verb type path to this instead of removing it from verbs so the statpanel can update
* Arguments:
* * target - Who the verb is being removed from, client or mob typepath
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
*/
/proc/remove_verb(client/target, verb_or_list_to_remove)
var/mob/mob_target = null
if(ismob(target))
mob_target = target
target = mob_target.client
else if(!istype(target, /client))
CRASH("remove_verb called on a non-mob and non-client")

var/list/verbs_list = list()
if(!islist(verb_or_list_to_remove))
verbs_list += verb_or_list_to_remove
else
var/list/verb_listref = verb_or_list_to_remove
var/list/elements_to_process = verb_listref.Copy()
while(LAZYLEN(elements_to_process))
var/element_or_list = elements_to_process[LAZYLEN(elements_to_process)] //Last element
elements_to_process.len--
if(islist(element_or_list))
elements_to_process += element_or_list //list/a += list/b adds the contents of b into a, not the reference to the list itself
else
verbs_list += element_or_list

if(mob_target)
mob_target.verbs -= verbs_list
if(!target)
return //Our work is done.
else
target.verbs -= verbs_list

var/list/output_list = list()
for(var/thing in verbs_list)
var/procpath/verb_to_remove = thing
output_list[++output_list.len] = list(verb_to_remove.category, verb_to_remove.name)
output_list = url_encode(json_encode(output_list))

target << output("[output_list];", "statbrowser:remove_verb_list")
2 changes: 1 addition & 1 deletion code/_global_vars/lists/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GLOBAL_LIST_INIT(first_names_female, file2list("config/names/first_female.txt"))
GLOBAL_LIST_INIT(last_names, file2list("config/names/last.txt"))
GLOBAL_LIST_INIT(clown_names, file2list("config/names/clown.txt"))

GLOBAL_LIST_INIT(verbs, file2list("config/names/verbs.txt"))
GLOBAL_LIST_INIT(verb_names, file2list("config/names/verbs.txt"))
GLOBAL_LIST_INIT(adjectives, file2list("config/names/adjectives.txt"))

GLOBAL_LIST_EMPTY(in_character_filter)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@
var/turf/T = get_turf(src)
if(T && user.TurfAdjacent(T))
user.listed_turf = T
user.client.statpanel = "Turf"
return 1
user.client << output("[url_encode(json_encode(T.name))];", "statbrowser:create_listedturf")
return TRUE

/mob/proc/TurfAdjacent(turf/T)
return T.AdjacentQuick(src)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/screen_objects/base_screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
src.icon_state = _icon_state
..()

/obj/screen/examine(mob/user)
/obj/screen/examine(mob/user, extra_description = "")
if(desc)
to_chat(user, SPAN_NOTICE(desc))
to_chat(user, SPAN_NOTICE("<div id='examine'>[desc]</div>"))

/obj/screen/Process()
return
Expand Down
4 changes: 1 addition & 3 deletions code/controllers/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick)
usr.client.debug_variables(target)
message_admins("Admin [key_name_admin(usr)] is debugging the [target] [class].")


ADMIN_VERB_ADD(/client/proc/restart_controller, R_DEBUG, null)
// Debug verbs.
/client/proc/restart_controller(controller in list("Master", "Failsafe"))
set category = "Debug"
Expand All @@ -61,7 +59,7 @@ ADMIN_VERB_ADD(/client/proc/restart_controller, R_DEBUG, null)

message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")

ADMIN_VERB_ADD(/client/proc/debug_controller, R_DEBUG, null)

/client/proc/debug_controller()
set category = "Debug"
set name = "Debug Controller"
Expand Down
Loading

0 comments on commit e2f39a3

Please sign in to comment.