Navigation Menu

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

Fix #12308: Cannot use cheats in editor modes #12661

Merged
merged 2 commits into from Aug 13, 2020

Conversation

Gymnasiast
Copy link
Member

This allows opening the cheats window while in editor mode. Some tabs and options are disabled because they are not relevant to these modes.

This allows opening the cheats window while in editor mode. Some tabs and options are disabled because they are not relevant to these modes.
@Gymnasiast Gymnasiast linked an issue Aug 12, 2020 that may be closed by this pull request
@AaronVanGeffen AaronVanGeffen self-requested a review August 12, 2020 21:00
Copy link
Contributor

@AaronVanGeffen AaronVanGeffen left a comment

Choose a reason for hiding this comment

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

At the time of writing, the cheats window looks like this when opened in the scenario editor:

Unnamed park 2020-08-12 23-06-37

I don't like the tabs missing entirely. Perhaps they could be repositioned to fill the gap, but ideally, I would like this to use the disabled tab sprite introduced in #5138. With Twitch support removed, I believe no window is currently using it. However, I think it would be a perfect fit for this.

In #5138, the sprite on the widget definition itself was changed, depending on the compile-time availability of Twitch. I believe it would be easy to do something similar in the invalidate event instead.

A more appropriate solution would probably be to swap out the sprite in widget_tab_draw in Widget.cpp instead. While writing this, I realise this probably warrants a PR of its own. Perhaps along with the MakeTab abstraction I've been meaning to work on.

Just to illustrate, here's what the disabled Twitch tab looked like:

@Gymnasiast
Copy link
Member Author

Since you said that handling greying out properly requires a PR of its own to do properly, I have opted for the simplest solution: updating the positions so that there is no awkward gap between tabs 1 and 4.

Copy link
Contributor

@AaronVanGeffen AaronVanGeffen left a comment

Choose a reason for hiding this comment

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

Repositioning the tabs should probably be a generic window function, but in its current state, this will do.

I will work on a PR that refactors the tab definitions soon-ish.

@Gymnasiast Gymnasiast merged commit 5e09ecc into OpenRCT2:develop Aug 13, 2020
@Gymnasiast Gymnasiast deleted the fix/12308 branch August 13, 2020 11:04
@Gymnasiast Gymnasiast added this to the v0.3.0 milestone Aug 13, 2020
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 this pull request may close these issues.

Cannot use cheats in Track Designer (and Scenario Editor)
2 participants