Skip to content

Commit 0558c83

Browse files
Daniel NunesInfernio
authored andcommitted
Add fomod installer support
Option types are not validated - contradicting group and option types should be undefined behaviour. However, to simplify, option type always wins the conflict and we deliver a warning if needed. As an example, in a SelectAll group a NotUsable option would not be selected. Remove fomod metadata handling Rework fomod installer backend Changed: - User's choices are now "saved" when going to previous pages - Folders to install are now properly merged based on priority - Omitted destination attributes in file/folder tags are now properly handled. TODO: - Update tests in test_bash repo - Add some inline documentation This must go into the final commit message: Ignored tags: - moduleImage - fommDependency Ignored attributes: - position, colour - [moduleName] - alwaysInstall, installIfUsable - [file, folder] Note: Rework exe-based game detection logic FFF fomods @@ -64,3 +64,3 @@ def __init__(self, parent_window, installer, page_size, pos): data_path = bass.dirs["mods"] - ver = env.get_file_version(bass.dirs["app"].join(bush.game.exe).s) + ver = env.get_file_version(bass.dirs["app"].join(bush.game.launch_exe).s) game_ver = u".".join([unicode(i) for i in ver]) Some wx cleanup in gui fomods Cache images it does speedup loading them (although that's probably due to my using balt.Image) FFF couple typos FileInfo(object): -> _FomodFileInfo(object): FFF WIP Infernio: Updated for 'Rework game version calculation' SSS Improve FOMOD installer link name Should be FOMOD or FOMod, not Fomod. Also added three dots, since that link opens an interactive dialog. SSS to be squashed into the final FOMOD commit _text = _(u'FOMOD Installer...') class variable SSS No need to override __init__ Remove some leftover debug prints Replace PageInfo with OrderedDict Std lib is better. Port of dh-nunes/pyfomod@547494309 Add some docs to the fomod backend
1 parent 486169a commit 0558c83

7 files changed

Lines changed: 1062 additions & 7 deletions

File tree

Mopy/bash/balt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,10 @@ def vistaDialog(parent, message, title, buttons=[], checkBoxTxt=None,
840840
return id_
841841
return None, checkbox
842842

843-
def askStyled(parent,message,title,style,**kwdargs):
843+
def askStyled(parent, message, title, style, do_center=False, **kwdargs):
844844
"""Shows a modal MessageDialog.
845845
Use ErrorMessage, WarningMessage or InfoMessage."""
846+
if do_center: style |= wx.CENTER
846847
if canVista:
847848
buttons = []
848849
icon = None

Mopy/bash/basher/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,9 @@ def SetFile(self, fileName='SAME'):
27072707
self.gSubList.Clear()
27082708
else:
27092709
balt.setCheckListItems(self.gSubList, [x.replace(u'&',u'&&') for x in installer.subNames[1:]], installer.subActives[1:])
2710+
if installer.has_fomod_conf:
2711+
self.gSubList.Insert("fomod", 0)
2712+
self.gSubList.Check(0, installer.extras_dict.get('fomod_active', False))
27102713
#--Espms
27112714
if not installer.espms:
27122715
self.gEspmList.Clear()
@@ -2851,8 +2854,16 @@ def OnCheckSubItem(self,event):
28512854
installer = self.file_info
28522855
index = event.GetSelection()
28532856
self.gSubList.SetSelection(index)
2857+
has_fomod = False
2858+
if self.gSubList.GetString(0) == "fomod":
2859+
installer.extras_dict['fomod_active'] = self.gSubList.IsChecked(0)
2860+
self.gSubList.Delete(0)
2861+
has_fomod = True
28542862
for index in range(self.gSubList.GetCount()):
28552863
installer.subActives[index+1] = self.gSubList.IsChecked(index)
2864+
if has_fomod:
2865+
self.gSubList.Insert("fomod", 0)
2866+
self.gSubList.Check(0, installer.extras_dict.get('fomod_active', False))
28562867
if not balt.getKeyState_Shift():
28572868
self.refreshCurrent(installer)
28582869

0 commit comments

Comments
 (0)