Skip to content

Commit

Permalink
Added Installers Data to settings panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharlikran committed Nov 9, 2017
1 parent 6de5ff5 commit d37e8bf
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 17 deletions.
32 changes: 24 additions & 8 deletions Mopy/Wrye Mash.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ <h2><a name='Contents'>Contents</a></h2>
<p class=list-2>&bull;&nbsp; <a href="#SwitchBetweenSaveProfiles">Switch Between Save Profiles</a></p>
<p class=list-2>&bull;&nbsp; <a href="#GeneralAdvice">General Advice</a></p>
<p class=list-1>&bull;&nbsp; <a href="#Features">Features</a></p>
<p class=list-1>&bull;&nbsp; <a href="#UpdatingFromPreviousVersion">Updating From Previous Version</a></p>
<p class=list-1>&bull;&nbsp; <a href="#WryeMashSettings">Wrye Mash Settings</a></p>
<p class=list-1>&bull;&nbsp; <a href="#Installation">Installation</a></p>
<p class=list-2>&bull;&nbsp; <a href="#GetandInstall">Get and Install</a></p>
<p class=list-2>&bull;&nbsp; <a href="#WryeMashStandalone">Wrye Mash Standalone</a></p>
<p class=list-2>&bull;&nbsp; <a href="#UpdatingtoWryeMashStandalonev87orhigher">Updating to Wrye Mash Standalone v87 or higher</a></p>
<p class=list-2>&bull;&nbsp; <a href="#StartingWryeMash">Starting Wrye Mash</a></p>
<p class=list-2>&bull;&nbsp; <a href="#NonStandardMorrowindPythonDirectories">Non-Standard Morrowind/Python Directories</a></p>
<p class=list-2>&bull;&nbsp; <a href="#IfMashWontStart"><font color=red>If Mash Won't Start</font></a></p>
Expand Down Expand Up @@ -252,6 +253,28 @@ <h2><a name='Features'>Features</a></h2>
<p class=list-3>&bull;&nbsp; Status icons and hilight colors.
<p class=list-3>&bull;&nbsp; Toolbar/launcher buttons.
<p class=empty>&nbsp;</p>
<h2><a name='UpdatingFromPreviousVersion'>Updating From Previous Version</a></h2>
<p class=empty>&nbsp;</p>
<p><B>Remove the following three files:</B>
<p class=list-1>&bull;&nbsp; mash.exe
<p class=list-1>&bull;&nbsp; MSVCP71.dll
<p class=list-1>&bull;&nbsp; MSVCR71.dll
<p class=empty>&nbsp;</p>
<h2><a name='WryeMashSettings'>Wrye Mash Settings</a></h2>
<img src="images/settings.jpg" width="475" height="245" border="0" alt="Settings Window">
<p class=empty>&nbsp;</p>
<p>The Installers and Installers Data folders have been updated. However, you can specify the old location if you choose.
<p class=empty>&nbsp;</p>
<p><B>Old locations</B>
<p class=empty>&nbsp;</p>
<p class=list-1>&bull;&nbsp; [Path]\Morrowind Mods\Bash (installers.dat)
<p class=list-1>&bull;&nbsp; [Path]\Morrowind Mods\Bash Installers (All installers *.zip, *.rar, *.7z)
<p class=empty>&nbsp;</p>
<p><B>New locations</B>
<p class=empty>&nbsp;</p>
<p class=list-1>&bull;&nbsp; [Path]\Morrowind Mods\Installers Data (installers.dat)
<p class=list-1>&bull;&nbsp; [Path]\Morrowind Mods\Mash Installers (All installers *.zip, *.rar, *.7z)
<p class=empty>&nbsp;</p>
<h2><a name='Installation'>Installation</a></h2>
<h3><a name='GetandInstall'>Get and Install</a></h3>
<p class=list-1>&bull;&nbsp; Wrye Mash is written in <a href="http://www.python.org/doc/Summary.html">python</a> and uses the <a href="http://wxpython.org/what.php">wxPython GUI library</a> to provide the interface. So before you can run Wrye Mash, you'll need to download both of these.
Expand All @@ -267,13 +290,6 @@ <h3><a name='WryeMashStandalone'>Wrye Mash Standalone</a></h3>
<p class=list-1>&bull;&nbsp; <B>Wrye Mash 87 Standalone</B>
<p class=list-1>&nbsp;&nbsp; Download link: <a href="https://github.com/Wrye-Bashers/Wrye-Mash/releases/tag/87">Wrye Mash 87 Standalone</a>
<p class=empty>&nbsp;</p>
<h3><a name='UpdatingtoWryeMashStandalonev87orhigher'>Updating to Wrye Mash Standalone v87 or higher</a></h3>
<p class=empty>&nbsp;</p>
<p><B>Remove the following three files:</B>
<p class=list-1>&bull;&nbsp; mash.exe
<p class=list-1>&bull;&nbsp; MSVCP71.dll
<p class=list-1>&bull;&nbsp; MSVCR71.dll
<p class=empty>&nbsp;</p>
<h3><a name='StartingWryeMash'>Starting Wrye Mash</a></h3>
<p class=list-1>&bull;&nbsp; <B><I>Double click</I></B> the "Wrye Mash.exe" in the Mopy directory.
<p class=list-1>&bull;&nbsp; If this doesn't work, see <a href="#NonStandardMorrowindPythonDirectories">Non-Standard Morrowind/Python Directories</a> or <B><I><a href="#IfMashWontStart">If Mash Won't Start</a></I></B>.
Expand Down
14 changes: 13 additions & 1 deletion Mopy/Wrye Mash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,27 @@
* Status icons and hilight colors.
* Toolbar/launcher buttons.

== Updating to Wrye Mash Standalone v87 or higher
== Updating From Previous Version

__Remove the following three files:__
* mash.exe
* MSVCP71.dll
* MSVCR71.dll

== Wrye Mash Settings
<img src="images/settings.jpg" width="475" height="245" border="0" alt="Settings Window">

The Installers and Installers Data folders have been updated. However, you can specify the old location if you choose.

__Old locations__

* [Path]\Morrowind Mods\Bash (installers.dat)
* [Path]\Morrowind Mods\Bash Installers (All installers *.zip, *.rar, *.7z)

__New locations__

* [Path]\Morrowind Mods\Installers Data (installers.dat)
* [Path]\Morrowind Mods\Mash Installers (All installers *.zip, *.rar, *.7z)

== Installation ===============================================================
=== Get and Install
Expand Down
Binary file added Mopy/images/settings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 23 additions & 8 deletions Mopy/mash/gui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@

import wx

from ..mosh import GPath
from ..mosh import GPath, Path
from ..conf import dirs
from .. import conf

dataMap = {
"Inst" : "installers",
"Mw" : "app",
"DataDir": "mods",
"Inst" : "installers",
"InstData": "installersData",
"Mw" : "app",
"DataDir" : "mods",
}

class SettingsWindow(wx.MiniFrame):
Expand All @@ -52,7 +53,7 @@ class SettingsWindow(wx.MiniFrame):
init = True
settings_var = None

def __init__(self, parent=None, id=-1, size=(475, 250),
def __init__(self, parent=None, id=-1, size=(475, 350),
pos=wx.DefaultPosition,
style=wx.DEFAULT_FRAME_STYLE, settings=None):
"""..."""
Expand All @@ -71,32 +72,41 @@ def __init__(self, parent=None, id=-1, size=(475, 250),

btnBrowseMw = wx.Button(p, wx.ID_OPEN, _(u"..."), size=(-1, -1),
name=u"btnBrowseMw")
boxMwDir = wx.StaticBox(p, -1, _(u"Morrowind directory"))
boxMwDir = wx.StaticBox(p, -1, _(u"Morrowind directory (Morrowind.exe)"))
self.fldMw = wx.TextCtrl(p, -1, name=u"fldMw")
sizerBoxMwDir = wx.StaticBoxSizer(boxMwDir, wx.HORIZONTAL)
sizerBoxMwDir.AddMany(
[(self.fldMw, 1, wx.EXPAND), ((2, 0)), (btnBrowseMw, 0)])

btnBrowseInst = wx.Button(p, wx.ID_OPEN, _(u"..."), size=(-1, -1),
name=u"btnBrowseInst")
boxInst = wx.StaticBox(p, -1, _(u"Mods installers"))
boxInst = wx.StaticBox(p, -1, _(u"Mods installers (*.rar, *.zip, *.7z)"))
self.fldInst = wx.TextCtrl(p, -1, name=u"fldInst")
sizerBoxInstallersDir = wx.StaticBoxSizer(boxInst, wx.HORIZONTAL)
sizerBoxInstallersDir.AddMany(
[(self.fldInst, 1, wx.EXPAND), ((2, 0)), (btnBrowseInst, 0)])

btnBrowseDataDir = wx.Button(p, wx.ID_OPEN, _(u"..."), size=(-1, -1),
name=u"btnBrowseDataDir")
boxDataDir = wx.StaticBox(p, -1, _(u"Data Files"))
boxDataDir = wx.StaticBox(p, -1, _(u"Data Files (*.esp, *.esm)"))
self.fldDataDir = wx.TextCtrl(p, -1, name=u"fldDataDir")
sizerBoxDataDir = wx.StaticBoxSizer(boxDataDir, wx.HORIZONTAL)
sizerBoxDataDir.AddMany(
[(self.fldDataDir, 1, wx.EXPAND), ((2, 0)), (btnBrowseDataDir, 0)])

btnBrowseInstData = wx.Button(p, wx.ID_OPEN, _(u"..."), size=(-1, -1),
name=u"btnBrowseInstData")
boxInstData = wx.StaticBox(p, -1, _(u"Installer Data (installers.dat)"))
self.fldInstData = wx.TextCtrl(p, -1, name=u"fldInstData")
sizerBoxInstData = wx.StaticBoxSizer(boxInstData, wx.HORIZONTAL)
sizerBoxInstData.AddMany(
[(self.fldInstData, 1, wx.EXPAND), ((2, 0)), (btnBrowseInstData, 0)])

sizerFields = wx.BoxSizer(wx.VERTICAL)
sizerFields.AddMany([
(sizerBoxMwDir, 0, wx.EXPAND), ((0, 2)),
(sizerBoxInstallersDir, 0, wx.EXPAND), ((0, 2)),
(sizerBoxInstData, 0, wx.EXPAND), ((0, 2)),
(sizerBoxDataDir, 0, wx.EXPAND)
])
sizerBtn = wx.BoxSizer(wx.HORIZONTAL)
Expand Down Expand Up @@ -140,11 +150,15 @@ def OnCancel(self, event):
def OnOk(self, event):
"""Ok button handler."""
self.settings_var["mwDir"] = self.fldMw.GetValue()
self.settings_var["installersData"] = self.fldInstData.GetValue()
for item in self.Panel.GetChildren():
if item.Name.startswith("fld") == True and item.Name[3:] in dataMap:
name = dataMap[item.Name[3:]]
if name in dirs:
conf.dirs[name] = GPath(item.GetValue())
conf.settings['mwDir'] = conf.dirs['app'].s
conf.settings['installersData'] = conf.dirs['installersData'].s
conf.settings['sInstallersDir'] = conf.dirs['installers'].s
self.Close()

def Close(self):
Expand All @@ -157,6 +171,7 @@ def SetSettings(self, settings_var, **kwargs):
"""External settings change."""
self.settings_var = settings_var
self.fldMw.SetValue(self.settings_var["mwDir"])
self.fldInstData.SetValue(self.settings_var["installersData"])
if kwargs != {}:
for a in kwargs.keys():
item = getattr(self, "fld{!s}".format(a), None)
Expand Down

0 comments on commit d37e8bf

Please sign in to comment.