mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-31 05:24:20 +00:00 
			
		
		
		
	ajout de l'option du choix d'impression pour toutes les bibliothèques + refonte des bibliothèques. fix #18
This commit is contained in:
		
							parent
							
								
									44b8729230
								
							
						
					
					
						commit
						65fa675c6f
					
				
					 11 changed files with 254 additions and 67 deletions
				
			
		|  | @ -5,6 +5,7 @@ export default { | |||
| 
 | ||||
|   state: { | ||||
|     magicItems: [], | ||||
|     notPrintedMagicItems: [] | ||||
|   }, | ||||
| 
 | ||||
|   getters: { | ||||
|  | @ -31,7 +32,12 @@ export default { | |||
| 			// Récupération des données utilisateurs depuis le navigateur
 | ||||
| 			if(localStorage.getItem('myMagicItems') && localStorage.getItem('myMagicItems') !== undefined) { | ||||
|         let localStorageData = JSON.parse(localStorage.getItem('myMagicItems')) | ||||
|         state.magicItems = localStorageData.magicItems | ||||
|         if (localStorageData.magicItems) { | ||||
|           state.magicItems = localStorageData.magicItems | ||||
|         } | ||||
|         if (localStorageData.notPrintedMagicItems) { | ||||
|           state.notPrintedMagicItems = localStorageData.notPrintedMagicItems | ||||
|         } | ||||
| 			} | ||||
| 		}, | ||||
|     setMagicItems: (state, payload) => { | ||||
|  | @ -58,6 +64,21 @@ export default { | |||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     setNotPrintedMagicItems: (state, payload) => { | ||||
|       state.notPrintedMagicItems = payload | ||||
|     }, | ||||
|     addNotPrintedMagicItem: (state, payload) => { | ||||
|       let magicItemIndex = state.notPrintedMagicItems.findIndex(magicItem => magicItem.key == payload.key) | ||||
|       if (!magicItemIndex >= 0) { | ||||
|         state.notPrintedMagicItems.push(payload) | ||||
|       } | ||||
|     }, | ||||
|     removeNotPrintedMagicItem: (state, payload) => { | ||||
|       let magicItemIndex = state.notPrintedMagicItems.findIndex(magicItem => magicItem.key == payload.key) | ||||
|       if (magicItemIndex >= 0) { | ||||
|         state.notPrintedMagicItems.splice(magicItemIndex, 1) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -5,6 +5,7 @@ export default { | |||
| 
 | ||||
|   state: { | ||||
|     monsters: [], | ||||
|     notPrintedMonsters: [] | ||||
|   }, | ||||
| 
 | ||||
|   getters: { | ||||
|  | @ -31,7 +32,12 @@ export default { | |||
| 			// Récupération des données utilisateurs depuis le navigateur
 | ||||
| 			if(localStorage.getItem('myMonsters') && localStorage.getItem('myMonsters') !== undefined) { | ||||
|         let localStorageData = JSON.parse(localStorage.getItem('myMonsters')) | ||||
|         state.monsters = localStorageData.monsters | ||||
|         if (localStorageData.monsters) { | ||||
|           state.monsters = localStorageData.monsters | ||||
|         } | ||||
|         if (localStorageData.notPrintedMonsters) { | ||||
|           state.notPrintedMonsters = localStorageData.notPrintedMonsters | ||||
|         } | ||||
| 			} | ||||
| 		}, | ||||
|     setMonsters: (state, payload) => { | ||||
|  | @ -58,6 +64,21 @@ export default { | |||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     setNotPrintedMonsters: (state, payload) => { | ||||
|       state.notPrintedMonsters = payload | ||||
|     }, | ||||
|     addNotPrintedMonster: (state, payload) => { | ||||
|       let monsterIndex = state.notPrintedMonsters.findIndex(monster => monster.key == payload.key) | ||||
|       if (!monsterIndex >= 0) { | ||||
|         state.notPrintedMonsters.push(payload) | ||||
|       } | ||||
|     }, | ||||
|     removeNotPrintedMonster: (state, payload) => { | ||||
|       let monsterIndex = state.notPrintedMonsters.findIndex(monster => monster.key == payload.key) | ||||
|       if (monsterIndex >= 0) { | ||||
|         state.notPrintedMonsters.splice(monsterIndex, 1) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maxime Moraine
						Maxime Moraine