Hey there, I’ve been working on a language package for a small modding community. We use the Pawn language and compiler and I am wondering how to allow users of my package to easily set their compiler directory.
The Pawn compiler isn’t generally “installed” so it rarely has a default location or a PATH variable so the “sublime-build” file has to specify the absolute path to the compiler executable.
My package is set up on Package Control for community members to easily install, however I’m a bit stuck at making an easy way for users to alter their compiler path. I have set up a menu that successfully opens “${packages}/Pawn syntax/PAWN-stable.sublime-build” but it seems impossible to edit. I assumed it’s because this file is inside a “.sublime-package” zip file.
Here’s my menu code:
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children":
{
"caption": "Pawn Compiler Settings",
"mnemonic": "P",
"children":
{
"caption": "Build Settings",
"command": "open_file",
"args": { "file": "${packages}/Pawn syntax/PAWN-stable.sublime-build" }
}
]
}
]
}
]
}
]
And here’s the contents of the sublime-build file if it helps:
{
"cmd": "pawncc.exe", "$file", "-o$file_path\\\\$file_base_name", "-;+", "-(+", "-d3"],
"file_regex": "(.*?)(]([0-9]*))]",
"working_dir": "E:/Games/Projects/SA-MP/pawnostable"
}
(The “working_dir” property is what needs to be changed, the value there is my path which is also the default one on the repository).
I think it would be nice if users could just type in their path into a panel at the bottom (like when you rename a file) without even opening the sublime-build file but I’m not sure how difficult that would be and can imagine it would involve some Python.
Anyway, I’d love a solution to this problem, thanks in advance!