[MIRROR] Refactor of modular PC UIs (#874)

* Refactor of modular PC UIs

* .rej fix
This commit is contained in:
CitadelStationBot
2017-05-18 05:22:34 -05:00
committed by Poojawa
parent 663fd8e671
commit 2eea01f671
33 changed files with 262 additions and 769 deletions
@@ -1,6 +1,6 @@
/datum/computer_file/program/chatclient
filename = "ntnrc_client"
filedesc = "NTNet Relay Chat Client"
filedesc = "Chat Client"
program_icon_state = "command"
extended_desc = "This program allows communication over NTNRC network"
size = 8
@@ -9,6 +9,8 @@
network_destination = "NTNRC server"
ui_header = "ntnrc_idle.gif"
available_on_ntnet = 1
tgui_id = "ntos_net_chat"
var/last_message = null // Used to generate the toolbar icon
var/username
var/datum/ntnet_conversation/channel = null
@@ -180,21 +182,6 @@
channel = null
..()
/datum/computer_file/program/chatclient/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if (!ui)
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
assets.send(user)
ui = new(user, src, ui_key, "ntnet_chat", "NTNet Relay Chat Client", 575, 700, state = state)
ui.open()
ui.set_autoupdate(state = 1)
/datum/computer_file/program/chatclient/ui_data(mob/user)
if(!GLOB.ntnet_global || !GLOB.ntnet_global.chat_channels)
return