feat: implement scripting API access to user's tile size preferences#4343
Open
abhinavs1920 wants to merge 1 commit intomapeditor:masterfrom
Open
feat: implement scripting API access to user's tile size preferences#4343abhinavs1920 wants to merge 1 commit intomapeditor:masterfrom
abhinavs1920 wants to merge 1 commit intomapeditor:masterfrom
Conversation
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
Author
|
Hey @bjorn, I’ve added the PR. I just realized someone else has been assigned to it, if it’s not mergeable, I’d really appreciate any feedback. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves Issue #4222
This PR exposes user tile size preferences to the scripting API, allowing scripts to read and modify the default tile dimensions used in the New Map and New Tileset dialogs.
Scripts can now access these preferences through tiled.preferences:
mapTileWidth / mapTileHeight - default tile size for new maps
tilesetTileWidth / tilesetTileHeight - default tile size for new tilesets
The implementation adds a new ScriptPreferences class that wraps the existing session options, making them accessible to the scripting engine. Session options that were previously scoped locally in dialog files have been moved to a shared header (sessionoptions.h) so they can be accessed from the scripting layer.
This is useful for scripts that want to create maps or tilesets programmatically using the user's preferred tile dimensions, or for scripts that need to temporarily adjust these defaults.
I am also adding the screenshot to show successful working of the feature.