Esempio n. 1
0
        public override void Create()
        {
            behaviours = new List <GameBehaviour>(ModData.mods.Values.Select(m => m.gameBehaviour).Where(gb => gb != null));

            base.Create();

            preUpdate        = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PreUpdate");
            postUpdate       = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PostUpdate");
            onUpdateKeyboard = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "OnUpdateKeyboard");

            preDraw  = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PreDraw");
            postDraw = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PostDraw");

            preScreenClear  = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PreScreenClear");
            postScreenClear = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PostScreenClear");

            preDrawBackground  = HookManager.CreateHooks <GameBehaviour, Func <SpriteBatch, bool> >(behaviours, "PreDrawBackground");
            postDrawBackground = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PostDrawBackground");

            updateDebug = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "UpdateDebug");

            updateMusic = HookManager.CreateHooks <GameBehaviour, Action <Ref <BgmEntry> > >(behaviours, "UpdateMusic");
        }
Esempio n. 2
0
 public void OnUnload()
 {
     HookManager.Call(onUnload);
 }
Esempio n. 3
0
 public void OnAllModsLoaded()
 {
     HookManager.Call(onAllModsLoaded);
 }
Esempio n. 4
0
 public void Create()
 {
     onAllModsLoaded = HookManager.CreateHooks <ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded");
     onUnload        = HookManager.CreateHooks <ModDef, Action>(ModData.mods.Values, "OnUnload");
 }
Esempio n. 5
0
 public void OnUpdateKeyboard()
 {
     HookManager.Call(onUpdateKeyboard);
 }
Esempio n. 6
0
 public void PostUpdate()
 {
     HookManager.Call(postUpdate);
 }
Esempio n. 7
0
 public void PreUpdate()
 {
     HookManager.Call(preUpdate);
 }
Esempio n. 8
0
 public void PostScreenClear()
 {
     HookManager.Call(postScreenClear);
 }
Esempio n. 9
0
 public void PreScreenClear()
 {
     HookManager.Call(preScreenClear);
 }
Esempio n. 10
0
 public void PostDraw(SpriteBatch sb)
 {
     HookManager.Call(postDraw, sb);
 }
Esempio n. 11
0
 public void PreDraw(SpriteBatch sb)
 {
     HookManager.Call(preDraw, sb);
 }
Esempio n. 12
0
 public void PostDrawBackground(SpriteBatch sb)
 {
     HookManager.Call(postDrawBackground, sb);
 }
Esempio n. 13
0
        public bool PreDrawBackground(SpriteBatch sb)
        {
            var r = HookManager.Call(preDrawBackground, sb);

            return(r.Length == 0 || r.All(Convert.ToBoolean));
        }