mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Refactor the mod select changes, re-add accidentally deleted factions.
This commit is contained in:
@@ -19,8 +19,8 @@ from game.data.weapons import (
|
||||
Weapon,
|
||||
)
|
||||
from game.profiling import logged_duration
|
||||
from game.settings import ModSettings, Settings
|
||||
from game.theater.start_generator import GameGenerator, GeneratorSettings
|
||||
from game.settings import Settings
|
||||
from game.theater.start_generator import GameGenerator, GeneratorSettings, ModSettings
|
||||
from qt_ui import (
|
||||
liberation_install,
|
||||
liberation_theme,
|
||||
|
||||
@@ -24,8 +24,8 @@ class QFactionsInfos(QGroupBox):
|
||||
|
||||
def setGame(self, game: Game):
|
||||
if game is not None:
|
||||
self.player_name.setText(game.player_name)
|
||||
self.enemy_name.setText(game.enemy_name)
|
||||
self.player_name.setText(game.player_faction.name)
|
||||
self.enemy_name.setText(game.enemy_faction.name)
|
||||
else:
|
||||
self.player_name.setText("")
|
||||
self.enemy_name.setText("")
|
||||
|
||||
@@ -267,8 +267,8 @@ class QTopPanel(QFrame):
|
||||
closest_cps[0],
|
||||
closest_cps[1],
|
||||
self.game.theater.controlpoints[0].position,
|
||||
self.game.player_name,
|
||||
self.game.enemy_name,
|
||||
self.game.player_faction.name,
|
||||
self.game.enemy_faction.name,
|
||||
)
|
||||
|
||||
unit_map = self.game.initiate_event(game_event)
|
||||
|
||||
@@ -10,8 +10,9 @@ from PySide2.QtWidgets import QVBoxLayout, QTextEdit, QLabel, QCheckBox
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
|
||||
from game import db
|
||||
from game.settings import Settings, ModSettings
|
||||
from game.theater.start_generator import GameGenerator, GeneratorSettings
|
||||
from game.settings import Settings
|
||||
from game.theater.start_generator import GameGenerator, GeneratorSettings, ModSettings
|
||||
from game.factions.faction import Faction
|
||||
from qt_ui.widgets.QLiberationCalendar import QLiberationCalendar
|
||||
from qt_ui.widgets.spinsliders import TenthsSpinSlider, TimeInputs, CurrencySpinner
|
||||
from qt_ui.windows.newgame.QCampaignList import (
|
||||
@@ -112,8 +113,8 @@ class NewGameWizard(QtWidgets.QWizard):
|
||||
high_digit_sams=self.field("high_digit_sams"),
|
||||
)
|
||||
|
||||
blue_faction = [c for c in db.FACTIONS][self.field("blueFaction")]
|
||||
red_faction = [c for c in db.FACTIONS][self.field("redFaction")]
|
||||
blue_faction = self.faction_selection_page.selected_blue_faction
|
||||
red_faction = self.faction_selection_page.selected_red_faction
|
||||
generator = GameGenerator(
|
||||
blue_faction,
|
||||
red_faction,
|
||||
@@ -258,6 +259,14 @@ class FactionSelection(QtWidgets.QWizardPage):
|
||||
self.blueFactionDescription.setText(blue_faction_txt)
|
||||
self.redFactionDescription.setText(red_faction_txt)
|
||||
|
||||
@property
|
||||
def selected_blue_faction(self) -> Faction:
|
||||
return db.FACTIONS[self.blueFactionSelect.currentText()]
|
||||
|
||||
@property
|
||||
def selected_red_faction(self) -> Faction:
|
||||
return db.FACTIONS[self.redFactionSelect.currentText()]
|
||||
|
||||
|
||||
class TheaterConfiguration(QtWidgets.QWizardPage):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user