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

Controllable AutoShowMetal #1851

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

saurtron
Copy link
Collaborator

@saurtron saurtron commented Dec 24, 2024

Work done

  • Make guiHandler::autoShowMetal controllable through lua.

Related Issues

Remarks

See lua-callin-activecommand-set...rid-of-autoshowmetal for a direct comparison to parent (lua-callin-activecommand-set) branch.

  • Branch on top of Add ActiveCommandChanged callin. #1848, leaving this as DRAFT until that one is merged just to avoid this one being merged before, since it includes that one.
    • Had to base on that branch since it changes very similar lines.
  • Could be removed altogether but this makes it backwards compatible.

@saurtron saurtron marked this pull request as draft December 24, 2024 10:29
@sprunk
Copy link
Collaborator

sprunk commented Dec 26, 2024

Just get rid of it, the ticket contains a lua replacement. Ideally there would be a feature support tag and a bunch of forward-compatible PRs to games.

@saurtron
Copy link
Collaborator Author

saurtron commented Dec 26, 2024

Just get rid of it, the ticket contains a lua replacement. Ideally there would be a feature support tag and a bunch of forward-compatible PRs to games.

I think breaking compatibility as default policy, even if we PR to every game is not very good in general. We might not know all games (some could be private) and it puts an urgent burden on engine users (also on engine devs if we're expected to PR everyone).

Personally would rather make AutoShowMetal show a deprecated message so ppl have more time to adapt, and then in a future release (maybe even after next release), remove it.

@lhog
Copy link
Collaborator

lhog commented Jan 4, 2025

I don't think we need to rid of anything. Like who is going redo 100s of maps to include #1092 (comment) widget or who is going to create configs for the same 100s of maps per each game? This is just to replicate the previous behavior.

Seems like a bunch of work (that no one is going to do) for the very little benefit.

I'd keep LuaUnsyncedCtrl::SetAutoShowMetal() but remove all deprecation warnings and keep the default coming from the map, same as now.

@saurtron
Copy link
Collaborator Author

saurtron commented Jan 5, 2025

I don't think we need to rid of anything. Like who is going redo 100s of maps to include #1092 (comment) widget or who is going to create configs for the same 100s of maps per each game? This is just to replicate the previous behavior.

Seems like a bunch of work (that no one is going to do) for the very little benefit.

I'd keep LuaUnsyncedCtrl::SetAutoShowMetal() but remove all deprecation warnings and keep the default coming from the map, same as now.

Added an example widget showing usage: gui_autoshowmetal.lua

Using that gets rid of the deprecation message, due to the call to SetAutoShowMetal(false).

It is also backwards compatible with map declaration, starting there games can implement new policies and then get rid of autoshowmetal in mapinfo if they so desire.

In a future engine release version after SetAutoShowMetal has existed for at least one cycle, we can completely remove autoshowmetal logic from GuiHandler.cpp.

@lhog
Copy link
Collaborator

lhog commented Jan 5, 2025

Sounds reasonable.

@saurtron saurtron marked this pull request as ready for review January 8, 2025 23:39
rts/Lua/LuaConstEngine.cpp Outdated Show resolved Hide resolved
rts/Lua/LuaUnsyncedCtrl.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@sprunk sprunk left a comment

Choose a reason for hiding this comment

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

I dislike the existence of Spring.SetAutoShowMetal and would like future PRs to show a bit of foresight and avoid this kind of planned obsolescence, but I understand BAR is in a hurry so let's let it through.

@saurtron
Copy link
Collaborator Author

saurtron commented Jan 12, 2025

I dislike the existence of Spring.SetAutoShowMetal and would like future PRs to show a bit of foresight and avoid this kind of planned obsolescence, but I understand BAR is in a hurry so let's let it through.

Actually there is no hurry since this isn't due until a future release.

Maybe we can think of a better approach. It's important to have a deprecation mechanism, and similar situations will likely arise in the future.

I agree having a method just for that is a bit awkward. We could have a more general method, like Enable/DisableFeature maybe, or Enable/DisableComponent, but doing it without more thought could also mean we add something that has a short life because of later finding a better or more general way.

I think EnableComponent(name, enable) is probably what we will need in the future for other things too, but bit early to say right now.

@sprunk
Copy link
Collaborator

sprunk commented Jan 12, 2025

In this case the Lua replacement is confined to a single widget so it can be PRed to games, and then engine only touched once the gameside PRs are in.

@saurtron
Copy link
Collaborator Author

saurtron commented Jan 12, 2025

so it can be PRed to games

I don't think PRing to games is an engine developers "job" tbh. Engine developer job is improving the engine and clearly communicating changes through deprecation methods so game developers have time to adapt at their own pace.

Also that point of view assumes we know all games and are able to PR them, but that doesn't need to be the case and assuming that is going to be problematic, anyways lets better have that discussion elsewhere if it's needed. Here I'd discuss for a more generic deprecation method like I was proposing, but not about the need for deprecation itself.

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.

Get rid of AutoShowMetal
4 participants