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

Console: loan commands #4725

Closed
DorpsGek opened this issue Aug 14, 2011 · 4 comments
Closed

Console: loan commands #4725

DorpsGek opened this issue Aug 14, 2011 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

aditsu opened the ticket and wrote:

When inflation goes very high, e.g. a Lev4 engine costs $180 million, borrowing and repaying through the finances window becomes very cumbersome.
Yes, there's ctrl-click, but it borrows or repays everything, and that either increases the interest too much, or sends the money into the negative in a fraction of a second with at least one running vehicle, requiring lots of clicks to keep it positive.
My suggestion is to add 2 commands that can be used in the console: borrow and repay
where amount can be a number, or a number with a suffix (k = thousands, m = millions)

Reported version: 1.1.1
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4725
@DorpsGek
Copy link
Member Author

monoid wrote:

I don't think the console is the appropriate place to put such manual-loan-amount-setting functionality; instead it should be added to the existing loan increase/decrease section of the company finance GUI.

Here are two patches that implement that.

The first patch merges together the two command handlers CMD_INCREASE_LOAN and CMD_DECREASE_LOAN, replacing them with CMD_SET_LOAN. This has the following advantages:
* Less (virtually duplicated) code
* Makes more sense than having two command handlers which take delta loan amounts instead of a direct loan amount (IMO!)
* The new command takes the new loan amount to set as a parameter, instead of the change in loan amount requested. This helps in the (admittedly, very) edge case where two users request loan amount changes in a single company at the same time. If i.e. both users request loan increases, the new command ensures that only one increase is made, instead of two, which was not either user's intent.

The second patch adds the 'set loan amount' button to the company finances GUI, and is reasonably self-explanatory. Clicking it produces a query string window, asking for the new desired loan amount, which will be rounded up to the nearest LOAN_INTERVAL and set (if a valid value).

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4725#comment10366

@DorpsGek
Copy link
Member Author

monoid wrote:

I really need to start using git properly, instead of SVN >_>

Fixed a few missing chunks in patch 2.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4725#comment10367

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@TrueBrain
Copy link
Member

Making a console script part of your normal game-flow is a big no-no. It either needs a proper place in the UI, or not been done at all.

I don't like the current suggested UI solution, as it feels micromanaging .. we need a solution in between I think.

This needs a bit of thinking.

@andythenorth
Copy link
Contributor

When inflation goes very high

Let's not go putting lipstick on a pig. Loan management is usually a total non-issue. Inflation is broken (#4799), let's not pile sticking plasters on by making loans more complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

3 participants