mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 03:52:31 +00:00
## About The Pull Request **Comes with an UpdatePaths!** Removes the tablet subtype, PDAs now replaces them entirely. Nukie and Silicon tablets are now subtypes of the PDA instead, while contractor ones were removed entirely as they didn't do anything and were unused (though it wouldn't be hard to re-add). Nukie PDAs are now the only type of PDA that uses modular_tablets.dmi, which is just larger icons of modular_pda. Each application requires an icon state in both of these, for 2 different sizes, which makes it annoying to make new applications, especially if it can also run on computers/laptops. ### Icons Because Silicon tablets are now a subtype of PDA, they use PDA icons instead of tablet ones. Luckily for us, they already exist in code.  AI's don't use a tablet icon though, so they aren't affected. ## Why It's Good For The Game There's very little difference between tablets and PDAs, PDAs overshadow them in every single way, so at this point I don't see why we should have both of these, and if you compare the two in usefulness and actual in-game use by players, it's a no-brainer than the item all players get roundstart and comes with a messenger should be the one we go with. Also as said in the about section, when making an app you would need to make icon states for the program running for all hardware it can run on, which is Computer, Laptop, PDA, and Tablet. Laptop is just a smaller computer icon PDA is just a smaller tablet icon However, you can't simply shrink the size of the icon, instead you have to completely resprite the same app icon FOUR TIMES for it to not bluescreen on all these different devices. <details> <summary> Here's examples of it </summary> Computer (NOTE: *They share the same icon file as regular computers*) <img src="https://user-images.githubusercontent.com/53777086/203876801-486a8054-489a-4983-bdad-a2599b4dc379.png"/> Laptop <img src="https://user-images.githubusercontent.com/53777086/203876333-58e5d135-f4c6-4a02-8948-1df771e294a4.png"/> Tablet <img src="https://user-images.githubusercontent.com/53777086/203876352-816c7fb1-c681-40b9-99e0-052f49632c7f.png"/> PDA <img src="https://user-images.githubusercontent.com/53777086/203876358-1cf7253d-3c6a-456a-8133-ebf7f0351637.png"/> </details> If we wish to help in simplifying this, we should remove tablet icons entirely, which means 1 less icon to worry about. To do this, we'd need to resprite nukie PDAs, however I am very much not a spriter and never tried GAGS, so I'll leave it to someone else to do. ## Changelog 🆑 del: Tablets are now removed, PDAs are now the base 'tablet'. Silicon and nukie tablets are now PDAs. /🆑
157 lines
5.8 KiB
Plaintext
157 lines
5.8 KiB
Plaintext
/datum/computer_file/program/robotact
|
|
filename = "robotact"
|
|
filedesc = "RoboTact"
|
|
category = PROGRAM_CATEGORY_SCI
|
|
extended_desc = "A built-in app for cyborg self-management and diagnostics."
|
|
ui_header = "robotact.gif" //DEBUG -- new icon before PR
|
|
program_icon_state = "command"
|
|
requires_ntnet = FALSE
|
|
available_on_ntnet = FALSE
|
|
undeletable = TRUE
|
|
usage_flags = PROGRAM_TABLET
|
|
size = 5
|
|
tgui_id = "NtosRobotact"
|
|
program_icon = "terminal"
|
|
|
|
/datum/computer_file/program/robotact/on_start(mob/living/user)
|
|
if(!istype(computer, /obj/item/modular_computer/pda/silicon))
|
|
to_chat(user, span_warning("A warning flashes across \the [computer]: Device Incompatible."))
|
|
return FALSE
|
|
. = ..()
|
|
if(.)
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
if(tablet.device_theme == "syndicate")
|
|
program_icon_state = "command-syndicate"
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/computer_file/program/robotact/ui_data(mob/user)
|
|
var/list/data = get_header_data()
|
|
if(!iscyborg(user))
|
|
return data
|
|
|
|
//Implied, since we can't run on non tablets
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
|
|
var/mob/living/silicon/robot/cyborg = tablet.silicon_owner
|
|
|
|
data["name"] = cyborg.name
|
|
data["designation"] = cyborg.model
|
|
data["masterAI"] = cyborg.connected_ai //Master AI
|
|
|
|
var/charge = 0
|
|
var/maxcharge = 1
|
|
if(cyborg.cell)
|
|
charge = cyborg.cell.charge
|
|
maxcharge = cyborg.cell.maxcharge
|
|
data["charge"] = charge //Current cell charge
|
|
data["maxcharge"] = maxcharge //Cell max charge
|
|
data["integrity"] = ((cyborg.health + 100) / 2) //health, as percentage
|
|
data["lampIntensity"] = cyborg.lamp_intensity //lamp power setting
|
|
data["sensors"] = "[cyborg.sensors_on?"ACTIVE":"DISABLED"]"
|
|
data["printerPictures"] = cyborg.connected_ai? cyborg.connected_ai.aicamera.stored.len : cyborg.aicamera.stored.len //Number of pictures taken, synced to AI if available
|
|
data["printerToner"] = cyborg.toner //amount of toner
|
|
data["printerTonerMax"] = cyborg.tonermax //It's a variable, might as well use it
|
|
data["thrustersInstalled"] = cyborg.ionpulse //If we have a thruster uprade
|
|
data["thrustersStatus"] = "[cyborg.ionpulse_on?"ACTIVE":"DISABLED"]" //Feedback for thruster status
|
|
data["selfDestructAble"] = (cyborg.emagged || istype(cyborg, /mob/living/silicon/robot/model/syndicate))
|
|
|
|
//Cover, TRUE for locked
|
|
data["cover"] = "[cyborg.locked? "LOCKED":"UNLOCKED"]"
|
|
//Ability to move. FAULT if lockdown wire is cut, DISABLED if borg locked, ENABLED otherwise
|
|
data["locomotion"] = "[cyborg.wires.is_cut(WIRE_LOCKDOWN)?"FAULT":"[cyborg.lockcharge?"DISABLED":"ENABLED"]"]"
|
|
//Model wire. FAULT if cut, NOMINAL otherwise
|
|
data["wireModule"] = "[cyborg.wires.is_cut(WIRE_RESET_MODEL)?"FAULT":"NOMINAL"]"
|
|
//DEBUG -- Camera(net) wire. FAULT if cut (or no cameranet camera), DISABLED if pulse-disabled, NOMINAL otherwise
|
|
data["wireCamera"] = "[!cyborg.builtInCamera || cyborg.wires.is_cut(WIRE_CAMERA)?"FAULT":"[cyborg.builtInCamera.can_use()?"NOMINAL":"DISABLED"]"]"
|
|
//AI wire. FAULT if wire is cut, CONNECTED if connected to AI, READY otherwise
|
|
data["wireAI"] = "[cyborg.wires.is_cut(WIRE_AI)?"FAULT":"[cyborg.connected_ai?"CONNECTED":"READY"]"]"
|
|
//Law sync wire. FAULT if cut, NOMINAL otherwise
|
|
data["wireLaw"] = "[cyborg.wires.is_cut(WIRE_LAWSYNC)?"FAULT":"NOMINAL"]"
|
|
|
|
return data
|
|
|
|
/datum/computer_file/program/robotact/ui_static_data(mob/user)
|
|
var/list/data = list()
|
|
if(!iscyborg(user))
|
|
return data
|
|
var/mob/living/silicon/robot/cyborg = user
|
|
//Implied
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
|
|
data["Laws"] = cyborg.laws.get_law_list(TRUE, TRUE, FALSE)
|
|
data["borgLog"] = tablet.borglog
|
|
data["borgUpgrades"] = cyborg.upgrades
|
|
return data
|
|
|
|
/datum/computer_file/program/robotact/ui_act(action, params)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
//Implied type, memes
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
var/mob/living/silicon/robot/cyborg = tablet.silicon_owner
|
|
|
|
switch(action)
|
|
if("coverunlock")
|
|
if(cyborg.locked)
|
|
cyborg.locked = FALSE
|
|
cyborg.update_icons()
|
|
if(cyborg.emagged)
|
|
cyborg.logevent("ChÃ¥vÃis cover lock has been [cyborg.locked ? "engaged" : "released"]") //"The cover interface glitches out for a split second"
|
|
else
|
|
cyborg.logevent("Chassis cover lock has been [cyborg.locked ? "engaged" : "released"]")
|
|
|
|
if("lawchannel")
|
|
cyborg.set_autosay()
|
|
|
|
if("lawstate")
|
|
cyborg.checklaws()
|
|
|
|
if("alertPower")
|
|
if(cyborg.stat == CONSCIOUS)
|
|
if(!cyborg.cell || !cyborg.cell.charge)
|
|
cyborg.visible_message(span_notice("The power warning light on [span_name("[cyborg]")] flashes urgently."), \
|
|
"You announce you are operating in low power mode.")
|
|
playsound(cyborg, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
|
|
|
if("toggleSensors")
|
|
cyborg.toggle_sensors()
|
|
|
|
if("viewImage")
|
|
if(cyborg.connected_ai)
|
|
cyborg.connected_ai.aicamera?.viewpictures(usr)
|
|
else
|
|
cyborg.aicamera?.viewpictures(usr)
|
|
|
|
if("printImage")
|
|
var/obj/item/camera/siliconcam/robot_camera/borgcam = cyborg.aicamera
|
|
borgcam?.borgprint(usr)
|
|
|
|
if("toggleThrusters")
|
|
cyborg.toggle_ionpulse()
|
|
|
|
if("lampIntensity")
|
|
cyborg.lamp_intensity = params["ref"]
|
|
cyborg.toggle_headlamp(FALSE, TRUE)
|
|
|
|
if("selfDestruct")
|
|
if(cyborg.stat || cyborg.lockcharge) //No detonation while stunned or locked down
|
|
return
|
|
if(cyborg.emagged || istype(cyborg, /mob/living/silicon/robot/model/syndicate)) //This option shouldn't even be showing otherwise
|
|
cyborg.self_destruct(cyborg)
|
|
|
|
/**
|
|
* Forces a full update of the UI, if currently open.
|
|
*
|
|
* Forces an update that includes refreshing ui_static_data. Called by
|
|
* law changes and borg log additions.
|
|
*/
|
|
/datum/computer_file/program/robotact/proc/force_full_update()
|
|
if(!istype(computer, /obj/item/modular_computer/pda/silicon))
|
|
return
|
|
var/obj/item/modular_computer/pda/silicon/tablet = computer
|
|
var/datum/tgui/active_ui = SStgui.get_open_ui(tablet.silicon_owner, src)
|
|
if(active_ui)
|
|
active_ui.send_full_update()
|