Chess activity: display list of taken pieces
AbandonedPublic

Authored by jjazeix on Dec 11 2018, 2:55 PM.

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
smitpatil created this revision.Dec 11 2018, 2:55 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptDec 11 2018, 2:55 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
smitpatil requested review of this revision.Dec 11 2018, 2:55 PM

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.
Maybe be better if the Item is named TakenPiecesList, as it is the list of taken pieces that is displayed.

22 ↗(On Diff #47353)

2.6

jjazeix added a comment.EditedDec 11 2018, 7:41 PM

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.

smitpatil updated this revision to Diff 47461.Dec 12 2018, 3:14 PM
smitpatil marked 2 inline comments as done.
smitpatil updated this revision to Diff 47463.Dec 12 2018, 3:32 PM
jjazeix requested changes to this revision.Dec 12 2018, 8:08 PM

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).
Let's keep it this way, and we'll merge this patch once we have updated the minimal version of Qt.

This revision now requires changes to proceed.Dec 12 2018, 8:08 PM
smitpatil updated this revision to Diff 47512.Dec 13 2018, 1:19 PM
smitpatil marked an inline comment as done.Dec 13 2018, 1:24 PM
smitpatil added inline comments.
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 :)

jjazeix commandeered this revision.Oct 27 2019, 2:15 PM
jjazeix updated this revision to Diff 68833.
jjazeix edited reviewers, added: smitpatil; removed: jjazeix.
jjazeix marked an inline comment as done.

synchronized with master.
Logic is good, just need to find a better way to display them.

jjazeix added a comment.EditedOct 27 2019, 2:18 PM

@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).

Do you plan to do the changes to add the pop-up as I described, or should I do it?

Do you plan to do the changes to add the pop-up as I described, or should I do it?

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).

jjazeix updated this revision to Diff 69003.Oct 29 2019, 8:01 PM

use button

Here are my little changes (adapted the overlay color and size, the captured pieces size, and add hide-on-click-overlay).

This comment was removed by jjazeix.
jjazeix updated this revision to Diff 69025.Oct 30 2019, 7:38 AM

update from Timothée

jjazeix abandoned this revision.Nov 2 2019, 2:21 PM
jjazeix added a reviewer: GCompris: Improvements.