Skip to content

Commit

Permalink
Fix boolean properties in maid list; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorsington committed Apr 12, 2019
1 parent 850692b commit 04bc076
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Core/COM3D2.MaidFiddler.Plugin/Service/Service.GameMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ private Dictionary<string, string> GetLockableMaidStatusValueInfo()
return "int";
if (t.IsUnsignedInteger())
return "uint";
if (t == typeof(bool))
return "bool";
return "string";
});
}
Expand Down
2 changes: 1 addition & 1 deletion GUI/app_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "1.0.4.2"
VERSION = "1.0.4.3"

CONTRIBUTORS = [
"@ghorsington -- original developer",
Expand Down
12 changes: 9 additions & 3 deletions GUI/maidfiddler/ui/tabs/maid_stats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PyQt5.QtWidgets import QHeaderView, QTableWidgetItem, QLineEdit, QDoubleSpinBox, QSpinBox, QCheckBox, QWidget, QHBoxLayout, QGroupBox
from PyQt5.QtCore import Qt, pyqtSignal
from .ui_tab import UiTab
from maidfiddler.ui.qt_elements import NumberElement, TextElement
from maidfiddler.ui.qt_elements import NumberElement, TextElement, CheckboxElement
from maidfiddler.util.translation import tr


Expand All @@ -17,7 +17,8 @@ def __init__(self, ui):
"uint": lambda: NumberElement(QSpinBox(), 0, 2**32),
"int": lambda: NumberElement(QSpinBox()),
"double": lambda: NumberElement(QDoubleSpinBox()),
"string": lambda: TextElement(QLineEdit())
"string": lambda: TextElement(QLineEdit()),
"bool": lambda: CheckboxElement(QCheckBox())
}

def update_ui(self):
Expand Down Expand Up @@ -47,7 +48,11 @@ def update_ui(self):
name = QTableWidgetItem(maid_prop)
name.setWhatsThis(f"maid_props.{maid_prop}")
line = self.type_generators[prop_type]()
line.qt_element.setStyleSheet("width: 15em;")

if prop_type != "bool":
line.qt_element.setStyleSheet("width: 15em;")
else:
line.checkbox.setProperty("prop_name", maid_prop)

checkbox = QCheckBox()
widget = QWidget()
Expand Down Expand Up @@ -144,6 +149,7 @@ def on_maid_selected(self):
maid = self.maid_mgr.selected_maid

for name, widgets in self.properties.items():
print(f"Setting {name}")
widgets[0].set_value(maid["properties"][name])
widgets[1].setCheckState(
Qt.Checked if maid["prop_locks"][name] else Qt.Unchecked)
Expand Down
3 changes: 2 additions & 1 deletion GUI/translations/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
"evaluation": "Evaluation",
"totalEvaluations": "Total evaluations",
"sales": "Sales",
"totalSales": "Total sales"
"totalSales": "Total sales",
"isNickNameCall": "Call by nickname"
},
"maid_bonus_props": {
"excite": "Excitement",
Expand Down

0 comments on commit 04bc076

Please sign in to comment.