firmware+controller: Add generic in-game state
This commit is contained in:
		@@ -22,6 +22,7 @@ def main():
 | 
			
		||||
    h.pregame(RiotPlayerInfo.dummy(valorant=ValorantPlayerInfo(map='/Game/Maps/Bonsai/Bonsai')))
 | 
			
		||||
    h.match_found(RiotPlayerInfo.dummy(valorant=ValorantPlayerInfo()))
 | 
			
		||||
    h.pregame(RiotPlayerInfo.dummy(valorant=ValorantPlayerInfo()))
 | 
			
		||||
    h.game_generic(RiotPlayerInfo.dummy(valorant=ValorantPlayerInfo(queue_type='ggteam')))
 | 
			
		||||
 | 
			
		||||
    h.service()
 | 
			
		||||
  finally:
 | 
			
		||||
 
 | 
			
		||||
@@ -319,6 +319,24 @@ class HIDValconomyHandler(ValconomyHandler):
 | 
			
		||||
  def pregame(self, info: RiotPlayerInfo):
 | 
			
		||||
    self._enq(5, 1 if info.valorant.map == '/Game/Maps/Bonsai/Bonsai' else 0, fmt='B')
 | 
			
		||||
 | 
			
		||||
  def game_generic(self, info: RiotPlayerInfo):
 | 
			
		||||
    match info.valorant.queue_type:
 | 
			
		||||
      case 'hurm': # tdm
 | 
			
		||||
        gm = 0
 | 
			
		||||
      case 'deathmatch':
 | 
			
		||||
        gm = 1
 | 
			
		||||
      case 'ggteam': # escalation
 | 
			
		||||
        gm = 2
 | 
			
		||||
      case 'spikerush':
 | 
			
		||||
        gm = 3
 | 
			
		||||
      case _:
 | 
			
		||||
        if info.valorant.max_party_size == 12: # custom
 | 
			
		||||
          gm = 4
 | 
			
		||||
        else:
 | 
			
		||||
          gm = 5
 | 
			
		||||
 | 
			
		||||
    self._enq(6, gm, fmt='B')
 | 
			
		||||
 | 
			
		||||
class GameState(Enum):
 | 
			
		||||
  NONE = 0
 | 
			
		||||
  MENU = 1
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user