Skip to content

Commit b665536

Browse files
FunnyMan3595lewcc
andauthored
Buildmode say (#27826)
* Implement atom_emote * Buildmode say icon * Buildmode say * Better logging. * Apply suggestions from code review Co-authored-by: Luc <[email protected]> Signed-off-by: Charlie Nolan <[email protected]> --------- Signed-off-by: Charlie Nolan <[email protected]> Co-authored-by: Luc <[email protected]>
1 parent 77c5280 commit b665536

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

code/datums/emote.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
* * user - The user of the emote.
289289
* * text - The text of the emote.
290290
*/
291-
/datum/emote/proc/runechat_emote(mob/user, text)
291+
/proc/runechat_emote(atom/user, text)
292292
var/runechat_text = text
293293
if(length(text) > 100)
294294
runechat_text = "[copytext(text, 1, 101)]..."

code/game/atoms.dm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,13 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
11751175
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
11761176
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay), I, speech_bubble_hearers, 30)
11771177

1178+
/atom/proc/atom_emote(emote)
1179+
if(!emote)
1180+
return
1181+
visible_message("<span class='game emote'><span class='name'>[src]</span> [emote]</span>", "<span class='game emote'>You hear how something [emote]</span>")
1182+
1183+
runechat_emote(src, emote)
1184+
11781185
/atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list())
11791186
return
11801187

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/datum/buildmode_mode/say
2+
key = "say"
3+
4+
/datum/buildmode_mode/say/show_help(mob/user)
5+
to_chat(user, "<span class='notice'>***********************************************************</span>")
6+
to_chat(user, "<span class='notice'>Left Mouse Button = Say</span>")
7+
to_chat(user, "<span class='notice'>Right Mouse Button = Emote</span>")
8+
to_chat(user, "<span class='notice'>***********************************************************</span>")
9+
10+
/datum/buildmode_mode/say/handle_click(mob/user, params, atom/object)
11+
if(ismob(object))
12+
var/mob/target = object
13+
if(!isnull(target.ckey))
14+
alert("This cannot be used on mobs with a ckey. Use Forcesay in player panel instead.")
15+
return
16+
17+
var/list/pa = params2list(params)
18+
var/left_click = pa.Find("left")
19+
var/right_click = pa.Find("right")
20+
21+
if(left_click)
22+
var/say = tgui_input_text(user, "What should [object] say?", "Say what?")
23+
if(isnull(say))
24+
return
25+
log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].")
26+
message_admins("<span class='notice'>Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].</span>")
27+
user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] say [say].")
28+
object.atom_say(say)
29+
else if(right_click)
30+
var/emote = tgui_input_text(user, "What should [object] do?", "Emote what?")
31+
if(isnull(emote))
32+
return
33+
log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].")
34+
message_admins("<span class='notice'>Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].</span>")
35+
user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] emote *[emote].")
36+
object.atom_emote(emote)

icons/misc/buildmode.dmi

18 Bytes
Binary file not shown.

paradise.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,7 @@
17181718
#include "code\modules\buildmode\submodes\mapgen.dm"
17191719
#include "code\modules\buildmode\submodes\offer.dm"
17201720
#include "code\modules\buildmode\submodes\save.dm"
1721+
#include "code\modules\buildmode\submodes\say.dm"
17211722
#include "code\modules\buildmode\submodes\throwing.dm"
17221723
#include "code\modules\buildmode\submodes\tilt.dm"
17231724
#include "code\modules\buildmode\submodes\variable_edit.dm"

0 commit comments

Comments
 (0)