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

Release Perfect Timing! - Audio Quantizer v0.21 (Beta) #1329

Closed

Conversation

80icio
Copy link
Contributor

@80icio 80icio commented Mar 3, 2024

No description provided.

Comment on lines +41 to +55
function checkIMGUI()
local imgui_version, imgui_version_num, REAIMGUI_VERSION = r.ImGui_GetVersion()
local version_sum = 0
REAIMGUI_VERSION = string.gsub(REAIMGUI_VERSION, '%p', "")
return REAIMGUI_VERSION
end


if not dofile(r.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua') then ------------IMGUI check-----------------------
r.ShowMessageBox("Please, install IMGUI extension from REAPACK.\nThanks!", "Ooops!", 0)
r.ReaPack_BrowsePackages('ReaImGui: ReaScript binding for Dear ImGui')
return false
else
REAIMGUI_VERSION = tonumber(checkIMGUI())
if REAIMGUI_VERSION < 83 then ------------ IMGUI version check-----
Copy link
Member

@cfillion cfillion Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This errors out if ReaImGui is not installed (missing imgui.lua), does not properly check its version, and does not activate backward-compatibility.

Correct usage is as follow:

local imgui_path = r.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua'
if not r.file_exists(imgui_path) then
  -- ...
  return
end

dofile(imgui_path) '0.8.3' -- version check + backward compat

-- from this point onward it's safe to use r.ImGui_* functions (only of v0.8.3)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks! changing it and making a new pull request

@80icio 80icio closed this Mar 4, 2024
@80icio 80icio deleted the reapack.com_upload-1709502954695 branch March 4, 2024 22:03
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

Successfully merging this pull request may close these issues.

2 participants