Comments (7)
This is only possible from the edit entity dialog box. But still a bug, yes.
from solarus-quest-editor.
I see three ways to solve this issue:
- Check values when closing the dialog and show an appropriate error message.
- Detect value changes then force the value to be a multiple of the base size:
round(value / size) * size
. - Use suffix of QSpinBox to display
n * size
wheren >= 1
, so the user cannot set arbitrary values.
I like the last one because it's very simple and gives informations about the base size.
from solarus-quest-editor.
Even if 1 was the behavior in the old editor, I'd say 2, like we do for the entity name: we silently change it it is already used.
3 is not an option to me.
from solarus-quest-editor.
Ok, and what do you think about the idea to consider the ResizeMode in the edit entity dialog box?
- ResizeMode::NONE: disable two spin boxes.
- ResizeMode::HORIZONTAL_ONLY: disable the height spin box.
- ResizeMode::VERTICAL_ONLY: disable the width spin box.
- ResizeMode::SQUARE: detect when one of these spin boxes change and set the same value to the other one.
- ResizeMode::SINGLE_DIMENSION: the more complex, I don't know how to handle this case.
- ResizeMode::MULTI_DIMENSION_ONE: nothing to do.
- ResizeMode::MULTI_DIMENSION_ALL: nothing to do.
Also, what about the EntityModel::is_size_valid() method?
I think we should replace
if (width % 8 != 0 || height % 8 != 0) {
return false;
}
by
if (width % base_size.width() != 0 || height % base_size.height() != 0) {
return false;
}
It seems to me that width and height of the base_size
are always multiple of 8.
from solarus-quest-editor.
Good ideas. For ResizeMode::SINGLE_DIMENSION: detect when one of these spin boxes change and set the base size to the other one.
Ok for the is_size_valid() change but first we need to check all callers.
from solarus-quest-editor.
This is done for ResizeMode constraints!
But I realized that in this context, the modes SQUARE and SINGLE_DIMENSION aren't possible because they don't corresponds to a TilePatternRepeatMode.
Finally, we silently change values when closing the dialog or directly when editing spin boxes?
And for callers of the is_size_valid()
I think it's ok.
Edit: I am wrong, the jumpers can be in ResizeMode::SQUARE and separators can be in ResizeMode::SINGLE_DIMENSION. I was thinking only about tiles ...
from solarus-quest-editor.
All done!
Commited in master:
from solarus-quest-editor.
Related Issues (20)
- Allow to search backwards
- Allow to remove multiple files at once from the quest tree
- When opening a file, expand the tree and scroll to the item
- Dialogs editor: cursor reset when focusing out the dialog text field
- Allow to rename a file when importing
- Map capture shortcut conflicts with shortcut to show/hide entity types
- Copy license/author from parent dirs when importing
- Typo (wrong formatting ?)
- Solarus Quest Editor 1.6 UI: Multiple tilesets feature HOT 5
- Automatically reload tileset in map editor when it has changed
- Wrong name of duplicated patterns
- Quest Editor - Create optional 'explorer' view for sprite selection in the entities menus HOT 1
- Shader preview
- glsl editor
- Don't remove other files when deleting a map or tileset
- Tileset selector visible for all entities
- Add QTest unit test suite
- Opening last maps on quest editor
- Affichage des maps juxtaposées en transparence HOT 1
- Nouvelle fonction item:set_pickable_by_sword() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solarus-quest-editor.