Oware: Add tutorial component and minor changes 1. Added tutorial component…

Authored by dmadaan on Jun 4 2017, 12:05 PM.

Description

Oware: Add tutorial component and minor changes 1. Added tutorial component, the position of buttons needs to be checked (the buttons are hidden under the bar) 2. Changed score items 3. Deleted unused images

Details

Committed
dmadaanJun 4 2017, 12:05 PM
Parents
R2:60cf5357ef9c: Oware: Minor fixes and additions 1. Added tutorial 2. Updated icon and renamed…
Branches
Unknown
Tags
Unknown
Restricted Application added a subscriber: jjazeix. · View Herald TranscriptJun 4 2017, 6:43 AM

1.For instructions, I have used an array but the problem with it probably we can't use qsTr with it? We have a better way?

  1. For vertical mode, along with board everything needs to be rotated? Will it just be horizontal activity then?
echarruau added inline comments.
/src/activities/oware/ActivityInfo.qml
26

You can replace Oware activity with "Oware with a friend" to keep Homogeneity with the way gcomprus does.
For your "against computer" activity you can call it "Oware against Tux"

/src/activities/oware/Oware.qml
79

in qml always add a space after a :

87

Please be more precise with the repeater name, as you or somebody else could have to use the name variable somewhere else in the code.
Here I would have called it cellGridRepeater if I got the sens of your code.

104

here I would add an id for the repeater to know what it does, or a comment.
Personnally I would add an nice id variable which says what it does.

110

always add a space after the , in this case

/src/activities/oware/Tutorial.qml
46

here you added a space which is not needed
width: Math.min(implicitWidth, 0.8 * parent.width )
should be
width: Math.min(implicitWidth, 0.8 * parent.width)

jjazeix added inline comments.Jun 4 2017, 8:16 PM
/src/activities/oware/Oware.qml
57

you shouldn't have this much items related to the tutorial in the items.
You only need to do a visible = true at start (either here or in the js).
All the other can be set directly in the Tutorial item below

84

!tutorial.visible would be better to avoid a new variable

153

items.playerOneTurn = !items.playerOneTurn

158

I haven't tried but don't you still need the onReleased?
Maybe you can do it with the pressed property (http://doc.qt.io/qt-5/qml-qtquick-mousearea.html#pressed-prop) with a ternary directly in the src property. It should be easier.

164

I would define there the text and images. Something like:
[ { "text": qsTr("text1"), "image": "qrc:./...1" },
{ "text": qsTr("text2"), "image": "qrc:./...2" }...]
so the length would be the array size

/src/activities/oware/Tutorial.qml
25

shouldn't be needed

30

I haven't tested it so my comment why having a background of guesscount? Wouldn't having a transparent background with the activity behind enough? You can capture the clicks so it won't update the game behind

31

you should not access items from Tutorial

49

you only need to change the visible of the higher item not of all the items

51

it shouldn't be inside the GCText but the main object. But you don't need this property as you will use an Array to store the texts :)

84

qsTr()

134

3 shouldn't be hardcoded, you can use the length of the Array once you have it :)

139

qsTr()

193

qsTr()

201

I would call it skipTutorial instead of tutorialSkip

234

you can use the array directly once you have it instead of hardcode the folder path

/src/activities/oware/oware.js
35

showTutorial would be better. But do you need it if the visible is true by default on the qml? You can check by starting the activity, closing the tutorial, leaving the activity and re-enter it?

dmadaan added inline comments.Jun 5 2017, 7:20 AM
/src/activities/oware/ActivityInfo.qml
26

Oware will contain the core, and oware2friends will be added later inherited from it :)