//08/20/2026
class NewbieInteraction extends Interaction;

var bool bShowCrosshair;
var float CharWidth, CharHeight;
var float CenterX, CenterY;
var string Crosshair;

function bool KeyEvent(EInputKey Key, EInputAction Action, FLOAT Delta)
{
    if (Action == IST_Release && Key == IK_B)
    {
        OpenBuyMenu();
		return true;
    }
    if (Key == IK_RightMouse)
    {
        if (Action == IST_Press)
        {
            bShowCrosshair = false;
        }
        else if (Action == IST_Release)
        {
            bShowCrosshair = true;
        }
    }
    return false;
}

function OpenBuyMenu()
{
    ViewportOwner.Actor.ClientOpenMenu("KFGUI.GUIBuyMenu",,"WeaponLocker", string(KFHumanPawn(ViewportOwner.Actor.Pawn).MaxCarryWeight));
}

function PostRender(Canvas C)
{
    /*C.SetPos(50,100);
    C.SetDrawColor(255,255,255);
    C.DrawText("All work and no play makes Jack a dull boy.");*/
    
    if (ViewportOwner.Actor == None || ViewportOwner.Actor.Pawn == None)
         return;
    if (!bShowCrosshair)
        return;

    Crosshair = "+";
    C.TextSize(Crosshair, CharWidth, CharHeight);
    CenterX = (C.SizeX * 0.5) - (CharWidth * 0.5);
    CenterY = (C.SizeY * 0.5) - (CharHeight * 0.5);
    C.SetPos(CenterX, CenterY);
    C.SetDrawColor(255,255,255);
    C.DrawText(Crosshair);
}

defaultproperties {
    bActive=True
    bVisible=True
    bShowCrosshair=True
}
