This commit is contained in:
Artur
2020-01-15 09:41:33 +02:00
parent 6e3206a2e4
commit 8b8a112d2c
185 changed files with 12673 additions and 11295 deletions
@@ -316,7 +316,7 @@
data["PC_batteryicon"] = "batt_20.gif"
else
data["PC_batteryicon"] = "batt_5.gif"
data["PC_batterypercent"] = "[round(battery_module.battery.percent())] %"
data["PC_batterypercent"] = "[round(battery_module.battery.percent())]%"
data["PC_showbatteryicon"] = 1
else
data["PC_batteryicon"] = "batt_5.gif"
@@ -38,7 +38,8 @@
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
assets.send(user)
ui = new(user, src, ui_key, "ntos_main", "NTOS Main menu", 400, 500, master_ui, state)
ui = new(user, src, ui_key, "ntos_main", "NtOS Main menu", 400, 500, master_ui, state)
ui.set_style("ntos")
ui.open()
ui.set_autoupdate(state = 1)
@@ -68,10 +69,10 @@
switch(action)
if("PC_exit")
kill_program()
return 1
return TRUE
if("PC_shutdown")
shutdown_computer()
return 1
return TRUE
if("PC_minimize")
var/mob/user = usr
if(!active_program || !all_components[MC_CPU])
@@ -156,6 +157,7 @@
comp_light_color = new_color
light_color = new_color
update_light()
return TRUE
else
return
@@ -16,9 +16,9 @@
var/network_destination = null // Optional string that describes what NTNet server/system this program connects to. Used in default logging.
var/available_on_ntnet = 1 // Whether the program can be downloaded from NTNet. Set to 0 to disable.
var/available_on_syndinet = 0 // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
var/tgui_id // ID of TG UI interface
var/ui_style // ID of custom TG UI style (optional)
var/ui_x = 575 // Default size of TG UI window, in pixels
var/tgui_id // ID of TGUI interface
var/ui_style // ID of custom TGUI style (optional)
var/ui_x = 575 // Default size of TGUI window, in pixels
var/ui_y = 700
var/ui_header = null // Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!
@@ -12,8 +12,9 @@
network_destination = "power monitoring system"
size = 9
tgui_id = "ntos_power_monitor"
ui_x = 1200
ui_y = 1000
ui_style = "ntos"
ui_x = 550
ui_y = 700
var/has_alert = 0
var/obj/structure/cable/attached_wire
@@ -9,8 +9,9 @@
network_destination = "supermatter monitoring system"
size = 5
tgui_id = "ntos_supermatter_monitor"
ui_style = "ntos"
ui_x = 600
ui_y = 400
ui_y = 350
var/last_status = SUPERMATTER_INACTIVE
var/list/supermatters
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
+34 -34
View File
@@ -46,7 +46,7 @@
dev_card = 0
// Recalculates the price and optionally even fabricates the device.
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = 0)
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = FALSE)
total_price = 0
if(devtype == 1) // Laptop, generally cheaper to make it accessible for most station roles
var/obj/item/computer_hardware/battery/battery_module = null
@@ -160,7 +160,7 @@
if(fabricate)
fabricated_tablet.install_component(new/obj/item/computer_hardware/card_slot)
return total_price
return 0
return FALSE
@@ -168,79 +168,78 @@
/obj/machinery/lapvend/ui_act(action, params)
if(..())
return 1
return TRUE
switch(action)
if("pick_device")
if(state) // We've already picked a device type
return 0
return TRUE
devtype = text2num(params["pick"])
state = 1
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("clean_order")
reset_order()
return 1
return TRUE
if("purchase")
try_purchase()
return 1
return TRUE
if((state != 1) && devtype) // Following IFs should only be usable when in the Select Loadout mode
return 0
return TRUE
switch(action)
if("confirm_order")
state = 2 // Wait for ID swipe for payment processing
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_cpu")
dev_cpu = text2num(params["cpu"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_battery")
dev_battery = text2num(params["battery"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_disk")
dev_disk = text2num(params["disk"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_netcard")
dev_netcard = text2num(params["netcard"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_tesla")
dev_apc_recharger = text2num(params["tesla"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_nanoprint")
dev_printer = text2num(params["print"])
fabricate_and_recalc_price(0)
return 1
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_card")
dev_card = text2num(params["card"])
fabricate_and_recalc_price(0)
return 1
return 0
fabricate_and_recalc_price(FALSE)
return TRUE
return TRUE
/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
if(stat & (BROKEN | NOPOWER | MAINT))
if(ui)
ui.close()
return 0
return TRUE
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if (!ui)
ui = new(user, src, ui_key, "computer_fabricator", "Personal Computer Vendor", 500, 400, state = state)
ui.open()
ui.set_autoupdate(state = 1)
/obj/machinery/lapvend/attackby(obj/item/I as obj, mob/user as mob)
/obj/machinery/lapvend/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/stack/spacecash))
var/obj/item/stack/spacecash/c = I
if(!user.temporarilyRemoveItemFromInventory(c))
return
credits += c.value
visible_message("<span class='info'><span class='name'>[usr]</span> inserts [c.value] credits into [src].</span>")
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] credits into [src].</span>")
qdel(c)
return
return ..()
@@ -249,9 +248,9 @@
/obj/machinery/lapvend/proc/process_payment()
if(total_price > credits)
say("Insufficient credits.")
return 0
return TRUE
else
return 1
return TRUE
/obj/machinery/lapvend/ui_data(mob/user)
@@ -287,5 +286,6 @@
credits -= total_price
say("Enjoy your new product!")
state = 3
return 1
return 0
addtimer(CALLBACK(src, .proc/reset_order), 100)
return TRUE
return TRUE