Skip to content

Commit 18604d9

Browse files
authored
final major 516 fixes (ParadiseSS13#27676)
1 parent 2dcf243 commit 18604d9

File tree

7 files changed

+735
-656
lines changed

7 files changed

+735
-656
lines changed

code/modules/tgui/tgui_panel/tgui_panel_external.dm

+3-6
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@
1919
// Failed to fix
2020
action = alert(src, "Did that work?", "", "Yes", "No, switch to old ui")
2121
if(action == "No, switch to old ui")
22-
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
23-
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
22+
winset(src, "legacy_output_selector", "left=output_legacy")
2423
log_tgui(src, "Failed to fix.")
2524

2625
/client/proc/nuke_chat()
2726
// Catch all solution (kick the whole thing in the pants)
28-
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
29-
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
27+
winset(src, "legacy_output_selector", "left=output_legacy")
3028
if(!tgui_panel || !istype(tgui_panel))
3129
log_tgui(src, "tgui_panel datum is missing")
3230
tgui_panel = new(src, "chat_panel")
3331
tgui_panel.initialize(force = TRUE)
3432
// Force show the panel to see if there are any errors
35-
winset(src, "output", "is-disabled=1&is-visible=0")
36-
winset(src, "chat_panel", "is-disabled=0;is-visible=1")
33+
winset(src, "legacy_output_selector", "left=output_browser")
3734
if(byond_version >= 516)
3835
winset(src, null, "browser-options=byondstorage,find")
3936

interface/skin.dmf

+35-6
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ window "rpane"
294294
window "outputwindow"
295295
elem "outputwindow"
296296
type = MAIN
297-
pos = 281,0
297+
pos = 0,0
298298
size = 640x480
299299
anchor1 = -1,-1
300300
anchor2 = -1,-1
@@ -346,22 +346,51 @@ window "outputwindow"
346346
command = ".winset \"mebutton.is-checked=true ? input.command=\"!me \\\"\" : input.command=\"\"mebutton.is-checked=true ? saybutton.is-checked=false\"\"mebutton.is-checked=true ? oocbutton.is-checked=false\""
347347
is-flat = true
348348
button-type = pushbox
349-
elem "chat_panel"
350-
type = BROWSER
349+
elem "legacy_output_selector"
350+
type = CHILD
351351
pos = 0,0
352352
size = 640x456
353353
anchor1 = 0,0
354354
anchor2 = 100,100
355-
is-visible = false
356-
is-disabled = true
357-
saved-params = ""
355+
saved-params = "splitter"
356+
left = "output_legacy"
357+
is-vert = false
358+
window "output_legacy"
359+
elem "output_legacy"
360+
type = MAIN
361+
pos = 0,0
362+
size = 640x456
363+
anchor1 = -1,-1
364+
anchor2 = -1,-1
365+
background-color = none
366+
saved-params = "pos;size;is-minimized;is-maximized"
367+
is-pane = true
358368
elem "output"
359369
type = OUTPUT
360370
pos = 0,0
361371
size = 640x456
362372
anchor1 = 0,0
363373
anchor2 = 100,100
364374
is-default = true
375+
saved-params = "max-lines"
376+
377+
window "output_browser"
378+
elem "output_browser"
379+
type = MAIN
380+
pos = 0,0
381+
size = 640x456
382+
anchor1 = -1,-1
383+
anchor2 = -1,-1
384+
background-color = none
385+
saved-params = "pos;size;is-minimized;is-maximized"
386+
is-pane = true
387+
elem "chat_panel"
388+
type = BROWSER
389+
pos = 0,0
390+
size = 640x456
391+
anchor1 = 0,0
392+
anchor2 = 100,100
393+
background-color = none
365394
saved-params = ""
366395

367396
window "infowindow"

tgui/global.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ type ByondType = {
143143
*/
144144
parseJson(text: string): any;
145145

146+
/**
147+
* Downloads a blob, platform-agnostic
148+
*/
149+
saveBlob(blob: Blob, filename: string, ext: string): void;
150+
146151
/**
147152
* Sends a message to `/datum/tgui_window` which hosts this window instance.
148153
*/

tgui/packages/tgui-panel/chat/renderer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,9 @@ class ChatRenderer {
548548
+ '</body>\n'
549549
+ '</html>\n';
550550
// Create and send a nice blob
551-
const blob = new Blob([pageHtml]);
551+
const blob = new Blob([pageHtml], { type: 'text/plain' });
552552
const timestamp = new Date().toISOString().substring(0, 19).replace(/[-:]/g, '').replace('T', '-');
553-
window.navigator.msSaveBlob(blob, `ss13-chatlog-${timestamp}.html`);
553+
Byond.saveBlob(blob, `ss13-paradise-chatlog-${timestamp}.html`, '.html');
554554
}
555555
}
556556

tgui/packages/tgui-panel/index.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,9 @@ const setupApp = () => {
7070
// Dispatch incoming messages as store actions
7171
Byond.subscribe((type, payload) => store.dispatch({ type, payload }));
7272

73-
// Hide output
74-
Byond.winset('output', {
75-
'is-visible': false,
76-
'is-disabled': true,
77-
});
78-
7973
// Unhide the panel
80-
Byond.winset('chat_panel', {
81-
'is-visible': true,
82-
'is-disabled': false,
83-
'pos': '0x0',
84-
'size': '0x0',
74+
Byond.winset('legacy_output_selector', {
75+
left: 'output_browser',
8576
});
8677

8778
// Resize the panel to match the non-browser output

tgui/public/tgui-panel.bundle.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)