diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index c98aa0d..2de5f60 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -17,6 +17,7 @@ CHANGELOG * Makefile for Linux installing - Kiooeht [evacipatedBox] * Recognize www. as link - Kiooeht [evacipatedBox] * Pester menu option to just pester a handle - Kiooeht [evacipatedBox] +* Update to randomEncounter interface - Kiooeht [evacipatedBox] * Bug fixes * Don't require pygame (it's kind of optional, you just don't get sound) - Kiooeht [evacipatedBox] * Allow add chum dialog to open after adding an existing chum - Kiooeht [evacipatedBox] diff --git a/pesterchum.py b/pesterchum.py index 3f61e41..aa47a17 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1952,6 +1952,7 @@ class PesterWindow(MovingWindow): def toggleIdle(self, idle): if idle: self.setAway.emit(True) + self.randhandler.setIdle(True) sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"]) verb = self.theme["convo/text/idle"] for (h, convo) in self.convos.iteritems(): @@ -1962,6 +1963,7 @@ class PesterWindow(MovingWindow): self.sendMessage.emit("PESTERCHUM:IDLE", h) else: self.setAway.emit(False) + self.randhandler.setIdle(False) self.idletime = 0 @QtCore.pyqtSlot() def checkIdle(self): diff --git a/randomer.py b/randomer.py index ff9564e..6078d56 100644 --- a/randomer.py +++ b/randomer.py @@ -23,6 +23,12 @@ class RandomHandler(QtCore.QObject): self.queue.append(code) self.mainwindow.sendNotice.emit(code, self.randNick) + def setIdle(self, i): + if i: code = "~" + else: code = "*" + self.queue.append(code) + self.mainwindow.sendNotice.emit(code, self.randNick) + @QtCore.pyqtSlot() def getEncounter(self): self.queue.append("!") @@ -45,6 +51,9 @@ class RandomHandler(QtCore.QObject): self.mainwindow.userprofile.setRandom(True) else: self.mainwindow.userprofile.setRandom(False) + elif code in ["~","*"]: + if l[1][0] == "k": + pass elif code == "!": if l[1] == "x": from PyQt4 import QtGui