summaryrefslogtreecommitdiff
path: root/ueditor.rpy
diff options
context:
space:
mode:
Diffstat (limited to 'ueditor.rpy')
-rw-r--r--ueditor.rpy56
1 files changed, 53 insertions, 3 deletions
diff --git a/ueditor.rpy b/ueditor.rpy
index 4c904af..def5b9f 100644
--- a/ueditor.rpy
+++ b/ueditor.rpy
@@ -69,9 +69,21 @@ screen units_editor():
label _("%d - %s %s %s" % (uedit["unit_id"], star_write(uedit["rare"]), uedit["name"], ifte(uedit["sex"], "(F)", "(M)")))
hbox:
spacing 10
- textbutton _("-") action Function(ueditor, "unit_id", -1)
- label ("%d" % uedit["unit_id"])
- textbutton _("+") action Function(ueditor, "unit_id", 1)
+ #textbutton _("-") action Function(ueditor, "unit_id", -1)
+ #label ("%d" % uedit["unit_id"])
+ #textbutton _("+") action Function(ueditor, "unit_id", 1)
+ #def __init__(self, variable, key1, key2, inpu="int", key3=None, key4=None):
+ label _("ID: ")
+ $ input=Input(
+ value=UEditorInputValue(uedit, "unit_id", None, "int", dp=True),
+ copypaste=True,
+ allow="0123456789",
+ length=8)
+ button:
+ #key_events True
+ action input.enable
+ add input
+
null height 25
label _("Base ID %d" % uedit["unit_base_id"])
label _("Flavor text:")
@@ -274,6 +286,44 @@ init python:
return
+
+ class UEditorInputValue(InputValue):
+ def __init__(self, variable, key1, key2, inpu="int", key3=None, key4=None, dp=False):
+ try:
+ self.variable = variable
+ except:
+ self.variable = ""
+ self.inpu = inpu
+ self.short_display = dp
+
+ self.default=True
+ self.editable=True
+
+ self.key1=key1
+ self.key2=key2
+ self.key3=key3
+ self.key4=key4
+
+ def get_text(self):
+ try:
+ if not self.short_display:
+ return str(self.variable)
+ else:
+ return str(self.variable[self.key1])
+ except:
+ traceback.print_exc()
+ return ""
+ #return globals()[self.variable]
+
+ def set_text(self, s):
+ #globals()[self.variable] = s
+ ueditor_input(self.key1, self.key2, self.inpu, s, key3=self.key3, key4=self.key4)
+
+ def enter(self):
+ renpy.restart_interaction()
+ #renpy.run(self.Disable())
+ #raise renpy.IgnoreEvent()
+
label units_editors:
$ uedit=allunitsbase[0]
$ current=0