mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
More WIP
Majority of base systems done.
This commit is contained in:
@@ -125,12 +125,11 @@
|
||||
// It returns 0 if it can't run or if NanoModule was used instead. I suggest using NanoModules where applicable.
|
||||
/datum/computer_file/program/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 1, datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
if(program_state != PROGRAM_STATE_ACTIVE) // Our program was closed. Close the ui if it exists.
|
||||
if(!ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(ui)
|
||||
ui.close()
|
||||
return computer.ui_interact(user)
|
||||
if(istype(NM))
|
||||
NM.ui_interact(user, ui_key, null, force_open)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -139,8 +138,32 @@
|
||||
// Calls beginning with "PRG_" are reserved for programs handling.
|
||||
// Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program)
|
||||
// ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE.
|
||||
/datum/computer_file/program/Topic(href, href_list)
|
||||
/datum/computer_file/program/ui_act(action,params)
|
||||
if(..())
|
||||
return 1
|
||||
if(computer)
|
||||
return computer.Topic(href, href_list)
|
||||
switch(action)
|
||||
if("PC_exit")
|
||||
computer.kill_program()
|
||||
return 1
|
||||
if("PC_shutdown")
|
||||
computer.shutdown_computer()
|
||||
return 1
|
||||
if("PC_minimize")
|
||||
var/mob/user = usr
|
||||
if(!computer.active_program || !computer.processor_unit)
|
||||
return
|
||||
|
||||
computer.idle_threads.Add(computer.active_program)
|
||||
program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
|
||||
|
||||
computer.active_program = null
|
||||
computer.update_icon()
|
||||
if(user && istype(user))
|
||||
computer.ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
|
||||
|
||||
|
||||
|
||||
|
||||
//if(computer)
|
||||
// return computer.ui_act(action,params)
|
||||
|
||||
Reference in New Issue
Block a user