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

Track icon selector pcall CreateImage #1440

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Tracks/reapertips_Track icon selector.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-- @description Track icon selector
-- @author Reapertips & Sexan
-- @version 1.06
-- @version 1.07
-- @changelog
-- Add traceback report
-- Add padding whitespaces into name size calculation (to keep UI as it was)
-- Show Console message with unsupported image path
-- @provides
-- reatips_Track icon selector/Menu.png
-- reatips_Track icon selector/Reset.png
Expand Down Expand Up @@ -363,7 +362,9 @@ local function PngSelector(button_size)

imgui.PushID(ctx, n)
if not imgui.ValidatePtr(FILTERED_PNG[n + 1].img_obj, 'ImGui_Image*') then
FILTERED_PNG[n + 1].img_obj = imgui.CreateImage(image)
if not pcall(function() FILTERED_PNG[n + 1].img_obj = imgui.CreateImage(image) end) then
r.ShowConsoleMsg("Unsupported image : " .. image .. "\n\n")
end
end

if imgui.ImageButton(ctx, "##png_select", FILTERED_PNG[n + 1].img_obj, button_size, button_size, 0, 0, 1, 1) then
Expand Down