mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Fixes a merge conflict that broke stat panel (#96071)
## About The Pull Request Fixes a merge conflict between 2 of my stat panel PRs that caused the 'Toggle Stat Panel' button to not work. Also converts more skin stuff to defines that I missed in the last PR. ## Why It's Good For The Game Button works wahoo! ## Changelog 🆑 fix: Stat panel's "Toggle Stat Panel" button now works. /🆑
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
//`setClientTheme` has a list of nearly every skin.dmf element in it.
|
||||
#define SKIN_MAINWINDOW "mainwindow"
|
||||
#define SKIN_MAINWINDOW_SPLIT "[SKIN_MAINWINDOW].split"
|
||||
#define SKIN_MAINWINDOW_TOOLTIP "mainwindow.tooltip"
|
||||
|
||||
#define SKIN_MAPWINDOW "mapwindow"
|
||||
#define SKIN_MAPWINDOW_MAP "[SKIN_MAPWINDOW].map"
|
||||
#define SKIN_MAPWINDOW_STATUS_BAR "[SKIN_MAPWINDOW].status_bar"
|
||||
|
||||
#define INFOWINDOW "infowindow"
|
||||
#define INFOWINDOW_INFO "[INFOWINDOW].info"
|
||||
#define SKIN_INFOWINDOW "info"
|
||||
#define SKIN_INFOWINDOW_CHILD "[SKIN_INFOWINDOW].info_child"
|
||||
|
||||
#define SKIN_TGUISAY "tgui_say"
|
||||
#define SKIN_TGUISAY_BROWSER "[SKIN_TGUISAY].browser"
|
||||
|
||||
@@ -49,7 +49,7 @@ VERB_MANAGER_SUBSYSTEM_DEF(input)
|
||||
|
||||
/datum/controller/subsystem/verb_manager/input/can_queue_verb(datum/callback/verb_callback/incoming_callback, control)
|
||||
//make sure the incoming verb is actually something we specifically want to handle
|
||||
if(control != "mapwindow.map")
|
||||
if(control != SKIN_MAPWINDOW_MAP)
|
||||
return FALSE
|
||||
|
||||
if(average_click_delay > MAXIMUM_CLICK_LATENCY || !..())
|
||||
|
||||
@@ -351,16 +351,16 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
|
||||
var/aspect_ratio = view_size[1] / view_size[2]
|
||||
|
||||
// Calculate desired pixel width using window size and aspect ratio
|
||||
var/list/sizes = params2list(winget(src, "mainwindow.split;mapwindow", "size"))
|
||||
var/list/sizes = params2list(winget(src, "[SKIN_MAINWINDOW_SPLIT];[SKIN_MAPWINDOW]", "size"))
|
||||
|
||||
// Client closed the window? Some other error? This is unexpected behaviour, let's
|
||||
// CRASH with some info.
|
||||
if(!sizes["mapwindow.size"])
|
||||
if(!sizes["[SKIN_MAPWINDOW].size"])
|
||||
CRASH("sizes does not contain mapwindow.size key. This means a winget failed to return what we wanted. --- sizes var: [sizes] --- sizes length: [length(sizes)]")
|
||||
|
||||
var/list/map_size = splittext(sizes["mapwindow.size"], "x")
|
||||
var/list/map_size = splittext(sizes["[SKIN_MAPWINDOW].size"], "x")
|
||||
|
||||
var/split_size = splittext(sizes["mainwindow.split.size"], "x")
|
||||
var/split_size = splittext(sizes["[SKIN_MAINWINDOW_SPLIT].size"], "x")
|
||||
var/split_width = text2num(split_size[1])
|
||||
|
||||
// Window is minimized, we can't get proper data so return to avoid division by 0
|
||||
@@ -399,7 +399,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
|
||||
// Apply an ever-lowering offset until we finish or fail
|
||||
var/delta
|
||||
for(var/safety in 1 to 10)
|
||||
var/after_size = winget(src, "mapwindow", "size")
|
||||
var/after_size = winget(src, SKIN_MAPWINDOW, "size")
|
||||
map_size = splittext(after_size, "x")
|
||||
var/got_width = text2num(map_size[1])
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
///Sets the stat panel's visibility to the player, depending on whether they need it/have it enabled or not.
|
||||
/client/proc/set_stat_panel()
|
||||
if(prefs.read_preference(/datum/preference/toggle/statpanel) || needs_stat_panel())
|
||||
winset(src, INFOWINDOW_INFO, "left=statwindow")
|
||||
winset(src, SKIN_INFOWINDOW_CHILD, "left=statwindow")
|
||||
else
|
||||
winset(src, INFOWINDOW_INFO, "left=null")
|
||||
winset(src, SKIN_INFOWINDOW_CHILD, "left=null")
|
||||
|
||||
///Returns TRUE if the player has something that necessitates the stat panel.
|
||||
/client/proc/needs_stat_panel()
|
||||
|
||||
@@ -19,7 +19,7 @@ Notes:
|
||||
|
||||
/datum/tooltip
|
||||
var/client/owner
|
||||
var/control = "mainwindow.tooltip"
|
||||
var/control = SKIN_MAINWINDOW_TOOLTIP
|
||||
var/showing = 0
|
||||
var/queueHide = 0
|
||||
var/init = 0
|
||||
|
||||
Reference in New Issue
Block a user