This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
hyde.py
58 lines (42 loc) · 1.68 KB
/
hyde.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import logging
from sys import exit
from typing import Any, Dict, Optional
import coloredlogs
from BlackOpsColdWar import BlackOpsColdWar
from ModernWarfare import ModernWarfare
from utility import Utility
from Vanguard import Vanguard
log: logging.Logger = logging.getLogger(__name__)
coloredlogs.install(level="INFO", fmt="[%(asctime)s] %(message)s", datefmt="%I:%M:%S")
class Hyde:
"""
Call of Duty XAsset compiler that transforms raw assets into
digestible data.
"""
def Initialize(self: Any) -> None:
"""Configure the application and begin its main functionality."""
print("Hyde: Call of Duty XAsset Compiler")
print("https://github.com/EthanC/Hyde\n")
self.config: Dict[str, Any] = Hyde.LoadConfiguration(self)
if self.config is None:
return
log.info("Loaded configuration")
if self.config["Vanguard"]["enabled"] is True:
self.Vanguard = Vanguard(self.config)
self.Vanguard.Compile()
if self.config["BlackOpsColdWar"]["enabled"] is True:
self.BlackOpsColdWar = BlackOpsColdWar(self.config)
self.BlackOpsColdWar.Compile()
if self.config["ModernWarfare"]["enabled"] is True:
self.ModernWarfare = ModernWarfare(self.config)
self.ModernWarfare.Compile()
def LoadConfiguration(self: Any) -> Dict[str, Any]:
"""Load the configurable values from config.json"""
config: Optional[Dict[str, Any]] = Utility.ReadFile(self, "config.json")
if config is not None:
return dict(config)
if __name__ == "__main__":
try:
Hyde.Initialize(Hyde)
except KeyboardInterrupt:
exit()