From e11a405165b4202d2a35801ac22cdabc9945857d Mon Sep 17 00:00:00 2001 From: phil235 Date: Tue, 7 Apr 2015 17:44:43 +0200 Subject: [PATCH] Fixes the holopad choice window spam. The holopad now uses the standard popup window used by computers and most machines. A simple click to close it. Fixes /obj/item/clothing/suit/space/pirat hiding the mob's jumpsuit when worn. --- code/game/machinery/hologram.dm | 37 +++++++++++++++---- .../clothing/spacesuits/miscellaneous.dm | 1 + html/changelogs/phil235-HolopadSpamFix.yml | 7 ++++ 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 html/changelogs/phil235-HolopadSpamFix.yml diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index b713085f801..c5980fcf103 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -40,23 +40,46 @@ var/const/HOLOPAD_MODE = RANGE_BASED var/list/masters = list()//List of AIs that use the holopad var/last_request = 0 //to prevent request spam. ~Carn var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. + var/temp = "" /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. if(!istype(user)) return - if(alert(user,"Would you like to request an AI's presence?",,"Yes","No") == "Yes") - if(!Adjacent(user)) //also prevents request spam! - user << "You are too far from the holopad." - return - if(last_request + 200 < world.time) //don't spam the AI with requests you jerk! + if(user.stat || stat & (NOPOWER|BROKEN)) + return + user.set_machine(src) + var/dat + if(temp) + dat = temp + else + dat = "request an AI's presence." + + var/datum/browser/popup = new(user, "holopad", name, 300, 100) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + +/obj/machinery/hologram/holopad/Topic(href, href_list) + if(..()) + return + if (href_list["AIrequest"]) + if(last_request + 200 < world.time) last_request = world.time - user << "You request an AI's presence." + temp = "You requested an AI's presence.
" + temp += "Main Menu" var/area/area = get_area(src) for(var/mob/living/silicon/ai/AI in living_mob_list) if(!AI.client) continue AI << "Your presence is requested at \the [area]." else - user << "A request for AI presence was already sent recently." + temp = "A request for AI presence was already sent recently.
" + temp += "Main Menu" + + else if(href_list["mainmenu"]) + temp = "" + + updateUsrDialog() + add_fingerprint(usr) /obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) if (!istype(user)) diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index 09f52337f14..9dfdee6ef9e 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -110,6 +110,7 @@ icon_state = "pirate" item_state = "pirate" w_class = 3 + flags_inv = 0 allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank/internals) slowdown = 0 armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) diff --git a/html/changelogs/phil235-HolopadSpamFix.yml b/html/changelogs/phil235-HolopadSpamFix.yml new file mode 100644 index 00000000000..881b42a13d0 --- /dev/null +++ b/html/changelogs/phil235-HolopadSpamFix.yml @@ -0,0 +1,7 @@ +author: phil235 + +delete-after: True + +changes: + - tweak: "The AI holopads now use a popup window just like computers and other machines." +