////////////////////////////////////////////////////////////////////////// // Your module's main class must have a constructor that takes // ONLY a ModuleHost object. public EmptyModule( Furnarchy.ModuleHost host ) { m_host = host; // Subscribe to some commonly used events. (optional) m_host.EnabledEvent += new Furnarchy.EnabledDelegate( onEnabled ); m_host.DisabledEvent += new Furnarchy.DisabledDelegate( onDisabled ); m_host.TouchedEvent += new Furnarchy.TouchedDelegate( onTouched ); m_host.TickEvent += new Furnarchy.TickDelegate( onTick ); }
////////////////////////////////////////////////////////////////////////// // Your module's main class must have a constructor that takes // ONLY a ModuleHost object. public EmptyModule(Furnarchy.ModuleHost host) { m_host = host; // Subscribe to some commonly used events. (optional) m_host.EnabledEvent += new Furnarchy.EnabledDelegate(onEnabled); m_host.DisabledEvent += new Furnarchy.DisabledDelegate(onDisabled); m_host.TouchedEvent += new Furnarchy.TouchedDelegate(onTouched); m_host.TickEvent += new Furnarchy.TickDelegate(onTick); }
////////////////////////////////////////////////////////////////////////// // Your module's main class must have a constructor that takes // ONLY a ModuleHost object. public EmptyModule( Furnarchy.ModuleHost host ) { m_host = host; // Our list of toasters. m_toasters = new LinkedList<Toaster>( ); // Create our player context submenu you see when you right-click // on an avatar. m_player_menu = new MenuItem( ); m_player_menu.MenuItems.Add( "Toaster!" ).Click += new EventHandler( onMenuToasterClick ); // Attach it to Furc's player context menu. m_host.Client.attachPlayerMenu( m_player_menu ); /* Subscribe to events. */ // We need to intercept avatar creation, movement, and update commands to make // sure people are created as and remain toasters. The Net subsystem // exposes these events. m_host.Net.InboundAvatarCreateEvent += new Furnarchy.InboundAvatarCreateDelegate( onInboundAvatarCreate ); m_host.Net.InboundAvatarMoveEvent += new Furnarchy.InboundAvatarMoveDelegate( onInboundAvatarMove ); m_host.Net.InboundAvatarUpdateEvent += new Furnarchy.InboundAvatarUpdateDelegate( onInboundAvatarUpdate ); m_host.Net.InboundAvatarShowEvent += new Furnarchy.InboundAvatarShowDelegate( onInboundAvatarShow ); m_host.Net.InboundAvatarShow2Event += new Furnarchy.InboundAvatarShow2Delegate( onInboundAvatarShow2 ); // The Client subsystem's PlayerMenuShowingEvent event will tell us when the player // context menu is being shown and the player's name. This allows us to customize the // menu per-player. m_host.Client.PlayerMenuShowingEvent += new Furnarchy.PlayerMenuShowingDelegate( onPlayerMenuShowing ); // Some other common events we'll handle. m_host.EnabledEvent += new Furnarchy.EnabledDelegate( onEnabled ); m_host.DisabledEvent += new Furnarchy.DisabledDelegate( onDisabled ); m_host.TouchedEvent += new Furnarchy.TouchedDelegate( onTouched ); m_host.CommandEvent += new Furnarchy.CommandDelegate( onCommand ); // Load up the toasters file. loadToasters( ); // Enable ourselves right away. m_host.Enabled = true; }
////////////////////////////////////////////////////////////////////////// // Your module's main class must have a constructor that takes // ONLY a ModuleHost object. public EmptyModule(Furnarchy.ModuleHost host) { m_host = host; // Our list of toasters. m_toasters = new LinkedList <Toaster>( ); // Create our player context submenu you see when you right-click // on an avatar. m_player_menu = new MenuItem( ); m_player_menu.MenuItems.Add("Toaster!").Click += new EventHandler(onMenuToasterClick); // Attach it to Furc's player context menu. m_host.Client.attachPlayerMenu(m_player_menu); /* Subscribe to events. */ // We need to intercept avatar creation, movement, and update commands to make // sure people are created as and remain toasters. The Net subsystem // exposes these events. m_host.Net.InboundAvatarCreateEvent += new Furnarchy.InboundAvatarCreateDelegate(onInboundAvatarCreate); m_host.Net.InboundAvatarMoveEvent += new Furnarchy.InboundAvatarMoveDelegate(onInboundAvatarMove); m_host.Net.InboundAvatarUpdateEvent += new Furnarchy.InboundAvatarUpdateDelegate(onInboundAvatarUpdate); m_host.Net.InboundAvatarShowEvent += new Furnarchy.InboundAvatarShowDelegate(onInboundAvatarShow); m_host.Net.InboundAvatarShow2Event += new Furnarchy.InboundAvatarShow2Delegate(onInboundAvatarShow2); // The Client subsystem's PlayerMenuShowingEvent event will tell us when the player // context menu is being shown and the player's name. This allows us to customize the // menu per-player. m_host.Client.PlayerMenuShowingEvent += new Furnarchy.PlayerMenuShowingDelegate(onPlayerMenuShowing); // Some other common events we'll handle. m_host.EnabledEvent += new Furnarchy.EnabledDelegate(onEnabled); m_host.DisabledEvent += new Furnarchy.DisabledDelegate(onDisabled); m_host.TouchedEvent += new Furnarchy.TouchedDelegate(onTouched); m_host.CommandEvent += new Furnarchy.CommandDelegate(onCommand); // Load up the toasters file. loadToasters( ); // Enable ourselves right away. m_host.Enabled = true; }