-
Notifications
You must be signed in to change notification settings - Fork 261
Add economy overlay scaling #7287
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
Open
lL1l1
wants to merge
15
commits into
develop
Choose a base branch
from
feature/econ-overlay-scaling
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4fa5e74
Add scaled econ overlay textures
lL1l1 478a26c
Test setup for using scaled econ overlay
lL1l1 29f45cf
Record the script used
lL1l1 1d4e539
Revert "Record the script used"
lL1l1 45d4530
Create a game option for econ overlay scale
lL1l1 3563d06
Require restart upon changing option after activating overlay once
lL1l1 cf64f77
Don't scale width for the middle textures
lL1l1 1704e39
Fix Cybran right side textures
lL1l1 78f6b38
Add option tooltip
lL1l1 91f52c3
Add AI translations for tooltip
lL1l1 993f1e8
Add snippet template
FAForeverBot 48701c0
annotation
lL1l1 4d1f99b
Merge branch 'feature/econ-overlay-scaling' of https://github.com/FAF…
lL1l1 4ef2fd3
Snippet
lL1l1 94a7d55
Update loc/TW/strings_db.lua
lL1l1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Add an option to scale the economy overlay (#7287). |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,34 @@ | ||
| local scale = import('/lua/user/prefs.lua').GetOption('econ_overlay_scale') | ||
| local scaleSuffix = { | ||
| [0.8] = '_0.8x', | ||
| [1] = '', | ||
| [1.25] = '_1.25x', | ||
| [1.5] = '_1.5x', | ||
| [1.75] = '_1.75x', | ||
| [2] = '_2.0x', | ||
| } | ||
| local suffix = scaleSuffix[scale or 1] or '' | ||
| ---@param number number | ||
| ---@return integer | ||
| local function ScaleNumber(number) | ||
| return math.floor(number * scale) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| end | ||
|
|
||
| EconOverlayParams = { | ||
| positiveColor = "FF00D000", | ||
| negativeColor = "red", | ||
| leftTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_l.dds"), | ||
| midTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_m.dds"), | ||
| rightTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_r.dds"), | ||
| leftTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_l" .. suffix .. ".dds"), | ||
| midTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_m" .. suffix .. ".dds"), | ||
| rightTexture = import("/lua/ui/uiutil.lua").UIFile("/game/economic-overlay/econ_bmp_r" .. suffix .. ".dds"), | ||
| fontName = "Ariel", | ||
| fontSize = 9, | ||
| energyTopOffset = 13.0, | ||
| massTopOffset = 1.0, | ||
| } | ||
| fontSize = ScaleNumber(9), | ||
| energyTopOffset = ScaleNumber(13.0), | ||
| massTopOffset = ScaleNumber(1.0), | ||
| } | ||
|
|
||
| local scaleOptionItem = import('/lua/options/optionslogic.lua').FindOptionItem('econ_overlay_scale') | ||
| if scaleOptionItem then | ||
| -- engine only imports this file once per application opening | ||
| -- which means once imported, it needs a restart to be updated | ||
| scaleOptionItem.restart = true | ||
| end | ||
This file contains hidden or 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
Uh oh!
There was an error while loading. Please reload this page.