-
-
Notifications
You must be signed in to change notification settings - Fork 995
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
Editor enhancements #8903
Open
babaissarkar
wants to merge
35
commits into
wesnoth:master
Choose a base branch
from
babaissarkar:editor_enhancements
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Editor enhancements #8903
Conversation
This file contains 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
selecting file by browse button sets relative path instead of absolute path
also add tooltip to preview button and update copyright notice (missing from wesnoth#8066)
soliton-
reviewed
May 22, 2024
I'm not sure how you got this wrong, but it's Map, not Game. |
What do you mean by "prefix"? It converts an absolute path to something
like "misc/some-image.png" (the same as what is supported by image widget's
label)
…On Wed 22 May, 2024, 7:11 PM Celtic Minstrel, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/gui/dialogs/editor/custom_tod.cpp
<#8903 (comment)>:
> + std::string rel_path = "";
+ std::string core_asset_dir = filesystem::get_dir(game_config::path + "/data/core/" + asset_type);
+ std::string addon_asset_dir;
+
+ bool is_in_core_dir = (abs_path.find(core_asset_dir) != std::string::npos);
+ bool is_in_addon_dir = false;
+
+ if (!addon_id_.empty()) {
+ addon_asset_dir = filesystem::get_current_editor_dir(addon_id_) + "/" + asset_type;
+ is_in_addon_dir = (abs_path.find(addon_asset_dir) != std::string::npos);
+ }
+
+ if (is_in_core_dir) {
+ rel_path = abs_path.erase(0, core_asset_dir.size()+1);
+ } else if (is_in_addon_dir) {
+ rel_path = abs_path.erase(0, addon_asset_dir.size()+1);
…doesn't this need to add a prefix to the path as well?
—
Reply to this email directly, view it on GitHub
<#8903 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAT3AEX3DAEJ2W7VNCOPKDZDSN7XAVCNFSM6AAAAABIC2EFUWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANZRGI2TIOJVGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hmm, I think I'm getting confused between asset paths and WML paths actually. Never mind. |
bug details : if schedule editor is opened without assigning a tod first , the tod image or masks won't be shown unless invalidate_layout() is used.
Also contains small fixes to scroll_text, multiline_text and tab_container For the first two, cursor is now set at the start instead of at the end of text after a set_label call. This makes it easier to read the text. Adds a couple of new getters in tab_container to get the currently selected tab, and to access any of the grids of the tabs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Editor
Map/scenario editor issues.
Enhancement
Issues that are requests for new features or changes to existing ones.
Graphics
Issues that involve the graphics engine or assets.
UI
User interface issues, including both back-end and front-end issues.
Units
Issues that involve unit definitions or their implementation in the engine.
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.
Contains various enhancements mostly to the Time Schedule Editor that I couldn't manage to add in #8066. It also contains a few other things in the Map Editor itself. There are also changes to the Unit Type Editor that are related to the new features in the Schedule Editor.
Map Editor
Load Map
toLoad Map/Scenario
(since it can load both),Edit Scenario
toEdit Scenario Settings
,Save Map
to justSave
.editor/scenarios
. (Resolves editor: Save into addon when saving a scenario #8910)Save Scenario As
only for Scenariossettings.png
icon forPreferences
menu itemMap Mode:
Scenario Mode:
![Screenshot from 2024-05-25 17-53-03](https://private-user-images.githubusercontent.com/8469888/333799443-60cd2c95-33f1-4e82-99f0-1c96d1c7c5f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5MjM2MDEsIm5iZiI6MTcxODkyMzMwMSwicGF0aCI6Ii84NDY5ODg4LzMzMzc5OTQ0My02MGNkMmM5NS0zM2YxLTRlODItOTlmMC0xYzk2ZDFjN2M1ZjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjBUMjI0MTQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTAxZjUwNDJlYjZkNjJlNTBhYTRiYjEwYjNkNzE3ODBkNjNlNTQ3NDhiOWFmNDhiZGU1M2I2NTFiYzVlMTBhMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.o8mSQksaLuJlSI1pnNJaGHr76cOHCzppsmJqI--nGSQ)
Time Schedule Editor
tod_new_schedule
(missed in Add functionality to Time Schedule Editor #8066)Unit Type Editor
The last four entries above :
Add-on menu
The open add-on folder option shows a GUI2 file dialog at the add-on's folder which can be used to open any file. If it is a loadable map/scenario it will be opened in the editor, otherwise the OS's default application for that file will be opened.
File Dialog
Open External
button that opens selected file/folder in the platform's default application (independently of what pressingOpen
would do). This could be used to quickly open a folder or preview the file before actually selecting it.