Skip to content

Commit

Permalink
final major 516 fixes (ParadiseSS13#27676)
Browse files Browse the repository at this point in the history
  • Loading branch information
S34NW authored Dec 18, 2024
1 parent 2dcf243 commit 18604d9
Show file tree
Hide file tree
Showing 7 changed files with 735 additions and 656 deletions.
9 changes: 3 additions & 6 deletions code/modules/tgui/tgui_panel/tgui_panel_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@
// Failed to fix
action = alert(src, "Did that work?", "", "Yes", "No, switch to old ui")
if(action == "No, switch to old ui")
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
winset(src, "legacy_output_selector", "left=output_legacy")
log_tgui(src, "Failed to fix.")

/client/proc/nuke_chat()
// Catch all solution (kick the whole thing in the pants)
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
winset(src, "legacy_output_selector", "left=output_legacy")
if(!tgui_panel || !istype(tgui_panel))
log_tgui(src, "tgui_panel datum is missing")
tgui_panel = new(src, "chat_panel")
tgui_panel.initialize(force = TRUE)
// Force show the panel to see if there are any errors
winset(src, "output", "is-disabled=1&is-visible=0")
winset(src, "chat_panel", "is-disabled=0;is-visible=1")
winset(src, "legacy_output_selector", "left=output_browser")
if(byond_version >= 516)
winset(src, null, "browser-options=byondstorage,find")

Expand Down
41 changes: 35 additions & 6 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ window "rpane"
window "outputwindow"
elem "outputwindow"
type = MAIN
pos = 281,0
pos = 0,0
size = 640x480
anchor1 = -1,-1
anchor2 = -1,-1
Expand Down Expand Up @@ -346,22 +346,51 @@ window "outputwindow"
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\""
is-flat = true
button-type = pushbox
elem "chat_panel"
type = BROWSER
elem "legacy_output_selector"
type = CHILD
pos = 0,0
size = 640x456
anchor1 = 0,0
anchor2 = 100,100
is-visible = false
is-disabled = true
saved-params = ""
saved-params = "splitter"
left = "output_legacy"
is-vert = false
window "output_legacy"
elem "output_legacy"
type = MAIN
pos = 0,0
size = 640x456
anchor1 = -1,-1
anchor2 = -1,-1
background-color = none
saved-params = "pos;size;is-minimized;is-maximized"
is-pane = true
elem "output"
type = OUTPUT
pos = 0,0
size = 640x456
anchor1 = 0,0
anchor2 = 100,100
is-default = true
saved-params = "max-lines"

window "output_browser"
elem "output_browser"
type = MAIN
pos = 0,0
size = 640x456
anchor1 = -1,-1
anchor2 = -1,-1
background-color = none
saved-params = "pos;size;is-minimized;is-maximized"
is-pane = true
elem "chat_panel"
type = BROWSER
pos = 0,0
size = 640x456
anchor1 = 0,0
anchor2 = 100,100
background-color = none
saved-params = ""

window "infowindow"
Expand Down
5 changes: 5 additions & 0 deletions tgui/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ type ByondType = {
*/
parseJson(text: string): any;

/**
* Downloads a blob, platform-agnostic
*/
saveBlob(blob: Blob, filename: string, ext: string): void;

/**
* Sends a message to `/datum/tgui_window` which hosts this window instance.
*/
Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui-panel/chat/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ class ChatRenderer {
+ '</body>\n'
+ '</html>\n';
// Create and send a nice blob
const blob = new Blob([pageHtml]);
const blob = new Blob([pageHtml], { type: 'text/plain' });
const timestamp = new Date().toISOString().substring(0, 19).replace(/[-:]/g, '').replace('T', '-');
window.navigator.msSaveBlob(blob, `ss13-chatlog-${timestamp}.html`);
Byond.saveBlob(blob, `ss13-paradise-chatlog-${timestamp}.html`, '.html');
}
}

Expand Down
13 changes: 2 additions & 11 deletions tgui/packages/tgui-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,9 @@ const setupApp = () => {
// Dispatch incoming messages as store actions
Byond.subscribe((type, payload) => store.dispatch({ type, payload }));

// Hide output
Byond.winset('output', {
'is-visible': false,
'is-disabled': true,
});

// Unhide the panel
Byond.winset('chat_panel', {
'is-visible': true,
'is-disabled': false,
'pos': '0x0',
'size': '0x0',
Byond.winset('legacy_output_selector', {
left: 'output_browser',
});

// Resize the panel to match the non-browser output
Expand Down
4 changes: 2 additions & 2 deletions tgui/public/tgui-panel.bundle.js

Large diffs are not rendered by default.

Loading

0 comments on commit 18604d9

Please sign in to comment.