Files
Paradise/code/modules/pda/app.dm
Sirryan2002 61145a02f8 [TGUI] Space Credit Economy Overhaul + Supply Point -> Space Cash (#19209)
* initial edits

* initial edits

* converting shit over to machinery/economy

* vending and mapping fixes

* vending fix pt.2

* Converts Supply Economy to Use Space Credits instead of Supply Points

* Job Payment, NanoBank, and Paychecks

* clothing type path fixes (damn merge conflicts)

* fixes map typepath issues

* adjusts supply prices

* Vendor Price Adjustments

* account uplink terminal tweaks

* please pass tests

* Apply suggestions from code review

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* reviews and bug fixes

* Review Suggestions/Fixes and Request Console Rewrite

* edits

* vending changes for merge

* typepath fix

* final tweaks

* proc ref fixes

* Fixes and Tweaks from 2nd TM

* rebuild TGUI

* final tweaks

* Apply suggestions from code review

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* requested reviews

* tweaks

* updates slot machine winnings

* fixes

* GC fixes

* fixes

* oops. still need to deconflict this

* Apply suggestions from code review

Co-authored-by: Farie82 <farie82@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* requested changes and bug fixes

* atm runtime fix

* requested reviews

* vend act stuff

* attempt to pass tests

* supply packs fix

* user tochat -> debug log

* FINAL FIXES

* removes CC db stuff

* Apply suggestions from code review

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Co-authored-by: Farie82 <farie82@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
2022-11-21 23:30:50 +00:00

112 lines
2.9 KiB
Plaintext

// 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/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, silence_ringtone = FALSE)
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 && L.stat != UNCONSCIOUS) // Awake or dead people can see their messages
to_chat(L, "[bicon(pda)] [message]")
SStgui.update_user_uis(L, pda) // Update the receiving user's PDA UI so that they can see the new message
if(!pda.silent && !silence_ringtone)
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
if(!pda.silent)
playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE)
return TRUE
/datum/data/pda/app/proc/update_ui(mob/user, list/data)
return
// 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()
if(!pda.silent)
playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE)
return TRUE
/datum/data/pda/utility/scanmode/proc/scan_mob(mob/living/C, mob/living/user)
return
/datum/data/pda/utility/scanmode/proc/scan_atom(atom/A, mob/user)
return