fix code style

This commit is contained in:
GenZmeY 2021-06-13 05:54:35 +03:00
parent 68a5e16a9e
commit f63b4a80a3
35 changed files with 777 additions and 777 deletions

View File

@ -5,7 +5,7 @@ Class ClassicStyle extends KF2Style;
function RenderFramedWindow( KFGUI_FloatingWindow P) function RenderFramedWindow( KFGUI_FloatingWindow P)
{ {
local int XS,YS,TitleHeight; local int XS, YS, TitleHeight;
local float XL, YL, FontScale; local float XL, YL, FontScale;
XS = Canvas.ClipX-Canvas.OrgX; XS = Canvas.ClipX-Canvas.OrgX;
@ -13,48 +13,48 @@ function RenderFramedWindow( KFGUI_FloatingWindow P)
TitleHeight = DefaultHeight; TitleHeight = DefaultHeight;
if (P.bWindowFocused) if (P.bWindowFocused)
Canvas.SetDrawColor(105,105,105,255); Canvas.SetDrawColor(105, 105, 105, 255);
else Canvas.SetDrawColor(85,85,85,P.FrameOpacity); else Canvas.SetDrawColor(85, 85, 85, P.FrameOpacity);
// Frame Header // Frame Header
Canvas.SetPos(0, 0); Canvas.SetPos(0, 0);
Canvas.DrawTileStretched(TabTextures[`TAB_TOP],XS,TitleHeight,0,0,128,16); Canvas.DrawTileStretched(TabTextures[`TAB_TOP], XS, TitleHeight, 0,0, 128, 16);
// Frame itself. // Frame itself.
Canvas.SetPos(0, TitleHeight); Canvas.SetPos(0, TitleHeight);
Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT],XS,YS-TitleHeight,0,0,128,128); Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT], XS, YS-TitleHeight, 0,0, 128, 128);
// Title. // Title.
if (P.WindowTitle != "") if (P.WindowTitle != "")
{ {
Canvas.Font = PickFont(FontScale); Canvas.Font = PickFont(FontScale);
Canvas.TextSize(P.WindowTitle,XL,YL,FontScale,FontScale); Canvas.TextSize(P.WindowTitle, XL, YL, FontScale, FontScale);
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos((XS*0.5)-(XL*0.5),0); Canvas.SetPos((XS*0.5)-(XL*0.5), 0);
Canvas.DrawText(P.WindowTitle,,FontScale,FontScale); Canvas.DrawText(P.WindowTitle, ,FontScale, FontScale);
} }
} }
function RenderWindow( KFGUI_Page P) function RenderWindow( KFGUI_Page P)
{ {
local int XS,YS; local int XS, YS;
XS = Canvas.ClipX-Canvas.OrgX; XS = Canvas.ClipX-Canvas.OrgX;
YS = Canvas.ClipY-Canvas.OrgY; YS = Canvas.ClipY-Canvas.OrgY;
// Frame itself. // Frame itself.
if (P.bWindowFocused) if (P.bWindowFocused)
Canvas.SetDrawColor(105,105,105,255); Canvas.SetDrawColor(105, 105, 105, 255);
else Canvas.SetDrawColor(85,85,85,P.FrameOpacity); else Canvas.SetDrawColor(85, 85, 85, P.FrameOpacity);
Canvas.SetPos(0, 0); Canvas.SetPos(0, 0);
Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT],XS,YS,0,0,128,128); Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT], XS, YS, 0,0, 128, 128);
} }
function RenderToolTip( KFGUI_Tooltip TT) function RenderToolTip( KFGUI_Tooltip TT)
{ {
local int i; local int i;
local float X,Y,XS,YS,TX,TY,TS,DefFontHeight; local float X, Y,XS, YS, TX, TY, TS, DefFontHeight;
Canvas.Font = PickFont(TS); Canvas.Font = PickFont(TS);
@ -63,8 +63,8 @@ function RenderToolTip( KFGUI_Tooltip TT)
for (i=0; i < TT.Lines.Length; ++i) for (i=0; i < TT.Lines.Length; ++i)
{ {
if (TT.Lines[i] != "") if (TT.Lines[i] != "")
Canvas.TextSize(TT.Lines[i],XS,YS); Canvas.TextSize(TT.Lines[i], XS, YS);
TX = FMax(XS,TX); TX = FMax(XS, TX);
} }
TX*=TS; TX*=TS;
@ -82,30 +82,30 @@ function RenderToolTip( KFGUI_Tooltip TT)
Y = TT.CompPos[1]-TY; Y = TT.CompPos[1]-TY;
if (TT.CurrentAlpha < 255) if (TT.CurrentAlpha < 255)
TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255); TT.CurrentAlpha = Min(TT.CurrentAlpha+25, 255);
// Reset clipping. // Reset clipping.
Canvas.SetOrigin(0,0); Canvas.SetOrigin(0, 0);
Canvas.SetClip(TT.Owner.ScreenSize.X,TT.Owner.ScreenSize.Y); Canvas.SetClip(TT.Owner.ScreenSize.X, TT.Owner.ScreenSize.Y);
// Draw frame. // Draw frame.
Canvas.SetDrawColor(115,115,115,TT.CurrentAlpha); Canvas.SetDrawColor(115, 115, 115, TT.CurrentAlpha);
Canvas.SetPos(X-2,Y-2); Canvas.SetPos(X-2, Y-2);
DrawBoxHollow(X-2,Y-2,TX+4,TY+4,2); DrawBoxHollow(X-2, Y-2, TX+4, TY+4, 2);
Canvas.SetDrawColor(5,5,5,TT.CurrentAlpha); Canvas.SetDrawColor(5, 5,5, TT.CurrentAlpha);
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawWhiteBox(TX,TY); DrawWhiteBox(TX, TY);
DefFontHeight = DefaultHeight; DefFontHeight = DefaultHeight;
// Draw text. // Draw text.
Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha); Canvas.SetDrawColor(255, 255, 255, TT.CurrentAlpha);
X+=TOOLTIP_BORDER; X+=TOOLTIP_BORDER;
Y+=TOOLTIP_BORDER; Y+=TOOLTIP_BORDER;
for (i=0; i < TT.Lines.Length; ++i) for (i=0; i < TT.Lines.Length; ++i)
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(TT.Lines[i],,TS,TS,TT.TextFontInfo); Canvas.DrawText(TT.Lines[i], ,TS, TS, TT.TextFontInfo);
Y+=DefFontHeight; Y+=DefFontHeight;
} }
} }
@ -122,7 +122,7 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
else Canvas.SetDrawColor(15, 15, 15, 160); else Canvas.SetDrawColor(15, 15, 15, 160);
Canvas.SetPos(0.f, 0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(BorderTextures[`BOX_INNERBORDER],S.CompPos[2],S.CompPos[3],0,0,128,128); Canvas.DrawTileStretched(BorderTextures[`BOX_INNERBORDER], S.CompPos[2], S.CompPos[3], 0,0, 128, 128);
if (S.bDisabled) if (S.bDisabled)
return; return;
@ -131,7 +131,7 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
i = 3; i = 3;
else i = 2; else i = 2;
S.SliderScale = FMax(S.PageStep * (S.CompPos[i] - 32.f) / (S.MaxRange + S.PageStep),S.CalcButtonScale); S.SliderScale = FMax(S.PageStep * (S.CompPos[i] - 32.f) / (S.MaxRange + S.PageStep), S.CalcButtonScale);
if (S.bGrabbedScroller) if (S.bGrabbedScroller)
{ {
@ -148,20 +148,20 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale); S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale);
if (S.bGrabbedScroller) if (S.bGrabbedScroller)
Canvas.SetDrawColor(125,125,125,200); Canvas.SetDrawColor(125, 125, 125, 200);
else if (S.bFocused) else if (S.bFocused)
Canvas.SetDrawColor(200,200,200,200); Canvas.SetDrawColor(200, 200, 200, 200);
else Canvas.SetDrawColor(255,255,255,200); else Canvas.SetDrawColor(255, 255, 255, 200);
if (S.bVertical) if (S.bVertical)
{ {
Canvas.SetPos(0.f, S.ButtonOffset); Canvas.SetPos(0.f, S.ButtonOffset);
Canvas.DrawTileStretched(ScrollTexture,S.CompPos[2],S.SliderScale,0,0,32,32); Canvas.DrawTileStretched(ScrollTexture, S.CompPos[2], S.SliderScale, 0,0, 32, 32);
} }
else else
{ {
Canvas.SetPos(S.ButtonOffset, 0.f); Canvas.SetPos(S.ButtonOffset, 0.f);
Canvas.DrawTileStretched(ScrollTexture,S.SliderScale,S.CompPos[3],0,0,32,32); Canvas.DrawTileStretched(ScrollTexture, S.SliderScale, S.CompPos[3], 0,0, 32, 32);
} }
} }
@ -169,7 +169,7 @@ function RenderCheckbox( KFGUI_CheckBox C)
{ {
local Texture CheckMark; local Texture CheckMark;
DrawTileStretched(ItemBoxTextures[`ITEMBOX_DISABLED],0.f,0.f,C.CompPos[2],C.CompPos[3]); DrawTileStretched(ItemBoxTextures[`ITEMBOX_DISABLED], 0.f, 0.f, C.CompPos[2], C.CompPos[3]);
if (C.bChecked) if (C.bChecked)
{ {
@ -179,48 +179,48 @@ function RenderCheckbox( KFGUI_CheckBox C)
CheckMark = CheckBoxTextures[`CHECKMARK_HIGHLIGHTED]; CheckMark = CheckBoxTextures[`CHECKMARK_HIGHLIGHTED];
else CheckMark = CheckBoxTextures[`CHECKMARK_NORMAL]; else CheckMark = CheckBoxTextures[`CHECKMARK_NORMAL];
Canvas.SetDrawColor(255,255,255,255); Canvas.SetDrawColor(255, 255, 255, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(CheckMark,C.CompPos[2],C.CompPos[3],0,0,CheckMark.GetSurfaceWidth(),CheckMark.GetSurfaceHeight()); Canvas.DrawTile(CheckMark, C.CompPos[2], C.CompPos[3], 0,0, CheckMark.GetSurfaceWidth(), CheckMark.GetSurfaceHeight());
} }
} }
function RenderComboBox( KFGUI_ComboBox C) function RenderComboBox( KFGUI_ComboBox C)
{ {
if (C.bDisabled) if (C.bDisabled)
Canvas.SetDrawColor(64,64,64,255); Canvas.SetDrawColor(64, 64, 64, 255);
else if (C.bPressedDown) else if (C.bPressedDown)
Canvas.SetDrawColor(220,220,220,255); Canvas.SetDrawColor(220, 220, 220, 255);
else if (C.bFocused) else if (C.bFocused)
Canvas.SetDrawColor(190,190,190,255); Canvas.SetDrawColor(190, 190, 190, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(BorderTextures[`BOX_INNERBORDER],C.CompPos[2],C.CompPos[3],0,0,128,128); Canvas.DrawTileStretched(BorderTextures[`BOX_INNERBORDER], C.CompPos[2], C.CompPos[3], 0,0, 128, 128);
DrawArrowBox(3, C.CompPos[2]-32, 0.5f, 32, 32); DrawArrowBox(3, C.CompPos[2]-32, 0.5f, 32, 32);
if (C.SelectedIndex < C.Values.Length && C.Values[C.SelectedIndex] != "") if (C.SelectedIndex < C.Values.Length && C.Values[C.SelectedIndex] != "")
{ {
Canvas.SetPos(C.BorderSize,(C.CompPos[3]-C.TextHeight)*0.5); Canvas.SetPos(C.BorderSize, (C.CompPos[3]-C.TextHeight)*0.5);
if (C.bDisabled) if (C.bDisabled)
Canvas.DrawColor = C.TextColor*0.5f; Canvas.DrawColor = C.TextColor*0.5f;
else Canvas.DrawColor = C.TextColor; else Canvas.DrawColor = C.TextColor;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX-C.BorderSize,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX-C.BorderSize, Canvas.ClipY);
Canvas.DrawText(C.Values[C.SelectedIndex],,C.TextScale,C.TextScale,C.TextFontInfo); Canvas.DrawText(C.Values[C.SelectedIndex], ,C.TextScale, C.TextScale, C.TextFontInfo);
Canvas.PopMaskRegion(); Canvas.PopMaskRegion();
} }
} }
function RenderComboList( KFGUI_ComboSelector C) function RenderComboList( KFGUI_ComboSelector C)
{ {
local float X,Y,YL,YP,Edge; local float X, Y,YL, YP, Edge;
local int i; local int i;
local bool bCheckMouse; local bool bCheckMouse;
// Draw background. // Draw background.
Edge = C.Combo.BorderSize; Edge = C.Combo.BorderSize;
Canvas.SetPos(0.f, 0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT],C.CompPos[2],C.CompPos[3],0,0,128,128); Canvas.DrawTileStretched(BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT], C.CompPos[2], C.CompPos[3], 0,0, 128, 128);
// While rendering, figure out mouse focus row. // While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX; X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -234,24 +234,24 @@ function RenderComboList( KFGUI_ComboSelector C)
YP = Edge; YP = Edge;
C.CurrentRow = -1; C.CurrentRow = -1;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX, Canvas.ClipY);
for (i=0; i < C.Combo.Values.Length; ++i) for (i=0; i < C.Combo.Values.Length; ++i)
{ {
if (bCheckMouse && Y >= YP && Y <= (YP+YL)) if (bCheckMouse && Y >= YP && Y <= (YP+YL))
{ {
bCheckMouse = false; bCheckMouse = false;
C.CurrentRow = i; C.CurrentRow = i;
Canvas.SetPos(4.f,YP); Canvas.SetPos(4.f, YP);
Canvas.SetDrawColor(128,48,48,255); Canvas.SetDrawColor(128, 48, 48, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),YL); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), YL);
} }
Canvas.SetPos(Edge,YP); Canvas.SetPos(Edge, YP);
if (i == C.Combo.SelectedIndex) if (i == C.Combo.SelectedIndex)
Canvas.DrawColor = C.Combo.SelectedTextColor; Canvas.DrawColor = C.Combo.SelectedTextColor;
else Canvas.DrawColor = C.Combo.TextColor; else Canvas.DrawColor = C.Combo.TextColor;
Canvas.DrawText(C.Combo.Values[i],,C.Combo.TextScale,C.Combo.TextScale,C.Combo.TextFontInfo); Canvas.DrawText(C.Combo.Values[i], ,C.Combo.TextScale, C.Combo.TextScale, C.Combo.TextFontInfo);
YP+=YL; YP+=YL;
} }
@ -265,14 +265,14 @@ function RenderComboList( KFGUI_ComboSelector C)
function RenderRightClickMenu( KFGUI_RightClickMenu C) function RenderRightClickMenu( KFGUI_RightClickMenu C)
{ {
local float X,Y,XL,YL,YP,Edge,TextScale; local float X, Y,XL, YL, YP, Edge, TextScale;
local int i; local int i;
local bool bCheckMouse; local bool bCheckMouse;
local string S; local string S;
// Draw background. // Draw background.
Edge = C.EdgeSize; Edge = C.EdgeSize;
DrawOutlinedBox(0.f,0.f,C.CompPos[2],C.CompPos[3],Edge,C.BoxColor,C.OutlineColor); DrawOutlinedBox(0.f, 0.f, C.CompPos[2], C.CompPos[3], Edge, C.BoxColor, C.OutlineColor);
// While rendering, figure out mouse focus row. // While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX; X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -285,34 +285,34 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
YP = Edge*2; YP = Edge*2;
C.CurrentRow = -1; C.CurrentRow = -1;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX, Canvas.ClipY);
for (i=0; i < C.ItemRows.Length; ++i) for (i=0; i < C.ItemRows.Length; ++i)
{ {
if (C.ItemRows[i].bSplitter) if (C.ItemRows[i].bSplitter)
S = "-------"; S = "-------";
else S = C.ItemRows[i].Text; else S = C.ItemRows[i].Text;
Canvas.TextSize(S,XL,YL,TextScale,TextScale); Canvas.TextSize(S, XL, YL, TextScale, TextScale);
if (bCheckMouse && Y >= YP && Y <= (YP+YL)) if (bCheckMouse && Y >= YP && Y <= (YP+YL))
{ {
bCheckMouse = false; bCheckMouse = false;
C.CurrentRow = i; C.CurrentRow = i;
Canvas.SetPos(Edge,YP); Canvas.SetPos(Edge, YP);
Canvas.SetDrawColor(128,0,0,255); Canvas.SetDrawColor(128, 0,0, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),YL); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), YL);
} }
Canvas.SetPos(Edge*6,YP); Canvas.SetPos(Edge*6, YP);
if (C.ItemRows[i].bSplitter) if (C.ItemRows[i].bSplitter)
Canvas.SetDrawColor(255,255,255,255); Canvas.SetDrawColor(255, 255, 255, 255);
else else
{ {
if (C.ItemRows[i].bDisabled) if (C.ItemRows[i].bDisabled)
Canvas.SetDrawColor(148,148,148,255); Canvas.SetDrawColor(148, 148, 148, 255);
else Canvas.SetDrawColor(248,248,248,255); else Canvas.SetDrawColor(248, 248, 248, 255);
} }
Canvas.DrawText(S,,TextScale,TextScale); Canvas.DrawText(S, ,TextScale, TextScale);
YP+=YL; YP+=YL;
} }
@ -326,7 +326,7 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
function RenderButton( KFGUI_Button B) function RenderButton( KFGUI_Button B)
{ {
local float XL,YL,TS,AX,AY,GamepadTexSize; local float XL, YL, TS, AX, AY, GamepadTexSize;
local Texture2D Mat, ButtonTex; local Texture2D Mat, ButtonTex;
local bool bDrawOverride; local bool bDrawOverride;
@ -341,13 +341,13 @@ function RenderButton( KFGUI_Button B)
Mat = ButtonTextures[`BUTTON_HIGHLIGHTED]; Mat = ButtonTextures[`BUTTON_HIGHLIGHTED];
else Mat = ButtonTextures[`BUTTON_NORMAL]; else Mat = ButtonTextures[`BUTTON_NORMAL];
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Mat,B.CompPos[2],B.CompPos[3],0,0,32,32); Canvas.DrawTileStretched(Mat, B.CompPos[2], B.CompPos[3], 0,0, 32, 32);
if (B.OverlayTexture.Texture != None) if (B.OverlayTexture.Texture != None)
{ {
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(B.OverlayTexture.Texture,B.CompPos[2],B.CompPos[3],B.OverlayTexture.U,B.OverlayTexture.V,B.OverlayTexture.UL,B.OverlayTexture.VL); Canvas.DrawTile(B.OverlayTexture.Texture, B.CompPos[2], B.CompPos[3], B.OverlayTexture.U, B.OverlayTexture.V, B.OverlayTexture.UL, B.OverlayTexture.VL);
} }
} }
@ -362,18 +362,18 @@ function RenderButton( KFGUI_Button B)
while( true) while( true)
{ {
Canvas.TextSize(B.ButtonText,XL,YL,TS,TS); Canvas.TextSize(B.ButtonText, XL, YL, TS, TS);
if (XL < (B.CompPos[2]*0.9) && YL < (B.CompPos[3]*0.9)) if (XL < (B.CompPos[2]*0.9) && YL < (B.CompPos[3]*0.9))
break; break;
TS -= 0.001; TS -= 0.001;
} }
Canvas.SetPos((B.CompPos[2]-XL)*0.5,(B.CompPos[3]-YL)*0.5); Canvas.SetPos((B.CompPos[2]-XL)*0.5, (B.CompPos[3]-YL)*0.5);
if (B.bDisabled) if (B.bDisabled)
Canvas.DrawColor = B.TextColor*0.5f; Canvas.DrawColor = B.TextColor*0.5f;
else Canvas.DrawColor = B.TextColor; else Canvas.DrawColor = B.TextColor;
Canvas.DrawText(B.ButtonText,,TS,TS,B.TextFontInfo); Canvas.DrawText(B.ButtonText, ,TS, TS, B.TextFontInfo);
if (B.GetUsingGamepad()) if (B.GetUsingGamepad())
{ {
@ -399,8 +399,8 @@ function RenderButton( KFGUI_Button B)
break; break;
} }
Canvas.SetPos(Canvas.CurX-(GamepadTexSize*1.25),(B.CompPos[3]-GamepadTexSize)*0.5); Canvas.SetPos(Canvas.CurX-(GamepadTexSize*1.25), (B.CompPos[3]-GamepadTexSize)*0.5);
Canvas.DrawRect(GamepadTexSize,GamepadTexSize,ButtonTex); Canvas.DrawRect(GamepadTexSize, GamepadTexSize, ButtonTex);
} }
} }
} }

View File

@ -6,7 +6,7 @@ Class GUIStyleBase extends Object
var Texture2D ItemTex; var Texture2D ItemTex;
var array < Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures; var array < Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures;
var Texture2D ScrollTexture,FavoriteIcon,BankNoteIcon; var Texture2D ScrollTexture, FavoriteIcon, BankNoteIcon;
var SoundCue MenuDown, MenuDrag, MenuEdit, MenuFade, MenuClick, MenuHover, MenuUp; var SoundCue MenuDown, MenuDrag, MenuEdit, MenuFade, MenuClick, MenuHover, MenuUp;
@ -37,7 +37,7 @@ function InitStyle()
{ {
local FColorInfo ColorInfo; local FColorInfo ColorInfo;
ItemTex=Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02",class'Texture2D')); ItemTex=Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02", class'Texture2D'));
if (ItemTex == None) if (ItemTex == None)
ItemTex=Texture2D'EngineMaterials.DefaultWhiteGrid'; ItemTex=Texture2D'EngineMaterials.DefaultWhiteGrid';
@ -47,87 +47,87 @@ function InitStyle()
BlurColor2 = MakeColor(40, 40, 40, 140); BlurColor2 = MakeColor(40, 40, 40, 140);
ColorInfo.Code='Q'; ColorInfo.Code='Q';
ColorInfo.Color = MakeColor(0,140,0,255); // Dark Green ColorInfo.Color = MakeColor(0, 140, 0,255); // Dark Green
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='E'; ColorInfo.Code='E';
ColorInfo.Color = MakeColor(210,180,140,255); // Tan ColorInfo.Color = MakeColor(210, 180, 140, 255); // Tan
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='R'; ColorInfo.Code='R';
ColorInfo.Color = MakeColor(128,0,0,255); // Dark Red ColorInfo.Color = MakeColor(128, 0,0, 255); // Dark Red
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='T'; ColorInfo.Code='T';
ColorInfo.Color = MakeColor(153,102,204,255); // Purple ColorInfo.Color = MakeColor(153, 102, 204, 255); // Purple
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='U'; ColorInfo.Code='U';
ColorInfo.Color = MakeColor(128,128,128,255); // Dark Gray ColorInfo.Color = MakeColor(128, 128, 128, 255); // Dark Gray
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='I'; ColorInfo.Code='I';
ColorInfo.Color = MakeColor(255,170,0,255); // Orange ColorInfo.Color = MakeColor(255, 170, 0,255); // Orange
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='O'; ColorInfo.Code='O';
ColorInfo.Color = MakeColor(255,204,153,255); // Cream ColorInfo.Color = MakeColor(255, 204, 153, 255); // Cream
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='P'; ColorInfo.Code='P';
ColorInfo.Color = MakeColor(209,216,168,255); // Olive ColorInfo.Color = MakeColor(209, 216, 168, 255); // Olive
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='A'; ColorInfo.Code='A';
ColorInfo.Color = MakeColor(204,51,51,255); // Brick ColorInfo.Color = MakeColor(204, 51, 51, 255); // Brick
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='S'; ColorInfo.Code='S';
ColorInfo.Color = MakeColor(153,102,51,255); // Brown ColorInfo.Color = MakeColor(153, 102, 51, 255); // Brown
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='D'; ColorInfo.Code='D';
ColorInfo.Color = MakeColor(0,204,0,255); // Green ColorInfo.Color = MakeColor(0, 204, 0,255); // Green
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='F'; ColorInfo.Code='F';
ColorInfo.Color = MakeColor(238,238,51,255); // Yellow ColorInfo.Color = MakeColor(238, 238, 51, 255); // Yellow
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='G'; ColorInfo.Code='G';
ColorInfo.Color = MakeColor(200,0,0,255); // Red ColorInfo.Color = MakeColor(200, 0,0, 255); // Red
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='H'; ColorInfo.Code='H';
ColorInfo.Color = MakeColor(153,153,255,255); // Blue ColorInfo.Color = MakeColor(153, 153, 255, 255); // Blue
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='J'; ColorInfo.Code='J';
ColorInfo.Color = MakeColor(192,192,192,255); // Silver ColorInfo.Color = MakeColor(192, 192, 192, 255); // Silver
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='K'; ColorInfo.Code='K';
ColorInfo.Color = MakeColor(255,204,0,255); // Gold ColorInfo.Color = MakeColor(255, 204, 0,255); // Gold
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='C'; ColorInfo.Code='C';
ColorInfo.Color = MakeColor(255,255,255,255); // White ColorInfo.Color = MakeColor(255, 255, 255, 255); // White
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='V'; ColorInfo.Code='V';
ColorInfo.Color = MakeColor(0,191,255,255); // Sky Blue ColorInfo.Color = MakeColor(0, 191, 255, 255); // Sky Blue
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='B'; ColorInfo.Code='B';
ColorInfo.Color = MakeColor(204,204,204,255); // Gray ColorInfo.Color = MakeColor(204, 204, 204, 255); // Gray
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='N'; ColorInfo.Code='N';
ColorInfo.Color = MakeColor(0,128,255,255); // Dark Sky Blue ColorInfo.Color = MakeColor(0, 128, 255, 255); // Dark Sky Blue
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
ColorInfo.Code='M'; ColorInfo.Code='M';
ColorInfo.Color = MakeColor(18,18,18,255); // Black ColorInfo.Color = MakeColor(18, 18, 18, 255); // Black
ColorCodes.AddItem(ColorInfo); ColorCodes.AddItem(ColorInfo);
} }
@ -156,11 +156,11 @@ function Font PickFont( out float Scaler, optional bool bNumbersOnly, optional b
function PickDefaultFontSize( float YRes) function PickDefaultFontSize( float YRes)
{ {
local int XL,YL; local int XL, YL;
local string S; local string S;
S="ABC"; S="ABC";
PickFont(YRes).GetStringHeightAndWidth(S,YL,XL); PickFont(YRes).GetStringHeightAndWidth(S, YL, XL);
DefaultHeight=float(YL)*YRes; DefaultHeight=float(YL)*YRes;
} }
@ -177,20 +177,20 @@ final function DrawText( coerce string S)
local float Scale; local float Scale;
Canvas.Font=PickFont(Scale); Canvas.Font=PickFont(Scale);
Canvas.DrawText(S,,Scale,Scale); Canvas.DrawText(S, ,Scale, Scale);
} }
final function DrawCenteredText( coerce string S, float X, float Y, optional float Scale=1.f, optional bool bVertical, optional bool bUseOutline) final function DrawCenteredText( coerce string S, float X, float Y, optional float Scale=1.f, optional bool bVertical, optional bool bUseOutline)
{ {
local float XL,YL; local float XL, YL;
Canvas.TextSize(S,XL,YL); Canvas.TextSize(S, XL, YL);
if (bVertical) if (bVertical)
Canvas.SetPos(X,Y-(YL*Scale*0.5)); Canvas.SetPos(X, Y-(YL*Scale*0.5));
else Canvas.SetPos(X-(XL*Scale*0.5),Y); else Canvas.SetPos(X-(XL*Scale*0.5), Y);
if (bUseOutline) if (bUseOutline)
DrawTextShadow(S, Canvas.CurX, Canvas.CurY, 1, Scale); DrawTextShadow(S, Canvas.CurX, Canvas.CurY, 1, Scale);
else Canvas.DrawText(S,,Scale,Scale); else Canvas.DrawText(S, ,Scale, Scale);
} }
final function string StripColorTags( coerce string S) final function string StripColorTags( coerce string S)
{ {
@ -199,7 +199,7 @@ final function string StripColorTags( coerce string S)
Pos = InStr(S, "\\c"); Pos = InStr(S, "\\c");
while( Pos != INDEX_NONE) while( Pos != INDEX_NONE)
{ {
S = Left(S,Pos) $ Mid(S,Pos+3); S = Left(S, Pos) $ Mid(S, Pos+3);
Pos = InStr(S, "\\c"); Pos = InStr(S, "\\c");
} }
@ -207,7 +207,7 @@ final function string StripColorTags( coerce string S)
} }
final function DrawColoredText( coerce string S, float X, float Y, optional float Scale=1.f, optional bool bUseOutline) final function DrawColoredText( coerce string S, float X, float Y, optional float Scale=1.f, optional bool bUseOutline)
{ {
local float XL,YL; local float XL, YL;
local int i, Index; local int i, Index;
local array < string> SArray; local array < string> SArray;
local string T, PrevT; local string T, PrevT;
@ -219,25 +219,25 @@ final function DrawColoredText( coerce string S, float X, float Y, optional floa
DrawTextShadow(S, X, Y, 1, Scale); DrawTextShadow(S, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(S,,Scale,Scale); Canvas.DrawText(S, ,Scale, Scale);
} }
} }
else else
{ {
SArray = SplitString(S, "\\c"); SArray = SplitString(S, "\\c");
PrevT = Left(S,InStr(S, "\\c")); PrevT = Left(S, InStr(S, "\\c"));
if (Len(PrevT) > 0) if (Len(PrevT) > 0)
{ {
Canvas.TextSize(PrevT,XL,YL,Scale,Scale); Canvas.TextSize(PrevT, XL, YL, Scale, Scale);
if (bUseOutline) if (bUseOutline)
DrawTextShadow(PrevT, X, Y, 1, Scale); DrawTextShadow(PrevT, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(PrevT,,Scale,Scale); Canvas.DrawText(PrevT, ,Scale, Scale);
} }
} }
@ -257,14 +257,14 @@ final function DrawColoredText( coerce string S, float X, float Y, optional floa
} }
Canvas.DrawColor = TextColor; Canvas.DrawColor = TextColor;
Canvas.TextSize(T,XL,YL,Scale,Scale); Canvas.TextSize(T, XL, YL, Scale, Scale);
if (bUseOutline) if (bUseOutline)
DrawTextShadow(T, X, Y, 1, Scale); DrawTextShadow(T, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(T,,Scale,Scale); Canvas.DrawText(T, ,Scale, Scale);
} }
X += XL; X += XL;
@ -281,15 +281,15 @@ final function DrawTextBlurry( coerce string S, float X, float Y, optional float
Canvas.DrawColor = BlurColor; Canvas.DrawColor = BlurColor;
Canvas.SetPos(X + Owner.FontBlurX, Y + Owner.FontBlurY); Canvas.SetPos(X + Owner.FontBlurX, Y + Owner.FontBlurY);
Canvas.DrawText(S,,Scale,Scale); Canvas.DrawText(S, ,Scale, Scale);
Canvas.DrawColor = BlurColor2; Canvas.DrawColor = BlurColor2;
Canvas.SetPos(X + Owner.FontBlurX2, Y + Owner.FontBlurY2); Canvas.SetPos(X + Owner.FontBlurX2, Y + Owner.FontBlurY2);
Canvas.DrawText(S,,Scale,Scale); Canvas.DrawText(S, ,Scale, Scale);
Canvas.DrawColor = OldDrawColor; Canvas.DrawColor = OldDrawColor;
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawText(S,,Scale,Scale); Canvas.DrawText(S, ,Scale, Scale);
} }
final function DrawTextOutline( coerce string S, float X, float Y, int Size, Color OutlineColor, optional float Scale=1.f, optional FontRenderInfo FRI) final function DrawTextOutline( coerce string S, float X, float Y, int Size, Color OutlineColor, optional float Scale=1.f, optional FontRenderInfo FRI)
{ {
@ -312,13 +312,13 @@ final function DrawTextOutline( coerce string S, float X, float Y, int Size, Col
for (YS = -Size; YS <= Size; YS+=Steps) for (YS = -Size; YS <= Size; YS+=Steps)
{ {
Canvas.SetPos(X + XS, Y + YS); Canvas.SetPos(X + XS, Y + YS);
Canvas.DrawText(S,, Scale, Scale, FRI); Canvas.DrawText(S, , Scale, Scale, FRI);
} }
} }
Canvas.DrawColor = OldDrawColor; Canvas.DrawColor = OldDrawColor;
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawText(S,, Scale, Scale, FRI); Canvas.DrawText(S, , Scale, Scale, FRI);
} }
final function DrawTextShadow( coerce string S, float X, float Y, float ShadowSize, optional float Scale=1.f) final function DrawTextShadow( coerce string S, float X, float Y, float ShadowSize, optional float Scale=1.f)
{ {
@ -328,18 +328,18 @@ final function DrawTextShadow( coerce string S, float X, float Y, float ShadowSi
Canvas.SetPos(X + ShadowSize, Y + ShadowSize); Canvas.SetPos(X + ShadowSize, Y + ShadowSize);
Canvas.SetDrawColor(0, 0, 0, OldDrawColor.A); Canvas.SetDrawColor(0, 0, 0, OldDrawColor.A);
Canvas.DrawText(S,, Scale, Scale); Canvas.DrawText(S, , Scale, Scale);
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawColor = OldDrawColor; Canvas.DrawColor = OldDrawColor;
Canvas.DrawText(S,, Scale, Scale); Canvas.DrawText(S, , Scale, Scale);
} }
final function DrawTexturedString( coerce string S, float X, float Y, optional float TextScaler=1.f, optional FontRenderInfo FRI, optional bool bUseOutline, optional bool bOnlyTexture) final function DrawTexturedString( coerce string S, float X, float Y, optional float TextScaler=1.f, optional FontRenderInfo FRI, optional bool bUseOutline, optional bool bOnlyTexture)
{ {
local Texture2D Mat; local Texture2D Mat;
local string D; local string D;
local float XL, YL; local float XL, YL;
local int i,j; local int i, j;
local Color OrgC; local Color OrgC;
OrgC = Canvas.DrawColor; OrgC = Canvas.DrawColor;
@ -347,26 +347,26 @@ final function DrawTexturedString( coerce string S, float X, float Y, optional f
Mat = FindNextTexture(S); Mat = FindNextTexture(S);
while( Mat != None) while( Mat != None)
{ {
i = InStr(S," < TEXTURE"); i = InStr(S, " < TEXTURE");
j = InStr(S," > "); j = InStr(S, " > ");
D = Left(S,i); D = Left(S, i);
S = Mid(S,j+2); S = Mid(S, j+2);
if (!bOnlyTexture) if (!bOnlyTexture)
{ {
Canvas.TextSize(StripColorTags(D),XL,YL,TextScaler,TextScaler); Canvas.TextSize(StripColorTags(D), XL, YL, TextScaler, TextScaler);
DrawColoredText(D,X,Y,TextScaler,bUseOutline); DrawColoredText(D, X,Y, TextScaler, bUseOutline);
X += XL; X += XL;
} }
else Canvas.TextSize("W",XL,YL,TextScaler,TextScaler); else Canvas.TextSize("W", XL, YL, TextScaler, TextScaler);
Canvas.DrawColor = class'HUD'.default.WhiteColor; Canvas.DrawColor = class'HUD'.default.WhiteColor;
Canvas.DrawColor.A = OrgC.A; Canvas.DrawColor.A = OrgC.A;
Canvas.SetPos(X,Y+(Owner.HUDOwner.ScaledBorderSize/2)); Canvas.SetPos(X, Y+(Owner.HUDOwner.ScaledBorderSize/2));
Canvas.DrawRect(YL-Owner.HUDOwner.ScaledBorderSize,YL-Owner.HUDOwner.ScaledBorderSize,Mat); Canvas.DrawRect(YL-Owner.HUDOwner.ScaledBorderSize, YL-Owner.HUDOwner.ScaledBorderSize, Mat);
X += YL-Owner.HUDOwner.ScaledBorderSize; X += YL-Owner.HUDOwner.ScaledBorderSize;
@ -374,7 +374,7 @@ final function DrawTexturedString( coerce string S, float X, float Y, optional f
Mat = FindNextTexture(S); Mat = FindNextTexture(S);
} }
DrawColoredText(S,X,Y,TextScaler,bUseOutline); DrawColoredText(S, X,Y, TextScaler, bUseOutline);
} }
final function Texture2D FindNextTexture(out string S) final function Texture2D FindNextTexture(out string S)
{ {
@ -384,12 +384,12 @@ final function Texture2D FindNextTexture(out string S)
local FTexturePreCache Cache; local FTexturePreCache Cache;
Path = S; Path = S;
i = InStr(Path," < Icon > "); i = InStr(Path, " < Icon > ");
if (i == INDEX_NONE) if (i == INDEX_NONE)
return None; return None;
j = InStr(Path," < /Icon > "); j = InStr(Path, " < /Icon > ");
S = Left(Path,i)$" < TEXTURE > "$Mid(Path, j+6); S = Left(Path, i)$" < TEXTURE > "$Mid(Path, j+6);
Path = Mid(Path, i+6, j-(i+6)); Path = Mid(Path, i+6, j-(i+6));
i = PrecachedTextures.Find('Path', Path); i = PrecachedTextures.Find('Path', Path);
@ -418,12 +418,12 @@ final function string StripTextureFromString(string S, optional bool bNoStringAd
while( true) while( true)
{ {
i = InStr(S," < Icon > "); i = InStr(S, " < Icon > ");
if (i == INDEX_NONE) if (i == INDEX_NONE)
break; break;
j = InStr(S," < /Icon > "); j = InStr(S, " < /Icon > ");
S = Left(S,i)$(bNoStringAdd ? "" : "W")$Mid(S, j+Len(" < /Icon > ")); S = Left(S, i)$(bNoStringAdd ? "" : "W")$Mid(S, j+Len(" < /Icon > "));
} }
return StripColorTags(S); return StripColorTags(S);
@ -459,16 +459,16 @@ final function DrawCornerTexNU( int SizeX, int SizeY, byte Dir ) // Draw non-uni
switch( Dir) switch( Dir)
{ {
case 0: // Up-left case 0: // Up-left
Canvas.DrawTile(ItemTex,SizeX,SizeY,77,15,-66,58); Canvas.DrawTile(ItemTex, SizeX, SizeY, 77, 15, -66, 58);
break; break;
case 1: // Up-right case 1: // Up-right
Canvas.DrawTile(ItemTex,SizeX,SizeY,11,15,66,58); Canvas.DrawTile(ItemTex, SizeX, SizeY, 11, 15, 66, 58);
break; break;
case 2: // Down-left case 2: // Down-left
Canvas.DrawTile(ItemTex,SizeX,SizeY,77,73,-66,-58); Canvas.DrawTile(ItemTex, SizeX, SizeY, 77, 73, -66, -58);
break; break;
default: // Down-right default: // Down-right
Canvas.DrawTile(ItemTex,SizeX,SizeY,11,73,66,-58); Canvas.DrawTile(ItemTex, SizeX, SizeY, 11, 73, 66, -58);
} }
} }
final function DrawCornerTex( int Size, byte Dir) final function DrawCornerTex( int Size, byte Dir)
@ -476,29 +476,29 @@ final function DrawCornerTex( int Size, byte Dir)
switch( Dir) switch( Dir)
{ {
case 0: // Up-left case 0: // Up-left
Canvas.DrawTile(ItemTex,Size,Size,77,15,-66,58); Canvas.DrawTile(ItemTex, Size, Size, 77, 15, -66, 58);
break; break;
case 1: // Up-right case 1: // Up-right
Canvas.DrawTile(ItemTex,Size,Size,11,15,66,58); Canvas.DrawTile(ItemTex, Size, Size, 11, 15, 66, 58);
break; break;
case 2: // Down-left case 2: // Down-left
Canvas.DrawTile(ItemTex,Size,Size,77,73,-66,-58); Canvas.DrawTile(ItemTex, Size, Size, 77, 73, -66, -58);
break; break;
default: // Down-right default: // Down-right
Canvas.DrawTile(ItemTex,Size,Size,11,73,66,-58); Canvas.DrawTile(ItemTex, Size, Size, 11, 73, 66, -58);
} }
} }
final function DrawWhiteBox( float XS, float YS, optional bool bClip) final function DrawWhiteBox( float XS, float YS, optional bool bClip)
{ {
Canvas.DrawTile(ItemTex,XS,YS,19,45,1,1,,bClip); Canvas.DrawTile(ItemTex, XS, YS, 19, 45, 1,1, ,bClip);
} }
final function DrawRectBox( float X, float Y, float Width, float Height, int Edge, optional byte Extrav) final function DrawRectBox( float X, float Y, float Width, float Height, int Edge, optional byte Extrav)
{ {
if (Extrav == 2) if (Extrav == 2)
Edge=Min(FMin(Edge,(Width)*0.5),Height);// Verify size. Edge=Min(FMin(Edge, (Width)*0.5), Height);// Verify size.
else else
Edge=Min(FMin(Edge,(Width)*0.5),(Height)*0.5);// Verify size. Edge=Min(FMin(Edge, (Width)*0.5), (Height)*0.5);// Verify size.
Canvas.PreOptimizeDrawTiles(Extrav == 0 ? 7 : 6, ItemTex); Canvas.PreOptimizeDrawTiles(Extrav == 0 ? 7 : 6, ItemTex);
@ -511,26 +511,26 @@ final function DrawRectBox( float X, float Y, float Width, float Height, int Edg
// \______\ // \______\
// Top left // Top left
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawCornerTex(Edge,0); DrawCornerTex(Edge, 0);
// Top right // Top right
Canvas.SetPos(X+Width,Y); Canvas.SetPos(X+Width, Y);
DrawCornerTex(Edge,3); DrawCornerTex(Edge, 3);
// Bottom right // Bottom right
Canvas.SetPos(X+Width,Y+Height-Edge); Canvas.SetPos(X+Width, Y+Height-Edge);
DrawCornerTex(Edge,1); DrawCornerTex(Edge, 1);
// Fill // Fill
Canvas.SetPos(X+Edge,Y); Canvas.SetPos(X+Edge, Y);
DrawWhiteBox(Width-Edge,Height); DrawWhiteBox(Width-Edge, Height);
Canvas.SetPos(X,Y+Edge); Canvas.SetPos(X, Y+Edge);
DrawWhiteBox(Edge,Height-Edge*2); DrawWhiteBox(Edge, Height-Edge*2);
// Bottom left // Bottom left
Canvas.SetPos(X,Y+Height-Edge); Canvas.SetPos(X, Y+Height-Edge);
DrawCornerTex(Edge,2); DrawCornerTex(Edge, 2);
break; break;
case 2: case 2:
@ -540,28 +540,28 @@ final function DrawRectBox( float X, float Y, float Width, float Height, int Edg
// |/ \| // |/ \|
// Top left // Top left
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawCornerTex(Edge,0); DrawCornerTex(Edge, 0);
// Top right // Top right
Canvas.SetPos(X+Width-Edge,Y); Canvas.SetPos(X+Width-Edge, Y);
DrawCornerTex(Edge,1); DrawCornerTex(Edge, 1);
// Bottom right // Bottom right
Canvas.SetPos(X+Width-Edge,Y+Height); Canvas.SetPos(X+Width-Edge, Y+Height);
DrawCornerTex(Edge,2); DrawCornerTex(Edge, 2);
// Bottom left // Bottom left
Canvas.SetPos(X,Y+Height); Canvas.SetPos(X, Y+Height);
DrawCornerTex(Edge,3); DrawCornerTex(Edge, 3);
// Mid Fill // Mid Fill
Canvas.SetPos(X,Y+Edge); Canvas.SetPos(X, Y+Edge);
DrawWhiteBox(Width,Height-Edge); DrawWhiteBox(Width, Height-Edge);
// Top Fill // Top Fill
Canvas.SetPos(X+Edge,Y); Canvas.SetPos(X+Edge, Y);
DrawWhiteBox(Width-Edge*2,Edge); DrawWhiteBox(Width-Edge*2, Edge);
break; break;
case 3: case 3:
@ -571,32 +571,32 @@ final function DrawRectBox( float X, float Y, float Width, float Height, int Edg
// /______/ // /______/
// Top left // Top left
Canvas.SetPos(X - Edge,Y); Canvas.SetPos(X - Edge, Y);
DrawCornerTex(Edge,2); DrawCornerTex(Edge, 2);
// Top right // Top right
Canvas.SetPos(X+Width-Edge,Y); Canvas.SetPos(X+Width-Edge, Y);
DrawCornerTex(Edge,1); DrawCornerTex(Edge, 1);
// Bottom right // Bottom right
Canvas.SetPos(X+Width-Edge,Y+Height-Edge); Canvas.SetPos(X+Width-Edge, Y+Height-Edge);
DrawCornerTex(Edge,3); DrawCornerTex(Edge, 3);
// Top Fill // Top Fill
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawWhiteBox(Width-Edge,Edge); DrawWhiteBox(Width-Edge, Edge);
// Mid Fill // Mid Fill
Canvas.SetPos(X,Y+Edge); Canvas.SetPos(X, Y+Edge);
DrawWhiteBox(Width,Height-Edge*2); DrawWhiteBox(Width, Height-Edge*2);
// Bottom Fill // Bottom Fill
Canvas.SetPos(X,Y+Height-Edge); Canvas.SetPos(X, Y+Height-Edge);
DrawWhiteBox(Width-Edge,Edge); DrawWhiteBox(Width-Edge, Edge);
// Bottom left // Bottom left
Canvas.SetPos(X - Edge,Y+Height-Edge); Canvas.SetPos(X - Edge, Y+Height-Edge);
DrawCornerTex(Edge,0); DrawCornerTex(Edge, 0);
break; break;
case 4: case 4:
@ -606,28 +606,28 @@ final function DrawRectBox( float X, float Y, float Width, float Height, int Edg
// \______/ // \______/
// Top left // Top left
Canvas.SetPos(X,Y-Edge); Canvas.SetPos(X, Y-Edge);
DrawCornerTex(Edge,1); DrawCornerTex(Edge, 1);
// Top right // Top right
Canvas.SetPos(X+Width-Edge,Y-Edge); Canvas.SetPos(X+Width-Edge, Y-Edge);
DrawCornerTex(Edge,0); DrawCornerTex(Edge, 0);
// Bottom right // Bottom right
Canvas.SetPos(X+Width-Edge,Y+Height-Edge); Canvas.SetPos(X+Width-Edge, Y+Height-Edge);
DrawCornerTex(Edge,3); DrawCornerTex(Edge, 3);
// Mid Fill // Mid Fill
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawWhiteBox(Width,Height-Edge); DrawWhiteBox(Width, Height-Edge);
// Bottom Fill // Bottom Fill
Canvas.SetPos(X+Edge,Y+Height-Edge); Canvas.SetPos(X+Edge, Y+Height-Edge);
DrawWhiteBox(Width-Edge*2,Edge); DrawWhiteBox(Width-Edge*2, Edge);
// Bottom left // Bottom left
Canvas.SetPos(X,Y+Height-Edge); Canvas.SetPos(X, Y+Height-Edge);
DrawCornerTex(Edge,2); DrawCornerTex(Edge, 2);
break; break;
default: default:
@ -637,28 +637,28 @@ final function DrawRectBox( float X, float Y, float Width, float Height, int Edg
// \______/ // \______/
// Top left // Top left
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawCornerTex(Edge,0); DrawCornerTex(Edge, 0);
// Top right // Top right
Canvas.SetPos(X+Width-Edge,Y); Canvas.SetPos(X+Width-Edge, Y);
DrawCornerTex(Edge,1); DrawCornerTex(Edge, 1);
// Bottom right // Bottom right
Canvas.SetPos(X+Width-Edge,Y+Height-Edge); Canvas.SetPos(X+Width-Edge, Y+Height-Edge);
DrawCornerTex(Edge,3); DrawCornerTex(Edge, 3);
// Fill // Fill
Canvas.SetPos(X+Edge,Y); Canvas.SetPos(X+Edge, Y);
DrawWhiteBox(Width-Edge*2,Height); DrawWhiteBox(Width-Edge*2, Height);
Canvas.SetPos(X,Y+Edge); Canvas.SetPos(X, Y+Edge);
DrawWhiteBox(Edge,Height-Edge*2); DrawWhiteBox(Edge, Height-Edge*2);
Canvas.SetPos(X+Width-Edge,Y+Edge); Canvas.SetPos(X+Width-Edge, Y+Edge);
DrawWhiteBox(Edge,Height-Edge*2); DrawWhiteBox(Edge, Height-Edge*2);
// Bottom left // Bottom left
Canvas.SetPos(X,Y+Height-Edge); Canvas.SetPos(X, Y+Height-Edge);
DrawCornerTex(Edge,2); DrawCornerTex(Edge, 2);
break; break;
} }
} }
@ -693,27 +693,27 @@ final function DrawOutlinedBox( float X, float Y, float Width, float Height, flo
final function DrawBoxCorners(float BorderSize, float X, float Y, float W, float H, optional bool TopLeft, optional bool TopRight, optional bool BottomLeft, optional bool BottomRight) final function DrawBoxCorners(float BorderSize, float X, float Y, float W, float H, optional bool TopLeft, optional bool TopRight, optional bool BottomLeft, optional bool BottomRight)
{ {
// Top left // Top left
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
if (TopLeft) if (TopLeft)
DrawCornerTex(BorderSize,0); DrawCornerTex(BorderSize, 0);
else DrawWhiteBox(BorderSize, BorderSize); else DrawWhiteBox(BorderSize, BorderSize);
// Top right // Top right
Canvas.SetPos(X+W-BorderSize,Y); Canvas.SetPos(X+W-BorderSize, Y);
if (TopRight) if (TopRight)
DrawCornerTex(BorderSize,1); DrawCornerTex(BorderSize, 1);
else DrawWhiteBox(BorderSize, BorderSize); else DrawWhiteBox(BorderSize, BorderSize);
// Bottom left // Bottom left
Canvas.SetPos(X,Y+H-BorderSize); Canvas.SetPos(X, Y+H-BorderSize);
if (BottomLeft) if (BottomLeft)
DrawCornerTex(BorderSize,2); DrawCornerTex(BorderSize, 2);
else DrawWhiteBox(BorderSize, BorderSize); else DrawWhiteBox(BorderSize, BorderSize);
// Bottom right // Bottom right
Canvas.SetPos(X+W-BorderSize,Y+H-BorderSize); Canvas.SetPos(X+W-BorderSize, Y+H-BorderSize);
if (BottomRight) if (BottomRight)
DrawCornerTex(BorderSize,3); DrawCornerTex(BorderSize, 3);
else DrawWhiteBox(BorderSize, BorderSize); else DrawWhiteBox(BorderSize, BorderSize);
} }
@ -735,7 +735,7 @@ final function DrawRoundedBoxEx( float BorderSize, float X, float Y, float W, fl
Canvas.PreOptimizeDrawTiles(7, ItemTex); Canvas.PreOptimizeDrawTiles(7, ItemTex);
BorderSize = Min(FMin(BorderSize,(W)*0.5),(H)*0.5); BorderSize = Min(FMin(BorderSize, (W)*0.5), (H)*0.5);
Canvas.SetPos(X + BorderSize, Y); Canvas.SetPos(X + BorderSize, Y);
DrawWhiteBox(W - BorderSize * 2, H); DrawWhiteBox(W - BorderSize * 2, H);
@ -758,7 +758,7 @@ final function DrawRoundedBoxHollowEx( float BorderSize, float X, float Y, float
{ {
Canvas.PreOptimizeDrawTiles(8, ItemTex); Canvas.PreOptimizeDrawTiles(8, ItemTex);
BorderSize = Min(FMin(BorderSize,(W)*0.5),(H)*0.5); BorderSize = Min(FMin(BorderSize, (W)*0.5), (H)*0.5);
Canvas.DrawColor = BoxColor; Canvas.DrawColor = BoxColor;
@ -818,13 +818,13 @@ final function DrawArrowBox( int Direction, float X, float Y, float Width, float
break; break;
} }
DrawTileStretched(ScrollTexture,X,Y,Width,Height); DrawTileStretched(ScrollTexture, X,Y, Width, Height);
DrawTileStretched(DirectionMat,X,Y,Width,Height); DrawTileStretched(DirectionMat, X,Y, Width, Height);
} }
final function DrawTileStretched( Texture Tex, float X, float Y, float XS, float YS) final function DrawTileStretched( Texture Tex, float X, float Y, float XS, float YS)
{ {
local float mW,mH,MidX,MidY,SmallTileW,SmallTileH,fX,fY; local float mW, mH, MidX, MidY, SmallTileW, SmallTileH, fX, fY;
local int OptimizeTiles; local int OptimizeTiles;
if (Tex == None ) Tex = Texture2D'EngineMaterials.DefaultDiffuse'; if (Tex == None ) Tex = Texture2D'EngineMaterials.DefaultDiffuse';
@ -864,10 +864,10 @@ final function DrawTileStretched( Texture Tex, float X, float Y, float XS, float
else else
fY = MidY; fY = MidY;
Canvas.SetPos(X+fX,Y); Canvas.SetPos(X+fX, Y);
Canvas.DrawTile(Tex,SmallTileW,fY,MidX,0,1,fY); Canvas.DrawTile(Tex, SmallTileW, fY, MidX, 0,1, fY);
Canvas.SetPos(X+fX,Y+YS-fY); Canvas.SetPos(X+fX, Y+YS-fY);
Canvas.DrawTile(Tex,SmallTileW,fY,MidX,mH-fY,1,fY); Canvas.DrawTile(Tex, SmallTileW, fY, MidX, mH-fY, 1,fY);
} }
else else
fX = XS / 2; fX = XS / 2;
@ -877,10 +877,10 @@ final function DrawTileStretched( Texture Tex, float X, float Y, float XS, float
{ {
fY = MidY; fY = MidY;
Canvas.SetPos(X,Y+fY); Canvas.SetPos(X, Y+fY);
Canvas.DrawTile(Tex,fX,SmallTileH,0,fY,fX,1); Canvas.DrawTile(Tex, fX, SmallTileH, 0,fY, fX, 1);
Canvas.SetPos(X+XS-fX,Y+fY); Canvas.SetPos(X+XS-fX, Y+fY);
Canvas.DrawTile(Tex,fX,SmallTileH,mW-fX,fY,fX,1); Canvas.DrawTile(Tex, fX, SmallTileH, mW-fX, fY, fX, 1);
} }
else else
fY = YS / 2; fY = YS / 2;
@ -888,19 +888,19 @@ final function DrawTileStretched( Texture Tex, float X, float Y, float XS, float
// Center // Center
if ((mH < YS) && (mW < XS)) if ((mH < YS) && (mW < XS))
{ {
Canvas.SetPos(X+fX,Y+fY); Canvas.SetPos(X+fX, Y+fY);
Canvas.DrawTile(Tex,SmallTileW,SmallTileH,fX,fY,1,1); Canvas.DrawTile(Tex, SmallTileW, SmallTileH, fX, fY, 1,1);
} }
// Draw the 4 corners. // Draw the 4 corners.
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawTile(Tex,fX,fY,0,0,fX,fY); Canvas.DrawTile(Tex, fX, fY, 0,0, fX, fY);
Canvas.SetPos(X+XS-fX,Y); Canvas.SetPos(X+XS-fX, Y);
Canvas.DrawTile(Tex,fX,fY,mW-fX,0,fX,fY); Canvas.DrawTile(Tex, fX, fY, mW-fX, 0,fX, fY);
Canvas.SetPos(X,Y+YS-fY); Canvas.SetPos(X, Y+YS-fY);
Canvas.DrawTile(Tex,fX,fY,0,mH-fY,fX,fY); Canvas.DrawTile(Tex, fX, fY, 0,mH-fY, fX, fY);
Canvas.SetPos(X+XS-fX,Y+YS-fY); Canvas.SetPos(X+XS-fX, Y+YS-fY);
Canvas.DrawTile(Tex,fX,fY,mW-fX,mH-fY,fX,fY); Canvas.DrawTile(Tex, fX, fY, mW-fX, mH-fY, fX, fY);
} }
final function DrawTextJustified( byte Justification, float X1, float Y1, float X2, float Y2, coerce string S, optional float XS, optional float YS) final function DrawTextJustified( byte Justification, float X1, float Y1, float X2, float Y2, coerce string S, optional float XS, optional float YS)
@ -928,7 +928,7 @@ final function DrawTextJustified( byte Justification, float X1, float Y1, float
} }
Canvas.SetPos(CurX, CurY); Canvas.SetPos(CurX, CurY);
Canvas.DrawText(S,,XS, YS); Canvas.DrawText(S, ,XS, YS);
} }
static final function float TimeFraction( float Start, float End, float Current) static final function float TimeFraction( float Start, float End, float Current)

View File

@ -18,10 +18,10 @@ var delegate < Interaction.OnReceivedNativeInputChar> OldOnReceivedNativeInputCh
var delegate < GameViewportClient.HandleInputAxis> OldHandleInputAxis; var delegate < GameViewportClient.HandleInputAxis> OldHandleInputAxis;
var array < KFGUI_Page> ActiveMenus,PersistentMenus; var array < KFGUI_Page> ActiveMenus, PersistentMenus;
var transient KFGUI_Base MouseFocus,InputFocus,KeyboardFocus; var transient KFGUI_Base MouseFocus, InputFocus, KeyboardFocus;
var IntPoint MousePosition,ScreenSize,OldMousePos,LastMousePos,LastClickPos[2]; var IntPoint MousePosition, ScreenSize, OldMousePos, LastMousePos, LastClickPos[2];
var transient float MousePauseTime,MenuTime,LastClickTimes[2]; var transient float MousePauseTime, MenuTime, LastClickTimes[2];
var transient GUIStyleBase CurrentStyle; var transient GUIStyleBase CurrentStyle;
var transient Console OrgConsole; var transient Console OrgConsole;
@ -34,9 +34,9 @@ var int CurrentCursorIndex, CursorSize;
var Texture DefaultPens[3]; var Texture DefaultPens[3];
var byte CursorFade, FastCursorFade, CursorFlash; var byte CursorFade, FastCursorFade, CursorFlash;
var int CursorStep, FastCursorStep; var int CursorStep, FastCursorStep;
var int FontBlurX,FontBlurX2,FontBlurY,FontBlurY2,FastFontBlurX,FastFontBlurX2,FastFontBlurY,FastFontBlurY2; var int FontBlurX, FontBlurX2, FontBlurY, FontBlurY2, FastFontBlurX, FastFontBlurX2, FastFontBlurY, FastFontBlurY2;
var bool bMouseWasIdle,bIsInMenuState,bAbsorbInput,bIsInvalid,bHideCursor,bUsingGamepad,bForceEngineCursor,bNoInputReset; var bool bMouseWasIdle, bIsInMenuState, bAbsorbInput, bIsInvalid, bHideCursor, bUsingGamepad, bForceEngineCursor, bNoInputReset;
static function KF2GUIController GetGUIController( PlayerController PC) static function KF2GUIController GetGUIController( PlayerController PC)
{ {
@ -47,7 +47,7 @@ static function KF2GUIController GetGUIController( PlayerController PC)
return None; return None;
} }
foreach PC.ChildActors(class'ScoreboardExt.KF2GUIController',G) foreach PC.ChildActors(class'ScoreboardExt.KF2GUIController', G)
{ {
if (!G.bIsInvalid) if (!G.bIsInvalid)
{ {
@ -57,7 +57,7 @@ static function KF2GUIController GetGUIController( PlayerController PC)
if (G == None) if (G == None)
{ {
G = PC.Spawn(class'ScoreboardExt.KF2GUIController',PC); G = PC.Spawn(class'ScoreboardExt.KF2GUIController', PC);
} }
return G; return G;
@ -158,7 +158,7 @@ simulated function HandleDrawMenu()
simulated function RenderMenu( Canvas C) simulated function RenderMenu( Canvas C)
{ {
local int i; local int i;
local float OrgX,OrgY,ClipX,ClipY; local float OrgX, OrgY, ClipX, ClipY;
ClientViewport.ViewportConsole = OrgConsole; ClientViewport.ViewportConsole = OrgConsole;
@ -186,8 +186,8 @@ simulated function RenderMenu( Canvas C)
HUDOwner.HUDWidgets[i].PreDraw(); HUDOwner.HUDWidgets[i].PreDraw();
} }
C.SetOrigin(OrgX,OrgY); C.SetOrigin(OrgX, OrgY);
C.SetClip(ClipX,ClipY); C.SetClip(ClipX, ClipY);
} }
if (bIsInMenuState) if (bIsInMenuState)
@ -211,8 +211,8 @@ simulated function RenderMenu( Canvas C)
InputFocus.Canvas = C; InputFocus.Canvas = C;
InputFocus.PreDraw(); InputFocus.PreDraw();
} }
C.SetOrigin(OrgX,OrgY); C.SetOrigin(OrgX, OrgY);
C.SetClip(ClipX,ClipY); C.SetClip(ClipX, ClipY);
if (!bHideCursor) if (!bHideCursor)
{ {
@ -229,7 +229,7 @@ simulated function DrawCursor(Canvas C, float PosX, float PosY)
{ {
C.SetPos(PosX, PosY); C.SetPos(PosX, PosY);
C.DrawColor = CursorColor; C.DrawColor = CursorColor;
C.DrawTile(CursorTextures[CurrentCursorIndex], CurrentStyle.ScreenScale(CursorSize), CurrentStyle.ScreenScale(CursorSize), 0.f, 0.f, CursorTextures[CurrentCursorIndex].SizeX, CursorTextures[CurrentCursorIndex].SizeY,, true); C.DrawTile(CursorTextures[CurrentCursorIndex], CurrentStyle.ScreenScale(CursorSize), CurrentStyle.ScreenScale(CursorSize), 0.f, 0.f, CursorTextures[CurrentCursorIndex].SizeX, CursorTextures[CurrentCursorIndex].SizeY, , true);
} }
simulated final function InventoryChanged(optional KFWeapon Wep, optional bool bRemove) simulated final function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
@ -238,7 +238,7 @@ simulated final function InventoryChanged(optional KFWeapon Wep, optional bool b
for (i=(ActiveMenus.Length-1); i >= 0; --i) for (i=(ActiveMenus.Length-1); i >= 0; --i)
{ {
ActiveMenus[i].InventoryChanged(Wep,bRemove); ActiveMenus[i].InventoryChanged(Wep, bRemove);
} }
} }
@ -281,7 +281,7 @@ simulated final function SetMenuState( bool bActive)
PlayerOwner.PlayerInput = CustomInput; PlayerOwner.PlayerInput = CustomInput;
if (LastMousePos != default.LastMousePos) if (LastMousePos != default.LastMousePos)
ClientViewport.SetMouse(LastMousePos.X,LastMousePos.Y); ClientViewport.SetMouse(LastMousePos.X, LastMousePos.Y);
} }
else else
{ {
@ -437,7 +437,7 @@ simulated final function int GetFreeIndex( bool bNewAlwaysTop ) // Find first al
for (i=0; i < ActiveMenus.Length; ++i) for (i=0; i < ActiveMenus.Length; ++i)
if (bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop) if (bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop)
{ {
ActiveMenus.Insert(i,1); ActiveMenus.Insert(i, 1);
return i; return i;
} }
i = ActiveMenus.Length; i = ActiveMenus.Length;
@ -494,7 +494,7 @@ simulated function KFGUI_Page OpenMenu( class < KFGUI_Page> MenuClass)
if (i > 0 && ActiveMenus[i].BringPageToFront() ) // Sort it upfront. if (i > 0 && ActiveMenus[i].BringPageToFront() ) // Sort it upfront.
{ {
M = ActiveMenus[i]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i, 1);
i = GetFreeIndex(M.bAlwaysTop); i = GetFreeIndex(M.bAlwaysTop);
ActiveMenus[i] = M; ActiveMenus[i] = M;
} }
@ -507,7 +507,7 @@ simulated function KFGUI_Page OpenMenu( class < KFGUI_Page> MenuClass)
if (PersistentMenus[i].Class == MenuClass) if (PersistentMenus[i].Class == MenuClass)
{ {
M = PersistentMenus[i]; M = PersistentMenus[i];
PersistentMenus.Remove(i,1); PersistentMenus.Remove(i, 1);
i = GetFreeIndex(M.bAlwaysTop); i = GetFreeIndex(M.bAlwaysTop);
ActiveMenus[i] = M; ActiveMenus[i] = M;
M.ShowMenu(); M.ShowMenu();
@ -547,7 +547,7 @@ simulated function CloseMenu( class < KFGUI_Page> MenuClass, optional bool bClos
if (bCloseAll || ActiveMenus[i].Class == MenuClass) if (bCloseAll || ActiveMenus[i].Class == MenuClass)
{ {
M = ActiveMenus[i]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i, 1);
M.CloseMenu(); M.CloseMenu();
for (j=0; j < M.TimerNames.Length; j++) for (j=0; j < M.TimerNames.Length; j++)
@ -591,7 +591,7 @@ simulated function PopCloseMenu( KFGUI_Base Item)
if (ActiveMenus[i] == Item) if (ActiveMenus[i] == Item)
{ {
M = ActiveMenus[i]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i, 1);
M.CloseMenu(); M.CloseMenu();
// Cache menu. // Cache menu.
@ -613,14 +613,14 @@ simulated function BringMenuToFront( KFGUI_Page Page)
for (i=(ActiveMenus.Length-1); i >= 0; --i) for (i=(ActiveMenus.Length-1); i >= 0; --i)
if (ActiveMenus[i] == Page) if (ActiveMenus[i] == Page)
{ {
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i, 1);
break; break;
} }
if (i == -1) if (i == -1)
return; // Page isn't open. return; // Page isn't open.
// Put on front of stack. // Put on front of stack.
ActiveMenus.Insert(0,1); ActiveMenus.Insert(0, 1);
ActiveMenus[0] = Page; ActiveMenus[0] = Page;
} }
simulated final function bool MenuIsOpen( optional class < KFGUI_Page> MenuClass) simulated final function bool MenuIsOpen( optional class < KFGUI_Page> MenuClass)
@ -716,11 +716,11 @@ simulated final function bool CheckMouse( name Key, EInputEvent Event)
{ {
case 'XboxTypeS_A': case 'XboxTypeS_A':
case 'LeftMouseButton': case 'LeftMouseButton':
GUI_InputMouse(true,false); GUI_InputMouse(true, false);
return true; return true;
case 'XboxTypeS_B': case 'XboxTypeS_B':
case 'RightMouseButton': case 'RightMouseButton':
GUI_InputMouse(true,true); GUI_InputMouse(true, true);
return true; return true;
} }
} }
@ -730,11 +730,11 @@ simulated final function bool CheckMouse( name Key, EInputEvent Event)
{ {
case 'XboxTypeS_A': case 'XboxTypeS_A':
case 'LeftMouseButton': case 'LeftMouseButton':
GUI_InputMouse(false,false); GUI_InputMouse(false, false);
return true; return true;
case 'XboxTypeS_B': case 'XboxTypeS_B':
case 'RightMouseButton': case 'RightMouseButton':
GUI_InputMouse(false,true); GUI_InputMouse(false, true);
return true; return true;
} }
} }
@ -777,7 +777,7 @@ simulated function bool ReceivedInputKey( int ControllerId, name Key, EInputEven
} }
} }
if (!CheckMouse(Key,Event) && !OnInputKey(ControllerId,Key,Event,AmountDepressed,bGamepad)) if (!CheckMouse(Key, Event) && !OnInputKey(ControllerId, Key, Event, AmountDepressed, bGamepad))
{ {
if (bGamepad) if (bGamepad)
{ {
@ -812,7 +812,7 @@ simulated function bool ReceivedInputAxis( int ControllerId, name Key, float Del
{ {
local Vector2D V; local Vector2D V;
local KFPlayerInput KFInput; local KFPlayerInput KFInput;
local float GamepadSensitivity,OldMouseX,OldMouseY,MoveDelta,MoveDeltaInvert; local float GamepadSensitivity, OldMouseX, OldMouseY, MoveDelta, MoveDeltaInvert;
if (!bIsInMenuState) if (!bIsInMenuState)
return false; return false;
@ -862,7 +862,7 @@ simulated function bool ReceivedInputChar( int ControllerId, string Unicode)
{ {
if (!bIsInMenuState) if (!bIsInMenuState)
return false; return false;
return OnReceivedInputChar(ControllerId,Unicode); return OnReceivedInputChar(ControllerId, Unicode);
} }
simulated Delegate bool OnInputKey( int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad) simulated Delegate bool OnInputKey( int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad)
@ -889,7 +889,7 @@ simulated Delegate bool InternalReceivedInputChar( int ControllerId, string Unic
defaultproperties defaultproperties
{ {
CursorSize=24 CursorSize=24
CursorColor=(R=255,G=255,B=255,A=255) CursorColor=(R=255, G=255, B=255, A=255)
CursorTextures[`CURSOR_DEFAULT]=Texture2D'UI_Managers.LoaderManager_SWF_I13' CursorTextures[`CURSOR_DEFAULT]=Texture2D'UI_Managers.LoaderManager_SWF_I13'
CurrentCursorIndex=`CURSOR_DEFAULT CurrentCursorIndex=`CURSOR_DEFAULT

View File

@ -57,7 +57,7 @@ function PlayerInput( float DeltaTime)
function PreClientTravel( string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) function PreClientTravel( string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
{ {
`Log("PreClientTravel"@PendingURL@TravelType@bIsSeamlessTravel); `Log("PreClientTravel"@PendingURL@TravelType@bIsSeamlessTravel);
ControllerOwner.BackupInput.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel); // Let original mod do stuff too! ControllerOwner.BackupInput.PreClientTravel(PendingURL, TravelType, bIsSeamlessTravel); // Let original mod do stuff too!
ControllerOwner.NotifyLevelChange(); // Close menu NOW! ControllerOwner.NotifyLevelChange(); // Close menu NOW!
} }

View File

@ -12,8 +12,8 @@ function InitStyle()
Super.InitStyle(); Super.InitStyle();
LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D')); LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable", class'Texture2D'));
LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D')); LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick", class'Texture2D'));
for (i=0; i < ArrayCount(LoadedTex); ++i) for (i=0; i < ArrayCount(LoadedTex); ++i)
{ {
if (LoadedTex[i] == None) if (LoadedTex[i] == None)
@ -22,7 +22,7 @@ function InitStyle()
} }
function RenderFramedWindow( KFGUI_FloatingWindow P) function RenderFramedWindow( KFGUI_FloatingWindow P)
{ {
local int XS,YS,CornerSlope,TitleHeight; local int XS, YS, CornerSlope, TitleHeight;
XS = Canvas.ClipX-Canvas.OrgX; XS = Canvas.ClipX-Canvas.OrgX;
YS = Canvas.ClipY-Canvas.OrgY; YS = Canvas.ClipY-Canvas.OrgY;
@ -31,55 +31,55 @@ function RenderFramedWindow( KFGUI_FloatingWindow P)
// Frame Header // Frame Header
if (P.bWindowFocused) if (P.bWindowFocused)
Canvas.SetDrawColor(220,2,2,255); Canvas.SetDrawColor(220, 2,2, 255);
else Canvas.SetDrawColor(100,1,1,P.FrameOpacity); else Canvas.SetDrawColor(100, 1,1, P.FrameOpacity);
Canvas.SetPos(0,0); Canvas.SetPos(0, 0);
DrawCornerTex(CornerSlope,0); DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(0,TitleHeight); Canvas.SetPos(0, TitleHeight);
DrawCornerTex(CornerSlope,3); DrawCornerTex(CornerSlope, 3);
Canvas.SetPos(XS-CornerSlope,0); Canvas.SetPos(XS-CornerSlope, 0);
DrawCornerTex(CornerSlope,1); DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(XS-CornerSlope,TitleHeight); Canvas.SetPos(XS-CornerSlope, TitleHeight);
DrawCornerTex(CornerSlope,2); DrawCornerTex(CornerSlope, 2);
// Header filling // Header filling
Canvas.SetPos(0,CornerSlope); Canvas.SetPos(0, CornerSlope);
DrawWhiteBox(XS,TitleHeight-CornerSlope); DrawWhiteBox(XS, TitleHeight-CornerSlope);
Canvas.SetPos(CornerSlope,0); Canvas.SetPos(CornerSlope, 0);
DrawWhiteBox(XS-(CornerSlope*2),CornerSlope); DrawWhiteBox(XS-(CornerSlope*2), CornerSlope);
// Frame itself. // Frame itself.
if (P.bWindowFocused) if (P.bWindowFocused)
Canvas.SetDrawColor(32,6,6,255); Canvas.SetDrawColor(32, 6,6, 255);
else Canvas.SetDrawColor(16,2,2,P.FrameOpacity); else Canvas.SetDrawColor(16, 2,2, P.FrameOpacity);
Canvas.SetPos(0,TitleHeight); Canvas.SetPos(0, TitleHeight);
DrawCornerTex(CornerSlope,0); DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(XS-CornerSlope,TitleHeight); Canvas.SetPos(XS-CornerSlope, TitleHeight);
DrawCornerTex(CornerSlope,1); DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(0,YS-CornerSlope); Canvas.SetPos(0, YS-CornerSlope);
DrawCornerTex(CornerSlope,2); DrawCornerTex(CornerSlope, 2);
Canvas.SetPos(XS-CornerSlope,YS-CornerSlope); Canvas.SetPos(XS-CornerSlope, YS-CornerSlope);
DrawCornerTex(CornerSlope,3); DrawCornerTex(CornerSlope, 3);
// Filling // Filling
Canvas.SetPos(CornerSlope,TitleHeight); Canvas.SetPos(CornerSlope, TitleHeight);
DrawWhiteBox(XS-(CornerSlope*2),YS-TitleHeight); DrawWhiteBox(XS-(CornerSlope*2), YS-TitleHeight);
Canvas.SetPos(0,TitleHeight+CornerSlope); Canvas.SetPos(0, TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)-TitleHeight); DrawWhiteBox(CornerSlope, YS-(CornerSlope*2)-TitleHeight);
Canvas.SetPos(XS-CornerSlope,TitleHeight+CornerSlope); Canvas.SetPos(XS-CornerSlope, TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)-TitleHeight); DrawWhiteBox(CornerSlope, YS-(CornerSlope*2)-TitleHeight);
// Title. // Title.
if (P.WindowTitle != "") if (P.WindowTitle != "")
{ {
Canvas.SetDrawColor(250,250,250,P.FrameOpacity); Canvas.SetDrawColor(250, 250, 250, P.FrameOpacity);
Canvas.SetPos(CornerSlope,0); Canvas.SetPos(CornerSlope, 0);
DrawText(P.WindowTitle); DrawText(P.WindowTitle);
} }
} }
function RenderWindow( KFGUI_Page P) function RenderWindow( KFGUI_Page P)
{ {
local int XS,YS,CornerSlope; local int XS, YS, CornerSlope;
XS = Canvas.ClipX-Canvas.OrgX; XS = Canvas.ClipX-Canvas.OrgX;
YS = Canvas.ClipY-Canvas.OrgY; YS = Canvas.ClipY-Canvas.OrgY;
@ -87,29 +87,29 @@ function RenderWindow( KFGUI_Page P)
// Frame itself. // Frame itself.
if (P.bWindowFocused) if (P.bWindowFocused)
Canvas.SetDrawColor(64,64,64,255); Canvas.SetDrawColor(64, 64, 64, 255);
else Canvas.SetDrawColor(32,32,32,P.FrameOpacity); else Canvas.SetDrawColor(32, 32, 32, P.FrameOpacity);
Canvas.SetPos(0,0); Canvas.SetPos(0, 0);
DrawCornerTex(CornerSlope,0); DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(XS-CornerSlope,0); Canvas.SetPos(XS-CornerSlope, 0);
DrawCornerTex(CornerSlope,1); DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(0,YS-CornerSlope); Canvas.SetPos(0, YS-CornerSlope);
DrawCornerTex(CornerSlope,2); DrawCornerTex(CornerSlope, 2);
Canvas.SetPos(XS-CornerSlope,YS-CornerSlope); Canvas.SetPos(XS-CornerSlope, YS-CornerSlope);
DrawCornerTex(CornerSlope,3); DrawCornerTex(CornerSlope, 3);
// Filling // Filling
Canvas.SetPos(CornerSlope,0); Canvas.SetPos(CornerSlope, 0);
DrawWhiteBox(XS-(CornerSlope*2),YS); DrawWhiteBox(XS-(CornerSlope*2), YS);
Canvas.SetPos(0,CornerSlope); Canvas.SetPos(0, CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)); DrawWhiteBox(CornerSlope, YS-(CornerSlope*2));
Canvas.SetPos(XS-CornerSlope,CornerSlope); Canvas.SetPos(XS-CornerSlope, CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)); DrawWhiteBox(CornerSlope, YS-(CornerSlope*2));
} }
function RenderToolTip( KFGUI_Tooltip TT) function RenderToolTip( KFGUI_Tooltip TT)
{ {
local int i; local int i;
local float X,Y,XS,YS,TX,TY,TS,DefFontHeight; local float X, Y,XS, YS, TX, TY, TS, DefFontHeight;
Canvas.Font = PickFont(TS); Canvas.Font = PickFont(TS);
@ -118,8 +118,8 @@ function RenderToolTip( KFGUI_Tooltip TT)
for (i=0; i < TT.Lines.Length; ++i) for (i=0; i < TT.Lines.Length; ++i)
{ {
if (TT.Lines[i] != "") if (TT.Lines[i] != "")
Canvas.TextSize(TT.Lines[i],XS,YS); Canvas.TextSize(TT.Lines[i], XS, YS);
TX = FMax(XS,TX); TX = FMax(XS, TX);
} }
TX*=TS; TX*=TS;
@ -137,30 +137,30 @@ function RenderToolTip( KFGUI_Tooltip TT)
Y = TT.CompPos[1]-TY; Y = TT.CompPos[1]-TY;
if (TT.CurrentAlpha < 255) if (TT.CurrentAlpha < 255)
TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255); TT.CurrentAlpha = Min(TT.CurrentAlpha+25, 255);
// Reset clipping. // Reset clipping.
Canvas.SetOrigin(0,0); Canvas.SetOrigin(0, 0);
Canvas.SetClip(TT.Owner.ScreenSize.X,TT.Owner.ScreenSize.Y); Canvas.SetClip(TT.Owner.ScreenSize.X, TT.Owner.ScreenSize.Y);
// Draw frame. // Draw frame.
Canvas.SetDrawColor(200,200,80,TT.CurrentAlpha); Canvas.SetDrawColor(200, 200, 80, TT.CurrentAlpha);
Canvas.SetPos(X-2,Y-2); Canvas.SetPos(X-2, Y-2);
DrawBoxHollow(X-2,Y-2,TX+4,TY+4,2); DrawBoxHollow(X-2, Y-2, TX+4, TY+4, 2);
Canvas.SetDrawColor(80,10,80,TT.CurrentAlpha); Canvas.SetDrawColor(80, 10, 80, TT.CurrentAlpha);
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
DrawWhiteBox(TX,TY); DrawWhiteBox(TX, TY);
DefFontHeight = DefaultHeight; DefFontHeight = DefaultHeight;
// Draw text. // Draw text.
Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha); Canvas.SetDrawColor(255, 255, 255, TT.CurrentAlpha);
X+=TOOLTIP_BORDER; X+=TOOLTIP_BORDER;
Y+=TOOLTIP_BORDER; Y+=TOOLTIP_BORDER;
for (i=0; i < TT.Lines.Length; ++i) for (i=0; i < TT.Lines.Length; ++i)
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(TT.Lines[i],,TS,TS,TT.TextFontInfo); Canvas.DrawText(TT.Lines[i], ,TS, TS, TT.TextFontInfo);
Y+=DefFontHeight; Y+=DefFontHeight;
} }
} }
@ -184,7 +184,7 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
i = 3; i = 3;
else i = 2; else i = 2;
S.SliderScale = FMax(S.PageStep * (S.CompPos[i] - 32.f) / (S.MaxRange + S.PageStep),S.CalcButtonScale); S.SliderScale = FMax(S.PageStep * (S.CompPos[i] - 32.f) / (S.MaxRange + S.PageStep), S.CalcButtonScale);
if (S.bGrabbedScroller) if (S.bGrabbedScroller)
{ {
@ -201,10 +201,10 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale); S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale);
if (S.bGrabbedScroller) if (S.bGrabbedScroller)
Canvas.SetDrawColor(255,0,0,200); Canvas.SetDrawColor(255, 0,0, 200);
else if (S.bFocused) else if (S.bFocused)
Canvas.SetDrawColor(200,0,0,200); Canvas.SetDrawColor(200, 0,0, 200);
else Canvas.SetDrawColor(150,0,0,200); else Canvas.SetDrawColor(150, 0,0, 200);
if (S.bVertical) if (S.bVertical)
DrawRectBox (0.f, S.ButtonOffset, S.CompPos[2], S.SliderScale, 4); DrawRectBox (0.f, S.ButtonOffset, S.CompPos[2], S.SliderScale, 4);
@ -217,85 +217,85 @@ function RenderColumnHeader( KFGUI_ColumnTop C, float XPos, float Width, int Ind
if (bSort) if (bSort)
{ {
if (bFocus) if (bFocus)
Canvas.SetDrawColor(175,240,8,255); Canvas.SetDrawColor(175, 240, 8,255);
else Canvas.SetDrawColor(128,200,56,255); else Canvas.SetDrawColor(128, 200, 56, 255);
} }
else if (bFocus) else if (bFocus)
Canvas.SetDrawColor(220,220,8,255); Canvas.SetDrawColor(220, 220, 8,255);
else Canvas.SetDrawColor(220,86,56,255); else Canvas.SetDrawColor(220, 86, 56, 255);
XS = DefaultHeight*0.125; XS = DefaultHeight*0.125;
Canvas.SetPos(XPos,0.f); Canvas.SetPos(XPos, 0.f);
DrawCornerTexNU(XS,C.CompPos[3],0); DrawCornerTexNU(XS, C.CompPos[3], 0);
Canvas.SetPos(XPos+XS,0.f); Canvas.SetPos(XPos+XS, 0.f);
DrawWhiteBox(Width-(XS*2),C.CompPos[3]); DrawWhiteBox(Width-(XS*2), C.CompPos[3]);
Canvas.SetPos(XPos+Width-(XS*2),0.f); Canvas.SetPos(XPos+Width-(XS*2), 0.f);
DrawCornerTexNU(XS,C.CompPos[3],1); DrawCornerTexNU(XS, C.CompPos[3], 1);
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(XPos+XS,(C.CompPos[3]-C.ListOwner.TextHeight)*0.5f); Canvas.SetPos(XPos+XS, (C.CompPos[3]-C.ListOwner.TextHeight)*0.5f);
C.ListOwner.DrawStrClipped(C.ListOwner.Columns[Index].Text); C.ListOwner.DrawStrClipped(C.ListOwner.Columns[Index].Text);
} }
function RenderCheckbox( KFGUI_CheckBox C) function RenderCheckbox( KFGUI_CheckBox C)
{ {
if (C.bDisabled) if (C.bDisabled)
Canvas.SetDrawColor(86,86,86,255); Canvas.SetDrawColor(86, 86, 86, 255);
else if (C.bPressedDown) else if (C.bPressedDown)
Canvas.SetDrawColor(128,255,128,255); Canvas.SetDrawColor(128, 255, 128, 255);
else if (C.bFocused) else if (C.bFocused)
Canvas.SetDrawColor(150,200,128,255); Canvas.SetDrawColor(150, 200, 128, 255);
else Canvas.SetDrawColor(128,186,128,255); else Canvas.SetDrawColor(128, 186, 128, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(LoadedTex[0],C.CompPos[2],C.CompPos[3],0,0,LoadedTex[0].GetSurfaceWidth(),LoadedTex[0].GetSurfaceHeight()); Canvas.DrawTileStretched(LoadedTex[0], C.CompPos[2], C.CompPos[3], 0,0, LoadedTex[0].GetSurfaceWidth(), LoadedTex[0].GetSurfaceHeight());
if (C.bChecked) if (C.bChecked)
{ {
if (C.bDisabled) if (C.bDisabled)
Canvas.SetDrawColor(128,128,128,255); Canvas.SetDrawColor(128, 128, 128, 255);
else Canvas.SetDrawColor(255,255,255,255); else Canvas.SetDrawColor(255, 255, 255, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(LoadedTex[1],C.CompPos[2],C.CompPos[3],0,0,LoadedTex[1].GetSurfaceWidth(),LoadedTex[1].GetSurfaceHeight()); Canvas.DrawTile(LoadedTex[1], C.CompPos[2], C.CompPos[3], 0,0, LoadedTex[1].GetSurfaceWidth(), LoadedTex[1].GetSurfaceHeight());
} }
} }
function RenderComboBox( KFGUI_ComboBox C) function RenderComboBox( KFGUI_ComboBox C)
{ {
if (C.bDisabled) if (C.bDisabled)
Canvas.SetDrawColor(64,4,4,255); Canvas.SetDrawColor(64, 4,4, 255);
else if (C.bPressedDown) else if (C.bPressedDown)
Canvas.SetDrawColor(220,56,56,255); Canvas.SetDrawColor(220, 56, 56, 255);
else if (C.bFocused) else if (C.bFocused)
Canvas.SetDrawColor(190,48,48,255); Canvas.SetDrawColor(190, 48, 48, 255);
else Canvas.SetDrawColor(186,4,4,255); else Canvas.SetDrawColor(186, 4,4, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
DrawWhiteBox(C.CompPos[2],C.CompPos[3]); DrawWhiteBox(C.CompPos[2], C.CompPos[3]);
if (C.SelectedIndex < C.Values.Length && C.Values[C.SelectedIndex] != "") if (C.SelectedIndex < C.Values.Length && C.Values[C.SelectedIndex] != "")
{ {
Canvas.SetPos(C.BorderSize,(C.CompPos[3]-C.TextHeight)*0.5); Canvas.SetPos(C.BorderSize, (C.CompPos[3]-C.TextHeight)*0.5);
if (C.bDisabled) if (C.bDisabled)
Canvas.DrawColor = C.TextColor*0.5f; Canvas.DrawColor = C.TextColor*0.5f;
else Canvas.DrawColor = C.TextColor; else Canvas.DrawColor = C.TextColor;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX-C.BorderSize,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX-C.BorderSize, Canvas.ClipY);
Canvas.DrawText(C.Values[C.SelectedIndex],,C.TextScale,C.TextScale,C.TextFontInfo); Canvas.DrawText(C.Values[C.SelectedIndex], ,C.TextScale, C.TextScale, C.TextFontInfo);
Canvas.PopMaskRegion(); Canvas.PopMaskRegion();
} }
} }
function RenderComboList( KFGUI_ComboSelector C) function RenderComboList( KFGUI_ComboSelector C)
{ {
local float X,Y,YL,YP,Edge; local float X, Y,YL, YP, Edge;
local int i; local int i;
local bool bCheckMouse; local bool bCheckMouse;
// Draw background. // Draw background.
Edge = C.Combo.BorderSize; Edge = C.Combo.BorderSize;
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.SetDrawColor(128,4,4,255); Canvas.SetDrawColor(128, 4,4, 255);
DrawWhiteBox(C.CompPos[2],C.CompPos[3]); DrawWhiteBox(C.CompPos[2], C.CompPos[3]);
Canvas.SetPos(Edge,Edge); Canvas.SetPos(Edge, Edge);
Canvas.SetDrawColor(64,4,4,255); Canvas.SetDrawColor(64, 4,4, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),C.CompPos[3]-(Edge*2.f)); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), C.CompPos[3]-(Edge*2.f));
// While rendering, figure out mouse focus row. // While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX; X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -309,24 +309,24 @@ function RenderComboList( KFGUI_ComboSelector C)
YP = Edge; YP = Edge;
C.CurrentRow = -1; C.CurrentRow = -1;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX, Canvas.ClipY);
for (i=0; i < C.Combo.Values.Length; ++i) for (i=0; i < C.Combo.Values.Length; ++i)
{ {
if (bCheckMouse && Y >= YP && Y <= (YP+YL)) if (bCheckMouse && Y >= YP && Y <= (YP+YL))
{ {
bCheckMouse = false; bCheckMouse = false;
C.CurrentRow = i; C.CurrentRow = i;
Canvas.SetPos(4.f,YP); Canvas.SetPos(4.f, YP);
Canvas.SetDrawColor(128,48,48,255); Canvas.SetDrawColor(128, 48, 48, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),YL); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), YL);
} }
Canvas.SetPos(Edge,YP); Canvas.SetPos(Edge, YP);
if (i == C.Combo.SelectedIndex) if (i == C.Combo.SelectedIndex)
Canvas.DrawColor = C.Combo.SelectedTextColor; Canvas.DrawColor = C.Combo.SelectedTextColor;
else Canvas.DrawColor = C.Combo.TextColor; else Canvas.DrawColor = C.Combo.TextColor;
Canvas.DrawText(C.Combo.Values[i],,C.Combo.TextScale,C.Combo.TextScale,C.Combo.TextFontInfo); Canvas.DrawText(C.Combo.Values[i], ,C.Combo.TextScale, C.Combo.TextScale, C.Combo.TextFontInfo);
YP+=YL; YP+=YL;
} }
@ -339,17 +339,17 @@ function RenderComboList( KFGUI_ComboSelector C)
} }
function RenderRightClickMenu( KFGUI_RightClickMenu C) function RenderRightClickMenu( KFGUI_RightClickMenu C)
{ {
local float X,Y,YP,Edge,TextScale,TexDefHieght; local float X, Y,YP, Edge, TextScale, TexDefHieght;
local int i; local int i;
local bool bCheckMouse; local bool bCheckMouse;
// Draw background. // Draw background.
Edge = C.EdgeSize; Edge = C.EdgeSize;
Canvas.SetDrawColor(148,4,4,255); Canvas.SetDrawColor(148, 4,4, 255);
DrawBoxHollow(0.f,0.f,C.CompPos[2],C.CompPos[3],Edge); DrawBoxHollow(0.f, 0.f, C.CompPos[2], C.CompPos[3], Edge);
Canvas.SetPos(Edge,Edge); Canvas.SetPos(Edge, Edge);
Canvas.SetDrawColor(64,4,4,200); Canvas.SetDrawColor(64, 4,4, 200);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),C.CompPos[3]-(Edge*2.f)); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), C.CompPos[3]-(Edge*2.f));
// While rendering, figure out mouse focus row. // While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX; X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -364,30 +364,30 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
TexDefHieght = DefaultHeight; TexDefHieght = DefaultHeight;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX, Canvas.ClipY);
for (i=0; i < C.ItemRows.Length; ++i) for (i=0; i < C.ItemRows.Length; ++i)
{ {
if (bCheckMouse && Y >= YP && Y <= (YP+TexDefHieght)) if (bCheckMouse && Y >= YP && Y <= (YP+TexDefHieght))
{ {
bCheckMouse = false; bCheckMouse = false;
C.CurrentRow = i; C.CurrentRow = i;
Canvas.SetPos(4.f,YP); Canvas.SetPos(4.f, YP);
Canvas.SetDrawColor(128,48,48,255); Canvas.SetDrawColor(128, 48, 48, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),TexDefHieght); DrawWhiteBox(C.CompPos[2]-(Edge*2.f), TexDefHieght);
} }
Canvas.SetPos(Edge,YP); Canvas.SetPos(Edge, YP);
if (C.ItemRows[i].bSplitter) if (C.ItemRows[i].bSplitter)
{ {
Canvas.SetDrawColor(0,0,0,255); Canvas.SetDrawColor(0, 0,0, 255);
Canvas.DrawText("-------",,TextScale,TextScale); Canvas.DrawText("-------", ,TextScale, TextScale);
} }
else else
{ {
if (C.ItemRows[i].bDisabled) if (C.ItemRows[i].bDisabled)
Canvas.SetDrawColor(148,148,148,255); Canvas.SetDrawColor(148, 148, 148, 255);
else Canvas.SetDrawColor(248,248,248,255); else Canvas.SetDrawColor(248, 248, 248, 255);
Canvas.DrawText(C.ItemRows[i].Text,,TextScale,TextScale); Canvas.DrawText(C.ItemRows[i].Text, ,TextScale, TextScale);
} }
YP+=TexDefHieght; YP+=TexDefHieght;
@ -401,51 +401,51 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
} }
function RenderButton( KFGUI_Button B) function RenderButton( KFGUI_Button B)
{ {
local float XL,YL,TS; local float XL, YL, TS;
local byte i; local byte i;
if (B.bDisabled) if (B.bDisabled)
Canvas.SetDrawColor(32,0,0,255); Canvas.SetDrawColor(32, 0,0, 255);
else if (B.bPressedDown) else if (B.bPressedDown)
Canvas.SetDrawColor(255,64,64,255); Canvas.SetDrawColor(255, 64, 64, 255);
else if (B.bFocused) else if (B.bFocused)
Canvas.SetDrawColor(180,45,45,255); Canvas.SetDrawColor(180, 45, 45, 255);
else Canvas.SetDrawColor(164,8,8,255); else Canvas.SetDrawColor(164, 8,8, 255);
if (B.bIsHighlighted) if (B.bIsHighlighted)
{ {
Canvas.DrawColor.R = Min(Canvas.DrawColor.R+25,255); Canvas.DrawColor.R = Min(Canvas.DrawColor.R+25, 255);
Canvas.DrawColor.G = Min(Canvas.DrawColor.G+25,255); Canvas.DrawColor.G = Min(Canvas.DrawColor.G+25, 255);
Canvas.DrawColor.B = Min(Canvas.DrawColor.B+25,255); Canvas.DrawColor.B = Min(Canvas.DrawColor.B+25, 255);
} }
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
if (B.ExtravDir == 255) if (B.ExtravDir == 255)
DrawWhiteBox(B.CompPos[2],B.CompPos[3]); DrawWhiteBox(B.CompPos[2], B.CompPos[3]);
else DrawRectBox(0,0,B.CompPos[2],B.CompPos[3],Min(B.CompPos[2],B.CompPos[3])*0.2,B.ExtravDir); else DrawRectBox(0, 0,B.CompPos[2], B.CompPos[3], Min(B.CompPos[2], B.CompPos[3])*0.2, B.ExtravDir);
if (B.OverlayTexture.Texture != None) if (B.OverlayTexture.Texture != None)
{ {
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(B.OverlayTexture.Texture,B.CompPos[2],B.CompPos[3],B.OverlayTexture.U,B.OverlayTexture.V,B.OverlayTexture.UL,B.OverlayTexture.VL); Canvas.DrawTile(B.OverlayTexture.Texture, B.CompPos[2], B.CompPos[3], B.OverlayTexture.U, B.OverlayTexture.V, B.OverlayTexture.UL, B.OverlayTexture.VL);
} }
if (B.ButtonText != "") if (B.ButtonText != "")
{ {
// Chose the best font to fit this button. // Chose the best font to fit this button.
i = Min(B.FontScale,MaxFontScale); i = Min(B.FontScale, MaxFontScale);
while( true) while( true)
{ {
Canvas.Font = PickFont(TS); Canvas.Font = PickFont(TS);
Canvas.TextSize(B.ButtonText,XL,YL,TS,TS); Canvas.TextSize(B.ButtonText, XL, YL, TS, TS);
if (i == 0 || (XL < (B.CompPos[2]*0.95) && YL < (B.CompPos[3]*0.95))) if (i == 0 || (XL < (B.CompPos[2]*0.95) && YL < (B.CompPos[3]*0.95)))
break; break;
--i; --i;
} }
Canvas.SetPos((B.CompPos[2]-XL)*0.5,(B.CompPos[3]-YL)*0.5); Canvas.SetPos((B.CompPos[2]-XL)*0.5, (B.CompPos[3]-YL)*0.5);
if (B.bDisabled) if (B.bDisabled)
Canvas.DrawColor = B.TextColor*0.5f; Canvas.DrawColor = B.TextColor*0.5f;
else Canvas.DrawColor = B.TextColor; else Canvas.DrawColor = B.TextColor;
Canvas.DrawText(B.ButtonText,,TS,TS,B.TextFontInfo); Canvas.DrawText(B.ButtonText, ,TS, TS, B.TextFontInfo);
} }
} }

View File

@ -23,17 +23,17 @@ enum EMenuSound
MN_DropdownChange, MN_DropdownChange,
}; };
var() float XPosition,YPosition,XSize,YSize; var() float XPosition, YPosition, XSize, YSize;
var() name ID; // Just for internal purposes, you can give the components unique ID values. var() name ID; // Just for internal purposes, you can give the components unique ID values.
var() int IDValue; // Integer ID value. var() int IDValue; // Integer ID value.
var transient float CompPos[4],InputPos[4]; var transient float CompPos[4], InputPos[4];
var transient KFGUI_Base MouseArea; // Next in recurse line of the mouse pointer focus area. var transient KFGUI_Base MouseArea; // Next in recurse line of the mouse pointer focus area.
var() bool bDisabled,bClickable,bCanFocus; var() bool bDisabled, bClickable, bCanFocus;
var bool bFocusedPostDrawItem; // If this component has been given input focus, should it receive draw menu call after everything else been drawn? var bool bFocusedPostDrawItem; // If this component has been given input focus, should it receive draw menu call after everything else been drawn?
var transient bool bFocused,bTextureInit,bVisible; var transient bool bFocused, bTextureInit, bVisible;
var bool bIsHUDWidget,bEnableInputs,bNoLookInputs; var bool bIsHUDWidget, bEnableInputs, bNoLookInputs;
var array < name> TimerNames; var array < name> TimerNames;
function InitMenu(); // Menu was initialized for the first time. function InitMenu(); // Menu was initialized for the first time.
@ -44,9 +44,9 @@ function PreDraw()
return; return;
ComputeCoords(); ComputeCoords();
Canvas.SetDrawColor(255,255,255); Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
} }
function DrawMenu(); // Draw menu now. function DrawMenu(); // Draw menu now.
@ -83,12 +83,12 @@ function Timer();
function MouseEnter() function MouseEnter()
{ {
bFocused = true; bFocused = true;
OnFocus(Self,True); OnFocus(Self, True);
} }
function MouseLeave() function MouseLeave()
{ {
bFocused = false; bFocused = false;
OnFocus(Self,False); OnFocus(Self, False);
} }
function MouseClick( bool bRight ); function MouseClick( bool bRight );
function MouseRelease( bool bRight ); function MouseRelease( bool bRight );
@ -311,7 +311,7 @@ simulated final function PlayMenuSound( EMenuSound Slot)
if (S != None) if (S != None)
{ {
S.VolumeMultiplier = (Engine.SFxVolumeMultiplier/100.f) * (Engine.MasterVolumeMultiplier/100.f); S.VolumeMultiplier = (Engine.SFxVolumeMultiplier/100.f) * (Engine.MasterVolumeMultiplier/100.f);
GetPlayer().PlaySound(S,true,,false); GetPlayer().PlaySound(S, true, ,false);
} }
} }
@ -335,7 +335,7 @@ static final function string MakeSortStr( int Value)
S = string(Value); S = string(Value);
i = Len(S); i = Len(S);
if (i < 10) if (i < 10)
return Mid("0000000000",i)$S; return Mid("0000000000", i)$S;
return S; return S;
} }

View File

@ -5,10 +5,10 @@ Class KFGUI_Button extends KFGUI_Clickable;
var() Canvas.CanvasIcon OverlayTexture; var() Canvas.CanvasIcon OverlayTexture;
var() string ButtonText,GamepadButtonName; var() string ButtonText, GamepadButtonName;
var() color TextColor; var() color TextColor;
var() Canvas.FontRenderInfo TextFontInfo; var() Canvas.FontRenderInfo TextFontInfo;
var() byte FontScale,ExtravDir; var() byte FontScale, ExtravDir;
var bool bIsHighlighted; var bool bIsHighlighted;
function DrawMenu() function DrawMenu()
@ -39,7 +39,7 @@ Delegate bool DrawOverride(Canvas C, KFGUI_Button B)
defaultproperties defaultproperties
{ {
ButtonText="Button!" ButtonText="Button!"
TextColor=(R=0,G=0,B=0,A=255) TextColor=(R=0, G=0, B=0, A=255)
TextFontInfo=(bClipText=true,bEnableShadow=true) TextFontInfo=(bClipText=true, bEnableShadow=true)
FontScale=1 FontScale=1
} }

View File

@ -10,7 +10,7 @@ var Color IconColor;
function DrawMenu() function DrawMenu()
{ {
local float XL,YL,TS,TextX,TextY; local float XL, YL, TS, TextX, TextY;
local Texture2D Mat; local Texture2D Mat;
local bool bDrawOverride; local bool bDrawOverride;
@ -25,13 +25,13 @@ function DrawMenu()
Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_NORMAL]; Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_NORMAL];
else Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_HIGHLIGHTED]; else Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_HIGHLIGHTED];
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Mat,CompPos[2],CompPos[3],0,0,32,32); Canvas.DrawTileStretched(Mat, CompPos[2], CompPos[3], 0,0, 32, 32);
if (OverlayTexture.Texture != None) if (OverlayTexture.Texture != None)
{ {
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(OverlayTexture.Texture,CompPos[2],CompPos[3],OverlayTexture.U,OverlayTexture.V,OverlayTexture.UL,OverlayTexture.VL); Canvas.DrawTile(OverlayTexture.Texture, CompPos[2], CompPos[3], OverlayTexture.U, OverlayTexture.V, OverlayTexture.UL, OverlayTexture.VL);
} }
} }
@ -44,7 +44,7 @@ function DrawMenu()
while( true) while( true)
{ {
Canvas.TextSize(ButtonText,XL,YL,TS,TS); Canvas.TextSize(ButtonText, XL, YL, TS, TS);
if (XL < (CompPos[2]*0.9) && YL < (CompPos[3]*0.9)) if (XL < (CompPos[2]*0.9) && YL < (CompPos[3]*0.9))
break; break;
@ -58,7 +58,7 @@ function DrawMenu()
if (bDisabled) if (bDisabled)
Canvas.DrawColor = TextColor*0.5f; Canvas.DrawColor = TextColor*0.5f;
else Canvas.DrawColor = TextColor; else Canvas.DrawColor = TextColor;
Canvas.DrawText(ButtonText,,TS,TS,TextFontInfo); Canvas.DrawText(ButtonText, ,TS, TS, TextFontInfo);
if (Icon != None) if (Icon != None)
{ {
@ -73,7 +73,7 @@ function DrawMenu()
} }
Canvas.DrawColor = class'HUD'.default.WhiteColor; Canvas.DrawColor = class'HUD'.default.WhiteColor;
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawRect(CompPos[3], CompPos[3], bOpened ? Owner.CurrentStyle.ArrowTextures[`ARROW_DOWN] : Owner.CurrentStyle.ArrowTextures[`ARROW_RIGHT]); Canvas.DrawRect(CompPos[3], CompPos[3], bOpened ? Owner.CurrentStyle.ArrowTextures[`ARROW_DOWN] : Owner.CurrentStyle.ArrowTextures[`ARROW_RIGHT]);
Canvas.SetPos(CompPos[2]-CompPos[3], 0.f); Canvas.SetPos(CompPos[2]-CompPos[3], 0.f);
Canvas.DrawRect(CompPos[3], CompPos[3], bOpened ? Owner.CurrentStyle.ArrowTextures[`ARROW_DOWN] : Owner.CurrentStyle.ArrowTextures[`ARROW_LEFT]); Canvas.DrawRect(CompPos[3], CompPos[3], bOpened ? Owner.CurrentStyle.ArrowTextures[`ARROW_DOWN] : Owner.CurrentStyle.ArrowTextures[`ARROW_LEFT]);

View File

@ -4,8 +4,8 @@ Class KFGUI_CheckBox extends KFGUI_EditControl;
`include(Logger.uci) `include(Logger.uci)
var() Texture CheckMark,CheckDisabled,CheckIdle,CheckFocus,CheckClicked; var() Texture CheckMark, CheckDisabled, CheckIdle, CheckFocus, CheckClicked;
var() bool bForceUniform,bChecked; var() bool bForceUniform, bChecked;
function UpdateSizes() function UpdateSizes()
{ {

View File

@ -3,8 +3,8 @@ class KFGUI_ColorSlider extends KFGUI_MultiComponent;
`include(Build.uci) `include(Build.uci)
`include(Logger.uci) `include(Logger.uci)
var KFGUI_Slider RSlider,GSlider,BSlider,ASlider; var KFGUI_Slider RSlider, GSlider, BSlider, ASlider;
var KFGUI_TextLable TextLable,RedLabel,GreenLabel,BlueLabel,AlphaLabel,RedValue,GreenValue,BlueValue,AlphaValue; var KFGUI_TextLable TextLable, RedLabel, GreenLabel, BlueLabel, AlphaLabel, RedValue, GreenValue, BlueValue, AlphaValue;
var KFGUI_ComponentList SettingsBox; var KFGUI_ComponentList SettingsBox;
var Color DefaultColor; var Color DefaultColor;
@ -19,10 +19,10 @@ function InitMenu()
TextLable = KFGUI_TextLable(FindComponentID('CaptionText')); TextLable = KFGUI_TextLable(FindComponentID('CaptionText'));
TextLable.SetText(CaptionText); TextLable.SetText(CaptionText);
RSlider = AddSlider("Red:",'ColorSliderR',0,255,RedLabel,RedValue); RSlider = AddSlider("Red:", 'ColorSliderR', 0,255, RedLabel, RedValue);
GSlider = AddSlider("Green:",'ColorSliderG',0,255,GreenLabel,GreenValue); GSlider = AddSlider("Green:", 'ColorSliderG', 0,255, GreenLabel, GreenValue);
BSlider = AddSlider("Blue:",'ColorSliderB',0,255,BlueLabel,BlueValue); BSlider = AddSlider("Blue:", 'ColorSliderB', 0,255, BlueLabel, BlueValue);
ASlider = AddSlider("Alpha:",'ColorSliderA',0,255,AlphaLabel,AlphaValue); ASlider = AddSlider("Alpha:", 'ColorSliderA', 0,255, AlphaLabel, AlphaValue);
SetDefaultColor(DefaultColor); SetDefaultColor(DefaultColor);
} }
@ -99,7 +99,7 @@ delegate OnColorSliderValueChanged(KFGUI_ColorSlider Sender, KFGUI_Slider Slider
function DrawMenu() function DrawMenu()
{ {
Owner.CurrentStyle.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL],0,0,CompPos[2],CompPos[3]); Owner.CurrentStyle.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL], 0,0, CompPos[2], CompPos[3]);
} }
defaultproperties defaultproperties

View File

@ -11,12 +11,12 @@ struct FColumnItem
var() bool bOnlyTextures; var() bool bOnlyTextures;
var transient bool bHidden; var transient bool bHidden;
var transient int X,XSize; var transient int X, XSize;
}; };
var() array < FColumnItem> Columns; var() array < FColumnItem> Columns;
var() class < KFGUI_ListItem> ListItemClass; var() class < KFGUI_ListItem> ListItemClass;
var() float FontSize; var() float FontSize;
var() color FocusedLineColor,SelectedLineColor; var() color FocusedLineColor, SelectedLineColor;
var() float EdgeSize; var() float EdgeSize;
var KFGUI_ColumnTop ColumnComp; var KFGUI_ColumnTop ColumnComp;
var Canvas.FontRenderInfo LineFontInfo; var Canvas.FontRenderInfo LineFontInfo;
@ -24,10 +24,10 @@ var Canvas.FontRenderInfo LineFontInfo;
var int SelectedRowIndex; var int SelectedRowIndex;
var int LastSortedColumn; var int LastSortedColumn;
var transient float TextHeight,ScalerSize,TextScaler; var transient float TextHeight, ScalerSize, TextScaler;
var transient int OldItemsPerFrame; var transient int OldItemsPerFrame;
var KFGUI_ListItem FirstItem,UnusedItem; var KFGUI_ListItem FirstItem, UnusedItem;
var transient bool bListSizeDirty; var transient bool bListSizeDirty;
var bool bLastSortedReverse; var bool bLastSortedReverse;
@ -38,7 +38,7 @@ delegate OnSelectedRow( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClic
function KFGUI_ListItem AddLine( string Value, optional int iValue, optional string SortValue, optional int Index=-1) function KFGUI_ListItem AddLine( string Value, optional int iValue, optional string SortValue, optional int Index=-1)
{ {
local KFGUI_ListItem N,O; local KFGUI_ListItem N, O;
local int i; local int i;
// Allocate list item object. // Allocate list item object.
@ -51,7 +51,7 @@ function KFGUI_ListItem AddLine( string Value, optional int iValue, optional str
else N = new (None) ListItemClass; else N = new (None) ListItemClass;
// Setup column text value. // Setup column text value.
N.SetValue(Value,iValue,SortValue); N.SetValue(Value, iValue, SortValue);
// Insert into list. // Insert into list.
if (bShouldSortList && Index == -1) if (bShouldSortList && Index == -1)
@ -160,7 +160,7 @@ final function RemoveLine( KFGUI_ListItem I)
} }
final function EmptyList() final function EmptyList()
{ {
local KFGUI_ListItem N,I; local KFGUI_ListItem N, I;
for (I=FirstItem; I != None; I=N) for (I=FirstItem; I != None; I=N)
{ {
@ -191,7 +191,7 @@ final function KFGUI_ListItem GetFromIndex( int Index)
function SortColumn( int Column, optional bool bReverse) function SortColumn( int Column, optional bool bReverse)
{ {
local array < KFGUI_ListItem> List; local array < KFGUI_ListItem> List;
local KFGUI_ListItem Sel,N,P; local KFGUI_ListItem Sel, N,P;
local int i; local int i;
if (!bCanSortColumn || Column < 0 || Column >= Columns.Length) if (!bCanSortColumn || Column < 0 || Column >= Columns.Length)
@ -226,7 +226,7 @@ function SortColumn( int Column, optional bool bReverse)
if (List[i].Temp > N.Temp) if (List[i].Temp > N.Temp)
break; break;
} }
List.Insert(i,1); List.Insert(i, 1);
List[i] = N; List[i] = N;
} }
@ -268,21 +268,21 @@ function InitMenu()
final function DrawStrClipped( string S, optional bool bOnlyTextures) final function DrawStrClipped( string S, optional bool bOnlyTextures)
{ {
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); Canvas.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX, Canvas.ClipY);
Owner.CurrentStyle.DrawTexturedString(S,Canvas.CurX,Canvas.CurY,TextScaler,LineFontInfo,false,bOnlyTextures); Owner.CurrentStyle.DrawTexturedString(S, Canvas.CurX, Canvas.CurY, TextScaler, LineFontInfo, false, bOnlyTextures);
Canvas.PopMaskRegion(); Canvas.PopMaskRegion();
} }
function DrawMenu() function DrawMenu()
{ {
local int i,n,j; local int i, n,j;
local float Y,TextY,XOffset; local float Y, TextY, XOffset;
local KFGUI_ListItem C; local KFGUI_ListItem C;
local bool bCheckMouse; local bool bCheckMouse;
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT],CompPos[2],CompPos[3],0,0,128,128); Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL_SLIGHTTRANSPARENT], CompPos[2], CompPos[3], 0,0, 128, 128);
// Mouse focused item check. // Mouse focused item check.
bCheckMouse = bClickable && bFocused; bCheckMouse = bClickable && bFocused;
@ -298,7 +298,7 @@ function DrawMenu()
Y = 0.f; Y = 0.f;
TextY = (ItemHeight-TextHeight)*0.5f; TextY = (ItemHeight-TextHeight)*0.5f;
XOffset = TextY*0.75; XOffset = TextY*0.75;
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
for (i=0; (i < ListItemsPerPage && C != None); ++i) for (i=0; (i < ListItemsPerPage && C != None); ++i)
{ {
@ -313,25 +313,25 @@ function DrawMenu()
// Draw selection background. // Draw selection background.
if (SelectedRowIndex == n ) // Selected if (SelectedRowIndex == n ) // Selected
{ {
Canvas.SetPos(EdgeSize,Y); Canvas.SetPos(EdgeSize, Y);
Canvas.DrawColor = SelectedLineColor; Canvas.DrawColor = SelectedLineColor;
Owner.CurrentStyle.DrawWhiteBox(CompPos[2]-(EdgeSize*2),ItemHeight); Owner.CurrentStyle.DrawWhiteBox(CompPos[2]-(EdgeSize*2), ItemHeight);
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
} }
else if (FocusMouseItem == n ) // Focused else if (FocusMouseItem == n ) // Focused
{ {
Canvas.SetPos(EdgeSize,Y); Canvas.SetPos(EdgeSize, Y);
Canvas.DrawColor = FocusedLineColor; Canvas.DrawColor = FocusedLineColor;
Owner.CurrentStyle.DrawWhiteBox(CompPos[2]-(EdgeSize*2),ItemHeight); Owner.CurrentStyle.DrawWhiteBox(CompPos[2]-(EdgeSize*2), ItemHeight);
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
} }
// Draw columns of text // Draw columns of text
for (j=0; j < Columns.Length; ++j) for (j=0; j < Columns.Length; ++j)
if (!Columns[j].bHidden) if (!Columns[j].bHidden)
{ {
//Canvas.SetClip(Columns[j].X+Columns[j].XSize+EdgeSize,YClip); //Canvas.SetClip(Columns[j].X+Columns[j].XSize+EdgeSize, YClip);
Canvas.SetPos(Columns[j].X+XOffset+EdgeSize,TextY); Canvas.SetPos(Columns[j].X+XOffset+EdgeSize, TextY);
DrawStrClipped(C.GetDisplayStr(j), Columns[j].bOnlyTextures); DrawStrClipped(C.GetDisplayStr(j), Columns[j].bOnlyTextures);
} }
Y+=ItemHeight; Y+=ItemHeight;
@ -344,7 +344,7 @@ function DrawMenu()
function PreDraw() function PreDraw()
{ {
local byte j; local byte j;
local float XS,SpaceX; local float XS, SpaceX;
if (!bVisible) if (!bVisible)
return; return;
@ -354,7 +354,7 @@ function PreDraw()
// Check font to use. // Check font to use.
Canvas.Font = Owner.CurrentStyle.PickFont(TextScaler); Canvas.Font = Owner.CurrentStyle.PickFont(TextScaler);
TextScaler *= FontSize; TextScaler *= FontSize;
Canvas.TextSize("ABC",XS,TextHeight,TextScaler,TextScaler); Canvas.TextSize("ABC", XS, TextHeight, TextScaler, TextScaler);
for (j=0; j < 4; ++j) for (j=0; j < 4; ++j)
{ {
@ -402,8 +402,8 @@ function PreDraw()
ScrollBar.PreDraw(); ScrollBar.PreDraw();
// Draw self. // Draw self.
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
// Reset scaling to allow mouse to capture input. // Reset scaling to allow mouse to capture input.
@ -414,12 +414,12 @@ function PreDraw()
function InternalClickedItem( int Index, bool bRight, int MouseX, int MouseY) function InternalClickedItem( int Index, bool bRight, int MouseX, int MouseY)
{ {
SelectedRowIndex = Index; SelectedRowIndex = Index;
OnSelectedRow(GetFromIndex(Index),Index,bRight,false); OnSelectedRow(GetFromIndex(Index), Index, bRight, false);
} }
function InternalDblClickedItem( int Index, bool bRight, int MouseX, int MouseY) function InternalDblClickedItem( int Index, bool bRight, int MouseX, int MouseY)
{ {
SelectedRowIndex = Index; SelectedRowIndex = Index;
OnSelectedRow(GetFromIndex(Index),Index,bRight,true); OnSelectedRow(GetFromIndex(Index), Index, bRight, true);
} }
defaultproperties defaultproperties
@ -431,8 +431,8 @@ defaultproperties
FontSize=1.f FontSize=1.f
EdgeSize=5.f EdgeSize=5.f
bClickable=true bClickable=true
FocusedLineColor=(R=64,G=3,B=48,A=255) FocusedLineColor=(R=64, G=3, B=48, A=255)
SelectedLineColor=(R=84,G=26,B=128,A=255) SelectedLineColor=(R=84, G=26, B=128, A=255)
bCanSortColumn=true bCanSortColumn=true
Begin Object Class=KFGUI_ColumnTop Name=ColumnComps Begin Object Class=KFGUI_ColumnTop Name=ColumnComps
@ -444,5 +444,5 @@ defaultproperties
End Object End Object
Components.Add(ColumnComps) Components.Add(ColumnComps)
LineFontInfo=(bClipText=true,bEnableShadow=false) LineFontInfo=(bClipText=true, bEnableShadow=false)
} }

View File

@ -7,9 +7,9 @@ Class KFGUI_ColumnTop extends KFGUI_Base;
var() float ColumnMinSize; // Minimum pixels width allowed. var() float ColumnMinSize; // Minimum pixels width allowed.
var KFGUI_ColumnList ListOwner; var KFGUI_ColumnList ListOwner;
var transient int PrevSortedColumn,MouseColumn,ScalingColumn; var transient int PrevSortedColumn, MouseColumn, ScalingColumn;
var transient byte PressedDown[2]; var transient byte PressedDown[2];
var transient bool bPressedDown,bScaleColumn,bMouseScaler; var transient bool bPressedDown, bScaleColumn, bMouseScaler;
function InitMenu() function InitMenu()
{ {
@ -19,8 +19,8 @@ function InitMenu()
function DrawMenu() function DrawMenu()
{ {
local int i,j; local int i, j;
local float X,XS,MouseX,GrabWidth,MinSize,Wd; local float X, XS, MouseX, GrabWidth, MinSize, Wd;
local bool bCheckMouse; local bool bCheckMouse;
bClickable = ListOwner.bClickable; bClickable = ListOwner.bClickable;
@ -110,24 +110,24 @@ function DrawMenu()
else else
{ {
ListOwner.Columns[i].bHidden = false; ListOwner.Columns[i].bHidden = false;
//Canvas.SetClip(X+Wd,CompPos[1]+CompPos[3]); //Canvas.SetClip(X+Wd, CompPos[1]+CompPos[3]);
// Draw column. // Draw column.
if (i == j) if (i == j)
{ {
if (MouseColumn == i && !bMouseScaler) if (MouseColumn == i && !bMouseScaler)
Canvas.SetDrawColor(175,240,8,255); Canvas.SetDrawColor(175, 240, 8,255);
else Canvas.SetDrawColor(128,200,56,255); else Canvas.SetDrawColor(128, 200, 56, 255);
} }
else if (MouseColumn == i && !bMouseScaler) else if (MouseColumn == i && !bMouseScaler)
Canvas.SetDrawColor(220,220,8,255); Canvas.SetDrawColor(220, 220, 8,255);
XS = Owner.CurrentStyle.DefaultHeight*0.5; XS = Owner.CurrentStyle.DefaultHeight*0.5;
Canvas.SetPos(X,0.f); Canvas.SetPos(X, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.TabTextures[`TAB_TOP],Min(Wd,CompPos[2]-X),CompPos[3],0,0,128,16); Canvas.DrawTileStretched(Owner.CurrentStyle.TabTextures[`TAB_TOP], Min(Wd, CompPos[2]-X), CompPos[3], 0,0, 128, 16);
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(X+XS,(CompPos[3]-ListOwner.TextHeight)*0.5f); Canvas.SetPos(X+XS, (CompPos[3]-ListOwner.TextHeight)*0.5f);
ListOwner.DrawStrClipped(ListOwner.Columns[i].Text); ListOwner.DrawStrClipped(ListOwner.Columns[i].Text);
} }
X+=Wd; X+=Wd;
@ -166,7 +166,7 @@ function MouseRelease( bool bRight)
if (MouseColumn >= 0) if (MouseColumn >= 0)
{ {
ListOwner.SortColumn(MouseColumn,(PrevSortedColumn == MouseColumn)); ListOwner.SortColumn(MouseColumn, (PrevSortedColumn == MouseColumn));
if (PrevSortedColumn == MouseColumn) if (PrevSortedColumn == MouseColumn)
PrevSortedColumn = -1; PrevSortedColumn = -1;
else PrevSortedColumn = MouseColumn; else PrevSortedColumn = MouseColumn;

View File

@ -8,7 +8,7 @@ var KFGUI_ComboSelector Selection;
var float BorderSize; var float BorderSize;
var() array < string> Values; var() array < string> Values;
var() int SelectedIndex; var() int SelectedIndex;
var() color SelectedTextColor,TextColor; var() color SelectedTextColor, TextColor;
var() bool bButtonStretched; var() bool bButtonStretched;
function UpdateSizes() function UpdateSizes()
@ -61,7 +61,7 @@ Delegate OnComboChanged( KFGUI_ComboBox Sender );
defaultproperties defaultproperties
{ {
SelectedTextColor=(R=255,G=128,B=128,A=255) SelectedTextColor=(R=255, G=128, B=128, A=255)
TextColor=(R=255,G=255,B=255,A=255) TextColor=(R=255, G=255, B=255, A=255)
BorderSize=4 BorderSize=4
} }

View File

@ -4,7 +4,7 @@ Class KFGUI_ComboSelector extends KFGUI_Clickable;
`include(Logger.uci) `include(Logger.uci)
var KFGUI_ComboBox Combo; var KFGUI_ComboBox Combo;
var int CurrentRow,OldRow; var int CurrentRow, OldRow;
function DrawMenu() function DrawMenu()
{ {

View File

@ -61,16 +61,16 @@ function InitMenu()
{ {
Super.InitMenu(); Super.InitMenu();
ListCount = 0; ListCount = 0;
NumColumns = Max(NumColumns,1); NumColumns = Max(NumColumns, 1);
} }
function DrawMenu() function DrawMenu()
{ {
if (bDrawBackground) if (bDrawBackground)
{ {
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER],CompPos[2],CompPos[3],0,0,128,128); Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER], CompPos[2], CompPos[3], 0,0, 128, 128);
} }
} }
@ -106,16 +106,16 @@ function PreDraw()
// Then downscale our selves to give room for scrollbar. // Then downscale our selves to give room for scrollbar.
CompPos[2] -= ScrollBar.CompPos[2]; CompPos[2] -= ScrollBar.CompPos[2];
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
PreDrawListItems(); PreDrawListItems();
CompPos[2] += ScrollBar.CompPos[2]; CompPos[2] += ScrollBar.CompPos[2];
} }
else else
{ {
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
PreDrawListItems(); PreDrawListItems();
} }
@ -123,8 +123,8 @@ function PreDraw()
function PreDrawListItems() function PreDrawListItems()
{ {
local int i,XNum,r; local int i, XNum, r;
local float XS,YS; local float XS, YS;
XNum = 0; XNum = 0;
r = 0; r = 0;
@ -205,7 +205,7 @@ function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
local int i; local int i;
for (i=0; i < ItemComponents.Length; ++i) for (i=0; i < ItemComponents.Length; ++i)
ItemComponents[i].InventoryChanged(Wep,bRemove); ItemComponents[i].InventoryChanged(Wep, bRemove);
} }
function MenuTick( float DeltaTime) function MenuTick( float DeltaTime)
{ {

View File

@ -12,11 +12,11 @@ var enum eTextCase
var Color FontColor; var Color FontColor;
var string TextStr,AllowedCharSet; var string TextStr, AllowedCharSet;
var bool bDrawBackground,bNoClearOnEnter,bMaskText,bIntOnly,bFloatOnly,bIncludeSign,bConvertSpaces,bCtrl,bAllSelected,bForceShowCaret; var bool bDrawBackground, bNoClearOnEnter, bMaskText, bIntOnly, bFloatOnly, bIncludeSign, bConvertSpaces, bCtrl, bAllSelected, bForceShowCaret;
var int MaxWidth; var int MaxWidth;
var bool bReadOnly,bAlwaysNotify; var bool bReadOnly, bAlwaysNotify;
var int CaretPos,FirstVis,LastSizeX,LastCaret,LastLength; var int CaretPos, FirstVis, LastSizeX, LastCaret, LastLength;
var float TextScale; var float TextScale;
function InitMenu() function InitMenu()
@ -50,7 +50,7 @@ function SetText(string NewText, optional bool bIgnoreDelegate)
function bool NotifyInputChar(int Key, string Unicode) function bool NotifyInputChar(int Key, string Unicode)
{ {
local string Temp,S; local string Temp, S;
if (bReadOnly) if (bReadOnly)
return false; return false;
@ -72,7 +72,7 @@ function bool NotifyInputChar(int Key, string Unicode)
bAllSelected=false; bAllSelected=false;
} }
if ((AllowedCharSet == "") || ( (bIncludeSign) && ( (S == "-") || (S == "+") ) && (TextStr == "") ) || (InStr(AllowedCharSet,S) >= 0)) if ((AllowedCharSet == "") || ( (bIncludeSign) && ( (S == "-") || (S == "+") ) && (TextStr == "") ) || (InStr(AllowedCharSet, S) >= 0))
{ {
if ((MaxWidth == 0) || (Len(TextStr) < MaxWidth)) if ((MaxWidth == 0) || (Len(TextStr) < MaxWidth))
{ {
@ -86,7 +86,7 @@ function bool NotifyInputChar(int Key, string Unicode)
} }
else else
{ {
Temp = Left(TextStr,CaretPos)$S$Mid(TextStr,CaretPos); Temp = Left(TextStr, CaretPos)$S$Mid(TextStr, CaretPos);
TextStr = Temp; TextStr = Temp;
CaretPos++; CaretPos++;
} }
@ -243,7 +243,7 @@ function bool NotifyInputKey(int ControllerId, name Key, EInputEvent Event, floa
} }
else if (CaretPos > 0) else if (CaretPos > 0)
{ {
SetInputText(Left(TextStr,CaretPos-1) $ Right(TextStr, Len(TextStr) - CaretPos)); SetInputText(Left(TextStr, CaretPos-1) $ Right(TextStr, Len(TextStr) - CaretPos));
CaretPos -= 1; CaretPos -= 1;
} }
@ -274,8 +274,8 @@ function string ConvertIllegal(string InputStr)
Max = Len(InputStr); Max = Len(InputStr);
while ( i < Max) while ( i < Max)
{ {
C = Mid(InputStr,i,1); C = Mid(InputStr, i,1);
if (AllowedCharSet != "" && InStr(AllowedCharSet,C) < 0) if (AllowedCharSet != "" && InStr(AllowedCharSet, C) < 0)
{ {
C = ""; C = "";
} }
@ -289,7 +289,7 @@ function string ConvertIllegal(string InputStr)
} }
if (MaxWidth > 0) if (MaxWidth > 0)
return Left(Retval,MaxWidth); return Left(Retval, MaxWidth);
return Retval; return Retval;
} }
@ -306,18 +306,18 @@ function TextChanged()
function DrawMenu() function DrawMenu()
{ {
local string Storage,FinalDraw,TmpString; local string Storage, FinalDraw, TmpString;
local int MaskIndex,StorageLength; local int MaskIndex, StorageLength;
local float XL,YL,BoxWidth,FontScale,CursorY,BorderSize; local float XL, YL, BoxWidth, FontScale, CursorY, BorderSize;
local FontRenderInfo FRI; local FontRenderInfo FRI;
Super.DrawMenu(); Super.DrawMenu();
if (bDrawBackground) if (bDrawBackground)
{ {
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL],CompPos[2],CompPos[3],0,0,Owner.CurrentStyle.BorderTextures[`BOX_SMALL].GetSurfaceWidth(),Owner.CurrentStyle.BorderTextures[`BOX_SMALL].GetSurfaceHeight()); Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_SMALL], CompPos[2], CompPos[3], 0,0, Owner.CurrentStyle.BorderTextures[`BOX_SMALL].GetSurfaceWidth(), Owner.CurrentStyle.BorderTextures[`BOX_SMALL].GetSurfaceHeight());
} }
BorderSize = Owner.CurrentStyle.ScreenScale(4.f); BorderSize = Owner.CurrentStyle.ScreenScale(4.f);
@ -346,7 +346,7 @@ function DrawMenu()
if ((Len(Storage) != LastLength) || (CaretPos != LastCaret)) if ((Len(Storage) != LastLength) || (CaretPos != LastCaret))
{ {
if (CaretPos <= FirstVis) if (CaretPos <= FirstVis)
FirstVis = Max(0,CaretPos-1); FirstVis = Max(0, CaretPos-1);
else else
{ {
FinalDraw = Mid(Storage, FirstVis, CaretPos-FirstVis); FinalDraw = Mid(Storage, FirstVis, CaretPos-FirstVis);
@ -387,13 +387,13 @@ function DrawMenu()
if (bAllSelected) if (bAllSelected)
{ {
Canvas.SetDrawColor(255,255,255,195); Canvas.SetDrawColor(255, 255, 255, 195);
Canvas.SetPos(BorderSize, CursorY); Canvas.SetPos(BorderSize, CursorY);
Canvas.DrawTile( Owner.DefaultPens[`PEN_WHITE], XL, YL-Owner.HUDOwner.ScaledBorderSize, 0, 0, Owner.DefaultPens[`PEN_WHITE].GetSurfaceWidth(), Owner.DefaultPens[`PEN_WHITE].GetSurfaceHeight() ); Canvas.DrawTile( Owner.DefaultPens[`PEN_WHITE], XL, YL-Owner.HUDOwner.ScaledBorderSize, 0, 0, Owner.DefaultPens[`PEN_WHITE].GetSurfaceWidth(), Owner.DefaultPens[`PEN_WHITE].GetSurfaceHeight() );
} }
else else
{ {
Canvas.SetDrawColor(255,255,255,Owner.CursorFlash); Canvas.SetDrawColor(255, 255, 255, Owner.CursorFlash);
Canvas.SetPos(XL + (Len(FinalDraw) == 0 ? 0 : 3), CursorY); Canvas.SetPos(XL + (Len(FinalDraw) == 0 ? 0 : 3), CursorY);
Canvas.DrawTile( Owner.DefaultPens[`PEN_WHITE], 3, YL-Owner.HUDOwner.ScaledBorderSize, 0, 0, Owner.DefaultPens[`PEN_WHITE].GetSurfaceWidth(), Owner.DefaultPens[`PEN_WHITE].GetSurfaceHeight() ); Canvas.DrawTile( Owner.DefaultPens[`PEN_WHITE], 3, YL-Owner.HUDOwner.ScaledBorderSize, 0, 0, Owner.DefaultPens[`PEN_WHITE].GetSurfaceWidth(), Owner.DefaultPens[`PEN_WHITE].GetSurfaceHeight() );
} }
@ -401,7 +401,7 @@ function DrawMenu()
Canvas.DrawColor = FontColor; Canvas.DrawColor = FontColor;
Canvas.SetPos(BorderSize, (CompPos[3]/2) - (YL/2)); Canvas.SetPos(BorderSize, (CompPos[3]/2) - (YL/2));
Canvas.DrawText(FinalDraw,,FontScale,FontScale,FRI); Canvas.DrawText(FinalDraw, ,FontScale, FontScale, FRI);
} }
function HandleMouseClick( bool bRight) function HandleMouseClick( bool bRight)
@ -420,7 +420,7 @@ Delegate OnTextFinished(KFGUI_EditBox Sender, string S);
defaultproperties defaultproperties
{ {
FontColor=(R=255,G=255,B=255,A=255) FontColor=(R=255, G=255, B=255, A=255)
MaxWidth=768 MaxWidth=768
TextScale=1 TextScale=1
TextCase=TXTC_None TextCase=TXTC_None

View File

@ -4,7 +4,7 @@ Class KFGUI_EditControl extends KFGUI_Clickable;
`include(Logger.uci) `include(Logger.uci)
var export editinline KFGUI_TextLable TextLable; var export editinline KFGUI_TextLable TextLable;
var transient float TextHeight,TextScale; var transient float TextHeight, TextScale;
var transient Font TextFont; var transient Font TextFont;
var Canvas.FontRenderInfo TextFontInfo; var Canvas.FontRenderInfo TextFontInfo;
@ -54,7 +54,7 @@ function PreDraw()
TextScale *= FontScale; TextScale *= FontScale;
TextFont = Canvas.Font; TextFont = Canvas.Font;
Canvas.TextSize("ABC",XS,TextHeight,TextScale,TextScale); Canvas.TextSize("ABC", XS, TextHeight, TextScale, TextScale);
UpdateSizes(); UpdateSizes();
@ -71,13 +71,13 @@ function PreDraw()
final function DrawClippedText( string S, float TScale, float MaxX) final function DrawClippedText( string S, float TScale, float MaxX)
{ {
local int i,l; local int i, l;
local float X,XL,YL; local float X, XL, YL;
l = Len(S); l = Len(S);
for (i=0; i < l; ++i) for (i=0; i < l; ++i)
{ {
Canvas.TextSize(Mid(S,i,1),XL,YL,TScale,TScale); Canvas.TextSize(Mid(S, i,1), XL, YL, TScale, TScale);
if ((Canvas.CurX+X+XL) > MaxX) if ((Canvas.CurX+X+XL) > MaxX)
{ {
--i; --i;
@ -85,21 +85,21 @@ final function DrawClippedText( string S, float TScale, float MaxX)
} }
X+=XL; X+=XL;
} }
Canvas.DrawText(Left(S,i),,TScale,TScale,TextFontInfo); Canvas.DrawText(Left(S, i), ,TScale, TScale, TextFontInfo);
} }
defaultproperties defaultproperties
{ {
LableColor=(R=255,G=255,B=255,A=255) LableColor=(R=255, G=255, B=255, A=255)
FontScale=1 FontScale=1
LableWidth=0.5 LableWidth=0.5
bScaleByFontSize=true bScaleByFontSize=true
TextFontInfo=(bClipText=true,bEnableShadow=true) TextFontInfo=(bClipText=true, bEnableShadow=true)
Begin Object Class=KFGUI_TextLable Name=MyBoxLableText Begin Object Class=KFGUI_TextLable Name=MyBoxLableText
AlignX=0 AlignX=0
AlignY=1 AlignY=1
TextFontInfo=(bClipText=true,bEnableShadow=true) TextFontInfo=(bClipText=true, bEnableShadow=true)
End Object End Object
TextLable=MyBoxLableText TextLable=MyBoxLableText
} }

View File

@ -7,10 +7,10 @@ Class KFGUI_FloatingWindow extends KFGUI_Page
var() string WindowTitle; // Title of this window. var() string WindowTitle; // Title of this window.
var float DragOffset[2], OpenAnimSpeed; var float DragOffset[2], OpenAnimSpeed;
var KFGUI_FloatingWindowHeader HeaderComp; var KFGUI_FloatingWindowHeader HeaderComp;
var bool bDragWindow,bUseAnimation; var bool bDragWindow, bUseAnimation;
var float WindowFadeInTime; var float WindowFadeInTime;
var transient float OpenStartTime,OpenEndTime; var transient float OpenStartTime, OpenEndTime;
function InitMenu() function InitMenu()
{ {
@ -94,8 +94,8 @@ function PreDraw()
if (bDragWindow) if (bDragWindow)
{ {
XPosition = FClamp(Owner.MousePosition.X-DragOffset[0],0,InputPos[2]-CompPos[2]) / InputPos[2]; XPosition = FClamp(Owner.MousePosition.X-DragOffset[0], 0,InputPos[2]-CompPos[2]) / InputPos[2];
YPosition = FClamp(Owner.MousePosition.Y-DragOffset[1],0,InputPos[3]-CompPos[3]) / InputPos[3]; YPosition = FClamp(Owner.MousePosition.Y-DragOffset[1], 0,InputPos[3]-CompPos[3]) / InputPos[3];
} }
} }

View File

@ -6,7 +6,7 @@ Class KFGUI_Frame extends KFGUI_FloatingWindow;
var() float EdgeSize[4]; // Pixels wide for edges (left, top, right, bottom). var() float EdgeSize[4]; // Pixels wide for edges (left, top, right, bottom).
var() float HeaderSize[2]; // Pixels wide for edges (left, top). var() float HeaderSize[2]; // Pixels wide for edges (left, top).
var() Texture FrameTex; var() Texture FrameTex;
var() bool bDrawHeader,bHeaderCenter,bUseLegacyDrawTile,bDrawBackground; var() bool bDrawHeader, bHeaderCenter, bUseLegacyDrawTile, bDrawBackground;
var() float FontScale; var() float FontScale;
function InitMenu() function InitMenu()
@ -33,7 +33,7 @@ function DrawMenu()
delegate OnDrawFrame(Canvas C, float W, Float H) delegate OnDrawFrame(Canvas C, float W, Float H)
{ {
local float T,XL,YL,HeaderH; local float T, XL, YL, HeaderH;
local FontRenderInfo FRI; local FontRenderInfo FRI;
if (FrameTex == None) if (FrameTex == None)
@ -41,15 +41,15 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
return; return;
} }
C.SetDrawColor(255,255,255,FrameOpacity); C.SetDrawColor(255, 255, 255, FrameOpacity);
if (bUseLegacyDrawTile) if (bUseLegacyDrawTile)
{ {
Owner.CurrentStyle.DrawTileStretched(FrameTex,0,0,W,H); Owner.CurrentStyle.DrawTileStretched(FrameTex, 0,0, W,H);
} }
else else
{ {
Canvas.SetPos(0.f, 0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(FrameTex,W,H,0,0,FrameTex.GetSurfaceWidth(),FrameTex.GetSurfaceHeight()); Canvas.DrawTileStretched(FrameTex, W,H, 0,0, FrameTex.GetSurfaceWidth(), FrameTex.GetSurfaceHeight());
} }
if (bDrawHeader && WindowTitle != "") if (bDrawHeader && WindowTitle != "")
@ -60,15 +60,15 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
C.Font = Owner.CurrentStyle.MainFont; C.Font = Owner.CurrentStyle.MainFont;
T = Owner.CurrentStyle.ScreenScale(FontScale); T = Owner.CurrentStyle.ScreenScale(FontScale);
C.SetDrawColor(250,250,250,FrameOpacity); C.SetDrawColor(250, 250, 250, FrameOpacity);
C.TextSize(WindowTitle, XL, YL, T, T); C.TextSize(WindowTitle, XL, YL, T, T);
HeaderH = EdgeSize[1]-HeaderSize[1]; HeaderH = EdgeSize[1]-HeaderSize[1];
if (bHeaderCenter) if (bHeaderCenter)
C.SetPos((W/2) - (XL/2),(HeaderH/2) - (YL/2)); C.SetPos((W/2) - (XL/2), (HeaderH/2) - (YL/2));
else C.SetPos(HeaderSize[0],(HeaderH/2) - (YL/2)); else C.SetPos(HeaderSize[0], (HeaderH/2) - (YL/2));
C.DrawText(WindowTitle,,T,T,FRI); C.DrawText(WindowTitle, ,T, T,FRI);
} }
} }
@ -95,9 +95,9 @@ function PreDraw()
} }
ComputeCoords(); ComputeCoords();
Canvas.SetDrawColor(255,255,255); Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)

View File

@ -18,7 +18,7 @@ var enum eScaleStyle
var Color ImageColor; var Color ImageColor;
var Texture Image; var Texture Image;
var bool bAlignCenter, bForceUniformSize; var bool bAlignCenter, bForceUniformSize;
var int X1,Y1,X2,Y2; var int X1, Y1, X2, Y2;
var float ImageScale; var float ImageScale;
function DrawMenu() function DrawMenu()
@ -137,7 +137,7 @@ delegate DrawBackground(Canvas C, float W, Float H);
defaultproperties defaultproperties
{ {
ImageColor=(R=255,G=255,B=255,A=255) ImageColor=(R=255, G=255, B=255, A=255)
ImageStyle=ISTY_Normal ImageStyle=ISTY_Normal
X1=-1 X1=-1
X2=-1 X2=-1

View File

@ -10,8 +10,8 @@ var() int ListItemsPerPage;
var() color BackgroundColor; var() color BackgroundColor;
var KFGUI_ScrollBarV ScrollBar; var KFGUI_ScrollBarV ScrollBar;
var transient float OldXSize,ItemHeight,MouseYHit; var transient float OldXSize, ItemHeight, MouseYHit;
var transient int FocusMouseItem,LastFocusItem; var transient int FocusMouseItem, LastFocusItem;
var byte PressedDown[2]; var byte PressedDown[2];
var bool bPressedDown; var bool bPressedDown;
@ -32,15 +32,15 @@ function InitMenu()
function DrawMenu() function DrawMenu()
{ {
local int i,n; local int i, n;
local float Y; local float Y;
local bool bCheckMouse; local bool bCheckMouse;
if (bDrawBackground) if (bDrawBackground)
{ {
Canvas.DrawColor = BackgroundColor; Canvas.DrawColor = BackgroundColor;
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER],CompPos[2],CompPos[3],0,0,128,128); Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER], CompPos[2], CompPos[3], 0,0, 128, 128);
} }
// Mouse focused item check. // Mouse focused item check.
@ -62,7 +62,7 @@ function DrawMenu()
FocusMouseItem = n; FocusMouseItem = n;
else MouseYHit -= ItemHeight; else MouseYHit -= ItemHeight;
} }
OnDrawItem(Canvas,n,Y,ItemHeight,CompPos[2],(FocusMouseItem == n)); OnDrawItem(Canvas, n,Y, ItemHeight, CompPos[2], (FocusMouseItem == n));
Y+=ItemHeight; Y+=ItemHeight;
++n; ++n;
} }
@ -101,15 +101,15 @@ function PreDraw()
// Then downscale our selves to give room for scrollbar. // Then downscale our selves to give room for scrollbar.
CompPos[2] -= ScrollBar.CompPos[2]; CompPos[2] -= ScrollBar.CompPos[2];
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
CompPos[2] += ScrollBar.CompPos[2]; CompPos[2] += ScrollBar.CompPos[2];
} }
else else
{ {
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
} }
@ -129,12 +129,12 @@ function UpdateListVis()
{ {
if (ListCount <= ListItemsPerPage) if (ListCount <= ListItemsPerPage)
{ {
ScrollBar.UpdateScrollSize(0,1,1,1); ScrollBar.UpdateScrollSize(0, 1,1, 1);
ScrollBar.SetDisabled(true); ScrollBar.SetDisabled(true);
} }
else else
{ {
ScrollBar.UpdateScrollSize(ScrollBar.CurrentScroll,(ListCount-ListItemsPerPage),1,ListItemsPerPage); ScrollBar.UpdateScrollSize(ScrollBar.CurrentScroll, (ListCount-ListItemsPerPage), 1,ListItemsPerPage);
ScrollBar.SetDisabled(false); ScrollBar.SetDisabled(false);
} }
} }
@ -156,7 +156,7 @@ function DoubleMouseClick( bool bRight)
{ {
PressedDown[byte(bRight)] = 0; PressedDown[byte(bRight)] = 0;
bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0); bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0);
OnDblClickedItem(FocusMouseItem,bRight,Owner.MousePosition.X-CompPos[0],MouseYHit); OnDblClickedItem(FocusMouseItem, bRight, Owner.MousePosition.X-CompPos[0], MouseYHit);
} }
} }
function MouseClick( bool bRight) function MouseClick( bool bRight)
@ -173,7 +173,7 @@ function MouseRelease( bool bRight)
{ {
PressedDown[byte(bRight)] = 0; PressedDown[byte(bRight)] = 0;
bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0); bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0);
OnClickedItem(FocusMouseItem,bRight,Owner.MousePosition.X-CompPos[0],MouseYHit); OnClickedItem(FocusMouseItem, bRight, Owner.MousePosition.X-CompPos[0], MouseYHit);
} }
} }
function MouseLeave() function MouseLeave()
@ -207,7 +207,7 @@ defaultproperties
{ {
ListItemsPerPage=7 ListItemsPerPage=7
ListCount=1 ListCount=1
BackgroundColor=(R=0,G=0,B=0,A=75) BackgroundColor=(R=0, G=0, B=0, A=75)
bDrawBackground=false bDrawBackground=false
bUseFocusSound=false bUseFocusSound=false

View File

@ -10,8 +10,8 @@ var() float ButtonScale;
var() color BackgroundColor; var() color BackgroundColor;
var KFGUI_ScrollBarH ScrollBar; var KFGUI_ScrollBarH ScrollBar;
var transient float OldYSize,ItemWidth,MouseXHit; var transient float OldYSize, ItemWidth, MouseXHit;
var transient int FocusMouseItem,LastFocusItem; var transient int FocusMouseItem, LastFocusItem;
var byte PressedDown[2]; var byte PressedDown[2];
var bool bPressedDown; var bool bPressedDown;
@ -33,16 +33,16 @@ function InitMenu()
function DrawMenu() function DrawMenu()
{ {
local int i,n; local int i, n;
local float X; local float X;
local bool bCheckMouse; local bool bCheckMouse;
if (bDrawBackground) if (bDrawBackground)
{ {
//Canvas.DrawColor = BackgroundColor; //Canvas.DrawColor = BackgroundColor;
Canvas.SetDrawColor(250,250,250,255); Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(0.f,0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER],CompPos[2],CompPos[3],0,0,128,128); Canvas.DrawTileStretched(Owner.CurrentStyle.BorderTextures[`BOX_INNERBORDER], CompPos[2], CompPos[3], 0,0, 128, 128);
} }
// Mouse focused item check. // Mouse focused item check.
@ -64,7 +64,7 @@ function DrawMenu()
FocusMouseItem = n; FocusMouseItem = n;
else MouseXHit -= ItemWidth; else MouseXHit -= ItemWidth;
} }
OnDrawItem(Canvas,n,X,CompPos[3],ItemWidth,(FocusMouseItem == n)); OnDrawItem(Canvas, n,X, CompPos[3], ItemWidth, (FocusMouseItem == n));
X+=ItemWidth; X+=ItemWidth;
++n; ++n;
} }
@ -103,15 +103,15 @@ function PreDraw()
// Then downscale our selves to give room for scrollbar. // Then downscale our selves to give room for scrollbar.
CompPos[3] -= ScrollBar.CompPos[3]*1.15f; CompPos[3] -= ScrollBar.CompPos[3]*1.15f;
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
CompPos[3] += ScrollBar.CompPos[3]*1.15f; CompPos[3] += ScrollBar.CompPos[3]*1.15f;
} }
else else
{ {
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
} }
@ -131,12 +131,12 @@ function UpdateListVis()
{ {
if (ListCount <= ListItemsPerPage) if (ListCount <= ListItemsPerPage)
{ {
ScrollBar.UpdateScrollSize(0,1,1,1); ScrollBar.UpdateScrollSize(0, 1,1, 1);
ScrollBar.SetDisabled(true); ScrollBar.SetDisabled(true);
} }
else else
{ {
ScrollBar.UpdateScrollSize(ScrollBar.CurrentScroll,(ListCount-ListItemsPerPage),1,ListItemsPerPage); ScrollBar.UpdateScrollSize(ScrollBar.CurrentScroll, (ListCount-ListItemsPerPage), 1,ListItemsPerPage);
ScrollBar.SetDisabled(false); ScrollBar.SetDisabled(false);
} }
} }
@ -159,7 +159,7 @@ function DoubleMouseClick( bool bRight)
PlayMenuSound(MN_ClickButton); PlayMenuSound(MN_ClickButton);
PressedDown[byte(bRight)] = 0; PressedDown[byte(bRight)] = 0;
bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0); bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0);
OnDblClickedItem(FocusMouseItem,bRight,MouseXHit,Owner.MousePosition.Y-CompPos[1]); OnDblClickedItem(FocusMouseItem, bRight, MouseXHit, Owner.MousePosition.Y-CompPos[1]);
} }
} }
function MouseClick( bool bRight) function MouseClick( bool bRight)
@ -177,7 +177,7 @@ function MouseRelease( bool bRight)
PlayMenuSound(MN_ClickButton); PlayMenuSound(MN_ClickButton);
PressedDown[byte(bRight)] = 0; PressedDown[byte(bRight)] = 0;
bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0); bPressedDown = (PressedDown[0] != 0 || PressedDown[1] != 0);
OnClickedItem(FocusMouseItem,bRight,MouseXHit,Owner.MousePosition.Y-CompPos[1]); OnClickedItem(FocusMouseItem, bRight, MouseXHit, Owner.MousePosition.Y-CompPos[1]);
} }
} }
function MouseLeave() function MouseLeave()
@ -213,7 +213,7 @@ defaultproperties
{ {
ListItemsPerPage=7 ListItemsPerPage=7
ListCount=1 ListCount=1
BackgroundColor=(R=0,G=0,B=0,A=75) BackgroundColor=(R=0, G=0, B=0, A=75)
bDrawBackground=false bDrawBackground=false
bUseFocusSound=false bUseFocusSound=false

View File

@ -5,17 +5,17 @@ Class KFGUI_ListItem extends Object
`include(Logger.uci) `include(Logger.uci)
var KFGUI_ListItem Next; var KFGUI_ListItem Next;
var array < string> Columns,SortColumns; var array < string> Columns, SortColumns;
var int Index,Value; var int Index, Value;
var transient string Temp; // Cache sorting key. var transient string Temp; // Cache sorting key.
function SetValue( string S, int i, string SortStr) function SetValue( string S, int i, string SortStr)
{ {
ParseStringIntoArray(S,Columns,"\n",false); ParseStringIntoArray(S, Columns, "\n", false);
if (SortStr == "") if (SortStr == "")
SortColumns.Length = 0; SortColumns.Length = 0;
else ParseStringIntoArray(Caps(SortStr),SortColumns,"\n",false); else ParseStringIntoArray(Caps(SortStr), SortColumns, "\n", false);
Value = i; Value = i;
} }

View File

@ -32,9 +32,9 @@ function PreDraw()
return; return;
ComputeCoords(); ComputeCoords();
Canvas.SetDrawColor(255,255,255); Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
{ {
@ -49,7 +49,7 @@ function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
local int i; local int i;
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].InventoryChanged(Wep,bRemove); Components[i].InventoryChanged(Wep, bRemove);
} }
function MenuTick( float DeltaTime) function MenuTick( float DeltaTime)
{ {
@ -125,7 +125,7 @@ function FindAllComponentID( name InID, out array < KFGUI_Base> Res)
if (ID == InID) if (ID == InID)
Res[Res.Length] = Self; Res[Res.Length] = Self;
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].FindAllComponentID(InID,Res); Components[i].FindAllComponentID(InID, Res);
} }
function RemoveComponent( KFGUI_Base B) function RemoveComponent( KFGUI_Base B)
{ {
@ -134,7 +134,7 @@ function RemoveComponent( KFGUI_Base B)
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
if (Components[i] == B) if (Components[i] == B)
{ {
Components.Remove(i,1); Components.Remove(i, 1);
B.CloseMenu(); B.CloseMenu();
return; return;
} }

View File

@ -123,7 +123,7 @@ function float GetValue()
defaultproperties defaultproperties
{ {
BarColor=(R=255,G=255,B=255,A=255) BarColor=(R=255, G=255, B=255, A=255)
Low=0.f Low=0.f
High=100.f High=100.f
Value=0.f Value=0.f

View File

@ -5,15 +5,15 @@ Class KFGUI_RightClickMenu extends KFGUI_Clickable;
struct FRowItem struct FRowItem
{ {
var string Text,ToolTip; var string Text, ToolTip;
var bool bSplitter,bDisabled; var bool bSplitter, bDisabled;
}; };
var array < FRowItem> ItemRows; var array < FRowItem> ItemRows;
var int CurrentRow,OldRow; var int CurrentRow, OldRow;
var int EdgeSize; var int EdgeSize;
var int OldSizeX; var int OldSizeX;
var transient bool bDrawToolTip; var transient bool bDrawToolTip;
var Color BoxColor,OutlineColor; var Color BoxColor, OutlineColor;
function OpenMenu( KFGUI_Base Menu) function OpenMenu( KFGUI_Base Menu)
{ {
@ -25,7 +25,7 @@ function OpenMenu( KFGUI_Base Menu)
} }
final function ComputeSize() final function ComputeSize()
{ {
local float XS,YS,XL,YL,Scalar; local float XS, YS, XL, YL, Scalar;
local int i; local int i;
local string S; local string S;
@ -46,9 +46,9 @@ final function ComputeSize()
S = "----"; S = "----";
else S = ItemRows[i].Text; else S = ItemRows[i].Text;
Canvas.TextSize(S,XL,YL,Scalar,Scalar); Canvas.TextSize(S, XL, YL, Scalar, Scalar);
XS = FMax(XS,XL); XS = FMax(XS, XL);
YS += YL; YS += YL;
} }
} }
@ -101,7 +101,7 @@ function DrawMenu()
} }
function DrawToolTip() function DrawToolTip()
{ {
local float X,Y,XL,YL,BoxW,BoxH,TextX,TextY,Scalar,CursorSize; local float X, Y,XL, YL, BoxW, BoxH, TextX, TextY, Scalar, CursorSize;
local string S; local string S;
Canvas.Reset(); Canvas.Reset();
@ -109,7 +109,7 @@ function DrawToolTip()
S = ItemRows[CurrentRow].ToolTip; S = ItemRows[CurrentRow].ToolTip;
Canvas.Font = Owner.CurrentStyle.PickFont(Scalar); Canvas.Font = Owner.CurrentStyle.PickFont(Scalar);
Canvas.TextSize(S,XL,YL,Scalar,Scalar); Canvas.TextSize(S, XL, YL, Scalar, Scalar);
CursorSize = Owner.CurrentStyle.ScreenScale(Owner.CursorSize); CursorSize = Owner.CurrentStyle.ScreenScale(Owner.CursorSize);
X = Owner.MousePosition.X+CursorSize; X = Owner.MousePosition.X+CursorSize;
@ -122,14 +122,14 @@ function DrawToolTip()
X -= 0.01; X -= 0.01;
} }
Owner.CurrentStyle.DrawOutlinedBox(X, Y, BoxW, BoxH, EdgeSize, MakeColor(5,5,5,255), MakeColor(115,115,115,255)); Owner.CurrentStyle.DrawOutlinedBox(X, Y, BoxW, BoxH, EdgeSize, MakeColor(5, 5,5, 255), MakeColor(115, 115, 115, 255));
TextX = X + (BoxW/2) - (XL/2) - (EdgeSize/2); TextX = X + (BoxW/2) - (XL/2) - (EdgeSize/2);
TextY = Y + (BoxH/2) - (YL/2) - (EdgeSize/2); TextY = Y + (BoxH/2) - (YL/2) - (EdgeSize/2);
Canvas.DrawColor = class'HUD'.default.WhiteColor; Canvas.DrawColor = class'HUD'.default.WhiteColor;
Canvas.SetPos(TextX, TextY); Canvas.SetPos(TextX, TextY);
Canvas.DrawText(S,,Scalar,Scalar); Canvas.DrawText(S, ,Scalar, Scalar);
} }
function HandleMouseClick( bool bRight) function HandleMouseClick( bool bRight)
{ {
@ -161,6 +161,6 @@ defaultproperties
bFocusedPostDrawItem=true bFocusedPostDrawItem=true
bHoverSound=false bHoverSound=false
EdgeSize=2 EdgeSize=2
BoxColor=(R=5,G=5,B=5,A=200) BoxColor=(R=5, G=5, B=5, A=200)
OutlineColor=(R=115,G=115,B=115,A=255) OutlineColor=(R=115, G=115, B=115, A=255)
} }

View File

@ -4,13 +4,13 @@ Class KFGUI_ScrollBarBase extends KFGUI_Clickable
`include(Build.uci) `include(Build.uci)
`include(Logger.uci) `include(Logger.uci)
var() int MinRange,MaxRange,ScrollStride,PageStep; var() int MinRange, MaxRange, ScrollStride, PageStep;
var() float ButtonScale; // Button width (scaled by default font height). var() float ButtonScale; // Button width (scaled by default font height).
var int CurrentScroll; var int CurrentScroll;
// In-runtime values. // In-runtime values.
var transient float CalcButtonScale; var transient float CalcButtonScale;
var transient int SliderScale,ButtonOffset,GrabbedOffset; var transient int SliderScale, ButtonOffset, GrabbedOffset;
var transient bool bGrabbedScroller; var transient bool bGrabbedScroller;
var bool bVertical, bHideScrollbar; var bool bVertical, bHideScrollbar;
@ -29,8 +29,8 @@ final function AddValue( int V)
} }
final function SetValue( int V) final function SetValue( int V)
{ {
CurrentScroll = Clamp((V / ScrollStride) * ScrollStride,MinRange,MaxRange); CurrentScroll = Clamp((V / ScrollStride) * ScrollStride, MinRange, MaxRange);
OnScrollChange(Self,CurrentScroll); OnScrollChange(Self, CurrentScroll);
} }
final function int GetValue() final function int GetValue()
{ {

View File

@ -5,7 +5,7 @@ class KFGUI_Slider extends KFGUI_MultiComponent;
var KFGUI_ScrollBarH ScrollBar; var KFGUI_ScrollBarH ScrollBar;
var int MinValue,MaxValue; var int MinValue, MaxValue;
var transient int CurrentValue; var transient int CurrentValue;
delegate OnValueChanged(KFGUI_Slider Sender, int Value); delegate OnValueChanged(KFGUI_Slider Sender, int Value);
@ -35,7 +35,7 @@ function ValueChanged(KFGUI_ScrollBarBase Sender, int Value)
function UpdateListVis() function UpdateListVis()
{ {
ScrollBar.UpdateScrollSize(CurrentValue,MaxValue,1,1,MinValue); ScrollBar.UpdateScrollSize(CurrentValue, MaxValue, 1,1, MinValue);
} }
function ScrollMouseWheel( bool bUp) function ScrollMouseWheel( bool bUp)

View File

@ -6,10 +6,10 @@ Class KFGUI_SwitchMenuBar extends KFGUI_MultiComponent;
var array < KFGUI_Base> SubPages; var array < KFGUI_Base> SubPages;
var() byte ButtonPosition; // 0 = top, 1 = bottom, 2 = left, 3 = right var() byte ButtonPosition; // 0 = top, 1 = bottom, 2 = left, 3 = right
var() float BorderWidth,ButtonAxisSize; // Width for buttons. var() float BorderWidth, ButtonAxisSize; // Width for buttons.
var() float PagePadding; // Padding for pages var() float PagePadding; // Padding for pages
var int NumButtons,CurrentPageNum,PageComponentIndex; var int NumButtons, CurrentPageNum, PageComponentIndex;
var array < KFGUI_Button> PageButtons; var array < KFGUI_Button> PageButtons;
function ShowMenu() function ShowMenu()
@ -90,7 +90,7 @@ final function SelectPage( int Index)
{ {
PageButtons[CurrentPageNum].bIsHighlighted = false; PageButtons[CurrentPageNum].bIsHighlighted = false;
SubPages[CurrentPageNum].CloseMenu(); SubPages[CurrentPageNum].CloseMenu();
Components.Remove(PageComponentIndex,1); Components.Remove(PageComponentIndex, 1);
PageComponentIndex = -1; PageComponentIndex = -1;
} }
CurrentPageNum = (Index >= 0 && Index < SubPages.Length) ? Index : -1; CurrentPageNum = (Index >= 0 && Index < SubPages.Length) ? Index : -1;
@ -114,8 +114,8 @@ function PreDraw()
if (CurrentPageNum == -1 && NumButtons > 0) if (CurrentPageNum == -1 && NumButtons > 0)
SelectPage(0); SelectPage(0);
ComputeCoords(); ComputeCoords();
Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu(); DrawMenu();
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
{ {

View File

@ -33,13 +33,13 @@ var() string LineSplitter;
var() protected string Text; var() protected string Text;
var() Color TextColor; var() Color TextColor;
var() Canvas.FontRenderInfo TextFontInfo; var() Canvas.FontRenderInfo TextFontInfo;
var() float FontScale,MessageDisplayTime,MessageFadeInTime,MessageFadeOutTime; var() float FontScale, MessageDisplayTime, MessageFadeInTime, MessageFadeOutTime;
var() bool bNoReset,bFadeInOut,bUseOutlineText; var() bool bNoReset, bFadeInOut, bUseOutlineText;
var() int MaxHistory, OutlineSize; var() int MaxHistory, OutlineSize;
var protected transient array < FTextLineInfo> Lines,OrgLines; var protected transient array < FTextLineInfo> Lines, OrgLines;
var transient float MaxHeight,ScrollWidth,OldSize[2],InitFontScale,TextHeight,FadeStartTime; var transient float MaxHeight, ScrollWidth, OldSize[2], InitFontScale, TextHeight, FadeStartTime;
var transient Font InitFont; var transient Font InitFont;
var transient bool bShowScrollbar,bTextParsed; var transient bool bShowScrollbar, bTextParsed;
function SetText( string S) function SetText( string S)
{ {
@ -67,12 +67,12 @@ final function string GetText()
final function ParseTextLines() final function ParseTextLines()
{ {
local array < string> SA; local array < string> SA;
local int i,j,z; local int i, j,z;
local string S; local string S;
local color C; local color C;
local ETextFieldStyles TextType; local ETextFieldStyles TextType;
ParseStringIntoArray(Text,SA,LineSplitter,false); ParseStringIntoArray(Text, SA, LineSplitter, false);
Lines.Length = SA.Length; Lines.Length = SA.Length;
C.A = 0; C.A = 0;
TextType = TEXT_FIELD_NONE; TextType = TEXT_FIELD_NONE;
@ -87,11 +87,11 @@ final function ParseTextLines()
z = 0; z = 0;
while( true) while( true)
{ {
j = InStr(S,"#{"); j = InStr(S, "#{");
if (j > 0) if (j > 0)
{ {
Lines[i].Text.Length = z+1; Lines[i].Text.Length = z+1;
Lines[i].Text[z].S = Left(S,j); Lines[i].Text[z].S = Left(S, j);
Lines[i].Text[z].C = C; Lines[i].Text[z].C = C;
Lines[i].Text[z].TextType = TextType; Lines[i].Text[z].TextType = TextType;
++z; ++z;
@ -99,43 +99,43 @@ final function ParseTextLines()
else if (j == -1) else if (j == -1)
break; break;
S = Mid(S,j+2); S = Mid(S, j+2);
if (Left(S,4) == "DEF}") if (Left(S, 4) == "DEF}")
{ {
C.A = 0; C.A = 0;
S = Mid(S,4); S = Mid(S, 4);
TextType = TEXT_FIELD_NONE; TextType = TEXT_FIELD_NONE;
} }
else if (Left(S,4) == "HSV}") else if (Left(S, 4) == "HSV}")
{ {
C.A = 0; C.A = 0;
S = Mid(S,4); S = Mid(S, 4);
TextType = TEXT_FIELD_HSV; TextType = TEXT_FIELD_HSV;
} }
else if (Left(S,6) == "FLASH}") else if (Left(S, 6) == "FLASH}")
{ {
C.A = 0; C.A = 0;
S = Mid(S,6); S = Mid(S, 6);
TextType = TEXT_FIELD_FLASH; TextType = TEXT_FIELD_FLASH;
} }
else if (Left(S,7) == "CFLASH=") else if (Left(S, 7) == "CFLASH=")
{ {
C.A = 0; C.A = 0;
S = Mid(S,7); S = Mid(S, 7);
TextType = TEXT_FIELD_FLASH; TextType = TEXT_FIELD_FLASH;
C.R = GrabHexValue(Mid(S,0,2)); C.R = GrabHexValue(Mid(S, 0,2));
C.G = GrabHexValue(Mid(S,2,2)); C.G = GrabHexValue(Mid(S, 2,2));
C.B = GrabHexValue(Mid(S,4,2)); C.B = GrabHexValue(Mid(S, 4,2));
S = Mid(S,7); S = Mid(S, 7);
C.A = 255; C.A = 255;
} }
else else
{ {
C.R = GrabHexValue(Mid(S,0,2)); C.R = GrabHexValue(Mid(S, 0,2));
C.G = GrabHexValue(Mid(S,2,2)); C.G = GrabHexValue(Mid(S, 2,2));
C.B = GrabHexValue(Mid(S,4,2)); C.B = GrabHexValue(Mid(S, 4,2));
S = Mid(S,7); S = Mid(S, 7);
C.A = 255; C.A = 255;
TextType = TEXT_FIELD_NONE; TextType = TEXT_FIELD_NONE;
} }
@ -151,8 +151,8 @@ final function byte GrabHexValue( string S)
{ {
local byte n; local byte n;
n = (HexToInt(Asc(Left(S,1))) << 4) | HexToInt(Asc(Right(S,1))); n = (HexToInt(Asc(Left(S, 1))) << 4) | HexToInt(Asc(Right(S, 1)));
S = Mid(S,2); S = Mid(S, 2);
return n; return n;
} }
final function byte HexToInt( byte n) final function byte HexToInt( byte n)
@ -189,7 +189,7 @@ function InitSize()
// Compute Y-offsets of each line. // Compute Y-offsets of each line.
Canvas.Font = InitFont; Canvas.Font = InitFont;
Canvas.TextSize("ABC",XS,TextHeight,InitFontScale,InitFontScale); Canvas.TextSize("ABC", XS, TextHeight, InitFontScale, InitFontScale);
ParseLines(CompPos[2] / InitFontScale); ParseLines(CompPos[2] / InitFontScale);
MaxHeight = (Lines.Length * TextHeight); MaxHeight = (Lines.Length * TextHeight);
@ -202,7 +202,7 @@ function InitSize()
if (ScrollBar == None) if (ScrollBar == None)
{ {
ScrollBar = new(Self) class'KFGUI_ScrollBarV'; ScrollBar = new(Self) class'KFGUI_ScrollBarV';
ScrollBar.SetPosition(0.9,0.0,0.1,1.0); ScrollBar.SetPosition(0.9, 0.0, 0.1, 1.0);
ScrollBar.Owner = Owner; ScrollBar.Owner = Owner;
ScrollBar.ParentComponent = Self; ScrollBar.ParentComponent = Self;
ScrollBar.InitMenu(); ScrollBar.InitMenu();
@ -225,8 +225,8 @@ function InitSize()
if (Components.Find(ScrollBar) == -1) if (Components.Find(ScrollBar) == -1)
Components.AddItem(ScrollBar); Components.AddItem(ScrollBar);
MaxHeight = (Lines.Length * TextHeight); MaxHeight = (Lines.Length * TextHeight);
MaxScrollRange = Max(((MaxHeight-CompPos[3])/TextHeight),1); MaxScrollRange = Max(((MaxHeight-CompPos[3])/TextHeight), 1);
ScrollBar.UpdateScrollSize(bNoReset ? MaxScrollRange : 0,MaxScrollRange,1,1); ScrollBar.UpdateScrollSize(bNoReset ? MaxScrollRange : 0, MaxScrollRange, 1,1);
} }
else if (ScrollBar != None) else if (ScrollBar != None)
Components.RemoveItem(ScrollBar); Components.RemoveItem(ScrollBar);
@ -235,8 +235,8 @@ function InitSize()
// Parse textlines to see if they're too long. // Parse textlines to see if they're too long.
final function ParseLines( float ClipX) final function ParseLines( float ClipX)
{ {
local float X,XS,YS; local float X, XS, YS;
local int i,j,z,n; local int i, j,z, n;
for (i=0; i < Lines.Length; ++i) for (i=0; i < Lines.Length; ++i)
{ {
@ -245,31 +245,31 @@ final function ParseLines( float ClipX)
for (j=0; j < Lines[i].Text.Length; ++j) for (j=0; j < Lines[i].Text.Length; ++j)
{ {
Lines[i].Text[j].X = (X*InitFontScale); Lines[i].Text[j].X = (X*InitFontScale);
Canvas.TextSize(Lines[i].Text[j].S,XS,YS); Canvas.TextSize(Lines[i].Text[j].S, XS, YS);
if ((X+XS) > ClipX) if ((X+XS) > ClipX)
{ {
z = FindSplitPoint(Lines[i].Text[j].S,X,ClipX); z = FindSplitPoint(Lines[i].Text[j].S, X,ClipX);
// Add new line. // Add new line.
Lines.Insert(i+1,1); Lines.Insert(i+1, 1);
// Append the remaining lines there. // Append the remaining lines there.
for (n=j; n < Lines[i].Text.Length; ++n) for (n=j; n < Lines[i].Text.Length; ++n)
Lines[i+1].Text.AddItem(Lines[i].Text[n]); Lines[i+1].Text.AddItem(Lines[i].Text[n]);
// Split the string at wrapping point. // Split the string at wrapping point.
Lines[i+1].Text[0].S = Mid(Lines[i].Text[j].S,z); Lines[i+1].Text[0].S = Mid(Lines[i].Text[j].S, z);
// Remove whitespaces in front of the string. // Remove whitespaces in front of the string.
Lines[i+1].Text[0].S = StripWhiteSpaces(Lines[i+1].Text[0].S); Lines[i+1].Text[0].S = StripWhiteSpaces(Lines[i+1].Text[0].S);
// If empty, clean it up. // If empty, clean it up.
if (Lines[i+1].Text[0].S == "") if (Lines[i+1].Text[0].S == "")
Lines[i+1].Text.Remove(0,1); Lines[i+1].Text.Remove(0, 1);
// End the current line at wrapping point. // End the current line at wrapping point.
Lines[i].Text[j].S = Left(Lines[i].Text[j].S,z); Lines[i].Text[j].S = Left(Lines[i].Text[j].S, z);
Lines[i].Text.Length = j+1; Lines[i].Text.Length = j+1;
break; break;
} }
@ -281,12 +281,12 @@ final function ParseLines( float ClipX)
// Slow, find wrapped splitting point in text. // Slow, find wrapped splitting point in text.
final function int FindSplitPoint( string S, float X, float ClipX) final function int FindSplitPoint( string S, float X, float ClipX)
{ {
local int i,l,PrevWord; local int i, l,PrevWord;
local float XL,YL; local float XL, YL;
local bool bWasWhite,bStartedZero; local bool bWasWhite, bStartedZero;
bStartedZero = (X == 0.f); bStartedZero = (X == 0.f);
Canvas.TextSize(Mid(S,0,1),XL,YL); Canvas.TextSize(Mid(S, 0,1), XL, YL);
X += XL; X += XL;
i = 1; i = 1;
l = Len(S); l = Len(S);
@ -294,7 +294,7 @@ final function int FindSplitPoint( string S, float X, float ClipX)
bWasWhite = true; bWasWhite = true;
while( i < l) while( i < l)
{ {
if (Mid(S,i,1) == " ") if (Mid(S, i,1) == " ")
{ {
if (!bWasWhite) if (!bWasWhite)
{ {
@ -306,7 +306,7 @@ final function int FindSplitPoint( string S, float X, float ClipX)
{ {
bWasWhite = false; bWasWhite = false;
} }
Canvas.TextSize(Mid(S,i,1),XL,YL); Canvas.TextSize(Mid(S, i,1), XL, YL);
X+=XL; X+=XL;
if (X > ClipX ) // Split here if possible. if (X > ClipX ) // Split here if possible.
{ {
@ -320,8 +320,8 @@ final function int FindSplitPoint( string S, float X, float ClipX)
} }
final function string StripWhiteSpaces( string S) final function string StripWhiteSpaces( string S)
{ {
if (Left(S,1) == " ") if (Left(S, 1) == " ")
S = Mid(S,1); S = Mid(S, 1);
return S; return S;
} }
@ -332,7 +332,7 @@ function byte GetCursorStyle()
function DrawMenu() function DrawMenu()
{ {
local int i,j,Index; local int i, j,Index;
local float Y; local float Y;
if (Text == "" || !bVisible) if (Text == "" || !bVisible)
@ -357,7 +357,7 @@ function DrawMenu()
if (bShowScrollbar) if (bShowScrollbar)
{ {
Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth),CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth), CompPos[1]+CompPos[3]);
i = ScrollBar.GetValue(); i = ScrollBar.GetValue();
} }
else i = 0; else i = 0;
@ -419,18 +419,18 @@ function DrawTextField(string S, int Index, float X, float Y, optional Color C,
if (bUseOutlineText) if (bUseOutlineText)
{ {
Owner.CurrentStyle.DrawTextShadow(S,X,Y,OutlineSize,InitFontScale); Owner.CurrentStyle.DrawTextShadow(S, X,Y, OutlineSize, InitFontScale);
} }
else else
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X, Y);
Canvas.DrawText(S,,InitFontScale,InitFontScale,TextFontInfo); Canvas.DrawText(S, ,InitFontScale, InitFontScale, TextFontInfo);
} }
} }
function Color GetColorFromStyle(Color MainColor, ETextFieldStyles TextStyle) function Color GetColorFromStyle(Color MainColor, ETextFieldStyles TextStyle)
{ {
local float ColorHUE,Value; local float ColorHUE, Value;
local HSVColour HSV; local HSVColour HSV;
if (TextStyle == TEXT_FIELD_HSV) if (TextStyle == TEXT_FIELD_HSV)
@ -485,8 +485,8 @@ defaultproperties
MaxHistory=0 MaxHistory=0
OutlineSize=1 OutlineSize=1
Text="TextField" Text="TextField"
TextColor=(R=255,G=255,B=255,A=255) TextColor=(R=255, G=255, B=255, A=255)
TextFontInfo=(bClipText=true,bEnableShadow=true) TextFontInfo=(bClipText=true, bEnableShadow=true)
bCanFocus=false bCanFocus=false
bClickable=false bClickable=false
bUseOutlineText=false bUseOutlineText=false

View File

@ -6,17 +6,17 @@ Class KFGUI_TextLable extends KFGUI_Base;
var() protected string Text; var() protected string Text;
var() color TextColor; var() color TextColor;
var() Canvas.FontRenderInfo TextFontInfo; var() Canvas.FontRenderInfo TextFontInfo;
var() byte AlignX,AlignY; // Alignment, 0=Left/Up, 1=Center, 2=Right/Down var() byte AlignX, AlignY; // Alignment, 0=Left/Up, 1=Center, 2=Right/Down
var() float FontScale; var() float FontScale;
var() bool bUseOutline; var() bool bUseOutline;
var() int OutlineSize; var() int OutlineSize;
var transient Font InitFont; var transient Font InitFont;
var transient float OldSize[2],InitOffset[2],InitFontScale; var transient float OldSize[2], InitOffset[2], InitFontScale;
function InitSize() function InitSize()
{ {
local float XL,YL,TS; local float XL, YL, TS;
OldSize[0] = CompPos[2]; OldSize[0] = CompPos[2];
OldSize[1] = CompPos[3]; OldSize[1] = CompPos[3];
@ -28,16 +28,16 @@ function InitSize()
{ {
Canvas.Font = Owner.CurrentStyle.MainFont; Canvas.Font = Owner.CurrentStyle.MainFont;
if (TextFontInfo.bClipText) if (TextFontInfo.bClipText)
Canvas.TextSize(Text,XL,YL,TS,TS); Canvas.TextSize(Text, XL, YL, TS, TS);
else else
{ {
Canvas.SetPos(0,0); Canvas.SetPos(0, 0);
if (TS == 1) if (TS == 1)
Canvas.StrLen(Text,XL,YL); Canvas.StrLen(Text, XL, YL);
else else
{ {
Canvas.SetClip(CompPos[2]/TS,CompPos[3]); // Hacky, since StrLen has no TextSize support. Canvas.SetClip(CompPos[2]/TS, CompPos[3]); // Hacky, since StrLen has no TextSize support.
Canvas.StrLen(Text,XL,YL); Canvas.StrLen(Text, XL, YL);
XL*=TS; XL*=TS;
YL*=TS; YL*=TS;
} }
@ -47,7 +47,7 @@ function InitSize()
TS -= 0.001; TS -= 0.001;
} }
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
InitFont = Canvas.Font; InitFont = Canvas.Font;
InitFontScale = TS; InitFontScale = TS;
@ -57,7 +57,7 @@ function InitSize()
InitOffset[0] = 0; InitOffset[0] = 0;
break; break;
case 1: case 1:
InitOffset[0] = FMax((CompPos[2]-XL)*0.5,0.f); InitOffset[0] = FMax((CompPos[2]-XL)*0.5, 0.f);
break; break;
default: default:
InitOffset[0] = CompPos[2]-(XL+1); InitOffset[0] = CompPos[2]-(XL+1);
@ -68,7 +68,7 @@ function InitSize()
InitOffset[1] = 0; InitOffset[1] = 0;
break; break;
case 1: case 1:
InitOffset[1] = FMax((CompPos[3]-YL)*0.5,0.f); InitOffset[1] = FMax((CompPos[3]-YL)*0.5, 0.f);
break; break;
default: default:
InitOffset[1] = CompPos[3]-YL; InitOffset[1] = CompPos[3]-YL;
@ -99,12 +99,12 @@ function DrawMenu()
Canvas.DrawColor = TextColor; Canvas.DrawColor = TextColor;
if (bUseOutline) if (bUseOutline)
{ {
Owner.CurrentStyle.DrawTextShadow(Text,InitOffset[0],InitOffset[1],OutlineSize,InitFontScale); Owner.CurrentStyle.DrawTextShadow(Text, InitOffset[0], InitOffset[1], OutlineSize, InitFontScale);
} }
else else
{ {
Canvas.SetPos(InitOffset[0],InitOffset[1]); Canvas.SetPos(InitOffset[0], InitOffset[1]);
Canvas.DrawText(Text,,InitFontScale,InitFontScale,TextFontInfo); Canvas.DrawText(Text, ,InitFontScale, InitFontScale, TextFontInfo);
} }
} }
function bool CaptureMouse() function bool CaptureMouse()
@ -115,8 +115,8 @@ function bool CaptureMouse()
defaultproperties defaultproperties
{ {
Text="Label" Text="Label"
TextColor=(R=255,G=255,B=255,A=255) TextColor=(R=255, G=255, B=255, A=255)
TextFontInfo=(bClipText=false,bEnableShadow=true) TextFontInfo=(bClipText=false, bEnableShadow=true)
FontScale=1.f FontScale=1.f
OutlineSize=1 OutlineSize=1
bCanFocus=false bCanFocus=false

View File

@ -25,7 +25,7 @@ function SetText( string S)
function DrawMenu() function DrawMenu()
{ {
local int i,j,k,SLen,CurrentIndex; local int i, j,k, SLen, CurrentIndex;
local float Y, DTime, XL, YL, MainY, MainX, CharTime; local float Y, DTime, XL, YL, MainY, MainX, CharTime;
local string MainString; local string MainString;
local Color MainTextColor; local Color MainTextColor;
@ -49,7 +49,7 @@ function DrawMenu()
if (bShowScrollbar) if (bShowScrollbar)
{ {
Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth),CompPos[1]+CompPos[3]); Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth), CompPos[1]+CompPos[3]);
i = ScrollBar.GetValue(); i = ScrollBar.GetValue();
} }
else i = 0; else i = 0;
@ -138,8 +138,8 @@ function DrawMenu()
{ {
if (CurrentIndex == k) if (CurrentIndex == k)
{ {
Canvas.SetDrawColor(255,255,255,255); Canvas.SetDrawColor(255, 255, 255, 255);
Canvas.SetPos(MainX+XL,MainY); Canvas.SetPos(MainX+XL, MainY);
Canvas.DrawTile(CurrentCursor, YL/2, YL, 0, 0, CurrentCursor.GetSurfaceWidth(), CurrentCursor.GetSurfaceHeight()); Canvas.DrawTile(CurrentCursor, YL/2, YL, 0, 0, CurrentCursor.GetSurfaceWidth(), CurrentCursor.GetSurfaceHeight());
} }
@ -147,8 +147,8 @@ function DrawMenu()
} }
Canvas.DrawColor = GetColorFromStyle(MainTextColor, TextStyle); Canvas.DrawColor = GetColorFromStyle(MainTextColor, TextStyle);
Canvas.SetPos(MainX+XL,MainY); Canvas.SetPos(MainX+XL, MainY);
Canvas.DrawText(Mid(MainString, k, 1),,InitFontScale,InitFontScale,TextFontInfo); Canvas.DrawText(Mid(MainString, k, 1), ,InitFontScale, InitFontScale, TextFontInfo);
CurrentIndex = k+1; CurrentIndex = k+1;

View File

@ -26,7 +26,7 @@ function ShowMenu()
final function SetText( string S) final function SetText( string S)
{ {
ParseStringIntoArray(S,Lines," < SEPERATOR > ",false); ParseStringIntoArray(S, Lines, " < SEPERATOR > ", false);
} }
function PreDraw() function PreDraw()
@ -39,7 +39,7 @@ function PreDraw()
defaultproperties defaultproperties
{ {
TextFontInfo=(bClipText=true,bEnableShadow=true) TextFontInfo=(bClipText=true, bEnableShadow=true)
bCanFocus=false bCanFocus=false
bFocusedPostDrawItem=true bFocusedPostDrawItem=true
} }

View File

@ -119,7 +119,7 @@ function DrawMenu()
{ {
for (j=i-1; j >= 0; --j) for (j=i-1; j >= 0; --j)
{ {
if (!InOrder(KFPlayerReplicationInfo(KFGRI.PRIArray[i]),KFPlayerReplicationInfo(KFGRI.PRIArray[j]))) if (!InOrder(KFPlayerReplicationInfo(KFGRI.PRIArray[i]), KFPlayerReplicationInfo(KFGRI.PRIArray[j])))
{ {
PRI = KFGRI.PRIArray[i]; PRI = KFGRI.PRIArray[i];
KFGRI.PRIArray[i] = KFGRI.PRIArray[j]; KFGRI.PRIArray[i] = KFGRI.PRIArray[j];
@ -530,9 +530,9 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
if (KFPRI.Avatar == default.DefaultAvatar) if (KFPRI.Avatar == default.DefaultAvatar)
CheckAvatar(KFPRI, OwnerPC); CheckAvatar(KFPRI, OwnerPC);
C.SetDrawColor(255,255,255,255); C.SetDrawColor(255, 255, 255, 255);
C.SetPos(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f)); C.SetPos(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f));
C.DrawTile(KFPRI.Avatar,Height - 6,Height - 6,0,0,KFPRI.Avatar.SizeX,KFPRI.Avatar.SizeY); C.DrawTile(KFPRI.Avatar, Height - 6, Height - 6, 0,0, KFPRI.Avatar.SizeX, KFPRI.Avatar.SizeY);
Owner.CurrentStyle.DrawBoxHollow(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f), Height - 6, Height - 6, 1); Owner.CurrentStyle.DrawBoxHollow(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f), Height - 6, Height - 6, 1);
} }
else if (!KFPRI.bBot) else if (!KFPRI.bBot)
@ -654,7 +654,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
C.TextSize(S, XL, YL, FontScalar, FontScalar); C.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHVCenter(S, PingXPos, TextYOffset, Settings.Ping.ShowPingBars ? PingWBox/2 : PingWBox, FontScalar); DrawTextShadowHVCenter(S, PingXPos, TextYOffset, Settings.Ping.ShowPingBars ? PingWBox/2 : PingWBox, FontScalar);
C.SetDrawColor(250,250,250,255); C.SetDrawColor(250, 250, 250, 255);
if (Settings.Ping.ShowPingBars) if (Settings.Ping.ShowPingBars)
DrawPingBars(C, YOffset + (Height/2) - ((Height*0.5)/2), Width - (Height*0.5) - (Owner.HUDOwner.ScaledBorderSize*2), Height*0.5, Height*0.5, float(Ping)); DrawPingBars(C, YOffset + (Height/2) - ((Height*0.5)/2), Width - (Height*0.5) - (Owner.HUDOwner.ScaledBorderSize*2), Height*0.5, Height*0.5, float(Ping));
} }
@ -677,19 +677,19 @@ final function DrawPingBars( Canvas C, float YOffset, float XOffset, float W, fl
XPos = XOffset + ((i - 1) * BarW); XPos = XOffset + ((i - 1) * BarW);
YPos = YOffset + (H - BarH); YPos = YOffset + (H - BarH);
C.SetPos(XPos,YPos); C.SetPos(XPos, YPos);
C.SetDrawColor(20, 20, 20, 255); C.SetDrawColor(20, 20, 20, 255);
Owner.CurrentStyle.DrawWhiteBox(BarW,BarH); Owner.CurrentStyle.DrawWhiteBox(BarW, BarH);
if (PingMul >= (i / PingBars)) if (PingMul >= (i / PingBars))
{ {
C.SetPos(XPos,YPos); C.SetPos(XPos, YPos);
C.DrawColor = PingColor; C.DrawColor = PingColor;
Owner.CurrentStyle.DrawWhiteBox(BarW,BarH); Owner.CurrentStyle.DrawWhiteBox(BarW, BarH);
} }
C.SetDrawColor(80, 80, 80, 255); C.SetDrawColor(80, 80, 80, 255);
Owner.CurrentStyle.DrawBoxHollow(XPos,YPos,BarW,BarH,1); Owner.CurrentStyle.DrawBoxHollow(XPos, YPos, BarW, BarH, 1);
} }
} }
@ -700,7 +700,7 @@ static final function Texture2D FindAvatar( KFPlayerController PC, UniqueNetId C
S = PC.GetSteamAvatar(ClientID); S = PC.GetSteamAvatar(ClientID);
if (S == "") if (S == "")
return None; return None;
return Texture2D(PC.FindObject(S,class'Texture2D')); return Texture2D(PC.FindObject(S, class'Texture2D'));
} }
final static function string GetNiceSize(int Num) final static function string GetNiceSize(int Num)
@ -721,7 +721,7 @@ defaultproperties
{ {
bEnableInputs=true bEnableInputs=true
PingColor=(R=255,G=255,B=60,A=255) PingColor=(R=255, G=255, B=60, A=255)
PingBars=5.0 PingBars=5.0
Begin Object Class=KFGUI_List Name=PlayerList Begin Object Class=KFGUI_List Name=PlayerList

View File

@ -82,8 +82,8 @@ struct SCESettingsAdmin
StructDefaultProperties StructDefaultProperties
{ {
Rank="Admin" Rank="Admin"
TextColor=(R=250,G=0,B=0,A=255) TextColor=(R=250, G=0, B=0, A=255)
ApplyColorToFields=(Rank=True,Player=True,Level=False,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) ApplyColorToFields=(Rank=True, Player=True, Level=False, Perk=False, Dosh=False, Kills=False, Assists=False, Health=False, Ping=False)
} }
}; };
@ -96,8 +96,8 @@ struct SCESettingsPlayer
StructDefaultProperties StructDefaultProperties
{ {
Rank="Player" Rank="Player"
TextColor=(R=250,G=250,B=250,A=255) TextColor=(R=250, G=250, B=250, A=255)
ApplyColorToFields=(Rank=True,Player=True,Level=False,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) ApplyColorToFields=(Rank=True, Player=True, Level=False, Perk=False, Dosh=False, Kills=False, Assists=False, Health=False, Ping=False)
} }
}; };
@ -208,58 +208,58 @@ struct SCEStyle
StructDefaultProperties StructDefaultProperties
{ {
ServerNameBoxColor=(R=75,G=0,B=0,A=200) ServerNameBoxColor=(R=75, G=0, B=0, A=200)
ServerNameTextColor=(R=250,G=250,B=250,A=255) ServerNameTextColor=(R=250, G=250, B=250, A=255)
GameInfoBoxColor=(R=30,G=30,B=30,A=200) GameInfoBoxColor=(R=30, G=30, B=30, A=200)
GameInfoTextColor=(R=250,G=250,B=250,A=255) GameInfoTextColor=(R=250, G=250, B=250, A=255)
WaveBoxColor=(R=10,G=10,B=10,A=200) WaveBoxColor=(R=10, G=10, B=10, A=200)
WaveTextColor=(R=250,G=250,B=250,A=255) WaveTextColor=(R=250, G=250, B=250, A=255)
PlayerCountBoxColor=(R=75,G=0,B=0,A=200) PlayerCountBoxColor=(R=75, G=0, B=0, A=200)
PlayerCountTextColor=(R=250,G=250,B=250,A=255) PlayerCountTextColor=(R=250, G=250, B=250, A=255)
ListHeaderBoxColor=(R=10,G=10,B=10,A=200) ListHeaderBoxColor=(R=10, G=10, B=10, A=200)
ListHeaderTextColor=(R=250,G=250,B=250,A=255) ListHeaderTextColor=(R=250, G=250, B=250, A=255)
LeftStateBoxColor=(R=150,G=150,B=150,A=150) LeftStateBoxColor=(R=150, G=150, B=150, A=150)
LeftStateBoxColorDead=(R=200,G=0,B=0,A=150) LeftStateBoxColorDead=(R=200, G=0, B=0, A=150)
LeftStateBoxColorLow=(R=200,G=50,B=50,A=150) LeftStateBoxColorLow=(R=200, G=50, B=50, A=150)
LeftStateBoxColorMid=(R=200,G=200,B=0,A=150) LeftStateBoxColorMid=(R=200, G=200, B=0, A=150)
LeftStateBoxColorHigh=(R=0,G=200,B=0,A=150) LeftStateBoxColorHigh=(R=0, G=200, B=0, A=150)
PlayerOwnerBoxColor=(R=100,G=10,B=10,A=150) PlayerOwnerBoxColor=(R=100, G=10, B=10, A=150)
PlayerBoxColor=(R=30,G=30,B=30,A=150) PlayerBoxColor=(R=30, G=30, B=30, A=150)
StatsBoxColor=(R=10,G=10,B=10,A=150) StatsBoxColor=(R=10, G=10, B=10, A=150)
RankTextColor=(R=250,G=250,B=250,A=255) RankTextColor=(R=250, G=250, B=250, A=255)
ZedTextColor=(R=255,G=0,B=0,A=255) ZedTextColor=(R=255, G=0, B=0, A=255)
PerkTextColor=(R=250,G=250,B=250,A=255) PerkTextColor=(R=250, G=250, B=250, A=255)
LevelTextColor=(R=250,G=250,B=250,A=255) LevelTextColor=(R=250, G=250, B=250, A=255)
PlayerNameTextColor=(R=250,G=250,B=250,A=255) PlayerNameTextColor=(R=250, G=250, B=250, A=255)
KillsTextColor=(R=250,G=250,B=250,A=255) KillsTextColor=(R=250, G=250, B=250, A=255)
AssistsTextColor=(R=250,G=250,B=250,A=255) AssistsTextColor=(R=250, G=250, B=250, A=255)
DoshTextColor=(R=250,G=250,B=100,A=255) DoshTextColor=(R=250, G=250, B=100, A=255)
StateTextColor=(R=150,G=150,B=150,A=150) StateTextColor=(R=150, G=150, B=150, A=150)
PingTextColor=(R=250,G=250,B=250,A=255) PingTextColor=(R=250, G=250, B=250, A=255)
LevelTextColorLow=(R=250,G=100,B=100,A=255) LevelTextColorLow=(R=250, G=100, B=100, A=255)
LevelTextColorMid=(R=250,G=250,B=0,A=255) LevelTextColorMid=(R=250, G=250, B=0, A=255)
LevelTextColorHigh=(R=0,G=250,B=0,A=255) LevelTextColorHigh=(R=0, G=250, B=0, A=255)
StateTextColorLobby=(R=150,G=150,B=150,A=150) StateTextColorLobby=(R=150, G=150, B=150, A=150)
StateTextColorReady=(R=150,G=150,B=150,A=150) StateTextColorReady=(R=150, G=150, B=150, A=150)
StateTextColorNotReady=(R=150,G=150,B=150,A=150) StateTextColorNotReady=(R=150, G=150, B=150, A=150)
StateTextColorSpectator=(R=150,G=150,B=150,A=150) StateTextColorSpectator=(R=150, G=150, B=150, A=150)
StateTextColorDead=(R=250,G=0,B=0,A=255) StateTextColorDead=(R=250, G=0, B=0, A=255)
StateTextColorLowHP=(R=250,G=100,B=100,A=255) StateTextColorLowHP=(R=250, G=100, B=100, A=255)
StateTextColorMidHP=(R=250,G=250,B=0,A=255) StateTextColorMidHP=(R=250, G=250, B=0, A=255)
StateTextColorHighHP=(R=0,G=250,B=0,A=255) StateTextColorHighHP=(R=0, G=250, B=0, A=255)
PingTextColorLow=(R=0,G=250,B=0,A=255) PingTextColorLow=(R=0, G=250, B=0, A=255)
PingTextColorMid=(R=250,G=250,B=0,A=255) PingTextColorMid=(R=250, G=250, B=0, A=255)
PingTextColorHigh=(R=250,G=0,B=0,A=255) PingTextColorHigh=(R=250, G=0, B=0, A=255)
} }
}; };