diff --git a/Stuff/Modules/explorer.py b/Stuff/Modules/explorer.py index 58bd16f..01b1b6c 100644 --- a/Stuff/Modules/explorer.py +++ b/Stuff/Modules/explorer.py @@ -915,6 +915,7 @@ def _setParameterDisplays(self, timeReset): self.entrancesVar.set("0") self.selectedPVar.set("-") + def _changeButtonStatuses(self): if not self.showTrackVar.get(): self.playBut.state(["!disabled"]) @@ -962,7 +963,9 @@ def graphPopUp(self, event): parameters = {"CM": ("periodicity", "mobility", "immobility", "entrances", "shocks", "bad points", "thigmotaxis"), "MWM": ("mobility", "immobility", "bad points", "thigmotaxis", "passes"), - "OF": ("mobility", "immobility", "bad points", "thigmotaxis")} + "OF": ("mobility", "immobility", "bad points", "thigmotaxis"), + "RA": ("mobility", "immobility", "entrances", "shocks", "bad points", + "thigmotaxis")} parameters["CMSF"] = parameters["CM"] for parameter in parameters[m.mode]: diff --git a/Stuff/Modules/filestorage.py b/Stuff/Modules/filestorage.py index e703b35..bec265a 100644 --- a/Stuff/Modules/filestorage.py +++ b/Stuff/Modules/filestorage.py @@ -441,12 +441,15 @@ def openRoomFile(self, arenafile): if arenafile in self.fileStorage.pairedfiles: roomfile = self.fileStorage.pairedfiles[arenafile] else: - if "Arena" in basename(arenafile): + if m.pairing[m.mode][0] in basename(arenafile): splitName = os.path.split(arenafile) - roomfile = os.path.join(splitName[0], splitName[1].replace("Arena", "Room")) - elif "arena" in basename(arenafile): + roomfile = os.path.join(splitName[0], splitName[1].replace(m.pairing[m.mode][0], + m.pairing[m.mode][1])) + elif m.pairing[m.mode][0].lower() in basename(arenafile): splitName = os.path.split(arenafile) - roomfile = os.path.join(splitName[0], splitName[1].replace("arena", "room")) + roomfile = os.path.join(splitName[0], + splitName[1].replace(m.pairing[m.mode][0].lower(), + m.pairing[m.mode][1].lower())) if roomfile: os.startfile(roomfile) else: diff --git a/Stuff/Modules/graphs.py b/Stuff/Modules/graphs.py index 0fa4bd9..5965e2c 100644 --- a/Stuff/Modules/graphs.py +++ b/Stuff/Modules/graphs.py @@ -19,7 +19,7 @@ from tkinter import * from tkinter import ttk -from math import degrees, atan2, floor +from math import degrees, atan2, floor, ceil from optionget import optionGet import mode as m @@ -177,7 +177,8 @@ def distance(line): return cm.radius - min([line[2] - x0, x1 - line[2], line[3] - y0, y1 - line[3]]) else: def distance(line): - return ((line[2] - cm.centerX)**2 + (line[3] - cm.centerY)**2)**0.5 + x, y = line[cm.indices] + return ((x - cm.centerX)**2 + (y - cm.centerY)**2)**0.5 for content in cm.data[start:]: if content[1] <= self.maxTime: if distance(content) >= border: @@ -341,13 +342,9 @@ def compute(self, cm, skip = 12, smooth = 2): self.points.append((avgSpeed / (smoothCounter % smooth))) # computing maximum speed depicted on y-axis - maxSpeed = max(self.points) - if round(maxSpeed, -1) <= maxSpeed: - self.maxY = round(maxSpeed, -1) + 10 - else: - self.maxY = round(maxSpeed, -1) + self.maxY = ceil(max(self.points) / 10) * 10 + - def CM_loaded(self, cm, initTime = 0, minTime = 0, maxTime = "max"): """creates graph when CM file is loaded parameter initTime is the time of the player when the graph is initialized diff --git a/Stuff/Modules/ra.py b/Stuff/Modules/ra.py index bb14af9..292ea53 100644 --- a/Stuff/Modules/ra.py +++ b/Stuff/Modules/ra.py @@ -96,12 +96,17 @@ def _addReinforcedSector(self, string, position): self.sectorRadius = eval(string[position+1]) - def _cacheRemoval(self): if (self.nameA, self.nameR) in RA.cache: RA.cache.pop((self.nameA, self.nameR)) + def _returnSame(self, missing): + toDeleteRat = self._findSame(slice(7,9), missing) + addMissing = {row[0] - 1 for row in self.data if tuple(row[7:9]) in toDeleteRat} + return addMissing + + def removeReflections(self, points = None, deleteSame = True, bothframes = True): if points == None: ps = self.findReflections(time = "max", startTime = 0, results = "indices") @@ -113,7 +118,6 @@ def removeReflections(self, points = None, deleteSame = True, bothframes = True) super().removeReflections(points = ps, deleteSame = deleteSame, bothframes = True) - def _removalCondition(self, row, i, before, reflection): """conditions in order of appearance: large speed between the row and before row diff --git a/Stuff/Modules/version.py b/Stuff/Modules/version.py index bc65f75..1d446eb 100644 --- a/Stuff/Modules/version.py +++ b/Stuff/Modules/version.py @@ -21,7 +21,7 @@ def version(): return ['0', '4', '0'] def date(): - return "23 April 2014" + return "26 April 2014" def copyleft(): return "2013, 2014"