-
-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Do_afters have no visual feedback for nearby people, which is bad (and leads to a lot of unintentional interruptions) This adds a visual indicator in the form of a spinning cog that displays to nearby players while you do a Do_after() Ports [This Guy](tgstation/tgstation#82416) and assorted. Thanks @jlsnow301 (plus some assorted stuff) Implements it on do_mob()'s(which tg rightfully decided to kill.) Some of our equip handling code makes me want to explode, but that's a problem for another day <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Why It's Good For The Game Action feedback 4 nearby players, less accidental tileswaps <!-- Please add a short description of why you think these changes would benefit the game. If you can't justify it in words, it might not be worth adding. --> ## Changelog :cl: jlsnow301, sun-soaked add: do_afters and do_mob actions now show nearby players a spinning cog while in progress. fix: the progressbar.dmm file is no longer misspelled "progess"bar /:cl: <!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> --------- Co-authored-by: Sun-Soaked <[email protected]>
- Loading branch information
1 parent
c4a58c8
commit 8407cfb
Showing
17 changed files
with
122 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#define COGBAR_ANIMATION_TIME (0.5 SECONDS) | ||
|
||
/** | ||
* ### Cogbar | ||
* Represents that the user is busy doing something. | ||
*/ | ||
/datum/cogbar | ||
/// Who's doing the thing | ||
var/mob/user | ||
/// The user client | ||
var/client/user_client | ||
/// The visible element to other players | ||
var/obj/effect/overlay/vis/cog | ||
/// The blank image that overlaps the cog - hides it from the source user | ||
var/image/blank | ||
/// The offset of the icon | ||
//var/offset_y | ||
|
||
|
||
/datum/cogbar/New(mob/user) | ||
src.user = user | ||
src.user_client = user.client | ||
|
||
//Porting oversized icon offsets later, they have too many other unported dependencies. sorry zephyr | ||
//var/list/icon_offsets = user.get_oversized_icon_offsets() | ||
//offset_y = icon_offsets["y"] | ||
|
||
add_cog_to_user() | ||
|
||
RegisterSignal(user, COMSIG_PARENT_QDELETING, PROC_REF(on_user_delete)) | ||
|
||
|
||
/datum/cogbar/Destroy() | ||
if(user) | ||
SSvis_overlays.remove_vis_overlay(user, user.managed_vis_overlays) | ||
user_client?.images -= blank | ||
|
||
user = null | ||
user_client = null | ||
cog = null | ||
QDEL_NULL(blank) | ||
|
||
return ..() | ||
|
||
|
||
/// Adds the cog to the user, visible by other players | ||
/datum/cogbar/proc/add_cog_to_user() | ||
cog = SSvis_overlays.add_vis_overlay(user, | ||
icon = 'icons/effects/progressbar.dmi', | ||
iconstate = "cog", | ||
plane = HIGH_GAME_PLANE, | ||
add_appearance_flags = APPEARANCE_UI_IGNORE_ALPHA, | ||
unique = TRUE, | ||
alpha = 0, | ||
) | ||
cog.pixel_y = world.icon_size// + offset_y | ||
animate(cog, alpha = 255, time = COGBAR_ANIMATION_TIME) | ||
|
||
if(isnull(user_client)) | ||
return | ||
|
||
blank = image('icons/blanks/32x32.dmi', cog, "nothing") | ||
blank.plane = HIGH_GAME_PLANE | ||
blank.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | ||
blank.override = TRUE | ||
|
||
user_client.images += blank | ||
|
||
|
||
/// Removes the cog from the user | ||
/datum/cogbar/proc/remove() | ||
if(isnull(cog)) | ||
qdel(src) | ||
return | ||
|
||
animate(cog, alpha = 0, time = COGBAR_ANIMATION_TIME) | ||
|
||
QDEL_IN(src, COGBAR_ANIMATION_TIME) | ||
|
||
|
||
/// When the user is deleted, remove the cog | ||
/datum/cogbar/proc/on_user_delete(datum/source) | ||
SIGNAL_HANDLER | ||
|
||
qdel(src) | ||
|
||
|
||
#undef COGBAR_ANIMATION_TIME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters