Compare commits

..

2 Commits
1.3.2 ... 1.3.3

Author SHA1 Message Date
Vasyl Horbachenko
f9c1dd980b spamram for fa18; non-randomized groups vertical separation on spawn; argument to affect DCS folder selection 2018-08-04 04:35:27 +03:00
Vasyl Horbachenko
74c1861240 build archieve tool 2018-07-31 23:40:35 +03:00
8 changed files with 83 additions and 16 deletions

View File

@@ -2,6 +2,7 @@
import os
import sys
import dcs
import logging
import theater.caucasus
import theater.persiangulf
@@ -14,11 +15,13 @@ import ui.corruptedsavemenu
from game.game import Game
from theater import start_generator
from userdata import persistency, logging
from userdata import persistency, logging as logging_module
persistency.setup(sys.argv[1])
dcs.planes.FlyingType.payload_dirs.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads"))
dcs.planes.FlyingType.payload_dirs = [os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads")]
logging_module.setup_version_string(sys.argv[2])
logging.info("Using {} as userdata folder".format(persistency.base_path()))
def proceed_to_main_menu(game: Game):

View File

@@ -343,7 +343,7 @@ Payload will be used for operation of following type, "*" category will be used
"""
PLANE_PAYLOAD_OVERRIDES = {
FA_18C_hornet: {
"*": "AIM-9M*6, AIM-7M*2, FUEL*3",
"*": "AIM-120*4,AIM-9*2,AIM-7*2,Fuel",
},
Su_33: {

View File

@@ -37,14 +37,18 @@ TRANSPORT_LANDING_ALT = 1000
DEFENCE_ENGAGEMENT_MAX_DISTANCE = 60000
INTERCEPT_MAX_DISTANCE = 200000
GROUP_VERTICAL_OFFSET = 300
class AircraftConflictGenerator:
escort_targets = [] # type: typing.List[typing.Tuple[PlaneGroup, int]]
vertical_offset = None # type: int
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings):
self.m = mission
self.settings = settings
self.conflict = conflict
self.vertical_offset = 0
self.escort_targets = []
def _start_type(self) -> StartType:
@@ -123,11 +127,12 @@ class AircraftConflictGenerator:
assert count > 0
assert unit is not None
self.vertical_offset += GROUP_VERTICAL_OFFSET
if unit_type in helicopters.helicopter_map.values():
alt = WARM_START_HELI_ALT + random.randint(50, 200)
alt = WARM_START_HELI_ALT + self.vertical_offset
speed = WARM_START_HELI_AIRSPEED
else:
alt = WARM_START_ALTITUDE + random.randint(50, 800)
alt = WARM_START_ALTITUDE + self.vertical_offset
speed = WARM_START_AIRSPEED
pos = Point(at.x + random.randint(100, 1000), at.y + random.randint(100, 1000))

View File

@@ -0,0 +1,52 @@
import os
from zipfile import *
IGNORED_PATHS = [
"__pycache__",
".gitignore",
".gitmodules",
".git",
".idea",
".DS_Store",
"submodules",
"build",
"venv",
]
VERSION = "1.3.3"
def _zip_dir(archieve, path):
for path, directories, files in os.walk(path):
is_ignored = False
for ignored_path in IGNORED_PATHS:
if ignored_path in path:
is_ignored = True
break
if is_ignored:
continue
for file in files:
if file in IGNORED_PATHS:
continue
archieve.write(os.path.join(path, file))
def _mk_archieve():
path = os.path.join("build", "dcs_liberation_{}.zip".format(VERSION))
if os.path.exists(path):
print("version already exists")
return
archieve = ZipFile(path, "w")
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
_zip_dir(archieve, ".")
os.chdir("submodules\\dcs")
_zip_dir(archieve, "dcs")
_mk_archieve()

View File

@@ -1 +0,0 @@
py.exe __init__.py "%UserProfile%"

View File

@@ -6,11 +6,7 @@ from io import StringIO
from tkinter import *
from tkinter.scrolledtext import *
if "-stdout" in sys.argv:
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
else:
log_stream = StringIO()
logging.basicConfig(stream=log_stream, level=logging.INFO)
_version_string = None
def _error_prompt():
@@ -29,5 +25,16 @@ def _handle_exception(self, exception: BaseException, *args):
_error_prompt()
Tk.report_callback_exception = _handle_exception
logging.info("DCS Libration 1.3 RC2")
def setup_version_string(str):
global _version_string
_version_string = str
if "--stdout" in sys.argv:
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
else:
log_stream = StringIO()
logging.basicConfig(stream=log_stream, level=logging.INFO)
Tk.report_callback_exception = _handle_exception
logging.info("DCS Libration {}".format(_version_string))

View File

@@ -2,6 +2,7 @@ import logging
import typing
import pickle
import os
import sys
import shutil
_user_folder = None # type: str
@@ -17,7 +18,7 @@ def base_path() -> str:
assert _user_folder
openbeta_path = os.path.join(_user_folder, "Saved Games", "DCS.openbeta")
if os.path.exists(openbeta_path):
if "--force-stable-DCS" not in sys.argv and os.path.exists(openbeta_path):
return openbeta_path
else:
return os.path.join(_user_folder, "Saved Games", "DCS")