backgrounds for skill menu, better logic

This commit is contained in:
Shtoyan 2022-01-23 00:08:06 +04:00
parent 42f172f0df
commit aa20f8baa3

View File

@ -1,16 +1,36 @@
class NicePanelSkills extends UT2K4TabPanel;
// TODO add background
var automated NiceGUIPerkButton skillButtonA[5], skillButtonB[5];
function ShowPanel(bool bShow){
var automated GUISectionBackground sb_big_left, sb_big_right;
function ShowPanel(bool bShow)
{
local int i;
local class<NiceVeterancyTypes> niceVet;
local NicePlayerController nicePlayer;
Super.ShowPanel(bShow);
super.ShowPanel(bShow);
// loops are for puss
sb_big_left.ManageComponent(skillButtonA[0]);
sb_big_left.ManageComponent(skillButtonA[1]);
sb_big_left.ManageComponent(skillButtonA[2]);
sb_big_left.ManageComponent(skillButtonA[3]);
sb_big_left.ManageComponent(skillButtonA[4]);
sb_big_right.ManageComponent(skillButtonB[0]);
sb_big_right.ManageComponent(skillButtonB[1]);
sb_big_right.ManageComponent(skillButtonB[2]);
sb_big_right.ManageComponent(skillButtonB[3]);
sb_big_right.ManageComponent(skillButtonB[4]);
nicePlayer = NicePlayerController(PlayerOwner());
if (nicePlayer != none)
niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(nicePlayer.PlayerReplicationInfo);
if(niceVet != none){
for(i = 0;i < 5;i ++){
if (niceVet != none)
{
for (i = 0;i < 5;i ++)
{
skillButtonA[i].skillIndex = i;
skillButtonB[i].skillIndex = i;
skillButtonA[i].skillPerkIndex = niceVet.default.PerkIndex;
@ -22,16 +42,51 @@ function ShowPanel(bool bShow){
}
}
}
// size = (x=0.0125, y=0.0) ; (w=1.0, h=0.865)
// setup caption
defaultproperties
{
// BACKGROUNDS
Begin Object Class=AltSectionBackground Name=skillbckgrndl
Caption="LEFT SKILLS"
LeftPadding=0.000000
RightPadding=0.030000
TopPadding=0.000000
BottomPadding=0.000000
WinTop=0.000000
WinLeft=0.000000
WinWidth=0.500000
WinHeight=0.87
bBoundToParent=True
bScaleToParent=True
OnPreDraw=skillbckgrndl.InternalPreDraw
End Object
sb_big_left=skillbckgrndl
Begin Object Class=AltSectionBackground Name=skillbckgrndr
Caption="OBVIOUSLY RIGHT SKILLS"
LeftPadding=0.000000
RightPadding=0.030000
TopPadding=0.000000
BottomPadding=0.000000
WinTop=0.000000
WinLeft=0.500000
WinWidth=0.500000
WinHeight=0.87
bBoundToParent=True
bScaleToParent=True
OnPreDraw=skillbckgrndr.InternalPreDraw
End Object
sb_big_right=skillbckgrndr
// buttons
Begin Object Class=NiceGUIPerkButton Name=btn1A
WinTop=0.012500
// WinTop=0.012500
WinWidth=0.495000
WinHeight=0.160000
RenderWeight=2.000000
TabOrder=1
// RenderWeight=2.000000
// TabOrder=1
bBoundToParent=True
bScaleToParent=True
bMouseOverSound=False
@ -41,11 +96,11 @@ defaultproperties
skillButtonA(0)=btn1A
Begin Object Class=NiceGUIPerkButton Name=btn2A
WinTop=0.188500
// WinTop=0.188500
WinWidth=0.495000
WinHeight=0.160000
RenderWeight=2.000000
TabOrder=3
// RenderWeight=2.000000
// TabOrder=3
bBoundToParent=True
bScaleToParent=True
bMouseOverSound=False
@ -55,11 +110,11 @@ defaultproperties
skillButtonA(1)=btn2A
Begin Object Class=NiceGUIPerkButton Name=btn3A
WinTop=0.364500
// WinTop=0.364500
WinWidth=0.495000
WinHeight=0.160000
RenderWeight=2.000000
TabOrder=5
// RenderWeight=2.000000
// TabOrder=5
bBoundToParent=True
bScaleToParent=True
bMouseOverSound=False
@ -69,11 +124,11 @@ defaultproperties
skillButtonA(2)=btn3A
Begin Object Class=NiceGUIPerkButton Name=btn4A
WinTop=0.540500
// WinTop=0.540500
WinWidth=0.495000
WinHeight=0.160000
RenderWeight=2.000000
TabOrder=7
// RenderWeight=2.000000
// TabOrder=7
bBoundToParent=True
bScaleToParent=True
bMouseOverSound=False
@ -83,11 +138,11 @@ defaultproperties
skillButtonA(3)=btn4A
Begin Object Class=NiceGUIPerkButton Name=btn5A
WinTop=0.716500
// WinTop=0.716500
WinWidth=0.495000
WinHeight=0.160000
RenderWeight=2.000000
TabOrder=9
// RenderWeight=2.000000
// TabOrder=9
bBoundToParent=True
bScaleToParent=True
bMouseOverSound=False