Project

Profile

Help

Revision a5c338e8

Added by Vincent Le Goff almost 4 years ago

Put the macros and triggers in the world itself

View differences:

src/ui/window.py
107 107

  
108 108
    def OnMacro(self, e):
109 109
        """Open the macro dialog box."""
110
        dialog = MacroDialog(self.engine)
110
        dialog = MacroDialog(self.engine, self.world)
111 111
        dialog.ShowModal()
112 112
        dialog.Destroy()
113 113

  
......
258 258
            skip = self.HandleHistory(modifiers, key)
259 259

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

  
266 267
        if e.GetEventObject() is self.output:
267 268
            shortcut = key_name(key, modifiers)

Also available in: Unified diff