这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openage/convert/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .service.init.conversion_required import conversion_required
from .service.init.mount_asset_dirs import mount_asset_dirs
from .tool.interactive import interactive_browser
from .tool.subtool.acquire_sourcedir import acquire_conversion_source_dir
from .tool.subtool.acquire_sourcedir import acquire_conversion_source_dir, wanna_convert
from .tool.subtool.version_select import get_game_version


Expand Down Expand Up @@ -175,7 +175,7 @@ def main(args, error):
from ..assets import get_asset_path
outdir = get_asset_path(args.output_dir)

if args.force or conversion_required(outdir, args):
if args.force or wanna_convert() or conversion_required(outdir, args):
if not convert_assets(outdir, args, srcdir):
return 1
else:
Expand Down
3 changes: 1 addition & 2 deletions openage/convert/service/init/conversion_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ def conversion_required(asset_dir, args):

Sets options in args according to what sorts of conversion are required.

TODO: Reimplement for new converter.
TODO: Reimplement change detection for new converter.
"""

version_path = asset_dir / 'converted' / changelog.ASSET_VERSION_FILENAME
# determine the version of assets
try:
Expand Down
18 changes: 18 additions & 0 deletions openage/convert/tool/subtool/acquire_sourcedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ def expand_relative_path(path):
return os.path.realpath(os.path.expandvars(os.path.expanduser(path)))


def wanna_convert():
"""
Ask the user if assets should be converted.
"""
answer = None
while answer is None:
print(" Do you want to convert assets? [Y/n]")

user_selection = input("> ")
if user_selection.lower() in {"yes", "y", ""}:
answer = True

elif user_selection.lower() in {"no", "n"}:
answer = False

return answer


def wanna_use_wine():
"""
Ask the user if wine should be used.
Expand Down
5 changes: 3 additions & 2 deletions openage/game/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2015-2019 the openage authors. See copying.md for legal info.
# Copyright 2015-2020 the openage authors. See copying.md for legal info.

"""
Holds the game entry point for openage.
"""

from ..convert.tool.subtool.acquire_sourcedir import wanna_convert
from ..log import err, info


Expand Down Expand Up @@ -56,7 +57,7 @@ def main(args, error):
root["cfg"].mount(get_config_path(args.cfg_dir))

# ensure that the assets have been converted
if conversion_required(root["assets"], args):
if wanna_convert() or conversion_required(root["assets"], args):
# try to get previously used source dir
asset_location_path = root["cfg"] / "asset_location"
try:
Expand Down