mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
multiple changes
- load plugins when loading a game - moved plugins scripts to resources/plugins (for pyinstaller) - removed vanilla JTAC and JTAC_smoke options and settings GUI - call JtacAutolasePlugin in armor.py - made a dictionary of INSTALLED_PLUGINS - removed NIOD from the VEAF plugin
This commit is contained in:
@@ -28,6 +28,7 @@ from .event.event import Event, UnitsDeliveryEvent
|
||||
from .event.frontlineattack import FrontlineAttackEvent
|
||||
from .infos.information import Information
|
||||
from .settings import Settings
|
||||
from plugin import INSTALLED_PLUGINS
|
||||
|
||||
COMMISION_UNIT_VARIETY = 4
|
||||
COMMISION_LIMITS_SCALE = 1.5
|
||||
@@ -217,6 +218,11 @@ class Game:
|
||||
|
||||
def on_load(self) -> None:
|
||||
ObjectiveDistanceCache.set_theater(self.theater)
|
||||
|
||||
# set the settings in all plugins
|
||||
for pluginName in INSTALLED_PLUGINS:
|
||||
plugin = INSTALLED_PLUGINS[pluginName]
|
||||
plugin.setSettings(self.settings)
|
||||
|
||||
def pass_turn(self, no_action=False):
|
||||
logging.info("Pass turn")
|
||||
|
||||
@@ -148,7 +148,8 @@ class Operation:
|
||||
|
||||
if pluginName == None:
|
||||
pluginName = "custom"
|
||||
plugin_path = Path("./plugin",pluginName)
|
||||
plugin_path = Path("./resources/plugins",pluginName)
|
||||
logging.debug(f"plugin_path = {plugin_path}")
|
||||
|
||||
if scriptFile != None:
|
||||
scriptFile_path = Path(plugin_path, scriptFile)
|
||||
@@ -468,7 +469,8 @@ dcsLiberation.TargetPoints = {
|
||||
# Inject Plugins Lua Scripts and data
|
||||
self.listOfPluginsScripts = []
|
||||
|
||||
for plugin in INSTALLED_PLUGINS:
|
||||
for pluginName in INSTALLED_PLUGINS:
|
||||
plugin = INSTALLED_PLUGINS[pluginName]
|
||||
plugin.injectScripts(self)
|
||||
plugin.injectConfiguration(self)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from plugin import INSTALLED_PLUGINS
|
||||
|
||||
class Settings:
|
||||
|
||||
@@ -24,8 +25,6 @@ class Settings:
|
||||
self.sams = True # Legacy parameter do not use
|
||||
self.cold_start = False # Legacy parameter do not use
|
||||
self.version = None
|
||||
self.include_jtac_if_available = True
|
||||
self.jtac_smoke_on = True
|
||||
|
||||
# Performance oriented
|
||||
self.perf_red_alert_state = True
|
||||
@@ -42,5 +41,9 @@ class Settings:
|
||||
|
||||
# LUA Plugins system
|
||||
self.plugins = {}
|
||||
for pluginName in INSTALLED_PLUGINS:
|
||||
plugin = INSTALLED_PLUGINS[pluginName]
|
||||
plugin.setSettings(self)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user