Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions code/datums/browser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@
C = M.client
if(!C)
return
user << browse(get_content(), "window=[window_id];[window_options]")
var/dpi = C.dpiScale || 1
var/window_size = ""
if (width && height)
var/dpi = text2num(winget(C, window_id, "dpi")) || 1
winset(C, window_id, "size=[width*dpi]x[height*dpi]")
window_size = "size=[width*dpi]x[height*dpi];"
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
if (use_onclose)
onclose(user, window_id, ref)

Expand Down
3 changes: 2 additions & 1 deletion code/game/gamemodes/gameticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ var/datum/controller/gameticker/ticker
var/mob/new_player/np = M
if(!(np.ready && np.mind && np.mind.assigned_role))
//If they aren't ready, update new player panels so they say join instead of ready up.
np.new_player_panel()
spawn()
np.new_player_panel()
continue
var/datum/preferences/prefs = M.client.prefs
var/key = M.key
Expand Down
5 changes: 5 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
// See /goon/code/datums/browserOutput.dm
var/datum/chatOutput/chatOutput

// Post-Byond 516 DPI scaling settings affects opened windows.
// Rather than e.g. 100x100 you get (window size / scale), so for 125% scaling you get 80x80.
// This messes up a lot of interfaces so this value is cached and applied to opening windows to correct for scaling.
var/dpiScale = 1

////////////
//PARALLAX+OTHER PLANEMASTERS//
////////////
Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ var/updated_stats = 0


send_resources()
spawn()//dont let winget stall login on a dead client
var/dpi = text2num(winget(src, null, "dpi"))
if (dpi && (src in clients))
dpiScale = dpi

var/datum/DBQuery/query = SSdbcore.NewQuery("SELECT id, ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype, unbanned, unbanned_ckey, unbanned_datetime FROM erro_ban WHERE (ckey = :ckey [address ? "OR ip = :address" : ""] [computer_id ? "OR computerid = :computer_id" : ""]) AND unbanned_notification = 0;",
list(
Expand Down
7 changes: 1 addition & 6 deletions code/modules/nano/nanoui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ nanoui is used to open and update nano browser uis
#define STATUS_DISABLED 0 // RED Visability
#define STATUS_CLOSE -1 // Close the window

// Post-Byond 516 DPI scaling settings affect the opened window.
// Rather than e.g. 100x100 you get (window size / scale), so for 125% scaling you get 80x80.
// This messes up a lot of interfaces so this value is cached and applied to opening windows to correct for scaling.
/client/var/dpiScale = 1

/datum/nanoui
// the user who opened this ui
var/mob/user
Expand Down Expand Up @@ -535,7 +530,7 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/Topic(href, href_list)
if (href_list["nanoui_dpr"])
if (href_list["nanoui_dpr"]) //viewport self-reports from layout_default.tmpl, cache dpi on client
var/scale = text2num(href_list["nanoui_dpr"])
if (!scale && href_list["nanoui_inner_w"] && width)
var/inner_width = text2num(href_list["nanoui_inner_w"])
Expand Down
Loading