Project

Profile

Help

Revision e8ebc4c5

Added by Vincent Le Goff over 4 years ago

Add the macros in the client (not the engine itself)

View differences:

src/client.py
63 63
        self.running = False
64 64
        self.sharp_engine = SharpScript(engine, self)
65 65
        self.triggers = []
66
        self.macros = []
66 67

  
67 68
        # Try to connect to the specified host and port
68 69
        self.client = Telnet(host, port)
src/game.py
68 68
        self.settings = Settings(self)
69 69
        self.worlds = {}
70 70
        self.default_world = None
71
        self.macros = {}
72 71
        self.level = Level.engine
73 72

  
74 73
    def load(self):
src/sharp/functions/macro.py
40 40
        """Creates the macro."""
41 41
        key, modifiers = key_code(shortcut)
42 42
        macro = ObjMacro(key, modifiers, action, self.sharp_engine)
43
        self.sharp_engine.engine.macros[key, modifiers] = macro
43
        self.client.macros.append(macro)
src/ui/window.py
258 258
            skip = self.HandleHistory(modifiers, key)
259 259

  
260 260
        # Look for matching macros
261
        for code, macro in self.engine.macros.items():
261
        for macro in self.client.macros:
262
            code = (macro.key, macro.modifiers)
262 263
            if code == (key, modifiers):
263 264
                macro.execute(self.engine, self.client)
264 265

  

Also available in: Unified diff