mirror of
https://github.com/mupen64plus/mupen64plus-ui-python.git
synced 2025-04-02 10:51:53 -04:00
Add plugins fallback and change defaults
This commit is contained in:
parent
bb9b3ee4f9
commit
b4a6f2c3e1
4 changed files with 20 additions and 9 deletions
|
@ -165,6 +165,14 @@ PLUGIN_NAME = {
|
||||||
}
|
}
|
||||||
|
|
||||||
PLUGIN_DEFAULT = {
|
PLUGIN_DEFAULT = {
|
||||||
|
M64PLUGIN_NULL: "NULL",
|
||||||
|
M64PLUGIN_RSP: "mupen64plus-rsp-hle%s" % DLL_EXT,
|
||||||
|
M64PLUGIN_GFX: "mupen64plus-video-GLideN64%s" % DLL_EXT,
|
||||||
|
M64PLUGIN_AUDIO: "mupen64plus-audio-sdl%s" % DLL_EXT,
|
||||||
|
M64PLUGIN_INPUT: "mupen64plus-input-sdl%s" % DLL_EXT
|
||||||
|
}
|
||||||
|
|
||||||
|
PLUGIN_FALLBACK = {
|
||||||
M64PLUGIN_NULL: "NULL",
|
M64PLUGIN_NULL: "NULL",
|
||||||
M64PLUGIN_RSP: "mupen64plus-rsp-hle%s" % DLL_EXT,
|
M64PLUGIN_RSP: "mupen64plus-rsp-hle%s" % DLL_EXT,
|
||||||
M64PLUGIN_GFX: "mupen64plus-video-rice%s" % DLL_EXT,
|
M64PLUGIN_GFX: "mupen64plus-video-rice%s" % DLL_EXT,
|
||||||
|
|
|
@ -123,8 +123,8 @@ class Cheat(QDialog, Ui_CheatDialog):
|
||||||
cd, address, value, choices = cheat
|
cd, address, value, choices = cheat
|
||||||
if choices:
|
if choices:
|
||||||
choices = Choices(self, name, choices)
|
choices = Choices(self, name, choices)
|
||||||
rval = choices.exec_()
|
rval = choices.exec()
|
||||||
if rval == QDialog.Accepted:
|
if rval == QDialog.DialogCode.Accepted:
|
||||||
curr_item = choices.listWidget.currentItem()
|
curr_item = choices.listWidget.currentItem()
|
||||||
value = curr_item.data(Qt.ItemDataRole.UserRole)
|
value = curr_item.data(Qt.ItemDataRole.UserRole)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -167,17 +167,17 @@ class Settings(QDialog, Ui_Settings):
|
||||||
|
|
||||||
def get_size_safe(self):
|
def get_size_safe(self):
|
||||||
try:
|
try:
|
||||||
size = self.qset.value("size", SIZE_1X)
|
size = self.qset.value("size", SIZE_2X)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
size = SIZE_1X
|
size = SIZE_2X
|
||||||
if not type(size) == tuple:
|
if not type(size) == tuple:
|
||||||
size = SIZE_1X
|
size = SIZE_2X
|
||||||
if len(size) != 2:
|
if len(size) != 2:
|
||||||
size = SIZE_1X
|
size = SIZE_2X
|
||||||
if type(size[0]) != int or type(size[1]) != int:
|
if type(size[0]) != int or type(size[1]) != int:
|
||||||
size = SIZE_1X
|
size = SIZE_2X
|
||||||
if size[0] <= 0 or size[1] <= 0:
|
if size[0] <= 0 or size[1] <= 0:
|
||||||
size = SIZE_1X
|
size = SIZE_2X
|
||||||
return size
|
return size
|
||||||
|
|
||||||
def get_parameter_help_safe(self, parameter):
|
def get_parameter_help_safe(self, parameter):
|
||||||
|
@ -293,6 +293,10 @@ class Settings(QDialog, Ui_Settings):
|
||||||
current = self.qset.value("Plugins/%s" % (
|
current = self.qset.value("Plugins/%s" % (
|
||||||
PLUGIN_NAME[plugin_type]), PLUGIN_DEFAULT[plugin_type])
|
PLUGIN_NAME[plugin_type]), PLUGIN_DEFAULT[plugin_type])
|
||||||
index = combo.findText(current)
|
index = combo.findText(current)
|
||||||
|
if index == -1:
|
||||||
|
current = self.qset.value("Plugins/%s" % (
|
||||||
|
PLUGIN_NAME[plugin_type]), PLUGIN_FALLBACK[plugin_type])
|
||||||
|
index = combo.findText(current)
|
||||||
if index == -1:
|
if index == -1:
|
||||||
index = 0
|
index = 0
|
||||||
combo.setCurrentIndex(index)
|
combo.setCurrentIndex(index)
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.platform.startswith("linux"):
|
if sys.platform.startswith("linux"):
|
||||||
|
|
Loading…
Add table
Reference in a new issue