diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index ad0ea23e9da..0902579bac8 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -51,17 +51,17 @@ #define ui_storage1 "CENTER+1:18,SOUTH:5" #define ui_storage2 "CENTER+2:20,SOUTH:5" -#define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs -#define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgies -#define ui_borg_thrusters "CENTER-5:16, SOUTH:5"//borgies -#define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs -#define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs -#define ui_inv3 "CENTER :16,SOUTH:5" //borgs -#define ui_borg_module "CENTER+1:16,SOUTH:5" -#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs - -#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs -#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs +#define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs +#define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgs +#define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //borgs +#define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs +#define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs +#define ui_inv3 "CENTER :16,SOUTH:5" //borgs +#define ui_borg_module "CENTER+1:16,SOUTH:5" //borgs +#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs +#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs +#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs +#define ui_borg_talk_wheel "CENTER+4:21,SOUTH+1:5" //borgs #define ui_monkey_head "CENTER-4:13,SOUTH:5" //monkey #define ui_monkey_mask "CENTER-3:14,SOUTH:5" //monkey @@ -69,6 +69,7 @@ #define ui_alien_storage_l "CENTER-2:14,SOUTH:5"//alien #define ui_alien_storage_r "CENTER+1:18,SOUTH:5"//alien +#define ui_alien_talk_wheel "EAST-3:26,SOUTH:5" //alien #define ui_drone_drop "CENTER+1:18,SOUTH:5" //maintenance drones #define ui_drone_pull "CENTER+2:2,SOUTH:5" //maintenance drones diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 2cd637f9653..305d7719b68 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -70,6 +70,11 @@ H.leap_icon.screen_loc = ui_alien_storage_r static_inventory += H.leap_icon + using = new/obj/screen/wheel/talk + using.screen_loc = ui_alien_talk_wheel + wheels += using + static_inventory += using + using = new /obj/screen/drop() using.icon = 'icons/mob/screen_alien.dmi' using.screen_loc = ui_drop_throw diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 9594fe08e61..4c04cc363ac 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -21,6 +21,11 @@ pull_icon.screen_loc = ui_pull_resist hotkeybuttons += pull_icon + using = new/obj/screen/wheel/talk + using.screen_loc = ui_alien_talk_wheel + wheels += using + static_inventory += using + zone_select = new /obj/screen/zone_sel/alien() zone_select.update_icon(mymob) static_inventory += zone_select diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 623b49723ae..0dfb1dbb14a 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -33,6 +33,8 @@ var/obj/screen/throw_icon var/obj/screen/module_store_icon + var/list/wheels = list() //list of the wheel screen objects + var/list/static_inventory = list() //the screen objects which are static var/list/toggleable_inventory = list() //the screen objects which can be hidden var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys @@ -64,6 +66,8 @@ qdel(module_store_icon) module_store_icon = null + wheels = null //all wheels are also in static_inventory + if(static_inventory.len) for(var/thing in static_inventory) qdel(thing) @@ -199,7 +203,18 @@ return /datum/hud/proc/persistant_inventory_update(mob/viewer) - return + if(!mymob) + return + var/mob/living/L = mymob + + var/mob/screenmob = viewer || L + + for(var/X in wheels) + var/obj/screen/wheel/W = X + if(W.toggled) + screenmob.client.screen |= W.buttons_list + else + screenmob.client.screen -= W.buttons_list //Triggered when F12 is pressed (Unless someone changed something in the DMF) /mob/verb/button_pressed_F12() diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 93f36820fd8..2e7d9e7a5b7 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -95,6 +95,11 @@ using.icon = ui_style static_inventory += using + using = new/obj/screen/wheel/talk + using.icon = ui_style + wheels += using + static_inventory += using + using = new /obj/screen/inventory/area_creator using.icon = ui_style static_inventory += using @@ -352,9 +357,12 @@ if(H.wear_mask) screenmob.client.screen -= H.wear_mask if(H.head) screenmob.client.screen -= H.head + + /datum/hud/human/persistant_inventory_update(mob/viewer) if(!mymob) return + ..() var/mob/living/carbon/human/H = mymob var/mob/screenmob = viewer || H @@ -394,11 +402,12 @@ if(hud_version != HUD_STYLE_NOHUD) for(var/obj/item/I in H.held_items) I.screen_loc = ui_hand_position(H.get_held_index_of_item(I)) - H.client.screen += I + screenmob.client.screen += I else for(var/obj/item/I in H.held_items) I.screen_loc = null - H.client.screen -= I + screenmob.client.screen -= I + /mob/living/carbon/human/verb/toggle_hotkey_verbs() set category = "OOC" diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index dd6ec4bef44..588d212375a 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -16,6 +16,11 @@ using.screen_loc = ui_movi static_inventory += using + using = new/obj/screen/wheel/talk + using.icon = ui_style + wheels += using + static_inventory += using + using = new /obj/screen/drop() using.icon = ui_style using.screen_loc = ui_drop_throw diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index aaf740f479e..0ac784718ae 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -93,6 +93,11 @@ var/mob/living/silicon/robot/mymobR = mymob var/obj/screen/using + using = new/obj/screen/wheel/talk + using.screen_loc = ui_borg_talk_wheel + wheels += using + static_inventory += using + //Radio using = new /obj/screen/robot/radio() using.screen_loc = ui_borg_radio diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index cb9c698efaf..8dedf4b91b7 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -480,3 +480,139 @@ /obj/screen/healthdoll name = "health doll" screen_loc = ui_healthdoll + + + +/obj/screen/wheel + name = "wheel" + layer = HUD_LAYER + icon_state = "" + screen_loc = null //if you make a new wheel, remember to give it a screen_loc + var/list/buttons_names = list() //list of the names for each button, its length is the amount of buttons. + var/toggled = 0 //wheel is hidden/shown + var/wheel_buttons_type //the type of buttons used with this wheel. + var/list/buttons_list = list() + +/obj/screen/wheel/New() + ..() + build_options() + + +//we create the buttons for the wheel and place them in a square spiral fashion. +/obj/screen/wheel/proc/build_options() + var/obj/screen/wheel_button/close_wheel/CW = new () + buttons_list += CW //the close option + CW.wheel = src + + var/list/offset_x_list = list() + var/list/offset_y_list = list() + var/num = 1 + var/N = 1 + var/M = 0 + var/sign = -1 + my_loop: + while(offset_y_list.len < buttons_names.len) + for(var/i=1, i<=num, i++) + offset_y_list += N + offset_x_list += M + if(offset_y_list.len == buttons_names.len) + break my_loop + if(N != 0) + N = 0 + M = -sign + else + N = sign + M = 0 + sign = -sign + num++ + + var/screenx = 8 + var/screeny = 8 + for(var/i = 1, i <= buttons_names.len, i++) + var/obj/screen/wheel_button/WB = new wheel_buttons_type() + WB.wheel = src + buttons_list += WB + screenx += offset_x_list[i] + screeny += offset_y_list[i] + WB.screen_loc = "[screenx], [screeny]" + set_button(WB, i) + +/obj/screen/wheel/proc/set_button(obj/screen/wheel_button/WB, button_number) + WB.name = buttons_names[button_number] + return + +/obj/screen/wheel/Destroy() + for(var/obj/screen/S in buttons_list) + qdel(S) + return ..() + +/obj/screen/wheel/Click() + if(world.time <= usr.next_move) + return + if(usr.stat) + return + if(isliving(usr)) + var/mob/living/L = usr + if(toggled) + L.client.screen -= buttons_list + else + L.client.screen |= buttons_list + toggled = !toggled + + +/obj/screen/wheel/talk + name = "talk wheel" + icon_state = "talk_wheel" + screen_loc = "11:6,2:-11" + wheel_buttons_type = /obj/screen/wheel_button/talk + buttons_names = list("help","hello","bye","stop","thanks","come","out", "yes", "no") + var/list/word_messages = list(list("Help!","Help me!"), list("Hello.", "Hi."), list("Bye.", "Goodbye."),\ + list("Stop!", "Halt!"), list("Thanks.", "Thanks!", "Thank you."), \ + list("Come.", "Follow me."), list("Out!", "Go away!", "Get out!"), \ + list("Yes.", "Affirmative."), list("No.", "Negative")) + +/obj/screen/wheel/talk/set_button(obj/screen/wheel_button/WB, button_number) + ..() + var/obj/screen/wheel_button/talk/T = WB //we already know what type the button is exactly. + T.icon_state = "talk_[T.name]" + T.word_messages = word_messages[button_number] + + +/obj/screen/wheel_button + name = "default wheel button" + screen_loc = "8,8" + layer = HUD_LAYER + mouse_opacity = 2 + var/obj/screen/wheel/wheel + +/obj/screen/wheel_button/Destroy() + wheel = null + return ..() + +/obj/screen/wheel_button/close_wheel + name = "close wheel" + icon_state = "x3" + +/obj/screen/wheel_button/close_wheel/Click() + if(isliving(usr)) + var/mob/living/L = usr + L.client.screen -= wheel.buttons_list + wheel.toggled = !wheel.toggled + + +/obj/screen/wheel_button/talk + name = "talk option" + icon_state = "talk_help" + var/talk_cooldown = 0 + var/list/word_messages = list() + +/obj/screen/wheel_button/talk/Click(location, control,params) + if(isliving(usr)) + var/mob/living/L = usr + if(L.stat) + return + + if(word_messages.len && talk_cooldown < world.time) + talk_cooldown = world.time + 10 + L.say(pick(word_messages)) + diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 40d23ea638d..e59f4708e90 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -465,3 +465,15 @@ It's fairly easy to fix if dealing with single letters but not so much with comp M << "There were no ghosts willing to take control." message_admins("No ghosts were willing to take control of [key_name_admin(M)])") return FALSE + +//toggles the talk wheel +/mob/verb/toggle_talk_wheel() + set name = "talk-wheel" + set hidden = 1 + + if(isliving(src)) + var/mob/living/L = src + if(L.hud_used) + for(var/obj/screen/wheel/talk/TW in L.hud_used.wheels) + TW.Click() + diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index b0a1dbcb168..256bd412b4f 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/screen_midnight.dmi b/icons/mob/screen_midnight.dmi index 4de01c73cc8..c25813197fe 100644 Binary files a/icons/mob/screen_midnight.dmi and b/icons/mob/screen_midnight.dmi differ diff --git a/icons/mob/screen_operative.dmi b/icons/mob/screen_operative.dmi index e1728959e6a..e6a65052c14 100644 Binary files a/icons/mob/screen_operative.dmi and b/icons/mob/screen_operative.dmi differ diff --git a/icons/mob/screen_plasmafire.dmi b/icons/mob/screen_plasmafire.dmi index c40a531d8a6..3d1846b3009 100644 Binary files a/icons/mob/screen_plasmafire.dmi and b/icons/mob/screen_plasmafire.dmi differ diff --git a/icons/mob/screen_retro.dmi b/icons/mob/screen_retro.dmi index 9c99dba486b..db87b592169 100644 Binary files a/icons/mob/screen_retro.dmi and b/icons/mob/screen_retro.dmi differ diff --git a/icons/mob/screen_slimecore.dmi b/icons/mob/screen_slimecore.dmi index 91e2d73abe2..8575fa037de 100644 Binary files a/icons/mob/screen_slimecore.dmi and b/icons/mob/screen_slimecore.dmi differ diff --git a/interface/skin.dmf b/interface/skin.dmf index 335caf26118..27dca90bcc8 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -77,6 +77,9 @@ macro "default" elem name = "CTRL+G" command = "a-intent right" + elem + name = "CTRL+H" + command = "talk-wheel" elem name = "CTRL+Q" command = ".northwest" @@ -238,6 +241,12 @@ macro "hotkeys" elem name = "CTRL+G" command = "a-intent right" + elem + name = "H" + command = "talk-wheel" + elem + name = "CTRL+H" + command = "talk-wheel" elem name = "M" command = "me"