Class KF2Style extends GUIStyleBase; var Texture2D LoadedTex[2]; var Font DrawFonts[3]; 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); DrawWhiteBox(TX+4,TY+4); Canvas.SetDrawColor(80,10,80,TT.CurrentAlpha); Canvas.SetPos(X,Y); DrawWhiteBox(TX,TY); // 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; local int i; local bool bCheckMouse; // Draw background. Edge = C.EdgeSize; Canvas.SetPos(0.f,0.f); Canvas.SetDrawColor(148,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; Y = C.Owner.MousePosition.Y - Canvas.OrgY; bCheckMouse = (X>0.f && X0.f && Y=YP && Y<=(YP+DefaultHeight)) { bCheckMouse = false; C.CurrentRow = i; Canvas.SetPos(4.f,YP); Canvas.SetDrawColor(128,48,48,255); DrawWhiteBox(C.CompPos[2]-(Edge*2.f),DefaultHeight); } 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+=DefaultHeight; } Canvas.PopMaskRegion(); if(C.OldRow!=C.CurrentRow) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); } } function Font PickFont(byte i, out float Scaler) { switch(i) { case 0: Scaler = 0.3; return DrawFonts[0]; // use unicode font only case 1: Scaler = 0.35; return DrawFonts[0]; // use unicode font only case 2: Scaler = 0.4; return DrawFonts[0]; case 3: Scaler = 0.55; return DrawFonts[0]; case 4: Scaler = 0.6; return DrawFonts[0]; case 5: Scaler = 0.75; return DrawFonts[0]; default: Scaler = 1.0; return DrawFonts[0]; } } defaultproperties { MaxFontScale=6 }