From b05710e95ea828083664d2c333cee0cb001fffd3 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 6 Aug 2015 12:01:06 +0300 Subject: [PATCH] - Deleted maps.xml - Added methods to lock/unlock on map locations: $ pytfall.maps.unlock("pytfall_ms", "general_store") $ pytfall.maps.lock("pytfall_ms", "general_store") Dev mode will notify if there is no such location or throw an Error if there is no such map. Fix #65 --- game/content/db/maps.xml | 86 ------------------------------ game/library/classes - support.rpy | 20 +++++-- 2 files changed, 16 insertions(+), 90 deletions(-) delete mode 100644 game/content/db/maps.xml diff --git a/game/content/db/maps.xml b/game/content/db/maps.xml deleted file mode 100644 index 6fb023415..000000000 --- a/game/content/db/maps.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/game/library/classes - support.rpy b/game/library/classes - support.rpy index 609c8fa39..9912891c4 100644 --- a/game/library/classes - support.rpy +++ b/game/library/classes - support.rpy @@ -373,7 +373,19 @@ init -9 python: def __call__(self, map): return getattr(self, map) - - - class OnScreenMapCell(_object): - pass + + def unlock(self, map, loc): + for l in self(map): + if l["id"] == loc: + l["hidden"] = False + break + else: + notify("Could not find location: {} in map: {} to unlock.".format(map, loc)) + + def lock(self, map, loc): + for l in self(map): + if l["id"] == loc: + l["hidden"] = True + break + else: + notify("Could not find location: {} in map: {} to lock.".format(map, loc))