mirror of
https://github.com/ysoftdevs/pf2015.git
synced 2026-03-20 00:05:12 +01:00
fix level counter
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#levelSelector {
|
#levelSelector {
|
||||||
max-width: 24em;
|
max-width: 21em;
|
||||||
margin-left:auto;
|
margin-left:auto;
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ angular.module('level-selector', ['LocalStorageModule'])
|
|||||||
{state:'locked', text:'6'},
|
{state:'locked', text:'6'},
|
||||||
{state:'locked', text:'7'},
|
{state:'locked', text:'7'},
|
||||||
{state:'locked', text:'8'},
|
{state:'locked', text:'8'},
|
||||||
{state:'locked', text:'9'},
|
{state:'locked', text:'PF'},
|
||||||
{state:'locked', text:'10'},
|
|
||||||
{state:'locked', text:'11'},
|
|
||||||
{state:'locked', text:'12'},
|
|
||||||
{state:'locked', text:'PF'}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$scope.startLevel = function(state, levelIndex) {
|
$scope.startLevel = function(state, levelIndex) {
|
||||||
@@ -62,7 +58,12 @@ angular.module('level-selector', ['LocalStorageModule'])
|
|||||||
if (!value) {
|
if (!value) {
|
||||||
$scope.storeConfiguration();
|
$scope.storeConfiguration();
|
||||||
} else {
|
} else {
|
||||||
$scope.levelLock = value;
|
// Load only state. Do not load titles or more items than are available.
|
||||||
|
var limit = Math.min(value.length, $scope.levelLock.length);
|
||||||
|
|
||||||
|
for (var index = 0; index < limit; index++) {
|
||||||
|
$scope.levelLock[index]['state'] = value[index]['state'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,8 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
* chainLength - How many cards must be found from the same kind
|
* chainLength - How many cards must be found from the same kind
|
||||||
* cardType - Define type of game
|
* cardType - Define type of game
|
||||||
* - picture - display image of item
|
* - picture - display image of item
|
||||||
* - "languageCode" - display text in specified language
|
* - key - display ID as text
|
||||||
* - oneLanguage - pickup one language for each card on the beginning of game
|
* - "name" - use text field from card set
|
||||||
* - randomLanguage - each turn of card selects different language for the same item
|
|
||||||
*/
|
*/
|
||||||
$scope.levels = [
|
$scope.levels = [
|
||||||
{
|
{
|
||||||
@@ -92,47 +91,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
cardSet: alphabetCards,
|
cardSet: alphabetCards,
|
||||||
cardTypes: ['key', 'morse']
|
cardTypes: ['key', 'morse']
|
||||||
},/* {
|
|
||||||
levelName: "09: Picture + Word",
|
|
||||||
totalCards: 4*4,
|
|
||||||
cardsPerRow: 4,
|
|
||||||
chainLength: 2,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'en-US']
|
|
||||||
}, {
|
}, {
|
||||||
levelName: "10: Foreign Word",
|
|
||||||
totalCards: 4*4,
|
|
||||||
cardsPerRow: 4,
|
|
||||||
chainLength: 2,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'oneLanguage']
|
|
||||||
}, {
|
|
||||||
levelName: "10: Random Word",
|
|
||||||
totalCards: 4*4,
|
|
||||||
cardsPerRow: 4,
|
|
||||||
chainLength: 2,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'randomLanguage']
|
|
||||||
}, {
|
|
||||||
totalCards: 3*3,
|
|
||||||
cardsPerRow: 3,
|
|
||||||
chainLength: 3,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'picture', 'picture']
|
|
||||||
}, {
|
|
||||||
totalCards: 3*3,
|
|
||||||
cardsPerRow: 3,
|
|
||||||
chainLength: 3,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'randomLanguage', 'randomLanguage']
|
|
||||||
}, {
|
|
||||||
levelName: "10: Grand MIX",
|
|
||||||
totalCards: 5*5,
|
|
||||||
cardsPerRow: 5,
|
|
||||||
chainLength: 2,
|
|
||||||
cardSet: basicCards,
|
|
||||||
cardTypes: ['picture', 'randomLanguage', 'randomLanguage', 'randomLanguage']
|
|
||||||
},*/ {
|
|
||||||
levelName: "Finale",
|
levelName: "Finale",
|
||||||
totalCards: 7*1,
|
totalCards: 7*1,
|
||||||
cardsPerRow: 7,
|
cardsPerRow: 7,
|
||||||
|
|||||||
Reference in New Issue
Block a user