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

camera console now uses camera manager #5310

Merged
merged 7 commits into from
Feb 1, 2024

Conversation

mullenpaul
Copy link
Contributor

@mullenpaul mullenpaul commented Dec 26, 2023

About the pull request

Continuing the work of #5309 - camera code now uses camera manager component.

Explain why it's good for the game

Reduction of duplicated code.

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
refactor: camera consoles now use camera manager component
/:cl:

@github-actions github-actions bot added the Refactor Make the code harder to read label Dec 26, 2023
Copy link
Contributor

@Drulikar Drulikar left a comment

Choose a reason for hiding this comment

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

Not really worth doing this change until we resolve the issue where camera_manager is not refreshing byondui correctly.

(As in it not scaling when screen_loc dimensions change)
image

@Drulikar Drulikar marked this pull request as draft December 27, 2023 22:47
@Drulikar Drulikar added the Stale Exempt PR can't go stale label Dec 27, 2023
code/game/camera_manager/camera_manager.dm Outdated Show resolved Hide resolved
code/game/camera_manager/camera_manager.dm Outdated Show resolved Hide resolved
code/game/camera_manager/camera_manager.dm Show resolved Hide resolved
@Drulikar Drulikar removed the Stale Exempt PR can't go stale label Dec 28, 2023
@mullenpaul mullenpaul marked this pull request as ready for review December 30, 2023 11:33
@@ -191,7 +200,7 @@
// Cameras that get here are moving, and are likely attached to some moving atom such as cyborgs.
last_camera_turf = get_turf(cam_location)

var/list/visible_things = current.isXRay() ? range(current.view_range, cam_location) : view(current.view_range, cam_location)
var/list/visible_things = current.isXRay() ? range("[target_width]x[target_height]", cam_location) : view("[target_width]x[target_height]", cam_location)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change seems to just produce incorrect results in every view:
image
Despite it having a 7 and 7 for width and height, it made a view of 5x7.

If its not merely because you don't have the fix setting target_width and target_height in /datum/component/camera_manager/proc/set_camera_rect(source, x, y, z, w, h) like in #5298 then I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also recommend using 515.1609+ so you don't have the viewport sizing bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Reverting only that line the views seem to be properly displayed:
image

@Drulikar Drulikar marked this pull request as draft December 30, 2023 13:45
@cm13-github cm13-github added the Merge Conflict PR can't be merged because it touched too much code label Jan 6, 2024
@cm13-github
Copy link
Contributor

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

Copy link
Contributor

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the Stale beg a maintainer to review your PR label Jan 14, 2024
@mullenpaul mullenpaul removed the Stale beg a maintainer to review your PR label Jan 14, 2024
@mullenpaul
Copy link
Contributor Author

I'll resolve conflicts today

Copy link
Contributor

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the Stale beg a maintainer to review your PR label Jan 22, 2024
# Conflicts:
#	code/game/machinery/computer/camera_console.dm
@cm13-github
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@cm13-github cm13-github removed the Merge Conflict PR can't be merged because it touched too much code label Jan 28, 2024
@mullenpaul mullenpaul removed the Stale beg a maintainer to review your PR label Jan 28, 2024
@mullenpaul mullenpaul marked this pull request as ready for review January 28, 2024 14:07
Copy link
Contributor

@Drulikar Drulikar left a comment

Choose a reason for hiding this comment

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

Ultimately this makes set_camera_rect proc not do what it is intended to do (target_width and target_height both aren't used for anything) but your version does atleast have no in game problems as far as I can see.

@Drulikar Drulikar added this pull request to the merge queue Feb 1, 2024
Merged via the queue into cmss13-devs:master with commit 87e05b4 Feb 1, 2024
26 checks passed
cm13-github added a commit that referenced this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Make the code harder to read
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants