mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Move PDA to code/modules/pda
This commit is contained in:
106
code/modules/pda/app.dm
Normal file
106
code/modules/pda/app.dm
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
// Base class for anything that can show up on home screen
|
||||||
|
/datum/data/pda
|
||||||
|
var/icon = "tasks" //options comes from http://fontawesome.io/icons/
|
||||||
|
var/notify_icon = "exclamation-circle"
|
||||||
|
var/notify_silent = 0
|
||||||
|
var/hidden = 0 // program not displayed in main menu
|
||||||
|
var/category = "General" // the category to list it in on the main menu
|
||||||
|
var/obj/item/pda/pda // if this is null, and the app is running code, something's gone wrong
|
||||||
|
|
||||||
|
/datum/data/pda/Destroy()
|
||||||
|
pda = null
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/datum/data/pda/proc/start()
|
||||||
|
return
|
||||||
|
|
||||||
|
/datum/data/pda/proc/stop()
|
||||||
|
return
|
||||||
|
|
||||||
|
/datum/data/pda/proc/program_process()
|
||||||
|
return
|
||||||
|
|
||||||
|
/datum/data/pda/proc/program_hit_check()
|
||||||
|
return
|
||||||
|
|
||||||
|
/datum/data/pda/proc/notify(message, blink = 1)
|
||||||
|
if(message)
|
||||||
|
//Search for holder of the PDA.
|
||||||
|
var/mob/living/L = null
|
||||||
|
if(pda.loc && isliving(pda.loc))
|
||||||
|
L = pda.loc
|
||||||
|
//Maybe they are a pAI!
|
||||||
|
else
|
||||||
|
L = get(pda, /mob/living/silicon)
|
||||||
|
|
||||||
|
if(L)
|
||||||
|
to_chat(L, "[bicon(pda)] [message]")
|
||||||
|
SSnanoui.update_user_uis(L, pda) // Update the receiving user's PDA UI so that they can see the new message
|
||||||
|
|
||||||
|
if(!notify_silent)
|
||||||
|
pda.play_ringtone()
|
||||||
|
|
||||||
|
if(blink && !(src in pda.notifying_programs))
|
||||||
|
pda.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||||
|
pda.notifying_programs |= src
|
||||||
|
|
||||||
|
/datum/data/pda/proc/unnotify()
|
||||||
|
if(src in pda.notifying_programs)
|
||||||
|
pda.notifying_programs -= src
|
||||||
|
if(!pda.notifying_programs.len)
|
||||||
|
pda.overlays -= image('icons/obj/pda.dmi', "pda-r")
|
||||||
|
|
||||||
|
// An app has a button on the home screen and its own UI
|
||||||
|
/datum/data/pda/app
|
||||||
|
name = "App"
|
||||||
|
size = 3
|
||||||
|
var/title = null // what is displayed in the title bar when this is the current app
|
||||||
|
var/template = ""
|
||||||
|
var/update = PDA_APP_UPDATE
|
||||||
|
var/has_back = 0
|
||||||
|
|
||||||
|
/datum/data/pda/app/New()
|
||||||
|
if(!title)
|
||||||
|
title = name
|
||||||
|
|
||||||
|
/datum/data/pda/app/start()
|
||||||
|
if(pda.current_app)
|
||||||
|
pda.current_app.stop()
|
||||||
|
pda.current_app = src
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/datum/data/pda/app/proc/update_ui(mob/user as mob, list/data)
|
||||||
|
|
||||||
|
|
||||||
|
// Utilities just have a button on the home screen, but custom code when clicked
|
||||||
|
/datum/data/pda/utility
|
||||||
|
name = "Utility"
|
||||||
|
icon = "gear"
|
||||||
|
size = 1
|
||||||
|
category = "Utilities"
|
||||||
|
|
||||||
|
|
||||||
|
/datum/data/pda/utility/scanmode
|
||||||
|
var/base_name
|
||||||
|
category = "Scanners"
|
||||||
|
|
||||||
|
/datum/data/pda/utility/scanmode/New(obj/item/cartridge/C)
|
||||||
|
..(C)
|
||||||
|
name = "Enable [base_name]"
|
||||||
|
|
||||||
|
/datum/data/pda/utility/scanmode/start()
|
||||||
|
if(pda.scanmode)
|
||||||
|
pda.scanmode.name = "Enable [pda.scanmode.base_name]"
|
||||||
|
|
||||||
|
if(pda.scanmode == src)
|
||||||
|
pda.scanmode = null
|
||||||
|
else
|
||||||
|
pda.scanmode = src
|
||||||
|
name = "Disable [base_name]"
|
||||||
|
|
||||||
|
pda.update_shortcuts()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/datum/data/pda/utility/scanmode/proc/scan_mob(mob/living/C as mob, mob/living/user as mob)
|
||||||
|
|
||||||
|
/datum/data/pda/utility/scanmode/proc/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob)
|
||||||
@@ -1157,12 +1157,6 @@
|
|||||||
#include "code\game\objects\items\devices\communicator\messaging.dm"
|
#include "code\game\objects\items\devices\communicator\messaging.dm"
|
||||||
#include "code\game\objects\items\devices\communicator\phone.dm"
|
#include "code\game\objects\items\devices\communicator\phone.dm"
|
||||||
#include "code\game\objects\items\devices\communicator\UI.dm"
|
#include "code\game\objects\items\devices\communicator\UI.dm"
|
||||||
#include "code\game\objects\items\devices\PDA\cart.dm"
|
|
||||||
#include "code\game\objects\items\devices\PDA\cart_vr.dm"
|
|
||||||
#include "code\game\objects\items\devices\PDA\chatroom.dm"
|
|
||||||
#include "code\game\objects\items\devices\PDA\PDA.dm"
|
|
||||||
#include "code\game\objects\items\devices\PDA\PDA_vr.dm"
|
|
||||||
#include "code\game\objects\items\devices\PDA\radio.dm"
|
|
||||||
#include "code\game\objects\items\devices\radio\beacon.dm"
|
#include "code\game\objects\items\devices\radio\beacon.dm"
|
||||||
#include "code\game\objects\items\devices\radio\electropack.dm"
|
#include "code\game\objects\items\devices\radio\electropack.dm"
|
||||||
#include "code\game\objects\items\devices\radio\encryptionkey.dm"
|
#include "code\game\objects\items\devices\radio\encryptionkey.dm"
|
||||||
@@ -3071,6 +3065,13 @@
|
|||||||
#include "code\modules\paperwork\photography.dm"
|
#include "code\modules\paperwork\photography.dm"
|
||||||
#include "code\modules\paperwork\silicon_photography.dm"
|
#include "code\modules\paperwork\silicon_photography.dm"
|
||||||
#include "code\modules\paperwork\stamps.dm"
|
#include "code\modules\paperwork\stamps.dm"
|
||||||
|
#include "code\modules\pda\app.dm"
|
||||||
|
#include "code\modules\pda\cart.dm"
|
||||||
|
#include "code\modules\pda\cart_vr.dm"
|
||||||
|
#include "code\modules\pda\chatroom.dm"
|
||||||
|
#include "code\modules\pda\pda.dm"
|
||||||
|
#include "code\modules\pda\pda_vr.dm"
|
||||||
|
#include "code\modules\pda\radio.dm"
|
||||||
#include "code\modules\persistence\filth.dm"
|
#include "code\modules\persistence\filth.dm"
|
||||||
#include "code\modules\persistence\graffiti.dm"
|
#include "code\modules\persistence\graffiti.dm"
|
||||||
#include "code\modules\persistence\noticeboard.dm"
|
#include "code\modules\persistence\noticeboard.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user