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