diff options
author | Treeki <treeki@gmail.com> | 2012-07-25 14:11:19 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-07-25 14:11:19 +0200 |
commit | e0aebec63011cbcb676caa92948e25c62fd6c17b (patch) | |
tree | d23461dd544b6fb6d914406436aadbef5ab08468 /src/unlock.py | |
parent | faaa82bd81f24fc897a5d0ae912381413625ddeb (diff) | |
download | koopatlas-freeform-unlocks.tar.gz koopatlas-freeform-unlocks.zip |
exporting of unlockable paths donefreeform-unlocks
Diffstat (limited to 'src/unlock.py')
-rw-r--r-- | src/unlock.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/unlock.py b/src/unlock.py index 446cd0a..cf3e6fd 100644 --- a/src/unlock.py +++ b/src/unlock.py @@ -11,6 +11,8 @@ def parseUnlockText(text): parsed = _parseUnlockBit(text.lower()) if parsed == ('always',): return None + else: + return parsed def _parseUnlockBit(text): # blank criterion @@ -110,7 +112,7 @@ def stringifyUnlockData(data): return (' %s ' % kind).join(map(lambda x: '(%s)' % stringifyUnlockData(x), data[1])) -def packUnlockSpec(spec): +def packUnlockSpec(data): kind = data[0] if kind == 'always': @@ -119,7 +121,7 @@ def packUnlockSpec(spec): elif kind == 'level': k, world, level, secret = data - one = (1 << 6) | (0x10 if secret else 0) | (worldNumber - 1) + one = (1 << 6) | (0x10 if secret else 0) | (world - 1) return chr(one) + chr(level - 1) @@ -198,6 +200,8 @@ class KPUnlockSpecDialog(QtGui.QDialog): self.layout.addWidget(self.statusLabel) self.layout.addWidget(self.buttons) self.setLayout(self.layout) + + self.spec = None def setSpec(self, spec): self.textBox.setText(stringifyUnlockData(spec)) |