manups4e / ScaleformUI

ScaleformUI is a GTA menu styled API made with custom Scaleforms to be lighter, faster and visually better
Other
147 stars 49 forks source link

Unloads the buttons on the bottom right (INSTRUCTIONAL_BUTTONS) when closing the menu #238

Closed SulimanX closed 2 weeks ago

SulimanX commented 1 month ago
---Removes all instructional buttons and unloads the Scaleform
function ButtonsHandler:ClearButtonList()    
    local scaleform = self._sc

    if (scaleform and scaleform.handle) then
        SetScaleformMovieAsNoLongerNeeded(scaleform.handle) 
        self._sc = nil
    end

    self.ControlButtons = {}
    self._changed = true
end

useful for me because i use HasScaleformMovieFilenameLoaded for checking if INSTRUCTIONAL_BUTTONS is loaded and if it was loaded then the timerbars should have higher Y pos (maybe it's useful for other people) anyways it's important to unload a model or scaleform i guess 😅

manups4e commented 1 month ago

If you think it's useful make a PR I will merge it☺️