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

Get rid of AutoShowMetal #1092

Open
sprunk opened this issue Nov 23, 2023 · 1 comment · May be fixed by #1851
Open

Get rid of AutoShowMetal #1092

sprunk opened this issue Nov 23, 2023 · 1 comment · May be fixed by #1851

Comments

@sprunk
Copy link
Collaborator

sprunk commented Nov 23, 2023

Bill of materials to be done before starting this ticket:


This is a map-side setting which cannot be controlled by a game, and which makes it so that the metal view is force-enabled when "build mex" becomes the active command.

Gameside control can already be achieved via Lua. Right now it has to be polling, but with #1091 a replacement should become as simple as:

function widget:ActiveCommandSet(cmdID)
  local isMex = cmdID < 0 and UnitDefs[-cmdID].extractsMetal > 0
  local isMetalViewOn = (Spring.GetMapDrawMode() == 'metal')
  if isMex ~= isMetalViewOn then
    Spring.SendCommands("showmetalmap")
  end
end

Therefore the proposal is to remove the mapside tag.

@saurtron
Copy link
Collaborator

a replacement should become as simple as:

I think the replacement needs something more, since some maps disable this logic, so wupget code should be able to apply the same heuristic (not sure what it is about but it's controlled per map so I think some may be disabling it?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants