Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDA improvements/QoL #1873

Closed
wants to merge 8 commits into from
2 changes: 2 additions & 0 deletions code/__DEFINES/interaction_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#define INTERACT_ATOM_NO_FINGERPRINT_INTERACT (1<<8)
/// allows this atom to skip the adjacency check
#define INTERACT_ATOM_ALLOW_USER_LOCATION (1<<9)
/// ignores mobility check
#define INTERACT_ATOM_IGNORE_MOBILITY (1<<10)

/// attempt pickup on attack_hand for items
#define INTERACT_ITEM_ATTACK_HAND_PICKUP (1<<0)
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/~monkestation/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Sent when a crew record added to manifest (datum/record/crew)
#define COMSIG_GLOB_CREW_RECORD_ADDED "!crew_record_added"
/// Sent when a crew record is removed from manifest (datum/record/crew)
#define COMSIG_GLOB_CREW_RECORD_REMOVED "!crew_record_removed"

/// Sent when a locked record added to manifest (datum/record/locked)
#define COMSIG_GLOB_LOCKED_RECORD_ADDED "!locked_record_added"
/// Sent when a locked record is removed from manifest (datum/record/locked)
#define COMSIG_GLOB_LOCKED_RECORD_REMOVED "!locked_record_removed"
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ DEFINE_BITFIELD(interaction_flags_atom, list(
"INTERACT_ATOM_REQUIRES_DEXTERITY" = INTERACT_ATOM_REQUIRES_DEXTERITY,
"INTERACT_ATOM_UI_INTERACT" = INTERACT_ATOM_UI_INTERACT,
"INTERACT_ATOM_ALLOW_USER_LOCATION" = INTERACT_ATOM_ALLOW_USER_LOCATION,
"INTERACT_ATOM_IGNORE_MOBILITY" = INTERACT_ATOM_IGNORE_MOBILITY,
))

DEFINE_BITFIELD(interaction_flags_machine, list(
Expand Down
4 changes: 4 additions & 0 deletions code/datums/records/record.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@
src.quirk_notes = quirk_notes

GLOB.manifest.general += src
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CREW_RECORD_ADDED, src) // monkestation edit: add crew record update signals

/datum/record/crew/Destroy()
GLOB.manifest.general -= src
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CREW_RECORD_REMOVED, src) // monkestation edit: add crew record update signals
return ..()

/**
Expand Down Expand Up @@ -152,9 +154,11 @@
species_type = dna_ref.species.type

GLOB.manifest.locked += src
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LOCKED_RECORD_ADDED, src) // monkestation edit: add crew record update signals

/datum/record/locked/Destroy()
GLOB.manifest.locked -= src
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LOCKED_RECORD_REMOVED, src) // monkestation edit: add crew record update signals
return ..()

/// A helper proc to get the front photo of a character from the record.
Expand Down
3 changes: 2 additions & 1 deletion code/modules/modular_computers/computers/item/pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

steel_sheet_cost = 2
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT * 3, /datum/material/glass=SMALL_MATERIAL_AMOUNT, /datum/material/plastic=SMALL_MATERIAL_AMOUNT)
interaction_flags_atom = INTERACT_ATOM_ALLOW_USER_LOCATION
interaction_flags_atom = INTERACT_ATOM_ALLOW_USER_LOCATION | INTERACT_ATOM_IGNORE_MOBILITY

icon_state_menu = "menu"
max_capacity = 64
Expand All @@ -34,6 +34,7 @@
///Static list of default PDA apps to install on Initialize.
var/static/list/datum/computer_file/pda_programs = list(
/datum/computer_file/program/messenger,
/datum/computer_file/program/chatclient, // monke edit: install IRC client by default
/datum/computer_file/program/nt_pay,
/datum/computer_file/program/notepad,
/datum/computer_file/program/crew_manifest // monke edit: install crew manifest by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@

if("GetPayToken")
wanted_token = null
// monkestation start: better name matching - case insentive and disregard non-alphanumeric characters
var/static/regex/cleanup_regex = new(@"\[^a-z0-9]+", "ig")
var/cleaned_wanted_name = cleanup_regex.Replace(trim(params["wanted_name"]), "")
for(var/account in SSeconomy.bank_accounts_by_id)
var/datum/bank_account/acc = SSeconomy.bank_accounts_by_id[account]
if(acc.account_holder == params["wanted_name"])
var/cleaned_account_holder = cleanup_regex.Replace(trim(acc.account_holder), "")
if(cmptext(cleaned_account_holder, cleaned_wanted_name))
wanted_token = "Token: [acc.pay_token]"
break
// monkestation end
if(!wanted_token)
return wanted_token = "Account \"[params["wanted_name"]]\" not found."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@

if (!input_message || !sending_and_receiving)
return
if(!user.can_perform_action(computer))
if(!user.can_perform_action(computer, ALLOW_RESTING))
return
return sanitize(input_message)

Expand Down Expand Up @@ -415,7 +415,7 @@
if(computer.active_program != src)
if(!computer.open_program(usr, src, open_ui = FALSE))
return
if(!href_list["close"] && usr.can_perform_action(computer, FORBID_TELEKINESIS_REACH))
if(!href_list["close"] && usr.can_perform_action(computer, ALLOW_RESTING))
switch(href_list["choice"])
if("Message")
send_message(usr, list(locate(href_list["target"])))
Expand Down
3 changes: 2 additions & 1 deletion code/modules/tgui/states.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@

/mob/living/shared_ui_interaction(src_object)
. = ..()
if(!(mobility_flags & MOBILITY_UI) && . == UI_INTERACTIVE)
var/obj/item/object = src_object
if(!(mobility_flags & MOBILITY_UI) && !(object.interaction_flags_atom & INTERACT_ATOM_IGNORE_MOBILITY) && . == UI_INTERACTIVE)
return UI_UPDATE

/mob/living/silicon/ai/shared_ui_interaction(src_object)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/datum/ntnet_conversation/add_message(message, username)
. = ..()
for(var/datum/computer_file/program/chatclient/hunter2 in active_clients)
if(!cmptext(hunter2.username, username))
hunter2.computer.alert_call(hunter2, "[username] in [title]: [message]", 'sound/machines/ping.ogg')
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/datum/computer_file/program/crew_manifest
filedesc = "Plexagon Crew Manifest"
transfer_access = list()
detomatix_resistance = NONE

/datum/computer_file/program/crew_manifest/New()
. = ..()
RegisterSignals(SSdcs, list(COMSIG_GLOB_CREW_RECORD_ADDED, COMSIG_GLOB_CREW_RECORD_REMOVED))
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, PROC_REF(_update_ui_data))

/datum/computer_file/program/crew_manifest/Destroy()
Expand Down
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@
#include "code\__DEFINES\~monkestation\virology.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_atom.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_carbon.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_global.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_guns.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_item.dm"
#include "code\__DEFINES\~monkestation\dcs\signals\signals_mob.dm"
Expand Down Expand Up @@ -6612,6 +6613,7 @@
#include "monkestation\code\modules\modular_bartending\item_modifications\reagent_modification.dm"
#include "monkestation\code\modules\modular_bartending\reactions\food_reactions.dm"
#include "monkestation\code\modules\modular_computers\file_system\programs\crewmanifest.dm"
#include "monkestation\code\modules\modular_computers\NTNet\NTNRC\conversation.dm"
#include "monkestation\code\modules\modular_guns\__base_attachment.dm"
#include "monkestation\code\modules\modular_guns\__base_modular_gun.dm"
#include "monkestation\code\modules\modular_guns\attachment_datums\__base_attachment_datum.dm"
Expand Down
Loading