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

Fix: Take into account FFXI's UI Scale option when positioning the bars/text. #6

Open
joshuateveryday opened this issue Jun 22, 2018 · 0 comments

Comments

@joshuateveryday
Copy link

Made a quick edit to ui.lua. Basically you just need to account for UI Scale when positioning the hotbar. Sorry for the quick and dirty copy/paste, didn't have my git pipeline set up on the PC I'm making edits on.

I play FFXI in 5K so I have to scale my main fullscreen window up to 2.0 on the UI Scale.

Then when I launch mules, my hot bars are positioned wrong because the have the incorrect OffsetX/OffsetY used by the 5k resolution window. (Mules use 2K resolution with a 1.0 UI scale)

-- setup positions and dimensions for ui
function ui:setup_metrics(theme_options)
    self.hotbar_width = (400 + theme_options.slot_spacing * 9)

    local settings = windower.get_windower_settings()
    -- Calculate UI Scale
    -- Need to take into account users who are using UI Scales > 1.0 in windower.
    local ui_scalar = ((settings.ui_x_res * 1.0) / (settings.x_res * 1.0))
    self.pos_x = ((settings.x_res * ui_scalar) / 2) - (self.hotbar_width / 2) + theme_options.offset_x
    self.pos_y = ((settings.y_res * ui_scalar) - 120) + theme_options.offset_y

    self.slot_spacing = theme_options.slot_spacing

    if theme_options.hide_action_names == true then
        theme_options.hotbar_spacing = theme_options.hotbar_spacing - 10
        self.pos_y = self.pos_y + 10
    end

    self.hotbar_spacing = theme_options.hotbar_spacing
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant