Skip to content

Commit

Permalink
Vic2の項目を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
matanki-saito committed Jul 17, 2021
1 parent c91f570 commit 7a8adc3
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 8 deletions.
83 changes: 75 additions & 8 deletions angelica.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def uninstaller(uninstall_info_list):

if 'app_id' in info:
base_path = get_game_install_dir_path(info['app_id'])
if os.path.exists(__(base_path, "claes.exe")):
logger.info('claes uninstall mode')
sb.call(__(base_path, "claes.exe /uninstall-all"))

elif 'game_dir_name' in info:
base_path = __(get_my_documents_folder(),
"Paradox Interactive",
Expand Down Expand Up @@ -305,21 +309,24 @@ def get_my_documents_folder():
raise Exception(_("ERR_SHGetSpecialFolderPathW"))


def mod_installer(app_id, target_repository, key_file_name, game_dir_name, key_list_url):
def mod_installer(app_id, target_repository, key_file_name, key_list_url, game_dir_name=None):
logger.info('mod install')

# My Documents をAPIから見つける
install_game_dir_path = __(get_my_documents_folder(),
"Paradox Interactive",
game_dir_name)

logger.info('install_game_dir_path=%s', install_game_dir_path)

# exeを見つける
install_dll_dir_path = get_game_install_dir_path(app_id)

logger.info('install_dll_dir_path=%s', install_dll_dir_path)

# My Documents をAPIから見つける
if game_dir_name is None:
install_game_dir_path = install_dll_dir_path
else:
install_game_dir_path = __(get_my_documents_folder(),
"Paradox Interactive",
game_dir_name)

logger.info('install_game_dir_path=%s', install_game_dir_path)

logger.info('install downloader')

# Modダウンローダーを配置
Expand Down Expand Up @@ -488,6 +495,27 @@ def ir_button_function():
key_list_url=repo_url + "irmods.json")


def vic2_button_function():
logger.info('Push a button to install vic2')
dll_installer(
app_id=42960,
final_check_file='v2game.exe',
target_repository={
"author": "matanki-saito",
"name": "vic2dll"
},
)

mod_installer(
app_id=42960,
target_repository={
"author": "matanki-saito",
"name": "moddownloader"
},
key_file_name='v2game.exe',
key_list_url=repo_url + "vic2mods.json")


# EU4
eu4InstallButton = tkinter.Button(frame1_2,
activebackground='#d3a243',
Expand Down Expand Up @@ -527,6 +555,19 @@ def ir_button_function():
irInstallButton.bind("<Enter>", lambda e: on_enter(e, "#bc64a4", "#c1e4e9"))
irInstallButton.bind("<Leave>", lambda e: on_leave(e, "#cca6bf", "#8f2e14"))

# VIC2
vic2InstallButton = tkinter.Button(frame1_2,
activebackground='#a9a9a9',
background='#a9a9a9',
relief='flat',
fg='#000000',
text=_('INSTALL_VIC2'),
command=lambda: threader(vic2InstallButton, vic2_button_function),
font=("sans-selif", 16, "bold"))
vic2InstallButton.pack(expand=True, fill='both')
vic2InstallButton.bind("<Enter>", lambda e: on_enter(e, "#dcdcdc", "#000000"))
vic2InstallButton.bind("<Leave>", lambda e: on_leave(e, "#a9a9a9", "#000000"))

# その他
frame1_3 = tkinter.Frame(tab3, pady=0)
frame1_3.pack(expand=True, fill='both')
Expand Down Expand Up @@ -611,6 +652,32 @@ def ir_button_function():
font=("Helvetica", 12))
uninstall_button_ck2.pack(expand=True, fill='both')

uninstall_button_vic2 = tkinter.Button(frame1_3,
background='#FFFFFF',
fg='black',
text=_('UNINSTALL_VIC2'),
command=lambda: threader(uninstall_button_vic2, lambda: uninstaller(
[
{
# VIC2 DLL and mod
'app_id': 42960,
'final_check_file': 'v2game.exe',
'remove_target_paths': [
'd3d9.dll',
'plugins',
'pattern_ck2jps.log',
'README.md',
'.dist.v1.json',
'claes.exe',
'claes.key',
'claes.cache'
]
}
])),
height='1',
font=("Helvetica", 12))
uninstall_button_vic2.pack(expand=True, fill='both')

logger.info('mainloop')

# ログエリア
Expand Down
12 changes: 12 additions & 0 deletions loca.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def get_language_windows(system_lang=True):
'default': 'Uninstall a CK2 multibyte dll',
'ja_JP': 'アンインストール\n・CK2日本語DLL\n・関連MOD',
},
'UNINSTALL_VIC2': {
'default': 'Uninstall a VIC2 multibyte dll',
'ja_JP': 'アンインストール\n・VIC2日本語DLL\n・関連MOD',
},
'INSTALL_CK2': {
'default': 'CK2\nmulti-byte patch',
'ja_JP': 'クルセイダーキングズ2\n日本語化',
Expand All @@ -73,6 +77,10 @@ def get_language_windows(system_lang=True):
'default': 'Imperator: Rome\ndisplay fix patch',
'ja_JP': 'インペラトル: ローマ\n表示修正',
},
'INSTALL_VIC2': {
'default': 'Victoria II\nmulti-byte patch',
'ja_JP': 'ヴィクトリア2\n日本語化',
},
'TITLE': {
'default': 'CK2/EU4 Multibyte DLL Installer',
'ja_JP': 'CK2/EU4 日本語化DLLインストーラー',
Expand Down Expand Up @@ -192,6 +200,10 @@ def get_language_windows(system_lang=True):
'default': 'Install\nCK2 JPMODs',
'ja_JP': 'CK2日本語化Mod\nインストール'
},
'INSTALL_VIC2_JPMOD': {
'default': 'Install\nVIC2 JPMODs',
'ja_JP': 'VIC2日本語化Mod\nインストール'
},
'TASK_DO': {
'default': 'running...',
'ja_JP': '処理中...',
Expand Down

0 comments on commit 7a8adc3

Please sign in to comment.