Hope someone can help.
I'm trying to add a hud interaction. This is from my HUD class:
This is in the interaction class
So, I start the mod and the first map it loads everything works fine, you press M and it draws the map. Second map loads, it prints "TESTING" so the tick is getting ran, it prints "Initialized" so the interaction gets added, if you press "m" it prints "pressed m", BUT it doesn't draw the map. Load the third map and everything works, load 4th map same as 2nd map, etc. Any ideas why it would do this?
I'm trying to add a hud interaction. This is from my HUD class:
Code:
simulated function Tick(float deltaTime){ if(tickEnabled){ Level.Game.Broadcast(self, ("TESTING")); PlayerOwner.Player.InteractionMaster.AddInteraction("MyMod.MapInteraction", PlayerOwner.Player); } }
This is in the interaction class
Code:
function Initialize(){ ViewportOwner.Actor.ClientMessage("Initialized"); MyMod(ViewportOwner.Actor.myHUD).setDrawMap(false); PlayerOwner = ViewportOwner.Actor; if (PlayerOwner != none){ MyMod(ViewportOwner.Actor.myHUD).disableTheTick(); } }
Code:
function bool KeyEvent(EInputKey Key, EInputAction Action, FLOAT Delta ) { if ((Action == IST_Press) && (Key == IK_M)){ ViewportOwner.Actor.ClientMessage("Pressed m"); ViewportOwner.Actor.ClientMessage(MyMod(ViewportOwner.Actor.myHud).getTickEnabled()); if(MyMod(ViewportOwner.Actor.myHUD).getDrawMap() == false){ ViewportOwner.Actor.ClientMessage("Drawing map."); MyMod(ViewportOwner.Actor.myHUD).setDrawMap(true); } else{ MyMod(ViewportOwner.Actor.myHUD).setDrawMap(false); } } return false; }
So, I start the mod and the first map it loads everything works fine, you press M and it draws the map. Second map loads, it prints "TESTING" so the tick is getting ran, it prints "Initialized" so the interaction gets added, if you press "m" it prints "pressed m", BUT it doesn't draw the map. Load the third map and everything works, load 4th map same as 2nd map, etc. Any ideas why it would do this?
Comment