# wot-public-mods/battle-hits architecture

> Architecture diagram of the GitHub repository wot-public-mods/battle-hits, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wot-public-mods/battle-hits
- Repository: https://github.com/wot-public-mods/battle-hits

## Overview

BattleHits is a World of Tanks lobby mod for reviewing shots dealt by or received by the player, including past battles loaded from replay files. The main workflow captures in-battle shot events, maintains battle history and selected-hit data, transforms these into lobby data providers, and displays them in the battle and hit panels; selecting a hit also drives a 3D vehicle-and-impact presentation in the hangar. Settings control hit direction and hangar behavior. The graph reflects the README and sampled sources; several controller implementations and replay-storage details are represented only by their exact tree paths.

Main entry points: [`python/gui/battlehits/views/BattleHitsMainView.py`](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsMainView.py) (Battle View), [`python/gui/battlehits/controllers/HangarScene.py`](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/HangarScene.py) (Hangar Scene), [`python/gui/battlehits/hooks.py`](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/hooks.py) (Game Hooks), [`python/gui/battlehits/data/Hits.py`](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/Hits.py) (Hit Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Battle Capture"]
  node_mod["Mod Entry<br/>[mod_battlehits.py]"]
  node_hooks["Game Hooks<br/>[hooks.py]"]
  node_processor["Battle Processor<br/>[BattleProcessor.py]"]
end

subgraph group_domain["Battle Data"]
  node_history["Battle History<br/>[BattlesHistory.py]"]
  node_current["Current Battle<br/>[CurrentBattle.py]"]
  node_battles["Battle Data<br/>[Battles.py]"]
  node_hits["Hit Data<br/>[Hits.py]"]
end

subgraph group_lobby["Lobby Experience"]
  node_state["View State<br/>[State.py]"]
  node_settings["Preferences<br/>[Settings.py]"]
  node_mainview["Battle View"]
  node_header["Hits Header"]
  node_prefview["Preferences View"]
  node_flashui["Battle UI<br/>[DOMDocument.xml]"]
  node_headerjs["Header Tabs"]
end

subgraph group_hangar["Hangar Review"]
  node_hangar["Hangar Scene<br/>[HangarScene.py]"]
  node_vehicle["Preview Vehicle<br/>[Vehicle.py]"]
end

subgraph group_assets["Game Assets"]
  node_shells["Shell Models"]
  node_effects["Impact Effects"]
end

node_player(("Player"))
node_wot["World of Tanks"]

node_player -->|"plays battles"| node_wot
node_wot -->|"emits shot events"| node_hooks
node_mod -->|"loads mod"| node_hooks
node_hooks -->|"processes shots"| node_processor
node_processor -->|"updates battle"| node_current
node_history -->|"provides history"| node_battles
node_current -->|"provides hit data"| node_hits
node_battles -->|"supplies battle list"| node_mainview
node_hits -->|"supplies hit list"| node_mainview
node_mainview -->|"updates panels"| node_flashui
node_mainview -->|"selects battle and hit"| node_state
node_player -->|"reviews results"| node_mainview
node_header -->|"updates hit direction"| node_settings
node_header -->|"renders tabs"| node_headerjs
node_headerjs -->|"opens popover"| node_prefview
node_prefview -->|"updates preferences"| node_settings
node_settings -->|"controls hit direction"| node_hits
node_state -->|"selects impact"| node_hangar
node_hangar -->|"positions hit"| node_vehicle
node_hangar -->|"loads shell models"| node_shells
node_hangar -->|"loads impact effects"| node_effects
node_wot -.->|"provides replay battles"| node_history

click node_mod "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/mods/mod_battlehits.py"
click node_hooks "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/hooks.py"
click node_processor "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/BattleProcessor.py"
click node_history "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/BattlesHistory.py"
click node_current "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/CurrentBattle.py"
click node_battles "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/Battles.py"
click node_hits "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/Hits.py"
click node_state "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/State.py"
click node_settings "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/Settings.py"
click node_mainview "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsMainView.py"
click node_header "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsHeaderView.py"
click node_prefview "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsPreferencesPopover.py"
click node_flashui "https://github.com/wot-public-mods/battle-hits/blob/master/as3/battleHitsMainView/DOMDocument.xml"
click node_hangar "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/HangarScene.py"
click node_vehicle "https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/Vehicle.py"
click node_shells "https://github.com/wot-public-mods/battle-hits/tree/master/resources/in/content/battlehits/common/shells"
click node_effects "https://github.com/wot-public-mods/battle-hits/tree/master/resources/in/content/battlehits/style1"
click node_headerjs "https://github.com/wot-public-mods/battle-hits/blob/master/resources/in/gui/gameface/mods/poliroid/BattleHitsHeaderView/BattleHitsHeaderView.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mod,node_hooks,node_processor toneBlue
class node_history,node_current,node_battles,node_hits toneAmber
class node_state,node_settings,node_mainview,node_header,node_prefview,node_flashui,node_headerjs toneMint
class node_hangar,node_vehicle toneRose
class node_shells,node_effects,node_player,node_wot toneIndigo
```

## Components

### Battle Capture

- [Mod Entry](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/mods/mod_battlehits.py): `python/gui/mods/mod_battlehits.py`
- [Game Hooks](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/hooks.py): `python/gui/battlehits/hooks.py`
- [Battle Processor](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/BattleProcessor.py): `python/gui/battlehits/controllers/BattleProcessor.py`

### Battle Data

- [Battle History](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/BattlesHistory.py): `python/gui/battlehits/controllers/BattlesHistory.py`
- [Current Battle](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/CurrentBattle.py): `python/gui/battlehits/data/CurrentBattle.py`
- [Battle Data](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/Battles.py): `python/gui/battlehits/data/Battles.py`
- [Hit Data](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/data/Hits.py): `python/gui/battlehits/data/Hits.py`

### Lobby Experience

- [View State](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/State.py): `python/gui/battlehits/controllers/State.py`
- [Preferences](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/Settings.py): `python/gui/battlehits/controllers/Settings.py`
- [Battle View](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsMainView.py): `python/gui/battlehits/views/BattleHitsMainView.py`
- [Hits Header](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsHeaderView.py): `python/gui/battlehits/views/BattleHitsHeaderView.py`
- [Preferences View](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/views/BattleHitsPreferencesPopover.py): `python/gui/battlehits/views/BattleHitsPreferencesPopover.py`
- [Battle UI](https://github.com/wot-public-mods/battle-hits/blob/master/as3/battleHitsMainView/DOMDocument.xml): `as3/battleHitsMainView/DOMDocument.xml`
- [Header Tabs](https://github.com/wot-public-mods/battle-hits/blob/master/resources/in/gui/gameface/mods/poliroid/BattleHitsHeaderView/BattleHitsHeaderView.js): `resources/in/gui/gameface/mods/poliroid/BattleHitsHeaderView/BattleHitsHeaderView.js`

### Hangar Review

- [Hangar Scene](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/HangarScene.py): `python/gui/battlehits/controllers/HangarScene.py`
- [Preview Vehicle](https://github.com/wot-public-mods/battle-hits/blob/master/python/gui/battlehits/controllers/Vehicle.py): `python/gui/battlehits/controllers/Vehicle.py`

### Game Assets

- [Shell Models](https://github.com/wot-public-mods/battle-hits/tree/master/resources/in/content/battlehits/common/shells): `resources/in/content/battlehits/common/shells`
- [Impact Effects](https://github.com/wot-public-mods/battle-hits/tree/master/resources/in/content/battlehits/style1): `resources/in/content/battlehits/style1`

### Other components

- **Player**
- **World of Tanks**

## Connections

- Player → World of Tanks: plays battles
- World of Tanks → Game Hooks: emits shot events
- Mod Entry → Game Hooks: loads mod
- Game Hooks → Battle Processor: processes shots
- Battle Processor → Current Battle: updates battle
- Battle History → Battle Data: provides history
- Current Battle → Hit Data: provides hit data
- Battle Data → Battle View: supplies battle list
- Hit Data → Battle View: supplies hit list
- Battle View → Battle UI: updates panels
- Battle View → View State: selects battle and hit
- Player → Battle View: reviews results
- Hits Header → Preferences: updates hit direction
- Hits Header → Header Tabs: renders tabs
- Header Tabs → Preferences View: opens popover
- Preferences View → Preferences: updates preferences
- Preferences → Hit Data: controls hit direction
- View State → Hangar Scene: selects impact
- Hangar Scene → Preview Vehicle: positions hit
- Hangar Scene → Shell Models: loads shell models
- Hangar Scene → Impact Effects: loads impact effects
- World of Tanks → Battle History: provides replay battles
