add event on Help
Co-authored-by: Alberto Xamin <alberto@xamin.it>
This commit is contained in:
		
							parent
							
								
									b779cb21d0
								
							
						
					
					
						commit
						19a8dcc17c
					
				| @ -435,5 +435,21 @@ def get_characters(sid): | ||||
|     cards = ch.all_characters(['dodge_city']) | ||||
|     sio.emit('characters_info', room=sid, data=json.dumps(cards, default=lambda o: o.__dict__)) | ||||
| 
 | ||||
| @sio.event | ||||
| def get_highnooncards(sid): | ||||
|     import bang.expansions.high_noon.card_events as ceh | ||||
|     chs = [] | ||||
|     chs.extend(ceh.get_all_events()) | ||||
|     chs.append(ceh.get_endgame_card()) | ||||
|     sio.emit('highnooncards_info', room=sid, data=json.dumps(chs, default=lambda o: o.__dict__)) | ||||
| 
 | ||||
| @sio.event | ||||
| def get_foccards(sid): | ||||
|     import bang.expansions.fistful_of_cards.card_events as ce | ||||
|     chs = [] | ||||
|     chs.extend(ce.get_all_events()) | ||||
|     chs.append(ce.get_endgame_card()) | ||||
|     sio.emit('foccards_info', room=sid, data=json.dumps(chs, default=lambda o: o.__dict__)) | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     eventlet.wsgi.server(eventlet.listen(('', 5001)), app) | ||||
|  | ||||
| @ -75,6 +75,24 @@ | ||||
| 				</div> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 		<h2 id="highnooncards">{{$t('help.highnooncards')}}</h2> | ||||
| 		<div> | ||||
| 			<div v-for="(c, i) in highnooncards" v-bind:key="c.name ? (c.name+c.number) : i" style="display:flex"> | ||||
| 				<Card :card="c" :class="'high-noon last-event'" @pointerenter.native="''" @pointerleave.native="''"/> | ||||
| 				<div style="margin-left:6pt;"> | ||||
| 					<p>{{$t(`cards.${c.name}.desc`)}}</p> | ||||
| 				</div> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 		<h2 id="foccards">{{$t('help.foccards')}}</h2> | ||||
| 		<div> | ||||
| 			<div v-for="(c, i) in foccards" v-bind:key="c.name ? (c.name+c.number) : i" style="display:flex"> | ||||
| 				<Card :card="c" :class="'fistful-of-cards last-event'" @pointerenter.native="''" @pointerleave.native="''"/> | ||||
| 				<div style="margin-left:6pt;"> | ||||
| 					<p>{{$t(`cards.${c.name}.desc`)}}</p> | ||||
| 				</div> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 	</div> | ||||
| </template> | ||||
| <script> | ||||
| @ -91,6 +109,8 @@ export default { | ||||
| 		}, | ||||
| 		cards: [], | ||||
| 		characters: [], | ||||
| 		highnooncards: [], | ||||
| 		foccards: [], | ||||
| 	}), | ||||
| 	computed: { | ||||
| 		endTurnCard() { | ||||
| @ -110,10 +130,22 @@ export default { | ||||
| 				is_character:true, | ||||
| 			})) | ||||
| 		}, | ||||
| 		highnooncards_info(cardsJson) { | ||||
| 			this.highnooncards = JSON.parse(cardsJson).map(x=>({ | ||||
| 				...x, | ||||
| 			})) | ||||
| 		}, | ||||
| 		foccards_info(cardsJson) { | ||||
| 			this.foccards = JSON.parse(cardsJson).map(x=>({ | ||||
| 				...x, | ||||
| 			})) | ||||
| 		}, | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		this.$socket.emit('get_cards') | ||||
| 		this.$socket.emit('get_characters') | ||||
| 		this.$socket.emit('get_highnooncards') | ||||
| 		this.$socket.emit('get_foccards') | ||||
| 		document.getElementById('help').scrollIntoView(); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -596,6 +596,8 @@ | ||||
|     "outlaw": "Outlaw", | ||||
|     "sheriff": "Sheriff", | ||||
|     "allcharacters": "All characters", | ||||
|     "gotoallcharacters": "Jump to all characters" | ||||
|     "gotoallcharacters": "Jump to all characters", | ||||
|     "highnooncards": "High Noon - Event Cards", | ||||
|     "foccards": "Fistful of Cards - Event Cards" | ||||
|   } | ||||
| } | ||||
| @ -596,6 +596,8 @@ | ||||
|     "renegade": "Rinnegato", | ||||
|     "vice": "Vice", | ||||
|     "gotoallcharacters": "Visualizza tutti i personaggi", | ||||
|     "allcharacters": "Tutti i personaggi" | ||||
|     "allcharacters": "Tutti i personaggi", | ||||
|     "highnooncards": "Carte Evento High Noon", | ||||
|     "foccards": "Carte Evento Fistful of Cards" | ||||
|   } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Giulio
						Giulio