Make NanoUI resistant to Topic spoofs

Move Topic() into a NanoUI-specific ui_act proc
Update to @YotaXP's latest JSON code.
Return focus to the mapwindow if a key is pressed in a NanoUI.
This commit is contained in:
Bjorn Neergaard
2015-12-15 22:37:52 -06:00
parent 070a081db8
commit da4842dddf
29 changed files with 354 additions and 168 deletions
@@ -157,22 +157,21 @@ Thus, the two variables affect pump operation are set in New():
return
interact(user)
/obj/machinery/atmospherics/components/binary/pump/Topic(href,href_list)
/obj/machinery/atmospherics/components/binary/pump/ui_act(action, params)
if(..())
return
switch(href_list["nano"])
switch(action)
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
if("pressure")
switch(href_list["set"])
switch(params["set"])
if ("max")
target_pressure = MAX_OUTPUT_PRESSURE
if ("custom")
target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure)))
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
add_fingerprint(usr)
update_icon()
return 1