mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Merge
This commit is contained in:
commit
7ca435337f
11
.gitignore
vendored
11
.gitignore
vendored
@ -10,13 +10,4 @@ a.py
|
||||
resources/tools/a.miz
|
||||
tests/**
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
.idea/misc.xml
|
||||
.idea/*.iml
|
||||
*.iml
|
||||
.idea
|
||||
.idea/*.xml
|
||||
.idea/**/*.xml
|
||||
.idea/
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "submodules/dcs"]
|
||||
path = submodules/dcs
|
||||
url = https://github.com/pydcs/dcs
|
||||
38
a.py
38
a.py
@ -1,38 +0,0 @@
|
||||
from theater.caucasus import *
|
||||
from gen.conflictgen import Conflict
|
||||
|
||||
from matplotlib import pyplot
|
||||
from matplotlib import lines
|
||||
from shapely import geometry
|
||||
from shapely.geometry import Polygon
|
||||
from descartes.patch import PolygonPatch
|
||||
|
||||
def put_lines(ls, ax):
|
||||
for g in ls.geoms:
|
||||
ax.plot([g.xy[0][0], g.xy[0][1]], [g.xy[1][0], g.xy[1][1]])
|
||||
|
||||
cau = CaucasusTheater()
|
||||
#left, heading, dist = Conflict.frontline_vector(cau.soganlug, cau.kutaisi, cau)
|
||||
#right = left.point_from_heading(heading, dist)
|
||||
|
||||
left, heading = Conflict.frontline_position(cau, cau.soganlug, cau.kutaisi)
|
||||
right = left.point_from_heading(heading+90, 80000)
|
||||
left = left.point_from_heading(heading-90, 80000)
|
||||
|
||||
line = geometry.LineString([(left.x, left.y), (right.x, right.y)])
|
||||
line = line.intersection(cau.land_poly)
|
||||
|
||||
fig = pyplot.figure(1, figsize=(20, 20), dpi=90)
|
||||
ax = fig.add_subplot(121)
|
||||
ax.set_ylim([0, 1500000])
|
||||
ax.set_xlim([-600000, 400000])
|
||||
|
||||
patch = PolygonPatch(cau.land_poly, facecolor=(0, 0, 0), edgecolor=(0, 0, 0), alpha=0.5, zorder=2)
|
||||
ax.add_patch(patch)
|
||||
ax.plot([left.x, right.x], [left.y, right.y], 'k-', lw=2)
|
||||
|
||||
ax.plot([cau.soganlug.position.x, cau.soganlug.position.x+1000], [cau.soganlug.position.y, cau.soganlug.position.y+1000], lw=5)
|
||||
ax.plot([cau.kutaisi.position.x, cau.kutaisi.position.x+1000], [cau.kutaisi.position.y, cau.kutaisi.position.y+1000], lw=5)
|
||||
put_lines(line, ax)
|
||||
pyplot.show()
|
||||
|
||||
@ -3,38 +3,47 @@
|
||||
block_cipher = None
|
||||
|
||||
|
||||
a = Analysis(['__init__.py'],
|
||||
pathex=['C:\\Users\\shdwp\\PycharmProjects\\dcs_liberation'],
|
||||
binaries=[],
|
||||
datas=[
|
||||
('resources', 'resources'),
|
||||
('submodules/dcs/dcs/terrain/caucasus.p', 'dcs/terrain/'),
|
||||
('submodules/dcs/dcs/terrain/nevada.p', 'dcs/terrain/'),
|
||||
],
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
noarchive=False)
|
||||
pyz = PYZ(a.pure, a.zipped_data,
|
||||
cipher=block_cipher)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
icon="resources/icon.ico",
|
||||
exclude_binaries=True,
|
||||
name='liberation_main',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=True )
|
||||
coll = COLLECT(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='dcs_liberation')
|
||||
analysis = Analysis(
|
||||
['__init__.py'],
|
||||
pathex=['.'],
|
||||
binaries=[],
|
||||
datas=[
|
||||
('resources', 'resources'),
|
||||
('resources/caucasus.p', 'dcs/terrain/'),
|
||||
('resources/nevada.p', 'dcs/terrain/'),
|
||||
],
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
pyz = PYZ(
|
||||
analysis.pure,
|
||||
analysis.zipped_data,
|
||||
cipher=block_cipher,
|
||||
)
|
||||
exe = EXE(
|
||||
pyz,
|
||||
analysis.scripts,
|
||||
[],
|
||||
icon="resources/icon.ico",
|
||||
exclude_binaries=True,
|
||||
name='liberation_main',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=True,
|
||||
)
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
analysis.binaries,
|
||||
analysis.zipfiles,
|
||||
analysis.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='dcs_liberation',
|
||||
)
|
||||
|
||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
pygame
|
||||
pydcs>=0.9.3
|
||||
pyinstaller
|
||||
BIN
resources/caucasus.p
Normal file
BIN
resources/caucasus.p
Normal file
Binary file not shown.
BIN
resources/nevada.p
Normal file
BIN
resources/nevada.p
Normal file
Binary file not shown.
@ -7,12 +7,10 @@ from zipfile import *
|
||||
IGNORED_PATHS = [
|
||||
"__pycache__",
|
||||
".gitignore",
|
||||
".gitmodules",
|
||||
".git",
|
||||
".idea",
|
||||
".DS_Store",
|
||||
"submodules",
|
||||
|
||||
"requirements.txt",
|
||||
"build",
|
||||
"venv",
|
||||
]
|
||||
@ -38,18 +36,19 @@ def _zip_dir(archieve, path):
|
||||
|
||||
|
||||
def _mk_archieve():
|
||||
path = os.path.join("build", "dcs_liberation_{}.zip".format(VERSION))
|
||||
path = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "build", "dcs_liberation_{}.zip".format(VERSION))
|
||||
if os.path.exists(path):
|
||||
print("version already exists")
|
||||
return
|
||||
|
||||
shutil.rmtree("./dist")
|
||||
|
||||
try:
|
||||
shutil.rmtree("./dist")
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
os.system("pyinstaller.exe pyinstaller.spec")
|
||||
|
||||
archieve = ZipFile(path, "w")
|
||||
archieve.writestr("dcs_liberation.bat", "cd dist\\dcs_liberation\r\nliberation_main \"%UserProfile%\\Saved Games\" \"{}\"".format(VERSION))
|
||||
_zip_dir(archieve, "./dist/dcs_liberation")
|
||||
|
||||
|
||||
_mk_archieve()
|
||||
_mk_archieve()
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 4fbb7ad3e0e2eecedc4e1dd14f2eb18025fef9f5
|
||||
Loading…
x
Reference in New Issue
Block a user