mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user