Feature/generator (#13)

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* ..

* ..

* ..

* ..

* ..

* ..

* ..

* added many ui options

* stable

* release candidate
This commit is contained in:
spencershepard
2022-01-30 23:36:14 -08:00
committed by GitHub
parent 07c4afa947
commit 8cda007768
45 changed files with 2321 additions and 8743 deletions

View File

@@ -0,0 +1,5 @@
1) Place your .miz file in this directory.
2) Run embed_sounds.exe
3) A new file will be created in the same directory; a copy of your mission file with RotorOps sound files already embedded so you don't need to add manually.
Tip: You can use this tool to update your existing RotorOps missions with the current sound files.

View File

@@ -0,0 +1,37 @@
import dcs
import os
from tkinter import messagebox as mbox
mizfound = False
path = os.getcwd()
dir_list = os.listdir(path)
print("Looking for mission files in '", path, "' :")
for filename in dir_list:
if filename.endswith(".miz") and not filename == "template_source.miz" and not filename.startswith("SoundsAdded"):
mizfound = True
print("Attempting to add sound files to: " + filename)
m = dcs.mission.Mission()
m.load_file(filename)
# add all of our required sounds
os.chdir("../sound/embedded")
path = os.getcwd()
sound_file_list = os.listdir(path)
print("Attempting to add sound files from '", path, "' :")
for soundfilename in sound_file_list:
if soundfilename.endswith(".ogg"):
print("Adding " + soundfilename)
m.map_resource.add_resource_file(soundfilename)
continue
else:
continue
os.chdir("../../Generator")
m.save("SoundsAdded_" + filename)
if not mizfound:
print("No valid miz files found!")
mbox.showerror('No Source Files Found', 'Error: Place your .miz files in this directory before running the application.')

View File

@@ -0,0 +1,40 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['embed_sounds.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
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,
a.binaries,
a.zipfiles,
a.datas,
[],
name='embed_sounds',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )