-
Notifications
You must be signed in to change notification settings - Fork 224
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
/atom/proc/examine() rework. #4836
base: dev
Are you sure you want to change the base?
Conversation
666f6ea
to
78a388c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know how i managed to review this but i did.
@@ -8,15 +8,12 @@ | |||
var/mob/living/user_living = user | |||
user_living.prepare_maneuver() | |||
|
|||
/obj/screen/maneuver/examine(mob/user, distance) | |||
/obj/screen/maneuver/examined_by(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/obj/screen/maneuver/examined_by(mob/user, distance, infix, suffix) | |
/obj/screen/maneuver/get_examine_strings(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional, doesn't need the full proc, same for the other screen elem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue is the return type, examined_by doesn't return strings, you need a direct to_chat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept as examined_by() but fixed return.
@@ -34,10 +34,10 @@ | |||
if(. && intent && parent) | |||
parent.set_intent(intent) | |||
|
|||
/obj/screen/intent_button/examine(mob/user, distance) | |||
/obj/screen/intent_button/examined_by(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/obj/screen/intent_button/examined_by(mob/user, distance, infix, suffix) | |
/obj/screen/intent_button/get_examine_strings(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per above, kept as examined_by() but fixed return.
code/game/objects/items/rescuebag.dm
Outdated
if(Adjacent(user)) //The bag's rather thick and opaque from a distance. | ||
to_chat(user, "<span class='info'>You peer into \the [src].</span>") | ||
. += SPAN_INFO("You peer into \the [src].") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examined_by
has a bool return type, this is invalid. you probably do legit just want to_chat()
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple more notes i found, think that's it
@@ -117,16 +117,17 @@ | |||
RETURN_TYPE(/decl/material) | |||
return GET_DECL(/decl/material/solid/metal/steel) | |||
|
|||
/obj/machinery/door/firedoor/examine(mob/user, distance) | |||
/obj/machinery/door/firedoor/get_examine_strings(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed a to_chat on line 142
for(var/path in uncreated_component_parts) | ||
var/obj/item/thing = path | ||
to_chat(user, "<span class='notice'> [initial(thing.name)] ([uncreated_component_parts[path] || 1])</span>") | ||
. += SPAN_NOTICE(" [initial(thing.name)] ([uncreated_component_parts[path] || 1])") | ||
if(length(.) && show_directly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a fan of this pattern, i think maybe display_parts
should always return a list and stuff that passes show_directly = TRUE
should just use to_chat() directly, or there should be a separate proc that does that
@@ -50,10 +50,10 @@ | |||
return . | |||
return ..() | |||
|
|||
/obj/item/sticky_pad/examine(mob/user) | |||
/obj/item/sticky_pad/examined_by(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/obj/item/sticky_pad/examined_by(mob/user, distance, infix, suffix) | |
/obj/item/sticky_pad/get_examine_strings(mob/user, distance, infix, suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split into examine_strings and examine_hints.
/obj/item/duct_tape/examine() | ||
return stuck ? stuck.examine(arglist(args)) : ..() | ||
/obj/item/duct_tape/examined_by(mob/user, distance, infix, suffix) | ||
return stuck ? stuck.examined_by(arglist(args)) : ..() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return stuck ? stuck.examined_by(arglist(args)) : ..() | |
return stuck ? stuck.examined_by(user, distance, infix, suffix) : ..() |
i don't really like the use of arglist here tbh. like, we've standardized the args, haven't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I replaced it everywhere I saw it, missed this one.
78a388c
to
6cbd4e4
Compare
TODO
Description of changes
examine()
is nowexamined_by()
.examined_by()
assembles string lists via three procs, in order:get_examine_header()
get_examine_strings()
get_examine_hints()
Why and what will this PR improve
Allows control over ordering of examination output.
Nicer, more readable code.
Probably more performant given the removed string ops.
Authorship
Myself.
Changelog
Nothing player-facing.