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

Annotate some of the functionality related to worldviews #6600

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

Garanas
Copy link
Member

@Garanas Garanas commented Dec 25, 2024

Description of the proposed changes

Annotates the functionality related to world views. Documents to some degree how secondary worldviews (that run on secondary adapters) work.

Testing done on the proposed changes

Not necessary, these are just changes to annotations.

Additional context

In preparation of a feature for HintHunter to toggle the split screen.

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@Garanas Garanas added the area: documentation related to documentation to preserve knowledge and practices label Dec 25, 2024
@Garanas Garanas marked this pull request as ready for review December 25, 2024 19:36
@Garanas
Copy link
Member Author

Garanas commented Dec 26, 2024

There's some interesting possibilities here with world views. It's sad that the original interface of the module(s)* is not friendly towards refactoring. For example, the value viewLeft is referenced directly instead of via a function. Because of that we can't refactor it blindly.

lua/ui/game/worldview.lua Outdated Show resolved Hide resolved

--- Primary view, if in split screen this is the left view. The left view is always visible.
---
--- Most features that rely on a worldview only work for the left worldview. One example is the reclaim overlay.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a lua implementation detail, I don't think it is necessary in the documentation, as it is absolutely possible to have multi-view UI elements.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it is, but it's an intentional choice that we do not. For example, the reclaim overlay would be too expensive.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's good to document it as a ton of UI Lua being coupled to this specific worldview, but I think what stands out to me with this specific comment is that "features that rely on a worldview only work for the left worldview" sounds as if the engine depends on viewLeft, so I'd change it to something that specifies the Lua coupling more specifically.

engine/User.lua Outdated Show resolved Hide resolved
engine/User.lua Outdated Show resolved Hide resolved
lua/ui/game/multihead.lua Outdated Show resolved Hide resolved
lua/ui/game/multihead.lua Outdated Show resolved Hide resolved
lua/ui/game/worldview.lua Outdated Show resolved Hide resolved
lua/ui/game/worldview.lua Outdated Show resolved Hide resolved
if GetNumRootFrames() < 2 then return end

---------------------------------------------------------------------------
-- defensive programming
Copy link
Member

Choose a reason for hiding this comment

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

Cluttering comments.

if GetNumRootFrames() < 2 then return end


---------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

Same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation related to documentation to preserve knowledge and practices
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants