More NtOS interfaces, random fixes, client-side theming (#47836)

* General tgui fixes

* Handle ui_style on client side

* NtOS Net Downloader

* Rebuild tgui

* Fix regression on Tabs

* Fix bools
This commit is contained in:
Aleksej Komarov
2019-11-21 05:54:24 +02:00
committed by Rob Bailey
parent 9cbf2931dd
commit ac1f4d74c6
32 changed files with 368 additions and 141 deletions

View File

@@ -11,6 +11,8 @@
available_on_ntnet = 0
ui_header = "downloader_finished.gif"
tgui_id = "ntos_net_downloader"
ui_x = 480
ui_y = 735
var/datum/computer_file/program/downloaded_file = null
var/hacked_download = 0
@@ -113,49 +115,50 @@
var/list/data = get_header_data()
// This IF cuts on data transferred to client, so i guess it's worth it.
if(downloaderror) // Download errored. Wait until user resets the program.
data["error"] = downloaderror
else if(downloaded_file) // Download running. Wait please..
data["downloading"] = !!downloaded_file
data["error"] = downloaderror || FALSE
// Download running. Wait please..
if(downloaded_file)
data["downloadname"] = downloaded_file.filename
data["downloaddesc"] = downloaded_file.filedesc
data["downloadsize"] = downloaded_file.size
data["downloadspeed"] = download_netspeed
data["downloadcompletion"] = round(download_completion, 0.1)
else // No download running, pick file.
var/obj/item/computer_hardware/hard_drive/hard_drive = my_computer.all_components[MC_HDD]
data["disk_size"] = hard_drive.max_capacity
data["disk_used"] = hard_drive.used_capacity
var/list/all_entries[0]
for(var/A in SSnetworks.station_network.available_station_software)
var/datum/computer_file/program/P = A
// Only those programs our user can run will show in the list
if(!P.can_run(user,transfer = 1) || hard_drive.find_file_by_name(P.filename))
continue
all_entries.Add(list(list(
var/obj/item/computer_hardware/hard_drive/hard_drive = my_computer.all_components[MC_HDD]
data["disk_size"] = hard_drive.max_capacity
data["disk_used"] = hard_drive.used_capacity
var/list/all_entries[0]
for(var/A in SSnetworks.station_network.available_station_software)
var/datum/computer_file/program/P = A
// Only those programs our user can run will show in the list
if(!P.can_run(user,transfer = 1) || hard_drive.find_file_by_name(P.filename))
continue
all_entries.Add(list(list(
"filename" = P.filename,
"filedesc" = P.filedesc,
"fileinfo" = P.extended_desc,
"compatibility" = check_compatibility(P),
"size" = P.size
)))
data["hackedavailable"] = 0
if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software
var/list/hacked_programs[0]
for(var/S in SSnetworks.station_network.available_antag_software)
var/datum/computer_file/program/P = S
if(hard_drive.find_file_by_name(P.filename))
continue
data["hackedavailable"] = 1
hacked_programs.Add(list(list(
"size" = P.size,
)))
data["hackedavailable"] = FALSE
if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software
var/list/hacked_programs[0]
for(var/S in SSnetworks.station_network.available_antag_software)
var/datum/computer_file/program/P = S
if(hard_drive.find_file_by_name(P.filename))
continue
data["hackedavailable"] = TRUE
hacked_programs.Add(list(list(
"filename" = P.filename,
"filedesc" = P.filedesc,
"fileinfo" = P.extended_desc,
"size" = P.size
)))
data["hacked_programs"] = hacked_programs
"size" = P.size,
)))
data["hacked_programs"] = hacked_programs
data["downloadable_programs"] = all_entries
data["downloadable_programs"] = all_entries
return data

View File

@@ -12,7 +12,6 @@
network_destination = "power monitoring system"
size = 9
tgui_id = "ntos_power_monitor"
ui_style = "ntos"
ui_x = 550
ui_y = 700

View File

@@ -9,7 +9,6 @@
network_destination = "supermatter monitoring system"
size = 5
tgui_id = "ntos_supermatter_monitor"
ui_style = "ntos"
ui_x = 600
ui_y = 350
var/last_status = SUPERMATTER_INACTIVE