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

View File

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

View File

@ -18,10 +18,10 @@ var delegate < Interaction.OnReceivedNativeInputChar> OldOnReceivedNativeInputCh
var delegate < GameViewportClient.HandleInputAxis> OldHandleInputAxis;
var array < KFGUI_Page> ActiveMenus,PersistentMenus;
var transient KFGUI_Base MouseFocus,InputFocus,KeyboardFocus;
var IntPoint MousePosition,ScreenSize,OldMousePos,LastMousePos,LastClickPos[2];
var transient float MousePauseTime,MenuTime,LastClickTimes[2];
var array < KFGUI_Page> ActiveMenus, PersistentMenus;
var transient KFGUI_Base MouseFocus, InputFocus, KeyboardFocus;
var IntPoint MousePosition, ScreenSize, OldMousePos, LastMousePos, LastClickPos[2];
var transient float MousePauseTime, MenuTime, LastClickTimes[2];
var transient GUIStyleBase CurrentStyle;
var transient Console OrgConsole;
@ -34,9 +34,9 @@ var int CurrentCursorIndex, CursorSize;
var Texture DefaultPens[3];
var byte CursorFade, FastCursorFade, CursorFlash;
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)
{
@ -47,7 +47,7 @@ static function KF2GUIController GetGUIController( PlayerController PC)
return None;
}
foreach PC.ChildActors(class'ScoreboardExt.KF2GUIController',G)
foreach PC.ChildActors(class'ScoreboardExt.KF2GUIController', G)
{
if (!G.bIsInvalid)
{
@ -57,7 +57,7 @@ static function KF2GUIController GetGUIController( PlayerController PC)
if (G == None)
{
G = PC.Spawn(class'ScoreboardExt.KF2GUIController',PC);
G = PC.Spawn(class'ScoreboardExt.KF2GUIController', PC);
}
return G;
@ -158,7 +158,7 @@ simulated function HandleDrawMenu()
simulated function RenderMenu( Canvas C)
{
local int i;
local float OrgX,OrgY,ClipX,ClipY;
local float OrgX, OrgY, ClipX, ClipY;
ClientViewport.ViewportConsole = OrgConsole;
@ -186,8 +186,8 @@ simulated function RenderMenu( Canvas C)
HUDOwner.HUDWidgets[i].PreDraw();
}
C.SetOrigin(OrgX,OrgY);
C.SetClip(ClipX,ClipY);
C.SetOrigin(OrgX, OrgY);
C.SetClip(ClipX, ClipY);
}
if (bIsInMenuState)
@ -211,8 +211,8 @@ simulated function RenderMenu( Canvas C)
InputFocus.Canvas = C;
InputFocus.PreDraw();
}
C.SetOrigin(OrgX,OrgY);
C.SetClip(ClipX,ClipY);
C.SetOrigin(OrgX, OrgY);
C.SetClip(ClipX, ClipY);
if (!bHideCursor)
{
@ -229,7 +229,7 @@ simulated function DrawCursor(Canvas C, float PosX, float PosY)
{
C.SetPos(PosX, PosY);
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)
@ -238,7 +238,7 @@ simulated final function InventoryChanged(optional KFWeapon Wep, optional bool b
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;
if (LastMousePos != default.LastMousePos)
ClientViewport.SetMouse(LastMousePos.X,LastMousePos.Y);
ClientViewport.SetMouse(LastMousePos.X, LastMousePos.Y);
}
else
{
@ -437,7 +437,7 @@ simulated final function int GetFreeIndex( bool bNewAlwaysTop ) // Find first al
for (i=0; i < ActiveMenus.Length; ++i)
if (bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop)
{
ActiveMenus.Insert(i,1);
ActiveMenus.Insert(i, 1);
return i;
}
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.
{
M = ActiveMenus[i];
ActiveMenus.Remove(i,1);
ActiveMenus.Remove(i, 1);
i = GetFreeIndex(M.bAlwaysTop);
ActiveMenus[i] = M;
}
@ -507,7 +507,7 @@ simulated function KFGUI_Page OpenMenu( class < KFGUI_Page> MenuClass)
if (PersistentMenus[i].Class == MenuClass)
{
M = PersistentMenus[i];
PersistentMenus.Remove(i,1);
PersistentMenus.Remove(i, 1);
i = GetFreeIndex(M.bAlwaysTop);
ActiveMenus[i] = M;
M.ShowMenu();
@ -547,7 +547,7 @@ simulated function CloseMenu( class < KFGUI_Page> MenuClass, optional bool bClos
if (bCloseAll || ActiveMenus[i].Class == MenuClass)
{
M = ActiveMenus[i];
ActiveMenus.Remove(i,1);
ActiveMenus.Remove(i, 1);
M.CloseMenu();
for (j=0; j < M.TimerNames.Length; j++)
@ -591,7 +591,7 @@ simulated function PopCloseMenu( KFGUI_Base Item)
if (ActiveMenus[i] == Item)
{
M = ActiveMenus[i];
ActiveMenus.Remove(i,1);
ActiveMenus.Remove(i, 1);
M.CloseMenu();
// Cache menu.
@ -613,14 +613,14 @@ simulated function BringMenuToFront( KFGUI_Page Page)
for (i=(ActiveMenus.Length-1); i >= 0; --i)
if (ActiveMenus[i] == Page)
{
ActiveMenus.Remove(i,1);
ActiveMenus.Remove(i, 1);
break;
}
if (i == -1)
return; // Page isn't open.
// Put on front of stack.
ActiveMenus.Insert(0,1);
ActiveMenus.Insert(0, 1);
ActiveMenus[0] = Page;
}
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 'LeftMouseButton':
GUI_InputMouse(true,false);
GUI_InputMouse(true, false);
return true;
case 'XboxTypeS_B':
case 'RightMouseButton':
GUI_InputMouse(true,true);
GUI_InputMouse(true, true);
return true;
}
}
@ -730,11 +730,11 @@ simulated final function bool CheckMouse( name Key, EInputEvent Event)
{
case 'XboxTypeS_A':
case 'LeftMouseButton':
GUI_InputMouse(false,false);
GUI_InputMouse(false, false);
return true;
case 'XboxTypeS_B':
case 'RightMouseButton':
GUI_InputMouse(false,true);
GUI_InputMouse(false, 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)
{
@ -812,7 +812,7 @@ simulated function bool ReceivedInputAxis( int ControllerId, name Key, float Del
{
local Vector2D V;
local KFPlayerInput KFInput;
local float GamepadSensitivity,OldMouseX,OldMouseY,MoveDelta,MoveDeltaInvert;
local float GamepadSensitivity, OldMouseX, OldMouseY, MoveDelta, MoveDeltaInvert;
if (!bIsInMenuState)
return false;
@ -862,7 +862,7 @@ simulated function bool ReceivedInputChar( int ControllerId, string Unicode)
{
if (!bIsInMenuState)
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)
@ -889,7 +889,7 @@ simulated Delegate bool InternalReceivedInputChar( int ControllerId, string Unic
defaultproperties
{
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'
CurrentCursorIndex=`CURSOR_DEFAULT

View File

@ -57,7 +57,7 @@ function PlayerInput( float DeltaTime)
function PreClientTravel( string PendingURL, ETravelType TravelType, bool 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!
}

View File

@ -12,8 +12,8 @@ function InitStyle()
Super.InitStyle();
LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D'));
LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D'));
LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable", class'Texture2D'));
LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick", class'Texture2D'));
for (i=0; i < ArrayCount(LoadedTex); ++i)
{
if (LoadedTex[i] == None)
@ -22,7 +22,7 @@ function InitStyle()
}
function RenderFramedWindow( KFGUI_FloatingWindow P)
{
local int XS,YS,CornerSlope,TitleHeight;
local int XS, YS, CornerSlope, TitleHeight;
XS = Canvas.ClipX-Canvas.OrgX;
YS = Canvas.ClipY-Canvas.OrgY;
@ -31,55 +31,55 @@ function RenderFramedWindow( KFGUI_FloatingWindow P)
// Frame Header
if (P.bWindowFocused)
Canvas.SetDrawColor(220,2,2,255);
else Canvas.SetDrawColor(100,1,1,P.FrameOpacity);
Canvas.SetPos(0,0);
DrawCornerTex(CornerSlope,0);
Canvas.SetPos(0,TitleHeight);
DrawCornerTex(CornerSlope,3);
Canvas.SetPos(XS-CornerSlope,0);
DrawCornerTex(CornerSlope,1);
Canvas.SetPos(XS-CornerSlope,TitleHeight);
DrawCornerTex(CornerSlope,2);
Canvas.SetDrawColor(220, 2,2, 255);
else Canvas.SetDrawColor(100, 1,1, P.FrameOpacity);
Canvas.SetPos(0, 0);
DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(0, TitleHeight);
DrawCornerTex(CornerSlope, 3);
Canvas.SetPos(XS-CornerSlope, 0);
DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(XS-CornerSlope, TitleHeight);
DrawCornerTex(CornerSlope, 2);
// Header filling
Canvas.SetPos(0,CornerSlope);
DrawWhiteBox(XS,TitleHeight-CornerSlope);
Canvas.SetPos(CornerSlope,0);
DrawWhiteBox(XS-(CornerSlope*2),CornerSlope);
Canvas.SetPos(0, CornerSlope);
DrawWhiteBox(XS, TitleHeight-CornerSlope);
Canvas.SetPos(CornerSlope, 0);
DrawWhiteBox(XS-(CornerSlope*2), CornerSlope);
// Frame itself.
if (P.bWindowFocused)
Canvas.SetDrawColor(32,6,6,255);
else Canvas.SetDrawColor(16,2,2,P.FrameOpacity);
Canvas.SetPos(0,TitleHeight);
DrawCornerTex(CornerSlope,0);
Canvas.SetPos(XS-CornerSlope,TitleHeight);
DrawCornerTex(CornerSlope,1);
Canvas.SetPos(0,YS-CornerSlope);
DrawCornerTex(CornerSlope,2);
Canvas.SetPos(XS-CornerSlope,YS-CornerSlope);
DrawCornerTex(CornerSlope,3);
Canvas.SetDrawColor(32, 6,6, 255);
else Canvas.SetDrawColor(16, 2,2, P.FrameOpacity);
Canvas.SetPos(0, TitleHeight);
DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(XS-CornerSlope, TitleHeight);
DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(0, YS-CornerSlope);
DrawCornerTex(CornerSlope, 2);
Canvas.SetPos(XS-CornerSlope, YS-CornerSlope);
DrawCornerTex(CornerSlope, 3);
// Filling
Canvas.SetPos(CornerSlope,TitleHeight);
DrawWhiteBox(XS-(CornerSlope*2),YS-TitleHeight);
Canvas.SetPos(0,TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)-TitleHeight);
Canvas.SetPos(XS-CornerSlope,TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)-TitleHeight);
Canvas.SetPos(CornerSlope, TitleHeight);
DrawWhiteBox(XS-(CornerSlope*2), YS-TitleHeight);
Canvas.SetPos(0, TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope, YS-(CornerSlope*2)-TitleHeight);
Canvas.SetPos(XS-CornerSlope, TitleHeight+CornerSlope);
DrawWhiteBox(CornerSlope, YS-(CornerSlope*2)-TitleHeight);
// Title.
if (P.WindowTitle != "")
{
Canvas.SetDrawColor(250,250,250,P.FrameOpacity);
Canvas.SetPos(CornerSlope,0);
Canvas.SetDrawColor(250, 250, 250, P.FrameOpacity);
Canvas.SetPos(CornerSlope, 0);
DrawText(P.WindowTitle);
}
}
function RenderWindow( KFGUI_Page P)
{
local int XS,YS,CornerSlope;
local int XS, YS, CornerSlope;
XS = Canvas.ClipX-Canvas.OrgX;
YS = Canvas.ClipY-Canvas.OrgY;
@ -87,29 +87,29 @@ function RenderWindow( KFGUI_Page P)
// Frame itself.
if (P.bWindowFocused)
Canvas.SetDrawColor(64,64,64,255);
else Canvas.SetDrawColor(32,32,32,P.FrameOpacity);
Canvas.SetPos(0,0);
DrawCornerTex(CornerSlope,0);
Canvas.SetPos(XS-CornerSlope,0);
DrawCornerTex(CornerSlope,1);
Canvas.SetPos(0,YS-CornerSlope);
DrawCornerTex(CornerSlope,2);
Canvas.SetPos(XS-CornerSlope,YS-CornerSlope);
DrawCornerTex(CornerSlope,3);
Canvas.SetDrawColor(64, 64, 64, 255);
else Canvas.SetDrawColor(32, 32, 32, P.FrameOpacity);
Canvas.SetPos(0, 0);
DrawCornerTex(CornerSlope, 0);
Canvas.SetPos(XS-CornerSlope, 0);
DrawCornerTex(CornerSlope, 1);
Canvas.SetPos(0, YS-CornerSlope);
DrawCornerTex(CornerSlope, 2);
Canvas.SetPos(XS-CornerSlope, YS-CornerSlope);
DrawCornerTex(CornerSlope, 3);
// Filling
Canvas.SetPos(CornerSlope,0);
DrawWhiteBox(XS-(CornerSlope*2),YS);
Canvas.SetPos(0,CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2));
Canvas.SetPos(XS-CornerSlope,CornerSlope);
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2));
Canvas.SetPos(CornerSlope, 0);
DrawWhiteBox(XS-(CornerSlope*2), YS);
Canvas.SetPos(0, CornerSlope);
DrawWhiteBox(CornerSlope, YS-(CornerSlope*2));
Canvas.SetPos(XS-CornerSlope, CornerSlope);
DrawWhiteBox(CornerSlope, YS-(CornerSlope*2));
}
function RenderToolTip( KFGUI_Tooltip TT)
{
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);
@ -118,8 +118,8 @@ function RenderToolTip( KFGUI_Tooltip TT)
for (i=0; i < TT.Lines.Length; ++i)
{
if (TT.Lines[i] != "")
Canvas.TextSize(TT.Lines[i],XS,YS);
TX = FMax(XS,TX);
Canvas.TextSize(TT.Lines[i], XS, YS);
TX = FMax(XS, TX);
}
TX*=TS;
@ -137,30 +137,30 @@ function RenderToolTip( KFGUI_Tooltip TT)
Y = TT.CompPos[1]-TY;
if (TT.CurrentAlpha < 255)
TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255);
TT.CurrentAlpha = Min(TT.CurrentAlpha+25, 255);
// Reset clipping.
Canvas.SetOrigin(0,0);
Canvas.SetClip(TT.Owner.ScreenSize.X,TT.Owner.ScreenSize.Y);
Canvas.SetOrigin(0, 0);
Canvas.SetClip(TT.Owner.ScreenSize.X, TT.Owner.ScreenSize.Y);
// Draw frame.
Canvas.SetDrawColor(200,200,80,TT.CurrentAlpha);
Canvas.SetPos(X-2,Y-2);
DrawBoxHollow(X-2,Y-2,TX+4,TY+4,2);
Canvas.SetDrawColor(80,10,80,TT.CurrentAlpha);
Canvas.SetPos(X,Y);
DrawWhiteBox(TX,TY);
Canvas.SetDrawColor(200, 200, 80, TT.CurrentAlpha);
Canvas.SetPos(X-2, Y-2);
DrawBoxHollow(X-2, Y-2, TX+4, TY+4, 2);
Canvas.SetDrawColor(80, 10, 80, TT.CurrentAlpha);
Canvas.SetPos(X, Y);
DrawWhiteBox(TX, TY);
DefFontHeight = DefaultHeight;
// Draw text.
Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha);
Canvas.SetDrawColor(255, 255, 255, TT.CurrentAlpha);
X+=TOOLTIP_BORDER;
Y+=TOOLTIP_BORDER;
for (i=0; i < TT.Lines.Length; ++i)
{
Canvas.SetPos(X,Y);
Canvas.DrawText(TT.Lines[i],,TS,TS,TT.TextFontInfo);
Canvas.SetPos(X, Y);
Canvas.DrawText(TT.Lines[i], ,TS, TS, TT.TextFontInfo);
Y+=DefFontHeight;
}
}
@ -184,7 +184,7 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
i = 3;
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)
{
@ -201,10 +201,10 @@ function RenderScrollBar( KFGUI_ScrollBarBase S)
S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale);
if (S.bGrabbedScroller)
Canvas.SetDrawColor(255,0,0,200);
Canvas.SetDrawColor(255, 0,0, 200);
else if (S.bFocused)
Canvas.SetDrawColor(200,0,0,200);
else Canvas.SetDrawColor(150,0,0,200);
Canvas.SetDrawColor(200, 0,0, 200);
else Canvas.SetDrawColor(150, 0,0, 200);
if (S.bVertical)
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 (bFocus)
Canvas.SetDrawColor(175,240,8,255);
else Canvas.SetDrawColor(128,200,56,255);
Canvas.SetDrawColor(175, 240, 8,255);
else Canvas.SetDrawColor(128, 200, 56, 255);
}
else if (bFocus)
Canvas.SetDrawColor(220,220,8,255);
else Canvas.SetDrawColor(220,86,56,255);
Canvas.SetDrawColor(220, 220, 8,255);
else Canvas.SetDrawColor(220, 86, 56, 255);
XS = DefaultHeight*0.125;
Canvas.SetPos(XPos,0.f);
DrawCornerTexNU(XS,C.CompPos[3],0);
Canvas.SetPos(XPos+XS,0.f);
DrawWhiteBox(Width-(XS*2),C.CompPos[3]);
Canvas.SetPos(XPos+Width-(XS*2),0.f);
DrawCornerTexNU(XS,C.CompPos[3],1);
Canvas.SetPos(XPos, 0.f);
DrawCornerTexNU(XS, C.CompPos[3], 0);
Canvas.SetPos(XPos+XS, 0.f);
DrawWhiteBox(Width-(XS*2), C.CompPos[3]);
Canvas.SetPos(XPos+Width-(XS*2), 0.f);
DrawCornerTexNU(XS, C.CompPos[3], 1);
Canvas.SetDrawColor(250,250,250,255);
Canvas.SetPos(XPos+XS,(C.CompPos[3]-C.ListOwner.TextHeight)*0.5f);
Canvas.SetDrawColor(250, 250, 250, 255);
Canvas.SetPos(XPos+XS, (C.CompPos[3]-C.ListOwner.TextHeight)*0.5f);
C.ListOwner.DrawStrClipped(C.ListOwner.Columns[Index].Text);
}
function RenderCheckbox( KFGUI_CheckBox C)
{
if (C.bDisabled)
Canvas.SetDrawColor(86,86,86,255);
Canvas.SetDrawColor(86, 86, 86, 255);
else if (C.bPressedDown)
Canvas.SetDrawColor(128,255,128,255);
Canvas.SetDrawColor(128, 255, 128, 255);
else if (C.bFocused)
Canvas.SetDrawColor(150,200,128,255);
else Canvas.SetDrawColor(128,186,128,255);
Canvas.SetDrawColor(150, 200, 128, 255);
else Canvas.SetDrawColor(128, 186, 128, 255);
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.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(LoadedTex[0], C.CompPos[2], C.CompPos[3], 0,0, LoadedTex[0].GetSurfaceWidth(), LoadedTex[0].GetSurfaceHeight());
if (C.bChecked)
{
if (C.bDisabled)
Canvas.SetDrawColor(128,128,128,255);
else Canvas.SetDrawColor(255,255,255,255);
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.SetDrawColor(128, 128, 128, 255);
else Canvas.SetDrawColor(255, 255, 255, 255);
Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(LoadedTex[1], C.CompPos[2], C.CompPos[3], 0,0, LoadedTex[1].GetSurfaceWidth(), LoadedTex[1].GetSurfaceHeight());
}
}
function RenderComboBox( KFGUI_ComboBox C)
{
if (C.bDisabled)
Canvas.SetDrawColor(64,4,4,255);
Canvas.SetDrawColor(64, 4,4, 255);
else if (C.bPressedDown)
Canvas.SetDrawColor(220,56,56,255);
Canvas.SetDrawColor(220, 56, 56, 255);
else if (C.bFocused)
Canvas.SetDrawColor(190,48,48,255);
else Canvas.SetDrawColor(186,4,4,255);
Canvas.SetDrawColor(190, 48, 48, 255);
else Canvas.SetDrawColor(186, 4,4, 255);
Canvas.SetPos(0.f,0.f);
DrawWhiteBox(C.CompPos[2],C.CompPos[3]);
Canvas.SetPos(0.f, 0.f);
DrawWhiteBox(C.CompPos[2], C.CompPos[3]);
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)
Canvas.DrawColor = C.TextColor*0.5f;
else Canvas.DrawColor = C.TextColor;
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.PushMaskRegion(Canvas.OrgX, Canvas.OrgY, Canvas.ClipX-C.BorderSize, Canvas.ClipY);
Canvas.DrawText(C.Values[C.SelectedIndex], ,C.TextScale, C.TextScale, C.TextFontInfo);
Canvas.PopMaskRegion();
}
}
function RenderComboList( KFGUI_ComboSelector C)
{
local float X,Y,YL,YP,Edge;
local float X, Y,YL, YP, Edge;
local int i;
local bool bCheckMouse;
// Draw background.
Edge = C.Combo.BorderSize;
Canvas.SetPos(0.f,0.f);
Canvas.SetDrawColor(128,4,4,255);
DrawWhiteBox(C.CompPos[2],C.CompPos[3]);
Canvas.SetPos(Edge,Edge);
Canvas.SetDrawColor(64,4,4,255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),C.CompPos[3]-(Edge*2.f));
Canvas.SetPos(0.f, 0.f);
Canvas.SetDrawColor(128, 4,4, 255);
DrawWhiteBox(C.CompPos[2], C.CompPos[3]);
Canvas.SetPos(Edge, Edge);
Canvas.SetDrawColor(64, 4,4, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f), C.CompPos[3]-(Edge*2.f));
// While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -309,24 +309,24 @@ function RenderComboList( KFGUI_ComboSelector C)
YP = Edge;
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)
{
if (bCheckMouse && Y >= YP && Y <= (YP+YL))
{
bCheckMouse = false;
C.CurrentRow = i;
Canvas.SetPos(4.f,YP);
Canvas.SetDrawColor(128,48,48,255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),YL);
Canvas.SetPos(4.f, YP);
Canvas.SetDrawColor(128, 48, 48, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f), YL);
}
Canvas.SetPos(Edge,YP);
Canvas.SetPos(Edge, YP);
if (i == C.Combo.SelectedIndex)
Canvas.DrawColor = C.Combo.SelectedTextColor;
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;
}
@ -339,17 +339,17 @@ function RenderComboList( KFGUI_ComboSelector 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 bool bCheckMouse;
// Draw background.
Edge = C.EdgeSize;
Canvas.SetDrawColor(148,4,4,255);
DrawBoxHollow(0.f,0.f,C.CompPos[2],C.CompPos[3],Edge);
Canvas.SetPos(Edge,Edge);
Canvas.SetDrawColor(64,4,4,200);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),C.CompPos[3]-(Edge*2.f));
Canvas.SetDrawColor(148, 4,4, 255);
DrawBoxHollow(0.f, 0.f, C.CompPos[2], C.CompPos[3], Edge);
Canvas.SetPos(Edge, Edge);
Canvas.SetDrawColor(64, 4,4, 200);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f), C.CompPos[3]-(Edge*2.f));
// While rendering, figure out mouse focus row.
X = C.Owner.MousePosition.X - Canvas.OrgX;
@ -364,30 +364,30 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
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)
{
if (bCheckMouse && Y >= YP && Y <= (YP+TexDefHieght))
{
bCheckMouse = false;
C.CurrentRow = i;
Canvas.SetPos(4.f,YP);
Canvas.SetDrawColor(128,48,48,255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f),TexDefHieght);
Canvas.SetPos(4.f, YP);
Canvas.SetDrawColor(128, 48, 48, 255);
DrawWhiteBox(C.CompPos[2]-(Edge*2.f), TexDefHieght);
}
Canvas.SetPos(Edge,YP);
Canvas.SetPos(Edge, YP);
if (C.ItemRows[i].bSplitter)
{
Canvas.SetDrawColor(0,0,0,255);
Canvas.DrawText("-------",,TextScale,TextScale);
Canvas.SetDrawColor(0, 0,0, 255);
Canvas.DrawText("-------", ,TextScale, TextScale);
}
else
{
if (C.ItemRows[i].bDisabled)
Canvas.SetDrawColor(148,148,148,255);
else Canvas.SetDrawColor(248,248,248,255);
Canvas.DrawText(C.ItemRows[i].Text,,TextScale,TextScale);
Canvas.SetDrawColor(148, 148, 148, 255);
else Canvas.SetDrawColor(248, 248, 248, 255);
Canvas.DrawText(C.ItemRows[i].Text, ,TextScale, TextScale);
}
YP+=TexDefHieght;
@ -401,51 +401,51 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C)
}
function RenderButton( KFGUI_Button B)
{
local float XL,YL,TS;
local float XL, YL, TS;
local byte i;
if (B.bDisabled)
Canvas.SetDrawColor(32,0,0,255);
Canvas.SetDrawColor(32, 0,0, 255);
else if (B.bPressedDown)
Canvas.SetDrawColor(255,64,64,255);
Canvas.SetDrawColor(255, 64, 64, 255);
else if (B.bFocused)
Canvas.SetDrawColor(180,45,45,255);
else Canvas.SetDrawColor(164,8,8,255);
Canvas.SetDrawColor(180, 45, 45, 255);
else Canvas.SetDrawColor(164, 8,8, 255);
if (B.bIsHighlighted)
{
Canvas.DrawColor.R = Min(Canvas.DrawColor.R+25,255);
Canvas.DrawColor.G = Min(Canvas.DrawColor.G+25,255);
Canvas.DrawColor.B = Min(Canvas.DrawColor.B+25,255);
Canvas.DrawColor.R = Min(Canvas.DrawColor.R+25, 255);
Canvas.DrawColor.G = Min(Canvas.DrawColor.G+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)
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);
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);
if (B.OverlayTexture.Texture != None)
{
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.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);
}
if (B.ButtonText != "")
{
// Chose the best font to fit this button.
i = Min(B.FontScale,MaxFontScale);
i = Min(B.FontScale, MaxFontScale);
while( true)
{
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)))
break;
--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)
Canvas.DrawColor = B.TextColor*0.5f;
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,
};
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() 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() 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 transient bool bFocused,bTextureInit,bVisible;
var bool bIsHUDWidget,bEnableInputs,bNoLookInputs;
var transient bool bFocused, bTextureInit, bVisible;
var bool bIsHUDWidget, bEnableInputs, bNoLookInputs;
var array < name> TimerNames;
function InitMenu(); // Menu was initialized for the first time.
@ -44,9 +44,9 @@ function PreDraw()
return;
ComputeCoords();
Canvas.SetDrawColor(255,255,255);
Canvas.SetOrigin(CompPos[0],CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]);
Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu();
}
function DrawMenu(); // Draw menu now.
@ -83,12 +83,12 @@ function Timer();
function MouseEnter()
{
bFocused = true;
OnFocus(Self,True);
OnFocus(Self, True);
}
function MouseLeave()
{
bFocused = false;
OnFocus(Self,False);
OnFocus(Self, False);
}
function MouseClick( bool bRight );
function MouseRelease( bool bRight );
@ -311,7 +311,7 @@ simulated final function PlayMenuSound( EMenuSound Slot)
if (S != None)
{
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);
i = Len(S);
if (i < 10)
return Mid("0000000000",i)$S;
return Mid("0000000000", i)$S;
return S;
}

View File

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

View File

@ -10,7 +10,7 @@ var Color IconColor;
function DrawMenu()
{
local float XL,YL,TS,TextX,TextY;
local float XL, YL, TS, TextX, TextY;
local Texture2D Mat;
local bool bDrawOverride;
@ -25,13 +25,13 @@ function DrawMenu()
Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_NORMAL];
else Mat = Owner.CurrentStyle.ButtonTextures[`BUTTON_HIGHLIGHTED];
Canvas.SetPos(0.f,0.f);
Canvas.DrawTileStretched(Mat,CompPos[2],CompPos[3],0,0,32,32);
Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(Mat, CompPos[2], CompPos[3], 0,0, 32, 32);
if (OverlayTexture.Texture != None)
{
Canvas.SetPos(0.f,0.f);
Canvas.DrawTile(OverlayTexture.Texture,CompPos[2],CompPos[3],OverlayTexture.U,OverlayTexture.V,OverlayTexture.UL,OverlayTexture.VL);
Canvas.SetPos(0.f, 0.f);
Canvas.DrawTile(OverlayTexture.Texture, CompPos[2], CompPos[3], OverlayTexture.U, OverlayTexture.V, OverlayTexture.UL, OverlayTexture.VL);
}
}
@ -44,7 +44,7 @@ function DrawMenu()
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))
break;
@ -58,7 +58,7 @@ function DrawMenu()
if (bDisabled)
Canvas.DrawColor = TextColor*0.5f;
else Canvas.DrawColor = TextColor;
Canvas.DrawText(ButtonText,,TS,TS,TextFontInfo);
Canvas.DrawText(ButtonText, ,TS, TS, TextFontInfo);
if (Icon != None)
{
@ -73,7 +73,7 @@ function DrawMenu()
}
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.SetPos(CompPos[2]-CompPos[3], 0.f);
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)
var() Texture CheckMark,CheckDisabled,CheckIdle,CheckFocus,CheckClicked;
var() bool bForceUniform,bChecked;
var() Texture CheckMark, CheckDisabled, CheckIdle, CheckFocus, CheckClicked;
var() bool bForceUniform, bChecked;
function UpdateSizes()
{

View File

@ -3,8 +3,8 @@ class KFGUI_ColorSlider extends KFGUI_MultiComponent;
`include(Build.uci)
`include(Logger.uci)
var KFGUI_Slider RSlider,GSlider,BSlider,ASlider;
var KFGUI_TextLable TextLable,RedLabel,GreenLabel,BlueLabel,AlphaLabel,RedValue,GreenValue,BlueValue,AlphaValue;
var KFGUI_Slider RSlider, GSlider, BSlider, ASlider;
var KFGUI_TextLable TextLable, RedLabel, GreenLabel, BlueLabel, AlphaLabel, RedValue, GreenValue, BlueValue, AlphaValue;
var KFGUI_ComponentList SettingsBox;
var Color DefaultColor;
@ -19,10 +19,10 @@ function InitMenu()
TextLable = KFGUI_TextLable(FindComponentID('CaptionText'));
TextLable.SetText(CaptionText);
RSlider = AddSlider("Red:",'ColorSliderR',0,255,RedLabel,RedValue);
GSlider = AddSlider("Green:",'ColorSliderG',0,255,GreenLabel,GreenValue);
BSlider = AddSlider("Blue:",'ColorSliderB',0,255,BlueLabel,BlueValue);
ASlider = AddSlider("Alpha:",'ColorSliderA',0,255,AlphaLabel,AlphaValue);
RSlider = AddSlider("Red:", 'ColorSliderR', 0,255, RedLabel, RedValue);
GSlider = AddSlider("Green:", 'ColorSliderG', 0,255, GreenLabel, GreenValue);
BSlider = AddSlider("Blue:", 'ColorSliderB', 0,255, BlueLabel, BlueValue);
ASlider = AddSlider("Alpha:", 'ColorSliderA', 0,255, AlphaLabel, AlphaValue);
SetDefaultColor(DefaultColor);
}
@ -99,7 +99,7 @@ delegate OnColorSliderValueChanged(KFGUI_ColorSlider Sender, KFGUI_Slider Slider
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,10 +7,10 @@ Class KFGUI_FloatingWindow extends KFGUI_Page
var() string WindowTitle; // Title of this window.
var float DragOffset[2], OpenAnimSpeed;
var KFGUI_FloatingWindowHeader HeaderComp;
var bool bDragWindow,bUseAnimation;
var bool bDragWindow, bUseAnimation;
var float WindowFadeInTime;
var transient float OpenStartTime,OpenEndTime;
var transient float OpenStartTime, OpenEndTime;
function InitMenu()
{
@ -94,8 +94,8 @@ function PreDraw()
if (bDragWindow)
{
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];
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];
}
}

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 HeaderSize[2]; // Pixels wide for edges (left, top).
var() Texture FrameTex;
var() bool bDrawHeader,bHeaderCenter,bUseLegacyDrawTile,bDrawBackground;
var() bool bDrawHeader, bHeaderCenter, bUseLegacyDrawTile, bDrawBackground;
var() float FontScale;
function InitMenu()
@ -33,7 +33,7 @@ function DrawMenu()
delegate OnDrawFrame(Canvas C, float W, Float H)
{
local float T,XL,YL,HeaderH;
local float T, XL, YL, HeaderH;
local FontRenderInfo FRI;
if (FrameTex == None)
@ -41,15 +41,15 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
return;
}
C.SetDrawColor(255,255,255,FrameOpacity);
C.SetDrawColor(255, 255, 255, FrameOpacity);
if (bUseLegacyDrawTile)
{
Owner.CurrentStyle.DrawTileStretched(FrameTex,0,0,W,H);
Owner.CurrentStyle.DrawTileStretched(FrameTex, 0,0, W,H);
}
else
{
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 != "")
@ -60,15 +60,15 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
C.Font = Owner.CurrentStyle.MainFont;
T = Owner.CurrentStyle.ScreenScale(FontScale);
C.SetDrawColor(250,250,250,FrameOpacity);
C.SetDrawColor(250, 250, 250, FrameOpacity);
C.TextSize(WindowTitle, XL, YL, T, T);
HeaderH = EdgeSize[1]-HeaderSize[1];
if (bHeaderCenter)
C.SetPos((W/2) - (XL/2),(HeaderH/2) - (YL/2));
else C.SetPos(HeaderSize[0],(HeaderH/2) - (YL/2));
C.SetPos((W/2) - (XL/2), (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();
Canvas.SetDrawColor(255,255,255);
Canvas.SetOrigin(CompPos[0],CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]);
Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu();
for (i=0; i < Components.Length; ++i)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,15 +5,15 @@ Class KFGUI_RightClickMenu extends KFGUI_Clickable;
struct FRowItem
{
var string Text,ToolTip;
var bool bSplitter,bDisabled;
var string Text, ToolTip;
var bool bSplitter, bDisabled;
};
var array < FRowItem> ItemRows;
var int CurrentRow,OldRow;
var int CurrentRow, OldRow;
var int EdgeSize;
var int OldSizeX;
var transient bool bDrawToolTip;
var Color BoxColor,OutlineColor;
var Color BoxColor, OutlineColor;
function OpenMenu( KFGUI_Base Menu)
{
@ -25,7 +25,7 @@ function OpenMenu( KFGUI_Base Menu)
}
final function ComputeSize()
{
local float XS,YS,XL,YL,Scalar;
local float XS, YS, XL, YL, Scalar;
local int i;
local string S;
@ -46,9 +46,9 @@ final function ComputeSize()
S = "----";
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;
}
}
@ -101,7 +101,7 @@ function DrawMenu()
}
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;
Canvas.Reset();
@ -109,7 +109,7 @@ function DrawToolTip()
S = ItemRows[CurrentRow].ToolTip;
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);
X = Owner.MousePosition.X+CursorSize;
@ -122,14 +122,14 @@ function DrawToolTip()
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);
TextY = Y + (BoxH/2) - (YL/2) - (EdgeSize/2);
Canvas.DrawColor = class'HUD'.default.WhiteColor;
Canvas.SetPos(TextX, TextY);
Canvas.DrawText(S,,Scalar,Scalar);
Canvas.DrawText(S, ,Scalar, Scalar);
}
function HandleMouseClick( bool bRight)
{
@ -161,6 +161,6 @@ defaultproperties
bFocusedPostDrawItem=true
bHoverSound=false
EdgeSize=2
BoxColor=(R=5,G=5,B=5,A=200)
OutlineColor=(R=115,G=115,B=115,A=255)
BoxColor=(R=5, G=5, B=5, A=200)
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(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 int CurrentScroll;
// In-runtime values.
var transient float CalcButtonScale;
var transient int SliderScale,ButtonOffset,GrabbedOffset;
var transient int SliderScale, ButtonOffset, GrabbedOffset;
var transient bool bGrabbedScroller;
var bool bVertical, bHideScrollbar;
@ -29,8 +29,8 @@ final function AddValue( int V)
}
final function SetValue( int V)
{
CurrentScroll = Clamp((V / ScrollStride) * ScrollStride,MinRange,MaxRange);
OnScrollChange(Self,CurrentScroll);
CurrentScroll = Clamp((V / ScrollStride) * ScrollStride, MinRange, MaxRange);
OnScrollChange(Self, CurrentScroll);
}
final function int GetValue()
{

View File

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

View File

@ -6,10 +6,10 @@ Class KFGUI_SwitchMenuBar extends KFGUI_MultiComponent;
var array < KFGUI_Base> SubPages;
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 int NumButtons,CurrentPageNum,PageComponentIndex;
var int NumButtons, CurrentPageNum, PageComponentIndex;
var array < KFGUI_Button> PageButtons;
function ShowMenu()
@ -90,7 +90,7 @@ final function SelectPage( int Index)
{
PageButtons[CurrentPageNum].bIsHighlighted = false;
SubPages[CurrentPageNum].CloseMenu();
Components.Remove(PageComponentIndex,1);
Components.Remove(PageComponentIndex, 1);
PageComponentIndex = -1;
}
CurrentPageNum = (Index >= 0 && Index < SubPages.Length) ? Index : -1;
@ -114,8 +114,8 @@ function PreDraw()
if (CurrentPageNum == -1 && NumButtons > 0)
SelectPage(0);
ComputeCoords();
Canvas.SetOrigin(CompPos[0],CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]);
Canvas.SetOrigin(CompPos[0], CompPos[1]);
Canvas.SetClip(CompPos[0]+CompPos[2], CompPos[1]+CompPos[3]);
DrawMenu();
for (i=0; i < Components.Length; ++i)
{

View File

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

View File

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

View File

@ -25,7 +25,7 @@ function SetText( string S)
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 string MainString;
local Color MainTextColor;
@ -49,7 +49,7 @@ function DrawMenu()
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();
}
else i = 0;
@ -138,8 +138,8 @@ function DrawMenu()
{
if (CurrentIndex == k)
{
Canvas.SetDrawColor(255,255,255,255);
Canvas.SetPos(MainX+XL,MainY);
Canvas.SetDrawColor(255, 255, 255, 255);
Canvas.SetPos(MainX+XL, MainY);
Canvas.DrawTile(CurrentCursor, YL/2, YL, 0, 0, CurrentCursor.GetSurfaceWidth(), CurrentCursor.GetSurfaceHeight());
}
@ -147,8 +147,8 @@ function DrawMenu()
}
Canvas.DrawColor = GetColorFromStyle(MainTextColor, TextStyle);
Canvas.SetPos(MainX+XL,MainY);
Canvas.DrawText(Mid(MainString, k, 1),,InitFontScale,InitFontScale,TextFontInfo);
Canvas.SetPos(MainX+XL, MainY);
Canvas.DrawText(Mid(MainString, k, 1), ,InitFontScale, InitFontScale, TextFontInfo);
CurrentIndex = k+1;

View File

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

View File

@ -119,7 +119,7 @@ function DrawMenu()
{
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];
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)
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.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);
}
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);
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)
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);
YPos = YOffset + (H - BarH);
C.SetPos(XPos,YPos);
C.SetPos(XPos, YPos);
C.SetDrawColor(20, 20, 20, 255);
Owner.CurrentStyle.DrawWhiteBox(BarW,BarH);
Owner.CurrentStyle.DrawWhiteBox(BarW, BarH);
if (PingMul >= (i / PingBars))
{
C.SetPos(XPos,YPos);
C.SetPos(XPos, YPos);
C.DrawColor = PingColor;
Owner.CurrentStyle.DrawWhiteBox(BarW,BarH);
Owner.CurrentStyle.DrawWhiteBox(BarW, BarH);
}
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);
if (S == "")
return None;
return Texture2D(PC.FindObject(S,class'Texture2D'));
return Texture2D(PC.FindObject(S, class'Texture2D'));
}
final static function string GetNiceSize(int Num)
@ -721,7 +721,7 @@ defaultproperties
{
bEnableInputs=true
PingColor=(R=255,G=255,B=60,A=255)
PingColor=(R=255, G=255, B=60, A=255)
PingBars=5.0
Begin Object Class=KFGUI_List Name=PlayerList

View File

@ -82,8 +82,8 @@ struct SCESettingsAdmin
StructDefaultProperties
{
Rank="Admin"
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)
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)
}
};
@ -96,8 +96,8 @@ struct SCESettingsPlayer
StructDefaultProperties
{
Rank="Player"
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)
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)
}
};
@ -208,58 +208,58 @@ struct SCEStyle
StructDefaultProperties
{
ServerNameBoxColor=(R=75,G=0,B=0,A=200)
ServerNameTextColor=(R=250,G=250,B=250,A=255)
ServerNameBoxColor=(R=75, G=0, B=0, A=200)
ServerNameTextColor=(R=250, G=250, B=250, A=255)
GameInfoBoxColor=(R=30,G=30,B=30,A=200)
GameInfoTextColor=(R=250,G=250,B=250,A=255)
GameInfoBoxColor=(R=30, G=30, B=30, A=200)
GameInfoTextColor=(R=250, G=250, B=250, A=255)
WaveBoxColor=(R=10,G=10,B=10,A=200)
WaveTextColor=(R=250,G=250,B=250,A=255)
WaveBoxColor=(R=10, G=10, B=10, A=200)
WaveTextColor=(R=250, G=250, B=250, A=255)
PlayerCountBoxColor=(R=75,G=0,B=0,A=200)
PlayerCountTextColor=(R=250,G=250,B=250,A=255)
PlayerCountBoxColor=(R=75, G=0, B=0, A=200)
PlayerCountTextColor=(R=250, G=250, B=250, A=255)
ListHeaderBoxColor=(R=10,G=10,B=10,A=200)
ListHeaderTextColor=(R=250,G=250,B=250,A=255)
ListHeaderBoxColor=(R=10, G=10, B=10, A=200)
ListHeaderTextColor=(R=250, G=250, B=250, A=255)
LeftStateBoxColor=(R=150,G=150,B=150,A=150)
LeftStateBoxColorDead=(R=200,G=0,B=0,A=150)
LeftStateBoxColorLow=(R=200,G=50,B=50,A=150)
LeftStateBoxColorMid=(R=200,G=200,B=0,A=150)
LeftStateBoxColorHigh=(R=0,G=200,B=0,A=150)
LeftStateBoxColor=(R=150, G=150, B=150, A=150)
LeftStateBoxColorDead=(R=200, G=0, B=0, A=150)
LeftStateBoxColorLow=(R=200, G=50, B=50, A=150)
LeftStateBoxColorMid=(R=200, G=200, B=0, A=150)
LeftStateBoxColorHigh=(R=0, G=200, B=0, A=150)
PlayerOwnerBoxColor=(R=100,G=10,B=10,A=150)
PlayerBoxColor=(R=30,G=30,B=30,A=150)
StatsBoxColor=(R=10,G=10,B=10,A=150)
PlayerOwnerBoxColor=(R=100, G=10, B=10, A=150)
PlayerBoxColor=(R=30, G=30, B=30, A=150)
StatsBoxColor=(R=10, G=10, B=10, A=150)
RankTextColor=(R=250,G=250,B=250,A=255)
ZedTextColor=(R=255,G=0,B=0,A=255)
PerkTextColor=(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)
KillsTextColor=(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)
StateTextColor=(R=150,G=150,B=150,A=150)
PingTextColor=(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)
PerkTextColor=(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)
KillsTextColor=(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)
StateTextColor=(R=150, G=150, B=150, A=150)
PingTextColor=(R=250, G=250, B=250, A=255)
LevelTextColorLow=(R=250,G=100,B=100,A=255)
LevelTextColorMid=(R=250,G=250,B=0,A=255)
LevelTextColorHigh=(R=0,G=250,B=0,A=255)
LevelTextColorLow=(R=250, G=100, B=100, A=255)
LevelTextColorMid=(R=250, G=250, B=0, A=255)
LevelTextColorHigh=(R=0, G=250, B=0, A=255)
StateTextColorLobby=(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)
StateTextColorSpectator=(R=150,G=150,B=150,A=150)
StateTextColorDead=(R=250,G=0,B=0,A=255)
StateTextColorLowHP=(R=250,G=100,B=100,A=255)
StateTextColorMidHP=(R=250,G=250,B=0,A=255)
StateTextColorHighHP=(R=0,G=250,B=0,A=255)
StateTextColorLobby=(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)
StateTextColorSpectator=(R=150, G=150, B=150, A=150)
StateTextColorDead=(R=250, G=0, B=0, A=255)
StateTextColorLowHP=(R=250, G=100, B=100, A=255)
StateTextColorMidHP=(R=250, G=250, B=0, A=255)
StateTextColorHighHP=(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)
PingTextColorHigh=(R=250,G=0,B=0,A=255)
PingTextColorLow=(R=0, G=250, B=0, A=255)
PingTextColorMid=(R=250, G=250, B=0, A=255)
PingTextColorHigh=(R=250, G=0, B=0, A=255)
}
};