-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Replaces some progress bars with item bars, makes some bars be visible to the recipients #9361
Closed
CydiaLamiales
wants to merge
72
commits into
BeeStation:master
from
CydiaLamiales:goonlike-progress-bars
Closed
Changes from 5 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
3f9d426
main-progbar-code
CydiaLamiales b13656a
some-progress
CydiaLamiales 721d984
bit-more-progbar-work
CydiaLamiales 4a217a8
work-on-crafting
CydiaLamiales 5a9c25c
surgery-progbars
CydiaLamiales 19e9c68
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 94184fe
first-big-commit-only-20-percent-done
CydiaLamiales c50546d
Update code/datums/components/crafting/crafting.dm
CydiaLamiales 8ad2ba0
bit-more-work
CydiaLamiales 4a5d534
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 9107370
quick-fix
CydiaLamiales 51990a3
halfway-there
CydiaLamiales ad4906d
bit_more_work
CydiaLamiales 9019bcb
fixes-again
CydiaLamiales 9e99a48
holy_mother_of_all_commit_bombs
CydiaLamiales c0b69fb
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 877d068
small-touchups
CydiaLamiales 8d10435
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 40b2666
SECONDS-define
CydiaLamiales 7a38ca9
no-speed-boost-in-repair-for-cyborgs
CydiaLamiales cf8a8bd
oh-whoops-these-were-wrong
CydiaLamiales f48707a
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 326fee6
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 45a0d40
testus-restartus
CydiaLamiales a3b7734
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 9ea406e
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 71170cb
fix-these
CydiaLamiales 6e8f1f4
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales dd6e5bc
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 5f4f839
Merge branch 'goonlike-progress-bars' of https://github.com/CydiaLami…
CydiaLamiales 993f9c8
no-repeats-on-climbing
CydiaLamiales b0f854e
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 20c241d
slightly-better-logic-for-the-cashed-list
CydiaLamiales 0de9157
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales aa127e9
fixes
CydiaLamiales d6f7f1e
better-icon-size-search-logic
CydiaLamiales 7a3ce25
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 30b3460
stripping-and-feeding-tweaks
CydiaLamiales 3104e54
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 20ad439
storage-issue-fix
CydiaLamiales 3926e31
medibot-fixy
CydiaLamiales 86f8f50
martial-art-scroll-fix
CydiaLamiales 1c4b0ef
clientles-proccall-fix
CydiaLamiales a6332f7
color-and-click-fix
CydiaLamiales a362e0c
instant-doubleclick-completion-fix
CydiaLamiales 15ca523
stuck-image-fix
CydiaLamiales f8bad4c
code-cleanup
CydiaLamiales 7321381
Update code/modules/antagonists/clock_cult/items/replica_fabricator.dm
CydiaLamiales 9bf4a7d
Update code/modules/power/apc/apc_attack.dm
CydiaLamiales 86ebbce
Update code/modules/projectiles/guns/ballistic.dm
CydiaLamiales 51bfd45
Update code/datums/elements/mechanical_repair.dm
CydiaLamiales f05f76d
Update code/game/objects/structures/loom.dm
CydiaLamiales a9e7293
while_looping_removal
CydiaLamiales 9323fc2
paddles-icon-fix
CydiaLamiales ce22d04
afterattack-cleanup
CydiaLamiales 93046e9
cooldowns-instead-of-vars
CydiaLamiales f5b5702
instant-doubleclick-tool-completion-fix
CydiaLamiales ffda9e8
testus-restartus
CydiaLamiales d7cc012
Update code/modules/multiz/movement/mob/living_zmove.dm
CydiaLamiales 1284daf
typo-fix
CydiaLamiales 7c66bb6
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 5dd3125
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales bd1db14
extrapolator-fix
CydiaLamiales 9146423
Merge branch 'master' of https://github.com/CydiaLamiales/BeeStation-…
CydiaLamiales 06c1c66
this_should_be_target_visible
CydiaLamiales 595147d
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales eccfdcf
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales 67138e5
Update lib_items.dm
CydiaLamiales 9f0ce11
Update lib_items.dm
CydiaLamiales b18c6bf
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales ca551c4
Merge branch 'master' into goonlike-progress-bars
CydiaLamiales b0d7752
fix-var-issue
CydiaLamiales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Stores a list of items that had their leftmost and rightmost pixels found before, for the sake of optimization | ||
* | ||
* Format : | ||
* * cached_image_borders[type] = list("left" = x, "right" = y, "bottom" = z, "top" = w) | ||
*/ | ||
GLOBAL_LIST_EMPTY(cached_image_borders) |
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 |
---|---|---|
|
@@ -5,6 +5,13 @@ | |
#define FACING_EACHOTHER 2 | ||
/// Two mobs one is facing a person, but the other is perpendicular | ||
#define FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR 3 //! Do I win the most informative but also most stupid define award? | ||
/// Used for the image that replaces the progressbar in do_after | ||
#define BOUNDING_BOX_WIDTH 30 | ||
#define BOUNDING_BOX_HEIGHT 25 | ||
|
||
/// Gets the client of the mob, allowing for mocking of the client. | ||
/// You only need to use this if you know you're going to be mocking clients somewhere else. | ||
#define GET_CLIENT(mob) (##mob.client || ##mob.mock_client) | ||
|
||
/proc/random_blood_type() | ||
return pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") | ||
|
@@ -229,23 +236,29 @@ GLOBAL_LIST_EMPTY(species_list) | |
* | ||
* Checks that `user` does not move, change hands, get stunned, etc. for the | ||
* given `delay`. Returns `TRUE` on success or `FALSE` on failure. | ||
* | ||
* | ||
* Arguments: | ||
* * user - the primary "user" of the do_after. | ||
* * delay - how long the do_after takes. Defaults to 3 SECONDS. | ||
* * target - the (optional) target mob of the do_after. If they move/cease to exist, the do_after is cancelled. | ||
* * timed_action_flags - optional flags to override certain do_after checks (see DEFINES/timed_action.dm). | ||
* * progress - if TRUE, a progress bar is displayed. | ||
* * show_to_target - if TRUE, shows the bar and item to the target | ||
* * extra_checks - a callback that can be used to add extra checks to the do_after. Returning false in this callback will cancel the do_after. | ||
* * add_item - shows said item being 'filled up' instead of the progress bar | ||
* * x_offset - moves left/right increase/decrease for the item rendered above the bar | ||
* * y_offset - moves up/down the item rendered above the bar | ||
*/ | ||
/proc/do_after(mob/user, delay = 3 SECONDS, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks) | ||
/proc/do_after(mob/user, delay = 3 SECONDS, atom/target, timed_action_flags = NONE, progress = TRUE, show_to_target = FALSE, \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this progrss bar cancel if add_item gets deleted? I'm pretty sure appearance will count as a reference but im not entirely sure. You'll have to check DM docs |
||
datum/callback/extra_checks, atom/add_item, x_offset = 0, y_offset = 0) | ||
if(!user) | ||
return FALSE | ||
|
||
if(target) | ||
if(target in user.do_afters) // No stacking multiple do_afters on one target by a single person | ||
return FALSE | ||
LAZYADD(user.do_afters, target) | ||
LAZYADD(target.targeted_by, user) | ||
|
||
var/atom/user_loc = user.loc | ||
var/atom/target_loc = target?.loc | ||
|
||
|
@@ -257,13 +270,51 @@ GLOBAL_LIST_EMPTY(species_list) | |
|
||
delay *= user.cached_multiplicative_actions_slowdown | ||
|
||
var/left_border = 1 | ||
var/right_border = 32 | ||
var/bottom_border = 1 | ||
var/top_border = 32 | ||
var/scale = 1 | ||
if(add_item) | ||
var/list/temp_list = add_item.get_bounding_box() | ||
left_border = temp_list["left"] | ||
right_border = temp_list["right"] | ||
bottom_border = temp_list["bottom"] | ||
top_border = temp_list["top"] | ||
var/leftright_diff = 0 | ||
var/topbottom_diff = 0 | ||
if((right_border - left_border + 1) > BOUNDING_BOX_WIDTH) | ||
leftright_diff = right_border - left_border + 1 | ||
if((top_border - bottom_border + 1) > BOUNDING_BOX_HEIGHT) | ||
topbottom_diff = top_border - bottom_border + 1 | ||
if(leftright_diff != 0 || topbottom_diff != 0) | ||
if(topbottom_diff > leftright_diff) | ||
scale = BOUNDING_BOX_HEIGHT / top_border | ||
else | ||
scale = BOUNDING_BOX_WIDTH / right_border | ||
if(y_offset + bottom_border < 7) | ||
y_offset = 7 - bottom_border | ||
var/client/targeted_client | ||
if(show_to_target) | ||
if(target == user) | ||
show_to_target = FALSE | ||
else if(ismob(target)) | ||
var/mob/temp_mob = target | ||
targeted_client = temp_mob.client | ||
if(isnull(targeted_client)) | ||
show_to_target = FALSE | ||
else | ||
show_to_target = FALSE | ||
var/datum/progressbar/progbar | ||
if(progress) | ||
if(target) // the progress bar needs a target, so if we don't have one just pass it the user. | ||
progbar = new(user, delay, target) | ||
if(add_item) | ||
//var/mutable_appearance/itemappearance = add_item.appearance | ||
//itemappearance.color = add_item.color | ||
//itemappearance.overlays = add_item.overlays | ||
//itemappearance.underlays = add_item.underlays | ||
progbar = new(user, delay, target || user, show_to_target, add_item.appearance, left_border, right_border, x_offset, y_offset, scale, targeted_client) | ||
else | ||
progbar = new(user, delay, user) | ||
|
||
progbar = new(user, delay, target || user, show_to_target, targeted_client = targeted_client) | ||
var/endtime = world.time + delay | ||
var/starttime = world.time | ||
. = TRUE | ||
|
@@ -307,6 +358,7 @@ GLOBAL_LIST_EMPTY(species_list) | |
break | ||
|
||
if(progress) | ||
//progbar.end_progress() | ||
qdel(progbar) | ||
|
||
if(!QDELETED(target)) | ||
|
@@ -487,10 +539,6 @@ GLOBAL_LIST_EMPTY(species_list) | |
if(player.stat != DEAD && player.mind && is_station_level(player.z)) | ||
. |= player.mind | ||
|
||
/// Gets the client of the mob, allowing for mocking of the client. | ||
/// You only need to use this if you know you're going to be mocking clients somewhere else. | ||
#define GET_CLIENT(mob) (##mob.client || ##mob.mock_client) | ||
|
||
///Return a string for the specified body zone. Should be used for parsing non-instantiated bodyparts, otherwise use [/obj/item/bodypart/var/plaintext_zone] | ||
/proc/parse_zone(zone) | ||
if(zone == BODY_ZONE_PRECISE_R_HAND) | ||
|
@@ -743,3 +791,5 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) | |
#undef FACING_SAME_DIR | ||
#undef FACING_EACHOTHER | ||
#undef FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR | ||
#undef BOUNDING_BOX_WIDTH | ||
#undef BOUNDING_BOX_HEIGHT |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Unfortunately I just don't think this is going to work. Even with only around 300-500 calls getpixel becomes one of the most overtiming things on the server. Progress bar images need to be specifically chosen and have their parameters fed in directly, or they need to be an image with the normal progress bar below and ignore the fact that part of it might take a while to start showing.