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

Feature: Allow GameScripts to add additional text to Industry view window #8576

Merged
merged 1 commit into from Jan 22, 2021

Conversation

@ldpl
Copy link
Contributor

@ldpl ldpl commented Jan 15, 2021

Motivation / Problem

With #8115 and #7912 been merged it becomes quite important for GameScripts to have the ability to communicate some extra info about specific industries to the player. This PR adds an additional text field to the industry that is shown at the bottom of the industry view window, much like it's already done for towns.

GS for testing:
industry-text-test.zip

Checklist for review

  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
src/saveload/saveload.h Outdated Show resolved Hide resolved
@ldpl ldpl force-pushed the ldpl:industry-text branch from 01b5616 to 2ab3c83 Jan 15, 2021
Copy link
Member

@LordAro LordAro left a comment

No real concerns

src/script/api/script_error.hpp Outdated Show resolved Hide resolved
src/industry.h Outdated Show resolved Hide resolved
@ldpl ldpl force-pushed the ldpl:industry-text branch 2 times, most recently from 1b700e8 to 6c42ea2 Jan 16, 2021
@michicc
Copy link
Member

@michicc michicc commented Jan 17, 2021

Note for text in the comment of CmdIndustryCtrl is now outdated.

@ldpl ldpl force-pushed the ldpl:industry-text branch from 6c42ea2 to 1dc25c5 Jan 18, 2021
SetControlFlags = 0, ///< Set IndustryControlFlags
SetExclusiveSupplier = 1, ///< Set exclusive supplier
SetExclusiveConsumer = 2, ///< Set exclusive consumer
SetText = 3, ///< Set additional text

This comment has been minimized.

@michicc

michicc Jan 18, 2021
Member

Coding style for enum members:

LordAro: obviously it doesn't need the prefix, but yeah, should probably still be all caps

This comment has been minimized.

@ldpl

ldpl Jan 18, 2021
Author Contributor

Other 2 enum classes (ElementFloat and MidiSysexMessage) use this syntax. And IMO it's much nicer, as they are not in global namespace THERE IS NO NEED TO SHOUT :p

This comment has been minimized.

@michicc

michicc Jan 18, 2021
Member

Well, letting @LordAro have the last word here, but otherwise 👍

@ldpl ldpl force-pushed the ldpl:industry-text branch from 1dc25c5 to d49eb23 Jan 22, 2021
@LordAro LordAro merged commit bab7de6 into OpenTTD:master Jan 22, 2021
8 checks passed
8 checks passed
Emscripten
Details
Commit checker
Details
Check preview needs update Check preview needs update
Details
Linux (clang, clang++)
Details
Linux (gcc, g++)
Details
Mac OS (x64, x86_64)
Details
Windows (x86)
Details
Windows (x64)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants