|
1 | 1 | /datum/browser
|
2 |
| - var/mob/user |
| 2 | + var/client/user |
3 | 3 | var/title
|
4 | 4 | var/window_id // window_id is used as the window name for browse and onclose
|
5 | 5 | var/width = 0
|
|
70 | 70 | head_content += "<link rel='stylesheet' type='text/css' href='[common_asset.get_url_mappings()[stylesheet]]'>"
|
71 | 71 | head_content += "<link rel='stylesheet' type='text/css' href='[other_asset.get_url_mappings()["loading.gif"]]'>"
|
72 | 72 |
|
| 73 | + if(user.window_scaling && user.window_scaling != 1 && !user.prefs.window_scale && width && height) |
| 74 | + head_content += {" |
| 75 | + <style> |
| 76 | + body { |
| 77 | + zoom: [100 / user.window_scaling]%; |
| 78 | + } |
| 79 | + </style> |
| 80 | + "} |
| 81 | + |
73 | 82 | for (var/file in stylesheets)
|
74 | 83 | head_content += "<link rel='stylesheet' type='text/css' href='[SSassets.transport.get_asset_url(file)]'>"
|
75 | 84 |
|
|
114 | 123 | return
|
115 | 124 | var/window_size = ""
|
116 | 125 | if (width && height)
|
117 |
| - window_size = "size=[width]x[height];" |
| 126 | + if(user.window_scaling && user.prefs.window_scale) |
| 127 | + window_size = "size=[width * user?.window_scaling]x[height * user?.window_scaling];" |
| 128 | + else |
| 129 | + window_size = "size=[width]x[height];" |
118 | 130 | common_asset.send(user)
|
119 | 131 | other_asset.send(user)
|
120 | 132 | if (length(stylesheets))
|
|
226 | 238 | mob.unset_interaction()
|
227 | 239 | return
|
228 | 240 |
|
229 |
| -/proc/show_browser(target, browser_content, browser_name, id = null, window_options = null, closeref) |
| 241 | +/proc/show_browser(target, browser_content, browser_name, id = null, window_options = null, closeref, width, height) |
230 | 242 | var/client/C = target
|
231 | 243 |
|
232 | 244 | if (ismob(target))
|
|
241 | 253 | C.prefs.stylesheet = "Modern"
|
242 | 254 | stylesheet = "Modern"
|
243 | 255 |
|
244 |
| - var/datum/browser/popup = new(C, id ? id : browser_name, browser_name, GLOB.stylesheets[stylesheet], nref = closeref) |
| 256 | + var/datum/browser/popup = new(C, id ? id : browser_name, browser_name, GLOB.stylesheets[stylesheet], nwidth = width, nheight = height, nref = closeref) |
245 | 257 | popup.set_content(browser_content)
|
246 | 258 | if (window_options)
|
247 | 259 | popup.set_window_options(window_options)
|
|
324 | 336 | set_content(output)
|
325 | 337 |
|
326 | 338 | /datum/browser/modal/listpicker/Topic(href,href_list)
|
327 |
| - if (href_list["close"] || !user || !user.client) |
| 339 | + if (href_list["close"] || !user) |
328 | 340 | opentime = 0
|
329 | 341 | return
|
330 | 342 | if (href_list["button"])
|
|
0 commit comments