41 lines
817 B
Ucode
Raw Normal View History

2022-09-03 20:26:40 +03:00
class KFGUI_Button extends KFGUI_Clickable;
2021-06-12 23:11:37 +03:00
2020-01-10 07:14:11 -06:00
var() Canvas.CanvasIcon OverlayTexture;
2021-06-13 05:54:35 +03:00
var() string ButtonText, GamepadButtonName;
2020-01-10 07:14:11 -06:00
var() color TextColor;
var() Canvas.FontRenderInfo TextFontInfo;
2021-06-13 05:54:35 +03:00
var() byte FontScale, ExtravDir;
2020-01-10 07:14:11 -06:00
var bool bIsHighlighted;
function DrawMenu()
{
Owner.CurrentStyle.RenderButton(Self);
2020-01-10 07:14:11 -06:00
}
function bool GetUsingGamepad()
{
return Owner.bUsingGamepad && GamepadButtonName != "";
2020-01-10 07:14:11 -06:00
}
2021-06-13 06:00:19 +03:00
function HandleMouseClick(bool bRight)
2020-01-10 07:14:11 -06:00
{
2021-06-13 05:53:33 +03:00
if (bRight)
OnClickRight(Self);
else OnClickLeft(Self);
2020-01-10 07:14:11 -06:00
}
2021-06-13 06:00:19 +03:00
Delegate OnClickLeft(KFGUI_Button Sender);
Delegate OnClickRight(KFGUI_Button Sender);
2020-01-10 07:14:11 -06:00
Delegate bool DrawOverride(Canvas C, KFGUI_Button B)
{
return false;
2020-01-10 07:14:11 -06:00
}
defaultproperties
{
ButtonText="Button!"
2021-06-13 05:54:35 +03:00
TextColor=(R=0, G=0, B=0, A=255)
TextFontInfo=(bClipText=true, bEnableShadow=true)
FontScale=1
}