Class KF2Style extends GUIStyleBase; var Texture2D LoadedTex[2]; const TOOLTIP_BORDER=4; function InitStyle() { local byte i; Super.InitStyle(); LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D')); LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D')); for( i=0; iTT.Owner.ScreenSize.X ) X = TT.Owner.ScreenSize.X-TX; if( (Y+TY)>TT.Owner.ScreenSize.Y ) Y = TT.CompPos[1]-TY; if( TT.CurrentAlpha<255 ) TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255); // Reset clipping. 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); DefFontHeight = DefaultHeight; // Draw text. Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha); X+=TOOLTIP_BORDER; Y+=TOOLTIP_BORDER; for( i=0; i0.f && X0.f && 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(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); YP+=YL; } Canvas.PopMaskRegion(); if( C.OldRow!=C.CurrentRow ) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); } } function RenderRightClickMenu( KFGUI_RightClickMenu C ) { 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)); // While rendering, figure out mouse focus row. X = C.Owner.MousePosition.X - Canvas.OrgX; Y = C.Owner.MousePosition.Y - Canvas.OrgY; bCheckMouse = (X>0.f && X0.f && 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(Edge,YP); if( C.ItemRows[i].bSplitter ) { 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); } YP+=TexDefHieght; } Canvas.PopMaskRegion(); if( C.OldRow!=C.CurrentRow ) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); } } function RenderButton( KFGUI_Button B ) { local float XL,YL,TS; local byte i; if( B.bDisabled ) Canvas.SetDrawColor(32,0,0,255); else if( B.bPressedDown ) Canvas.SetDrawColor(255,64,64,255); else if( B.bFocused ) 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.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); 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); } if( B.ButtonText!="" ) { // Chose the best font to fit this button. i = Min(B.FontScale,MaxFontScale); while( true ) { Canvas.Font = PickFont(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); if( B.bDisabled ) Canvas.DrawColor = B.TextColor*0.5f; else Canvas.DrawColor = B.TextColor; Canvas.DrawText(B.ButtonText,,TS,TS,B.TextFontInfo); } } defaultproperties { MaxFontScale=5 }