Fixed CharacterDirectory (#15757)

This commit is contained in:
Selis
2024-02-12 14:17:31 +01:00
committed by GitHub
parent cc7bf56ae5
commit 66d4b40e9d
8 changed files with 250 additions and 222 deletions
+17 -12
View File
@@ -1,4 +1,4 @@
/**
/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
@@ -26,6 +26,18 @@
var/initial_inline_css
var/mouse_event_macro_set = FALSE
/**
* Static list used to map in macros that will then emit execute events to the tgui window
* A small disclaimer though I'm no tech wiz: I don't think it's possible to map in right or middle
* clicks in the current state, as they're keywords rather than modifiers.
*/
var/static/list/byondToTguiEventMap = list(
"MouseDown" = "byond/mousedown",
"MouseUp" = "byond/mouseup",
"Ctrl" = "byond/ctrldown",
"Ctrl+UP" = "byond/ctrlup",
)
/**
* public
*
@@ -165,8 +177,8 @@
* Acquire the window lock. Pool will not be able to provide this window
* to other UIs for the duration of the lock.
*
* Can be given an optional tgui datum, which will hook its on_message
* callback into the message stream.
* Can be given an optional tgui datum, which will be automatically
* subscribed to incoming messages via the on_message proc.
*
* optional ui /datum/tgui
*/
@@ -175,6 +187,8 @@
locked_by = ui
/**
* public
*
* Release the window lock.
*/
/datum/tgui_window/proc/release_lock()
@@ -391,11 +405,6 @@
if(mouse_event_macro_set)
return
var/list/byondToTguiEventMap = list(
"MouseDown" = "byond/mousedown",
"MouseUp" = "byond/mouseup"
)
for(var/mouseMacro in byondToTguiEventMap)
var/command_template = ".output CONTROL PAYLOAD"
var/event_message = TGUI_CREATE_MESSAGE(byondToTguiEventMap[mouseMacro], null)
@@ -416,10 +425,6 @@
/datum/tgui_window/proc/remove_mouse_macro()
if(!mouse_event_macro_set)
stack_trace("Unsetting mouse macro on tgui window that has none")
var/list/byondToTguiEventMap = list(
"MouseDown" = "byond/mousedown",
"MouseUp" = "byond/mouseup"
)
for(var/mouseMacro in byondToTguiEventMap)
winset(client, null, "[mouseMacro]Window[id]Macro.parent=null")
mouse_event_macro_set = FALSE