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 Floating Solo Toolbar v1.0 #1489

Merged

Conversation

Neftovsky
Copy link
Contributor

No description provided.

@cfillion
Copy link
Member

cfillion commented Jan 19, 2025

  • Scripts should use sentence case to blend well with native actions and other scripts: "Floating solo toolbar", perhaps "Neft's floating solo toolbar" (but there's already neftofsky_ shown in front, so it'd be a bit redundant?), etc...
  • Typo: "-aves" in the @about text
  • Public ReaImGui-based scripts must enable backward compatibility by specifying which API version they are written for (see examples at https://forum.cockos.com/showthread.php?t=250419)

Suggestion: it might be a good idea to save the settings in the same folder as the script's file rather than hard-coded to the resource path's root.

@Neftovsky Neftovsky changed the title Release Neft Floating Solo Toolbar v1.0 Release Floating Solo Toolbar v1.0 Jan 19, 2025
@cfillion
Copy link
Member

cfillion commented Jan 19, 2025

To enable backward compatibility, it's:

package.path = reaper.ImGui_GetBuiltinPath() .. '/?.lua'
require 'imgui' '0.X.Y'

Since the script uses the now-removed DestroyContext function, it looks like it was written for an older version of ReaImGui? Specify which one in the require line so that it can work with today's (0.9) and tomorrow's versions.

-- ReaImGui: API version 0.8 or later
-- @requires
-- REAPER 6.0 or later

Copy link
Member

Choose a reason for hiding this comment

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

It is better to use something like:

app_vrs = tonumber(reaper.GetAppVersion():match('[%d%.]+'))
check_vrs = 6.0
if app_vrs < check_vrs then return reaper.MB('This script require REAPER '..check_vrs..'+','',0) end
local ImGui

if not reaper.ImGui_GetBuiltinPath then return reaper.MB('This script require ReaImGui extension','',0) end
package.path =   reaper.ImGui_GetBuiltinPath() .. '/?.lua'
ImGui = require 'imgui' '0.9.3.2'

window_open = false
end
else
reaper.ImGui_DestroyContext(imgui)
Copy link
Member

Choose a reason for hiding this comment

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

DestroyContext is not required for 0.9.3.2

end

local function SaveSettings()
local file = io.open(save_file_path, "w")
Copy link
Member

Choose a reason for hiding this comment

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

This is really bad idea. At the you have NeftToolbarSettings.lua, which kinda "wtf is that", because it is not a script, while it is marked as a script. I would recommend to use Get(Set)ExtState() for things like that. It is better to use base64 encoding/decoding if you store multiline strings (very close to your case because you store serialized table).

@Neftovsky
Copy link
Contributor Author

I'm sorry for this mess. This is the first time I've posted something here. And anyway, this is my first script. I'm writing it with GPT. See the latest fix

@MichaelPilyavskiy MichaelPilyavskiy merged commit e00bc8e into ReaTeam:master Feb 1, 2025
1 check passed
@cfillion
Copy link
Member

cfillion commented Feb 1, 2025

The action filename still wasn't in sentence case: fixed via #1495.

@Neftovsky Neftovsky deleted the reapack.com_upload-1737282975966 branch February 3, 2025 07:51
@Neftovsky Neftovsky restored the reapack.com_upload-1737282975966 branch February 3, 2025 07:51
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.

3 participants