mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +01:00
This commit is contained in:
1 parent
4b16edbbee
commit
b8230cbf43
3 files changed
+24
-2
No files matched your search
@@ -277,6 +277,7 @@ class ConnectionManager:
|
|||||||
self.thread_man.show_cancel(False)
|
self.thread_man.show_cancel(False)
|
||||||
self.thread_man.update_dialog(waiting_for_launch)
|
self.thread_man.update_dialog(waiting_for_launch)
|
||||||
while True:
|
while True:
|
||||||
|
# FIXME: cancel should not be visible here per setting above
|
||||||
if self.controller.is_cancel_pending():
|
if self.controller.is_cancel_pending():
|
||||||
# TODO: some facility to also close spawned steam process
|
# TODO: some facility to also close spawned steam process
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Callable, TYPE_CHECKING, Union
|
from typing import Callable, TYPE_CHECKING, Union
|
||||||
|
|
||||||
@@ -7,10 +8,11 @@ from dzgui.api.mods import is_mission, get_custom_mods
|
|||||||
from dzgui.api.steam import launch_offline
|
from dzgui.api.steam import launch_offline
|
||||||
from dzgui.const.constants import APP_NAME, APPID_DAYZ_EXP
|
from dzgui.const.constants import APP_NAME, APPID_DAYZ_EXP
|
||||||
from dzgui.const.enum import Preferences
|
from dzgui.const.enum import Preferences
|
||||||
|
from dzgui.init.proc import is_dayz_running
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.strings import dialogs
|
from dzgui.strings import dialogs
|
||||||
from dzgui.util.symlink import create_custom_symlinks
|
from dzgui.util.symlink import create_custom_symlinks, symlink_mission
|
||||||
from dzgui.views.dialogs.filepicker import FolderPicker
|
from dzgui.views.dialogs.filepicker import FolderPicker
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -92,7 +94,15 @@ class OfflineManager:
|
|||||||
Path(steam_path), Path(custom_folder), custom_mods
|
Path(steam_path), Path(custom_folder), custom_mods
|
||||||
)
|
)
|
||||||
combined_mods.extend(new_symlinks)
|
combined_mods.extend(new_symlinks)
|
||||||
launch_offline(client, appid, name, combined_mods, mission)
|
|
||||||
|
if len(mission) > 0:
|
||||||
|
relative_link = symlink_mission(Path(steam_path), mission)
|
||||||
|
|
||||||
|
launch_offline(client, appid, name, combined_mods, relative_link)
|
||||||
|
while True:
|
||||||
|
if is_dayz_running():
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
def open_folderpicker(self, title: str) -> Union["Path", None]:
|
def open_folderpicker(self, title: str) -> Union["Path", None]:
|
||||||
picker = FolderPicker(self.controller.get_window(), title)
|
picker = FolderPicker(self.controller.get_window(), title)
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ def create_custom_symlinks(
|
|||||||
clone_symlinks(steam_path)
|
clone_symlinks(steam_path)
|
||||||
return links
|
return links
|
||||||
|
|
||||||
|
def symlink_mission(steam_path: Path, target: str) -> None:
|
||||||
|
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
|
||||||
|
for file in dayz_path.iterdir():
|
||||||
|
if file.is_symlink() and str(file.stem)[:2] == "@C":
|
||||||
|
file.unlink()
|
||||||
|
stem = Path(target).name
|
||||||
|
suffix = _hash(stem, use_custom=True)
|
||||||
|
source = dayz_path.joinpath(suffix)
|
||||||
|
source.symlink_to(Path(target))
|
||||||
|
return suffix
|
||||||
|
|
||||||
|
|
||||||
def clone_symlinks(steam_path: Path) -> None:
|
def clone_symlinks(steam_path: Path) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in new issue
Block a user