Details
- Reviewers
- None
- Group Reviewers
GCompris: Improvements - Maniphest Tasks
- T7828: Chess: add list of taken pieces
Diff Detail
- Repository
- R2 GCompris
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Thank you for the patch.
When you change level, the taken pieces are not resetted.
src/activities/chess/Chess.qml | ||
---|---|---|
169 | movesNum++ should be on the next line, it's quite easy to miss it after the '}' | |
src/activities/chess/TakenPieces.qml | ||
1 ↗ | (On Diff #47353) | neded to change filename and the year 2 lines below. |
22 ↗ | (On Diff #47353) | 2.6 |
Video link to the current feature: https://drive.google.com/open?id=1tvJRkIz9GiBIzPX0oWetqt1FuOj36EkY
I'm still not sure what is the best way to present the pieces but the main code to store them is present on this patch, shouldn't be too complicated to switch to another view if needed :)
Nice patch :)
However it would be much better to have a button opening a pop-up to show them full-screen rather than on the sides like that.
We can have the button on the right side/under (depending on the view) of the undo button, with a label "taken" for example.
We lose the keyboard focus when the drawers open (ctrl+F, escape to leave the activity... all the shortcuts).
Another issue using 2 Drawer is that we need to click twice to return back to the game.
Do you think we can have another way to display them with only one click to go back to the game?
src/activities/chess/TakenPiecesList.qml | ||
---|---|---|
26 ↗ | (On Diff #47463) | It will be really nice to have when we upgrade the minimal version of Qt but for now, it is Qt5.6 and Drawer has been added in Qt5.7 (https://doc.qt.io/qt-5.11/qml-qtquick-controls2-drawer.html). |
src/activities/chess/TakenPiecesList.qml | ||
---|---|---|
26 ↗ | (On Diff #47463) | I used Rectangle with animation. Thus we don't lose the keyboard focus. we don't need to remove list to play the game. Thus the user can leave it open while playing the game |
There are still some issues with overriding when reducing the size screen.
As Timothée will rework the activity later (replace the texts with icons, better layout), it may be better to let him integrate the feature and fix these overriding if you prefer?
Else feel free to continue :)
synchronized with master.
Logic is good, just need to find a better way to display them.
@timotheegiet what do you think we can do for the layout?
Do you have an idea for a potential button to set as "display the taken pieces"?
Then, I would suggest a single line/column with all taken pieces (separated by colors), that should take less room as it would be nice to still have the board displayed.
Else, having a pop up that fills the whole screen should do it
Like I said in previous comment, I'd like to have the list of taken pieces in a separate pop-up view.
For this I would add a new button with a new icon (here is a proposal).
Clicking the button opens a pop-up with a title "Captured pieces", and below two rectangles dividing the page (horizontally or vertically depending on the orientation), one for white pieces and the other for black pieces.
If one of the rectangles is empty, maybe display a message "No piece captured" in it (though that is not mandatory).
I'm planning to do it (except if you have "more" time). I already switched to add the button and the action in it, "there is just" to do the pop-up, I can provide the diff (let's discuss this tonight on irc directly).
Here are my little changes (adapted the overlay color and size, the captured pieces size, and add hide-on-click-overlay).
Fixed for 2 players mode.
Commited in https://commits.kde.org/gcompris/ce5d3f736b0ebd831c66da04a14eea6c7609a027