[516] Scaling and TGUI fixes (#28809)

* [516] Scaling and TGUI fixes

* fuck it we go with this

* ???

* final changes

* whoops
This commit is contained in:
Contrabang
2025-03-27 07:31:43 +00:00
committed by GitHub
parent 05e7754afb
commit 3fca5f8216
11 changed files with 47 additions and 8 deletions
+13
View File
@@ -86,6 +86,15 @@
for(var/file in scripts)
head_content += "<script type='text/javascript' src='[SSassets.transport.get_asset_url(file)]'></script>"
if(user.client.window_scaling && user.client.window_scaling != 1)
head_content += {"
<style>
body {
zoom: [100 / user.client.window_scaling]%;
}
</style>
"}
return {"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
@@ -122,6 +131,10 @@
var/window_size = ""
if(width && height)
window_size = "size=[width]x[height];"
if(user?.client?.window_scaling)
window_size = "size=[width * user.client.window_scaling]x[height * user.client.window_scaling];"
else
window_size = "size=[width]x[height];"
if(include_default_stylesheet)
var/datum/asset/simple/common/common_asset = get_asset_datum(/datum/asset/simple/common)
common_asset.send(user)
+4 -1
View File
@@ -255,6 +255,7 @@
<meta charset="UTF-8">
<title>[title]</title>
<link rel="stylesheet" type="text/css" href="[SSassets.transport.get_asset_url("view_variables.css")]">
[window_scaling ? "<style>body {zoom: [100 / window_scaling]%;}</style>" : ""]
</head>
<body onload='selectTextField(); updateSearch()' onkeydown='return checkreload()' onkeyup='updateSearch()'>
<script type="text/javascript">
@@ -453,7 +454,9 @@
if(istype(D, /datum))
log_admin("[key_name(usr)] opened VV for [D] ([D.UID()])")
usr << browse(html, "window=variables[refid];size=475x650")
var/size_string = window_scaling ? "size=[475 * window_scaling]x[650 * window_scaling]" : "size=[475]x[650]"
usr << browse(html, "window=variables[refid];[size_string]")
#define VV_HTML_ENCODE(thing) ( sanitize ? html_encode(thing) : thing )
/proc/debug_variable(name, value, level, datum/owner, sanitize = TRUE)