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

Adds setter for anchored. Cleans up a lot of anchored, density, and update_icon implementations #8941

Merged
merged 13 commits into from
Mar 3, 2024

Conversation

Tsar-Salat
Copy link
Contributor

@Tsar-Salat Tsar-Salat commented Apr 27, 2023

Ports:

About The Pull Request

Basically converts a bunch of anchored = T/F to set_anchored(T/F), which is a direct upgrade.

Cleans up a shitton of anchored implementations. I also cleaned up a few density and icon calls because they were adjacent.

The largest cleanup occured in how library shelves anchored. It sucks a lot less

Why It's Good For The Game

I looked at literally every implementation of anchored =

This is going to solve a lot of issues with this stupid var.

Basically, creating a setter proc as opposed to just setting value on the var directly has the benefit of allowing us to append behavior whenever we call it.
In this case and the prior #8689, we are attaching a signal so it fires whenever the anchored value successfully changes.

With set_anchored now defined at the atom-level, we can move behavior that was before on snowflake procs, onto it.

For example, machines that are dependent on being anchored to function (Satellites, Pacman, etc.), this is useful, mostly for code cleanliness.

For the fix part of this pr, its because of how poorly bookcases handle states, akin to the mess that was #9989

Testing Photographs and Procedure

Screenshots&Videos
dreamseeker_Uyz8NHfp1S.mp4

Changelog

🆑 RKz, ShizCalev
refactor: Converted everything to use setAnchored() as opposed to setting the anchored var directly. This means that COMSIG_MOVABLE_SETANCHORED can now actually be used reliably to track if an object's anchored var has changed.
fix: The refactor also means that varediting the anchored var will now properly update most items' other states that rely on it being set a certain way.
fix: Fixed bookcases having the incorrect icon when they're unanchored.
fix: Fixed bookcases not automatically picking up spellbooks / storage books when made/spawned.
fix: Fixed bookcases not dropping spellbooks / storage books when deconstructed.
/:cl:

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@itsmeow itsmeow added the Stale label Jun 1, 2023
@Tsar-Salat Tsar-Salat closed this Jun 2, 2023
@Tsar-Salat Tsar-Salat reopened this Jul 20, 2023
@Tsar-Salat Tsar-Salat marked this pull request as ready for review July 20, 2023 21:01
code/modules/antagonists/cult/cult_structures.dm Outdated Show resolved Hide resolved
code/modules/awaymissions/capture_the_flag.dm Show resolved Hide resolved
code/modules/library/lib_items.dm Outdated Show resolved Hide resolved
code/modules/library/lib_items.dm Outdated Show resolved Hide resolved
@Tsar-Salat Tsar-Salat marked this pull request as draft July 21, 2023 08:42
@Tsar-Salat
Copy link
Contributor Author

fug forgot testing evidence

@itsmeow itsmeow removed the Stale label Jul 23, 2023
@github-actions
Copy link

github-actions bot commented Aug 9, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Tsar-Salat Tsar-Salat marked this pull request as ready for review December 20, 2023 04:49
@Tsar-Salat Tsar-Salat requested a review from itsmeow December 21, 2023 17:03
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Tsar-Salat
Copy link
Contributor Author

Tsar-Salat commented Jan 6, 2024

Is this still a draft?

Its ready, just didnt update for when dragon reverted his machine changes

Copy link

github-actions bot commented Jan 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Crossedfall Crossedfall added the Frozen Frozen until a larger project is finished label Jan 31, 2024
Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs a better explanation of how it improves the game than:

This is going to solve a lot of issues with this stupid var.

Try to list the "lot of issues" this solves.
The parent PR from TG does no better job of explaining this.

@Tsar-Salat
Copy link
Contributor Author

Tsar-Salat commented Feb 27, 2024

Try to list the "lot of issues" this solves.

I thought I was thorough in the changelog. If you'd like to me elaborate specifically on how this works, sure.

Basically, creating a setter proc as opposed to just setting value on the var directly has the benefit of allowing us to append behavior whenever we call it.
In this case and the prior #8689, we are attaching a signal so it fires whenever the anchored value successfully changes.

With set_anchored now defined at the atom-level, we can move behavior that was before on snowflake procs, onto it.

For example, machines that are dependent on being anchored to function (Satellites, Pacman, etc.), this is useful, mostly for code cleanliness.

For the fix part of this pr, its because of how poorly bookcases handle states, akin to the mess that was #9989

@Tsar-Salat
Copy link
Contributor Author

I made this PR in April, I dont know why I didnt show testing evidence for satellites and booksshelves. Probably because of the long draft period.

Ill do that when I have free time after my exams

@Rukofamicom Rukofamicom removed Administration Frozen Frozen until a larger project is finished labels Mar 3, 2024
Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe additional testing evidence is necessary in this case, and thank you for the detailed explanation.

@Rukofamicom Rukofamicom dismissed itsmeow’s stale review March 3, 2024 15:22

Several months old and appears to be resolved.

@Rukofamicom Rukofamicom added this pull request to the merge queue Mar 3, 2024
Merged via the queue into BeeStation:master with commit ad7229c Mar 3, 2024
8 checks passed
DrDuckedGoose pushed a commit to DrDuckedGoose/BeeStation-Hornet that referenced this pull request May 11, 2024
…pdate_icon implementations (BeeStation#8941)

* tgstation/tgstation#52254

* more cleaning

* suggested

* fixes

* conflict

* conflicts
DrDuckedGoose pushed a commit to DrDuckedGoose/BeeStation-Hornet that referenced this pull request May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants