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

Add: Cheat menu under land information menu and 'cheat' console command #8207

Closed
wants to merge 1 commit into from

Conversation

telk5093
Copy link
Contributor

@telk5093 telk5093 commented Jun 7, 2020

This cheat command just opens the cheat window.
It might be used in the situation which users ard hard to push Ctrl+Alt+C, such as mobile.
This codes is based on pelya's openttd-android repo.

Of course I know that OpenTTD is not currently supporting android officially.
So I have no idea if this seems okay to you or fits with current OpenTTD's developing directions.

Please comment if any opinions or problems.
Thanks :)

@James103
Copy link
Contributor

James103 commented Jun 7, 2020

This can potentially allow for the cheat window to be opened while in multiplayer. To fix this, the ShowCheatWindow() should be guarded with an if (!_networking), just like via the hotkey.

Example: If _networking is false, then show the cheat window. Else (network game), show an error saying that "Cheating is not allowed in multiplayer".

@nielsmh
Copy link
Contributor

nielsmh commented Jun 7, 2020

I think it might be better then to move the if (!_networking) test into ShowCheatWindow() and make the function return a bool whether the window was allowed to open. Then the console command can print an error when it can not.
It should also check for being in-game, you don't want the cheat window on the title screen either.

@ldpl
Copy link
Contributor

ldpl commented Jun 7, 2020

Am I the only one who finds it ridiculous to use text interface for accessing GUI? Can't android port just make a separate button for cheats or smth?

For example, adding an entry for cheats to ? button in top menu would be fine imo.

@telk5093
Copy link
Contributor Author

telk5093 commented Jun 8, 2020

I've added if(networking) check into ShowCheatWindow() and make showing error message if multiplayer or title screen.

For example, adding an entry for cheats to ? button in top menu would be fine imo.

And also I've implemented this.

@telk5093 telk5093 changed the title Add: 'cheat' console command to open the cheat window Add: Cheat menu under land information menu and 'cheat' console command Jun 8, 2020
@LordAro
Copy link
Member

LordAro commented Jun 18, 2020

I agree with @ldpl . I don't like adding a command to open a specific window, it makes no real sense. Especially for the usecase suggested. I guess I would be ok with adding it to the dropdown though, though it needs proper consideration as it's supposed to be "hidden"

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

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

As per comment, though I'm tempted to just close it entirely tbh

@telk5093
Copy link
Contributor Author

telk5093 commented Jul 4, 2020

I think it would be great that Cheats menu appears under information menu only if a certain configuration variable is setted as true.
But I have no idea which variable would be that.
So, I'll close this PR for now until I would have more gorgeous idea.
Thanks all of your opinions :)

@telk5093 telk5093 closed this Jul 4, 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.

None yet

5 participants