Menus overhaul #14

Merged
dkanus merged 30 commits from :somechanges into master 2022-01-23 22:14:51 +03:00
4 changed files with 259 additions and 206 deletions
Showing only changes of commit 2b164b56df - Show all commits

View File

@ -1,27 +1,64 @@
class NiceGUISettings extends Settings_Tabs; class NiceGUISettings extends Settings_Tabs;
//var automated GUIButton skillButtonA; //var automated GUIButton skillButtonA;
var array<string> ForceProjItems; var array<string> ForceProjItems;
var automated moCheckBox ch_WeapManagement;
var automated moCheckBox ch_AltSwitches; // GENERAL WEAPON SETTINGS
var automated moCheckBox ch_DispCounters; var automated GUISectionBackground bg_WEAP;
var automated moCheckBox ch_DisWeapProgress; var automated moCheckBox ch_WeapManagement;
var automated moCheckBox ch_ShowHLMessages; var automated moCheckBox ch_AltSwitches;
var automated moCheckBox ch_CancelFire; var automated moCheckBox ch_DispCounters;
var automated moCheckBox ch_CancelSwitching; var automated moCheckBox ch_DisWeapProgress;
var automated moCheckBox ch_CancelNades; var automated moCheckBox ch_ShowHLMessages;
var automated moCheckBox ch_CancelAiming;
var automated moCheckBox ch_ReloadWontWork; // WEAPON RELOAD SETTINGS
var automated GUISectionBackground bg_WEAP; var automated GUISectionBackground bg_RELOAD;
var automated GUISectionBackground bg_RELOAD; var automated moCheckBox ch_CancelFire;
function InitComponent(GUIController MyController, GUIComponent MyOwner){ var automated moCheckBox ch_CancelSwitching;
super.InitComponent(MyController, MyOwner); var automated moCheckBox ch_CancelNades;
} var automated moCheckBox ch_CancelAiming;
function InternalOnLoadINI(GUIComponent sender, string s){ var automated moCheckBox ch_ReloadWontWork;
local NicePlayerController nicePlayer;
nicePlayer = NicePlayerController(PlayerOwner()); // RANDOM SETTINGS
if(nicePlayer == none) var automated GUISectionBackground bg_RANDOM;
return; var automated MoComboBox mo_ZedHPBars;
switch(sender){
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super.InitComponent(MyController, MyOwner);
mo_ZedHPBars.AddItem("Big Zeds");
mo_ZedHPBars.AddItem("All Zeds");
mo_ZedHPBars.AddItem("Disable");
// GENERAL WEAPON SETTINGS
bg_WEAP.ManageComponent(ch_WeapManagement);
bg_WEAP.ManageComponent(ch_AltSwitches);
bg_WEAP.ManageComponent(ch_DispCounters);
bg_WEAP.ManageComponent(ch_DisWeapProgress);
bg_WEAP.ManageComponent(ch_ShowHLMessages);
// WEAPON RELOAD SETTINGS
bg_RELOAD.ManageComponent(ch_CancelFire);
bg_RELOAD.ManageComponent(ch_CancelSwitching);
bg_RELOAD.ManageComponent(ch_CancelNades);
bg_RELOAD.ManageComponent(ch_CancelAiming);
bg_RELOAD.ManageComponent(ch_ReloadWontWork);
// RANDOM SETTINGS
bg_RANDOM.ManageComponent(mo_ZedHPBars);
}
function InternalOnLoadINI(GUIComponent sender, string s)
{
local NicePlayerController nicePlayer;
nicePlayer = NicePlayerController(PlayerOwner());
if (nicePlayer == none)
return;
switch(sender)
{
case ch_WeapManagement: case ch_WeapManagement:
ch_WeapManagement.Checked(nicePlayer.bNiceWeaponManagement); ch_WeapManagement.Checked(nicePlayer.bNiceWeaponManagement);
break; break;
@ -52,15 +89,23 @@ function InternalOnLoadINI(GUIComponent sender, string s){
case ch_ReloadWontWork: case ch_ReloadWontWork:
ch_ReloadWontWork.Checked(nicePlayer.bFlagUseServerReload); ch_ReloadWontWork.Checked(nicePlayer.bFlagUseServerReload);
break; break;
} case mo_ZedHPBars:
mo_ZedHPBars.SetIndex(nicePlayer.ZedHPBarStyle);
break;
}
} }
function InternalOnChange(GUIComponent Sender){
local NicePlayerController nicePlayer; function InternalOnChange(GUIComponent Sender)
super.InternalOnChange(Sender); {
nicePlayer = NicePlayerController(PlayerOwner()); local NicePlayerController nicePlayer;
if(nicePlayer == none)
return; super.InternalOnChange(Sender);
switch(sender){ nicePlayer = NicePlayerController(PlayerOwner());
if (nicePlayer == none)
return;
switch(sender)
{
case ch_WeapManagement: case ch_WeapManagement:
nicePlayer.bNiceWeaponManagement = ch_WeapManagement.IsChecked(); nicePlayer.bNiceWeaponManagement = ch_WeapManagement.IsChecked();
break; break;
@ -91,191 +136,174 @@ function InternalOnChange(GUIComponent Sender){
case ch_ReloadWontWork: case ch_ReloadWontWork:
nicePlayer.ServerSetUseServerReload(ch_ReloadWontWork.IsChecked()); nicePlayer.ServerSetUseServerReload(ch_ReloadWontWork.IsChecked());
break; break;
} case mo_ZedHPBars:
nicePlayer.ClientSaveConfig(); nicePlayer.ZedHPBarStyle = mo_ZedHPBars.GetIndex();
log(">>> nicePlayer.ZedHPBarStyle = " $ mo_ZedHPBars.GetIndex());
break;
}
nicePlayer.ClientSaveConfig();
} }
// size = (x=0.0125, y=0.0) ; (w=1.0, h=0.865) // size = (x=0.0125, y=0.0) ; (w=1.0, h=0.865)
// tab order // tab order
defaultproperties defaultproperties
{ {
Begin Object Class=moCheckBox Name=WeaponManagement // GENERAL WEAPON SETTINGS
CaptionWidth=0.955000 Begin Object Class=GUISectionBackground Name=WEAPBG
Caption="Nice weapon management" Caption="General weapon settings"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" WinTop=0.012500
OnCreateComponent=WeaponManagement.InternalOnCreateComponent WinWidth=0.495000
IniOption="@Internal" WinHeight=0.287500
Hint="If checked, NicePack will use it's own system to manage weapon switching" RenderWeight=0.100100
WinTop=0.050000 // OnPreDraw=WeaponsBG.InternalPreDraw
WinLeft=0.012500 OnPreDraw=WEAPBG.InternalPreDraw
WinWidth=0.278000 End Object
TabOrder=4 bg_WEAP=WEAPBG
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_WeapManagement=WeaponManagement
Begin Object Class=moCheckBox Name=AltSwitches Begin Object Class=moCheckBox Name=WeaponManagement
CaptionWidth=0.955000 Caption="Nice weapon management"
Caption="Alt fire switches modes" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=WeaponManagement.InternalOnCreateComponent
OnCreateComponent=AltSwitches.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="If checked, NicePack will use it's own system to manage weapon switching"
Hint="Assault-rifle only; if enabled - alt fire button switches between fire modes, otherwise - acts as an alt fire" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.100000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.012500 End Object
WinWidth=0.278000 ch_WeapManagement=WeaponManagement
TabOrder=6
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_AltSwitches=AltSwitches
Begin Object Class=moCheckBox Name=DispCounters Begin Object Class=moCheckBox Name=AltSwitches
CaptionWidth=0.955000 Caption="Alt fire switches modes"
Caption="Display counters" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=AltSwitches.InternalOnCreateComponent
OnCreateComponent=DispCounters.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="Assault-rifle only; if enabled - alt fire button switches between fire modes, otherwise - acts as an alt fire"
Hint="Toggles display of the various counters used by skills" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.150000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.012500 End Object
WinWidth=0.278000 ch_AltSwitches=AltSwitches
TabOrder=7
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_DispCounters=DispCounters
Begin Object Class=moCheckBox Name=DispWeapProgress Begin Object Class=moCheckBox Name=DispCounters
CaptionWidth=0.955000 Caption="Display counters"
Caption="Display weapon progress" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=DispCounters.InternalOnCreateComponent
OnCreateComponent=DispWeapProgress.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="Toggles display of the various counters used by skills"
Hint="Displays weapon progress rate, however it's defined by a skill that's using this functionality" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.200000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.012500 End Object
WinWidth=0.278000 ch_DispCounters=DispCounters
TabOrder=8
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_DisWeapProgress=DispWeapProgress
Begin Object Class=moCheckBox Name=ShowHLMessages Begin Object Class=moCheckBox Name=DispWeapProgress
CaptionWidth=0.955000 Caption="Display weapon progress"
Caption="Show Hardcore Level messages" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=DispWeapProgress.InternalOnCreateComponent
OnCreateComponent=ShowHLMessages.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="Displays weapon progress rate, however it's defined by a skill that's using this functionality"
Hint="Enable to be notified each time Hardcore Level is changed" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.300000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.012500 End Object
WinWidth=0.278000 ch_DisWeapProgress=DispWeapProgress
TabOrder=9
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_ShowHLMessages=ShowHLMessages
Begin Object Class=moCheckBox Name=CancelFire Begin Object Class=moCheckBox Name=ShowHLMessages
CaptionWidth=0.955000 Caption="Show Hardcore Level messages"
Caption="Cancel reload by shooting" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=ShowHLMessages.InternalOnCreateComponent
OnCreateComponent=CancelFire.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="Enable to be notified each time Hardcore Level is changed"
Hint="If checked, you'll be able to cancel reload of converted weapons by shooting (when you have ammo)" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.050000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.517500 End Object
WinWidth=0.287000 ch_ShowHLMessages=ShowHLMessages
TabOrder=11
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_CancelFire=CancelFire
Begin Object Class=moCheckBox Name=CancelSwitching // WEAPON RELOAD SETTINGS
CaptionWidth=0.955000 Begin Object Class=GUISectionBackground Name=RELOADBG
Caption="Cancel reload by switching weapons" Caption="Weapon reload settings"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" WinTop=0.012500
OnCreateComponent=CancelSwitching.InternalOnCreateComponent WinLeft=0.505000
IniOption="@Internal" WinWidth=0.495000
Hint="If checked, you'll be able to cancel reload of converted weapons by switching to different weapon" WinHeight=0.287500
WinTop=0.100000 RenderWeight=0.100100
WinLeft=0.517500 // OnPreDraw=WeaponsBG.InternalPreDraw
WinWidth=0.287000 OnPreDraw=RELOADBG.InternalPreDraw
TabOrder=12 End Object
OnChange=NiceGUISettings.InternalOnChange bg_RELOAD=RELOADBG
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_CancelSwitching=CancelSwitching
Begin Object Class=moCheckBox Name=CancelNades Begin Object Class=moCheckBox Name=CancelFire
CaptionWidth=0.955000 Caption="Cancel reload by shooting"
Caption="Cancel reload by throwing grenades" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=CancelFire.InternalOnCreateComponent
OnCreateComponent=CancelNades.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="If checked, you'll be able to cancel reload of converted weapons by shooting (when you have ammo)"
Hint="If checked, you'll be able to cancel reload of converted weapons by throwing a grenade" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.150000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.517500 End Object
WinWidth=0.287000 ch_CancelFire=CancelFire
TabOrder=13
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_CancelNades=CancelNades
Begin Object Class=moCheckBox Name=CancelAiming Begin Object Class=moCheckBox Name=CancelSwitching
CaptionWidth=0.955000 Caption="Cancel reload by switching weapons"
Caption="Cancel reload by aiming" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=CancelSwitching.InternalOnCreateComponent
OnCreateComponent=CancelAiming.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="If checked, you'll be able to cancel reload of converted weapons by switching to different weapon"
Hint="If checked, you'll be able to cancel reload of converted weapons by going into iron sights (when you have ammo)" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.200000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.517500 End Object
WinWidth=0.287000 ch_CancelSwitching=CancelSwitching
TabOrder=14
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_CancelAiming=CancelAiming
Begin Object Class=moCheckBox Name=ServerReload Begin Object Class=moCheckBox Name=CancelNades
CaptionWidth=0.955000 Caption="Cancel reload by throwing grenades"
Caption="My reload doesn't work" ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton" OnCreateComponent=CancelNades.InternalOnCreateComponent
OnCreateComponent=ServerReload.InternalOnCreateComponent IniOption="@Internal"
IniOption="@Internal" Hint="If checked, you'll be able to cancel reload of converted weapons by throwing a grenade"
Hint="Check this option ONLY in case converted weapons don't reload at all for you; this option should fix the problem, but then latency will affect both reload and active reload" OnChange=NiceGUISettings.InternalOnChange
WinTop=0.250000 OnLoadINI=NiceGUISettings.InternalOnLoadINI
WinLeft=0.517500 End Object
WinWidth=0.287000 ch_CancelNades=CancelNades
TabOrder=15
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
ch_ReloadWontWork=ServerReload
Begin Object Class=GUISectionBackground Name=WEAPBG Begin Object Class=moCheckBox Name=CancelAiming
Caption="General weapon settings" Caption="Cancel reload by aiming"
WinTop=0.012500 ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
WinWidth=0.495000 OnCreateComponent=CancelAiming.InternalOnCreateComponent
WinHeight=0.287500 IniOption="@Internal"
RenderWeight=0.100100 Hint="If checked, you'll be able to cancel reload of converted weapons by going into iron sights (when you have ammo)"
OnPreDraw=WeaponsBG.InternalPreDraw OnChange=NiceGUISettings.InternalOnChange
End Object OnLoadINI=NiceGUISettings.InternalOnLoadINI
bg_WEAP=WEAPBG End Object
ch_CancelAiming=CancelAiming
Begin Object Class=GUISectionBackground Name=RELOADBG Begin Object Class=moCheckBox Name=ServerReload
Caption="Weapon reload settings" Caption="My reload doesn't work"
WinTop=0.012500 ComponentClassName="ScrnBalanceSrv.ScrnGUICheckBoxButton"
WinLeft=0.505000 OnCreateComponent=ServerReload.InternalOnCreateComponent
WinWidth=0.495000 IniOption="@Internal"
WinHeight=0.287500 Hint="Check this option ONLY in case converted weapons don't reload at all for you; this option should fix the problem, but then latency will affect both reload and active reload"
RenderWeight=0.100100 OnChange=NiceGUISettings.InternalOnChange
OnPreDraw=WeaponsBG.InternalPreDraw OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object End Object
bg_RELOAD=RELOADBG ch_ReloadWontWork=ServerReload
}
// RANDOM SETTINGS
Begin Object Class=GUISectionBackground Name=randbg
Caption="Random settings"
WinTop=0.300000
WinWidth=0.495000
WinHeight=0.287500
WinLeft=0.505000
RenderWeight=0.100100
// OnPreDraw=WeaponsBG.InternalPreDraw
OnPreDraw=randbg.InternalPreDraw
End Object
bg_RANDOM=randbg
Begin Object class=moComboBox Name=zedhbarpmethod
bReadOnly=true
CaptionWidth=0.000000
Caption="Zed health bars"
Hint="Choose what health bars you want to see"
OnCreateComponent=zedhbarpmethod.InternalOnCreateComponent
OnChange=NiceGUISettings.InternalOnChange
OnLoadINI=NiceGUISettings.InternalOnLoadINI
End Object
mo_ZedHPBars=zedhbarpmethod
}

View File

@ -2,6 +2,8 @@ class NicePlayerController extends ScrnPlayerController
config(NiceUser) config(NiceUser)
dependson(NicePack) dependson(NicePack)
dependson(NiceFire); dependson(NiceFire);
var globalconfig int ZedHPBarStyle; // 0 - big zeds, 1 - all, 2 - disabled
var globalconfig int nicePlayerInfoVersionNumber; var globalconfig int nicePlayerInfoVersionNumber;
// These are values stored in a settings file // These are values stored in a settings file
var globalconfig bool bDebug; var globalconfig bool bDebug;

View File

@ -285,20 +285,38 @@ static function int GetInvincibilityDuration(KFPlayerReplicationInfo KFPRI){
static function int GetInvincibilitySafeMisses(KFPlayerReplicationInfo KFPRI){ static function int GetInvincibilitySafeMisses(KFPlayerReplicationInfo KFPRI){
return 0; return 0;
} }
static function SpecialHUDInfo(KFPlayerReplicationInfo KFPRI, Canvas C){
static function SpecialHUDInfo(KFPlayerReplicationInfo KFPRI, Canvas C)
{
local KFMonster KFEnemy; local KFMonster KFEnemy;
local HUDKillingFloor HKF; local HUDKillingFloor HKF;
local int i, hp;
local float MaxDistanceSquared; local float MaxDistanceSquared;
MaxDistanceSquared = 640000; MaxDistanceSquared = 640000;
MaxDistanceSquared *= GetHealthBarsDistanceMulti(KFPRI)**2; MaxDistanceSquared *= GetHealthBarsDistanceMulti(KFPRI)**2;
HKF = HUDKillingFloor(C.ViewPort.Actor.myHUD); HKF = HUDKillingFloor(C.ViewPort.Actor.myHUD);
if(HKF == none || C.ViewPort.Actor.Pawn == none || MaxDistanceSquared <= 0) if (HKF == none || C.ViewPort.Actor.Pawn == none || MaxDistanceSquared <= 0)
return; return;
foreach C.ViewPort.Actor.DynamicActors(class'KFMonster', KFEnemy){
if(KFEnemy.Health > 0 && (!KFEnemy.Cloaked() || KFEnemy.bZapped || KFEnemy.bSpotted) && VSizeSquared(KFEnemy.Location - C.ViewPort.Actor.Pawn.Location) < MaxDistanceSquared) // read and use player settings
// 0 - big zeds, 1 - all, 2 - disabled
i = NicePlayerController(C.ViewPort.actor).ZedHPBarStyle;
if (i == 2)
return;
else if (i == 1)
hp = 0;
else
hp = 1000;
foreach C.ViewPort.Actor.DynamicActors(class'KFMonster', KFEnemy)
{
if (KFEnemy.Health > hp && (!KFEnemy.Cloaked() || KFEnemy.bZapped || KFEnemy.bSpotted) && VSizeSquared(KFEnemy.Location - C.ViewPort.Actor.Pawn.Location) < MaxDistanceSquared)
HKF.DrawHealthBar(C, KFEnemy, KFEnemy.Health, KFEnemy.HealthMax , 50.0); HKF.DrawHealthBar(C, KFEnemy, KFEnemy.Health, KFEnemy.HealthMax , 50.0);
} }
} }
// Is player standing still? // Is player standing still?
static function bool IsStandingStill(KFPlayerReplicationInfo KFPRI){ static function bool IsStandingStill(KFPlayerReplicationInfo KFPRI){
if(KFPRI != none && PlayerController(KFPRI.Owner) != none && PlayerController(KFPRI.Owner).Pawn != none && VSize(PlayerController(KFPRI.Owner).Pawn.Velocity) > 0.0) if(KFPRI != none && PlayerController(KFPRI.Owner) != none && PlayerController(KFPRI.Owner).Pawn != none && VSize(PlayerController(KFPRI.Owner).Pawn.Velocity) > 0.0)

View File

@ -158,7 +158,12 @@ function SpawnTwoShots()
{ {
local vector X,Y,Z, FireStart; local vector X,Y,Z, FireStart;
local rotator FireRotation; local rotator FireRotation;
if( Controller!=none && KFDoorMover(Controller.Target)!=none )
// check this from the very start to prevent any log spam
if (Controller == none || IsInState('ZombieDying'))
return;
if (KFDoorMover(Controller.Target)!=none )
{ {
Controller.Target.TakeDamage(22,Self,Location,vect(0,0,0),Class'DamTypeVomit'); Controller.Target.TakeDamage(22,Self,Location,vect(0,0,0),Class'DamTypeVomit');
return; return;