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
Change: move "give money" from client-list to company window #8500
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frosch123
reviewed
Jan 5, 2021
frosch123
reviewed
Jan 5, 2021
…s changing Otherwise it can take a few OnPaint() calls before all planes are set correctly when switching companies.
Code acted as if WWT_TEXT starts a scope; it does not.
… Company window Currently password-lock icon + button was the same size, but this looks really weird. Now they are in sync, even with other fonts and languages.
TrueBrain
force-pushed
the
money-in-company-gui
branch
2 times, most recently
from
January 5, 2021 19:32
e1c3823
to
b019f6b
Compare
TrueBrain
force-pushed
the
money-in-company-gui
branch
2 times, most recently
from
January 5, 2021 20:04
47ab167
to
cec902c
Compare
frosch123
reviewed
Jan 5, 2021
TrueBrain
force-pushed
the
money-in-company-gui
branch
from
January 5, 2021 20:15
cec902c
to
ec0bb95
Compare
This is a much better location for this button, as you send money from one company to another company, not from player to player. This is based on work done by JGRPP in: JGRennison/OpenTTD-patches@f820543 and surrounding commits, which took the work from estys: https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311 We did modify it to fix several bugs and clean up the code while here anyway. The callback was removed, as it meant a modified client could prevent anyone from seeing money was transfered. The message is now generated in the command itself, making that impossible.
TrueBrain
force-pushed
the
money-in-company-gui
branch
from
January 5, 2021 20:19
ec0bb95
to
25f1283
Compare
frosch123
approved these changes
Jan 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
While fixing a bug with
INT32_MAX
"Give Money" situation, I found that JGRPP included a nice patch that brings the "Give Money" button to the company window. To me, it makes so much more sense to have that button there, over anywhere else.Description
It is mostly moving of code. I did fix the Company GUI with the Multiplayer buttons, as they were not aligned properly. As I never did anything with the new Window system before, please review carefully. Tnx :)
This removes
HandleOnEditText
as it was only used for GiveMoney .. that means less special code.CcGiveMoney callback is removed, as now the Command itself generates the chat message. This means modified clients cannot prevent a chat message from being send out, and it was a rather ugly hack on the chat system.
As a bonus, this now works in single-player too! Even AIs can receive your money, if you so like.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.