Skip to content

Commit

Permalink
[barfiller] Windower#2263 allow manual override of x position
Browse files Browse the repository at this point in the history
  • Loading branch information
posimagi committed Jan 19, 2023
1 parent adfc1f6 commit 05a61ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addons/barfiller/statics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ defaults = {}
defaults.Images = {}
defaults.Images.Background = {}
defaults.Images.Background.Pos = {}
defaults.Images.Background.Pos.AllowDecenter = false
defaults.Images.Background.Pos.X = 164
defaults.Images.Background.Pos.Y = 6
defaults.Images.Background.Visible = true
Expand Down Expand Up @@ -280,7 +281,12 @@ function calc_new_width()
end

function position_images()
local x = windower.get_windower_settings().x_res / 2 - settings.Images.Background.Size.Width / 2
local x
if settings.Images.Background.Pos.AllowDecenter then
x = settings.Images.Background.Pos.X
else
x = windower.get_windower_settings().x_res / 2 - settings.Images.Background.Size.Width / 2
end

background_image:pos(x, settings.Images.Background.Pos.Y)
foreground_image:pos(x + 2, settings.Images.Foreground.Pos.Y)
Expand Down

0 comments on commit 05a61ad

Please sign in to comment.