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

Pin display toggle #30

Open
bszonye opened this issue Sep 19, 2017 · 9 comments
Open

Pin display toggle #30

bszonye opened this issue Sep 19, 2017 · 9 comments

Comments

@bszonye
Copy link
Owner

bszonye commented Sep 19, 2017

ToggoStar requested:

Is there any way to toggle the display of pins on the map with this mod? I would love to use pins and especially this mod quite a lot, but I hate the cluttered look all of the pins leave on the map. I only need to glance at the pins from time to time and toggleing would be perfect!

This would not be too difficult technically. The challenging part would be avoiding conflicts with other mods, as an easily-accessible toggle switch would probably need to go into the minimap code.

@bszonye
Copy link
Owner Author

bszonye commented Oct 1, 2017

This should behave something like the yield toggle, which is defined in UI/WorldInput.lua and implemented in the OnInputActionTriggered function. The keybindings option screen is defined in UI/Options.lua with localization in Text/en_US/UI_Options_Text.xml.

The existing map toggles store state in UserConfiguration with a get/set function like this:

  • Get state: UserConfiguration.ShowMapFoo()
  • Toggle on: UserConfiguration.ShowMapFoo(true)
  • Toggle off: UserConfiguration.ShowMapFoo(false)

These configuration states might be built into the game and might not be modifiable, although it might be possible to save the information in a custom table. Of course, saving the toggle state would also make this affect saved games, which is undesirable. That means either putting this feature into a separate mod, or having it revert to default on load.

The set of keybindings seem to come from another opaque game object, Input, configured in UI/Options.lua:

  • Input.GetActionCount(): number of keybindings
  • Input.GetActionId(i): get binding by number
  • Input.GetActionId("ToggleYield"): get binding by name
  • Input.BindAction(action, index, gesture): set binding, index = 0 or 1
  • Input.GetGestureDisplayString(action, index): get binding for display

I have not yet found the definition for the set of keybindings and their categories, so that might also be built in and non-modifiable. I would rather not use a custom configuration file for extra keybindings, so this will require more research.

@bszonye
Copy link
Owner Author

bszonye commented Oct 1, 2017

See also: Hotkey Support (#18).

@gus-morales
Copy link

an easily-accessible toggle switch would probably need to go into the minimap code
What about a hotkey only?

@bszonye
Copy link
Owner Author

bszonye commented Feb 28, 2019

For my own private mods, I don’t mind doing quick & dirty hacks like hardcoding hotkeys, but for my public work I prefer implementing full solutions. In this case, that means adding a toggle switch to the map options UI and a customizable hotkey into the options screen. I have an idea how to implement some parts of that but not all.

I would also really like to avoid changing more game scripts outside of the three MapPinX scripts that this mod already replaces. I know how to do that for some of these changes but not others. I suspect that adding the toggle to the map options might actually be the easy part, because I now know how to insert new objects into control stacks like that one.

@gus-morales
Copy link

I see. I hope you could consider not to use the MinimapPanel file (if possible), because other popular mods like More Lenses and CUI already use it :)

@bszonye
Copy link
Owner Author

bszonye commented Mar 2, 2019

Yes, I think that is possible. In MinimapPanel.xml, the checkbox options are in a Stack called MapOptionsList. It's usually possible to extend Stacks without editing the original definition. I learned the technique from Sukritact's Simple UI Adjustments. Check out:

UI/Common/Additions/Suk_ScreenshotMode.lua
UI/Common/Additions/Suk_ScreenshotMode.xml

Those add a new screenshot button to the minimap UI without touching MinimapPanel.

@carafelix
Copy link

Hello, hope you are still considering implementing the toggle between hide and show pins. really annoying to be always missclicking on those or must zoom in for avoid it. keep up with the mod, really useful.

@JaKXz
Copy link

JaKXz commented Oct 25, 2020

@bszonye sorry to comment on an old issue, but is this still in the works? If it was PR'd in, would the update propagate to civ6?

Huge fan of this work, thank you btw!

@bszonye
Copy link
Owner Author

bszonye commented Oct 25, 2020

Hi, and thank you! I do not expect Firaxis to incorporate any of the version 3.x changes to the mod. For legal reasons, it would probably require a new round of contracts and licensing. I still tinker a bit when I notice something out of place, like the change to barbarian icons a few months ago, but I am not doing any major development for the mod right now.

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

No branches or pull requests

4 participants