fix level counter

This commit is contained in:
Juraj Michalek
2014-12-30 09:53:05 +00:00
parent a45c6f72e0
commit c4e8ccae42
3 changed files with 10 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
#levelSelector {
max-width: 24em;
max-width: 21em;
margin-left:auto;
margin-right:auto;
}

View File

@@ -12,11 +12,7 @@ angular.module('level-selector', ['LocalStorageModule'])
{state:'locked', text:'6'},
{state:'locked', text:'7'},
{state:'locked', text:'8'},
{state:'locked', text:'9'},
{state:'locked', text:'10'},
{state:'locked', text:'11'},
{state:'locked', text:'12'},
{state:'locked', text:'PF'}
{state:'locked', text:'PF'},
];
$scope.startLevel = function(state, levelIndex) {
@@ -62,7 +58,12 @@ angular.module('level-selector', ['LocalStorageModule'])
if (!value) {
$scope.storeConfiguration();
} 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'];
}
}
};

View File

@@ -29,9 +29,8 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
* chainLength - How many cards must be found from the same kind
* cardType - Define type of game
* - picture - display image of item
* - "languageCode" - display text in specified language
* - oneLanguage - pickup one language for each card on the beginning of game
* - randomLanguage - each turn of card selects different language for the same item
* - key - display ID as text
* - "name" - use text field from card set
*/
$scope.levels = [
{
@@ -92,47 +91,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
chainLength: 2,
cardSet: alphabetCards,
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",
totalCards: 7*1,
cardsPerRow: 7,