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

Buildmode say #27826

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/datums/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
* * user - The user of the emote.
* * text - The text of the emote.
*/
/datum/emote/proc/runechat_emote(mob/user, text)
/proc/runechat_emote(atom/user, text)
var/runechat_text = text
if(length(text) > 100)
runechat_text = "[copytext(text, 1, 101)]..."
Expand Down
7 changes: 7 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,13 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay), I, speech_bubble_hearers, 30)

/atom/proc/atom_emote(emote)
if(!emote)
return
visible_message("<span class='game emote'><span class='name'>[src]</span> [emote]</span>", "<span class='game emote'>You hear how something [emote]</span>")

runechat_emote(src, emote)

/atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list())
return

Expand Down
36 changes: 36 additions & 0 deletions code/modules/buildmode/submodes/say.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/datum/buildmode_mode/say
key = "say"

/datum/buildmode_mode/say/show_help(mob/user)
to_chat(user, "<span class='notice'>***********************************************************</span>")
to_chat(user, "<span class='notice'>Left Mouse Button = Say</span>")
to_chat(user, "<span class='notice'>Right Mouse Button = Emote</span>")
to_chat(user, "<span class='notice'>***********************************************************</span>")

/datum/buildmode_mode/say/handle_click(mob/user, params, atom/object)
if(ismob(object))
var/mob/target = object
if(!isnull(target.ckey))
alert("This cannot be used on mobs with a ckey. Use Forcesay in player panel instead.")
return

var/list/pa = params2list(params)
var/left_click = pa.Find("left")
var/right_click = pa.Find("right")

if(left_click)
var/say = tgui_input_text(user, "What should [object] say?", "Say what?")
if(isnull(say))
return
log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].")
message_admins("<span class='notice'>Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].</span>")
user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] say [say].")
object.atom_say(say)
else if(right_click)
var/emote = tgui_input_text(user, "What should [object] do?", "Emote what?")
if(isnull(emote))
return
log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].")
message_admins("<span class='notice'>Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].</span>")
user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] emote *[emote].")
object.atom_emote(emote)
Binary file modified icons/misc/buildmode.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,7 @@
#include "code\modules\buildmode\submodes\mapgen.dm"
#include "code\modules\buildmode\submodes\offer.dm"
#include "code\modules\buildmode\submodes\save.dm"
#include "code\modules\buildmode\submodes\say.dm"
#include "code\modules\buildmode\submodes\throwing.dm"
#include "code\modules\buildmode\submodes\tilt.dm"
#include "code\modules\buildmode\submodes\variable_edit.dm"
Expand Down
Loading