andristum / dpemotes

Emotes / Animations for fiveM with Prop support.
https://forum.fivem.net/t/dpemotes-356-emotes-usable-while-walking-props-and-more/843105
GNU General Public License v3.0
123 stars 310 forks source link

Fix for widescreen monitors from 21: 9 and higher #27

Open LSatan opened 3 years ago

LSatan commented 3 years ago

Hi I have a widescreen monitor with the format 32: 9. Unfortunately, the menu is then not displayed. The following code change solves the problem. my resolution is 5620x1440. I also tested other widescreen resolutions. It would be great if you could take over this bugfix. All previous formats will continue to be supported. In NativeUI.lua Download Widescreen fixed NativeUI.zip change this from:

function FormatXWYH(Value, Value2)
return Value/1920, Value2/1080
end

to this:

function FormatXWYH(Value, Value2)
    local W, H = GetActiveScreenResolution()
    if (W/H) < 2.3 then
        return Value/1920, Value2/1080
    else
        return Value/2560, Value2/H
    end
end

Regards