Skip to content

Refactor MC_Bedrock to use dynamic path for SoundVolumeView#26

Open
Ven0m0 wants to merge 1 commit intomainfrom
update-mc-bedrock-path-fix-10530591154500514658
Open

Refactor MC_Bedrock to use dynamic path for SoundVolumeView#26
Ven0m0 wants to merge 1 commit intomainfrom
update-mc-bedrock-path-fix-10530591154500514658

Conversation

@Ven0m0
Copy link
Owner

@Ven0m0 Ven0m0 commented Feb 4, 2026

  • Moved FindExe and MustGetExe from playnite-all.ahk to Lib/v2/AHK_Common.ahk for reusability.
  • Updated MC_Bedrock.ahk to use FindExe to locate SoundVolumeView.exe instead of a hardcoded user path.
  • Cleaned up playnite-all.ahk to remove duplicate function definitions.
  • Ensured graceful degradation if SoundVolumeView is not found.

PR created automatically by Jules for task 10530591154500514658 started by @Ven0m0

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 4, 2026 16:47
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Ven0m0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the maintainability and robustness of scripts by centralizing common utility functions and eliminating hardcoded paths. By introducing dynamic executable location, the system becomes more adaptable to different user environments and more resilient to missing external tools, enhancing the overall user experience without requiring manual path adjustments.

Highlights

  • Centralized Executable Finding: The FindExe and MustGetExe functions have been moved from playnite-all.ahk to Lib/v2/AHK_Common.ahk, making them reusable across different scripts.
  • Dynamic Path for SoundVolumeView: The MC_Bedrock.ahk script now uses the new FindExe function to dynamically locate SoundVolumeView.exe, eliminating the need for hardcoded user paths.
  • Improved Robustness: The MC_Bedrock.ahk script gracefully handles scenarios where SoundVolumeView.exe might not be found, ensuring the script continues execution without critical errors.
  • Code Cleanup: Duplicate definitions of FindExe and MustGetExe have been removed from playnite-all.ahk.
Changelog
  • Lib/v2/AHK_Common.ahk
    • Added FindExe function to search for executables in the system PATH and specified fallback directories.
    • Added MustGetExe function which uses FindExe and exits the application with an error message if the executable is not found.
  • Other/playnite-all.ahk
    • Removed the FindExe and MustGetExe functions, as they have been relocated to Lib/v2/AHK_Common.ahk for reusability.
  • ahk/Minecraft/MC_Bedrock.ahk
    • Updated script version to 2.1.0.
    • Replaced the hardcoded ToolDir variable and its associated SoundVolumeView.exe path with a dynamic lookup using the new FindExe function.
    • Implemented a conditional check to ensure SoundVolumeView.exe is found before attempting to execute its commands, allowing for graceful degradation if the tool is absent.
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively refactors the codebase by centralizing FindExe and MustGetExe into a shared library, which is a great move for maintainability. The update to MC_Bedrock.ahk to dynamically locate SoundVolumeView.exe instead of using a hardcoded path is a significant improvement, making the script more robust and portable. My review includes a few suggestions to further improve the code by adopting more modern and idiomatic AutoHotkey v2 syntax, which will enhance readability and maintainability.

Comment on lines +43 to +51
Loop Parse, EnvGet("PATH"), ";"
{
p := Trim(A_LoopField)
if !p
continue
cand := p . "\" . name
if FileExist(cand)
return cand
}

Choose a reason for hiding this comment

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

medium

For better readability and to adhere to modern AutoHotkey v2 style, consider using StrSplit() instead of the legacy Loop Parse. StrSplit() is generally preferred in AHK v2 for its clarity.

    for _, p_raw in StrSplit(EnvGet("PATH"), ";")
    {
        p := Trim(p_raw)
        if !p
            continue
        cand := p . "\" . name
        if FileExist(cand)
            return cand
    }


MustGetExe(name, fallbacks := []) {
exe := FindExe(name, fallbacks)
if exe = ""

Choose a reason for hiding this comment

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

medium

The check if exe = "" can be simplified. In AutoHotkey v2, you can check for an empty string using if !exe. This is more concise and idiomatic.

    if !exe

RunWait(ToolDir . "\SoundVolumeView\SoundVolumeView.exe /SetDefault `"Razer Audio Controller - Game`"")
} catch Error as err {
; SoundVolumeView not found or error - continue anyway
if (svv != "") {

Choose a reason for hiding this comment

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

medium

The check if (svv != "") can be simplified. In AutoHotkey v2, you can directly check the truthiness of the variable. Using if svv is more concise and idiomatic for checking if a string is not empty.

if svv {

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the MC_Bedrock script to use dynamic path resolution for SoundVolumeView instead of hardcoded user-specific paths, improving portability and maintainability across the codebase.

Changes:

  • Moved FindExe and MustGetExe utility functions from playnite-all.ahk to the shared Lib/v2/AHK_Common.ahk library for reuse across multiple scripts
  • Updated MC_Bedrock.ahk to use FindExe with relative fallback paths instead of hardcoded directory references
  • Removed obsolete warning comments about path customization requirements

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Lib/v2/AHK_Common.ahk Added FindExe and MustGetExe functions to provide centralized executable location logic with PATH and fallback support
ahk/Minecraft/MC_Bedrock.ahk Replaced hardcoded ToolDir variable with dynamic FindExe call using relative fallback paths; updated to version 2.1.0
Other/playnite-all.ahk Removed duplicate FindExe and MustGetExe function definitions now that they're in the shared library

Comment on lines +60 to +61
if exe = ""
{
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The opening brace should be on the same line as the if statement to follow OTBS (One True Brace Style) convention used throughout the codebase. For example, see Lib/v2/WindowManager.ahk:11 where if hasTitle { follows OTBS, and line 72 where if saved.Has(id) { also follows OTBS.

Copilot generated this review using guidance from repository custom instructions.
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.

1 participant