Possible Fix for 2. Open of the menu

This commit is contained in:
SchnitzelPommes 2019-01-22 22:45:30 +01:00
parent d4494c5f84
commit 1af58ace50
8 changed files with 45 additions and 45 deletions

View File

@ -18,7 +18,7 @@ class FPPermission
ref FPPermission Parent; ref FPPermission Parent;
ref array< ref FPPermission > Children; ref array< ref FPPermission > Children;
string Name; string Name;
PermissionType Type; PermissionTypeN Type;
void FPPermission( string name, ref FPPermission parent = NULL ) void FPPermission( string name, ref FPPermission parent = NULL )
@ -26,17 +26,17 @@ class FPPermission
Name = name; Name = name;
Parent = parent; Parent = parent;
Type = PermissionType.DISALLOW; Type = PermissionTypeN.DISALLOW;
if ( Parent == NULL ) if ( Parent == NULL )
{ {
Type = PermissionType.DISALLOW; Type = PermissionTypeN.DISALLOW;
} }
Children = new ref array< ref FPPermission >; Children = new ref array< ref FPPermission >;
} }
void SetPermissionType(string name, PermissionType type) void SetPermissionType(string name, PermissionTypeN type)
{ {
Print("Permission"); Print("Permission");
for ( int i = 0; i < Children.Count(); i++ ) for ( int i = 0; i < Children.Count(); i++ )
@ -53,33 +53,33 @@ class FPPermission
} }
void SetPermissionInternal(PermissionType type) void SetPermissionInternal(PermissionTypeN type)
{ {
Print("Type Set"); Print("Type Set");
Type = type; Type = type;
} }
void AddPermission( string inp, PermissionType permType = PermissionType.DISALLOW ) void AddPermission( string inp, PermissionTypeN permType = PermissionTypeN.DISALLOW )
{ {
array<string> tokens = new array<string>; array<string> tokens = new array<string>;
array<string> spaces = new array<string>; array<string> spaces = new array<string>;
inp.Split( " = ", spaces ); inp.Split( " = ", spaces );
PermissionType type; PermissionTypeN type;
for ( int i = 0; i < spaces.Count(); i++ ) for ( int i = 0; i < spaces.Count(); i++ )
{Print(spaces[i]);} {Print(spaces[i]);}
if (spaces.Count() == 2 ) if (spaces.Count() == 2 )
{ {
if ( spaces[1].Contains( "1" ) ) if ( spaces[1].Contains( "1" ) )
{ {
type = PermissionType.ALLOW; type = PermissionTypeN.ALLOW;
} else if ( spaces[1].Contains( "0" ) ) } else if ( spaces[1].Contains( "0" ) )
{ {
type = PermissionType.DISALLOW; type = PermissionTypeN.DISALLOW;
} else } else
{ {
type = PermissionType.DISALLOW; type = PermissionTypeN.DISALLOW;
} }
spaces[0].Split( "_", tokens ); spaces[0].Split( "_", tokens );
@ -120,7 +120,7 @@ class FPPermission
if ( nChild == NULL ) if ( nChild == NULL )
{ {
nChild = new FPPermission( name, this ); nChild = new FPPermission( name, this );
nChild.Type = PermissionType.DISALLOW; nChild.Type = PermissionTypeN.DISALLOW;
Children.Insert( nChild ); Children.Insert( nChild );
} }
@ -154,7 +154,7 @@ class FPPermission
bool parentDisallowed = false; bool parentDisallowed = false;
if ( Type == PermissionType.DISALLOW ) if ( Type == PermissionTypeN.DISALLOW )
{ {
parentDisallowed = true; parentDisallowed = true;
} }
@ -172,17 +172,17 @@ class FPPermission
{ {
bool ifReturnAs = false; bool ifReturnAs = false;
if ( Type == PermissionType.ALLOW ) if ( Type == PermissionTypeN.ALLOW )
{ {
ifReturnAs = true; ifReturnAs = true;
} }
if ( Type == PermissionType.DISALLOW ) if ( Type == PermissionTypeN.DISALLOW )
{ {
parentDisallowed = true; parentDisallowed = true;
} }
if ( Type == PermissionType.ALLOW ) if ( Type == PermissionTypeN.ALLOW )
{ {
parentDisallowed = false; parentDisallowed = false;
} }
@ -247,7 +247,7 @@ class FPPermission
} }
} }
private void AddPermissionInternal( array<string> tokens, int depth, PermissionType value ) private void AddPermissionInternal( array<string> tokens, int depth, PermissionTypeN value )
{ {
if ( depth < tokens.Count() ) if ( depth < tokens.Count() )
{ {

View File

@ -35,7 +35,7 @@ class FPPlayer
} }
void SetPermission(string name, PermissionType type) void SetPermission(string name, PermissionTypeN type)
{ {
Print("FPPlayer"); Print("FPPlayer");
RootPermission.SetPermissionType(name , type) RootPermission.SetPermissionType(name , type)
@ -147,7 +147,7 @@ class FPPlayer
return RootPermission.HasPermission( fPPermission ); return RootPermission.HasPermission( fPPermission );
} }
void AddPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW ) void AddPermission( string fPPermission, PermissionTypeN type = PermissionTypeN.DISALLOW )
{ {
RootPermission.AddPermission( fPPermission, type); RootPermission.AddPermission( fPPermission, type);
} }

View File

@ -13,7 +13,7 @@
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence. which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
*/ */
enum PermissionType enum PermissionTypeN
{ {
DISALLOW, ALLOW DISALLOW, ALLOW
} }

View File

@ -68,7 +68,7 @@ class FileHandler
// NEW BEGINN // NEW BEGINN
void SetPermission(string perm, PermissionType type, string id) //Identity.GetID() void SetPermission(string perm, PermissionTypeN type, string id) //Identity.GetID()
{ {
Print("FileHandler"); Print("FileHandler");
for ( int i = 0; i < FPPlayers.Count(); i++ ) for ( int i = 0; i < FPPlayers.Count(); i++ )
@ -126,7 +126,7 @@ class FileHandler
} }
} }
void RegisterPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW ) void RegisterPermission( string fPPermission, PermissionTypeN type = PermissionTypeN.DISALLOW )
{ {
RootPermission.AddPermission( fPPermission, type ); RootPermission.AddPermission( fPPermission, type );
} }

View File

@ -191,7 +191,7 @@ class AdminMenu //extends UIScriptedMenu
{ {
GetGame().ObjectDelete( ObJIs ); GetGame().ObjectDelete( ObJIs );
status = "Object Deleted !"; status = "Object Deleted !";
TL().status(sender, status); // TL().status(sender, status);
} }
} }
@ -240,7 +240,7 @@ class AdminMenu //extends UIScriptedMenu
return; return;
} }
oObj.PlaceOnSurface(); oObj.PlaceOnSurface();
TL().status(sender, GroundN_Item + " Spawned"); // TL().status(sender, GroundN_Item + " Spawned");
} }
} }
@ -365,7 +365,7 @@ class AdminMenu //extends UIScriptedMenu
return; return;
} }
oCursorObj.PlaceOnSurface(); oCursorObj.PlaceOnSurface();
TL().status(sender, Cursor_Item + " Spawned"); // TL().status(sender, Cursor_Item + " Spawned");
} }
} }
@ -398,7 +398,7 @@ class AdminMenu //extends UIScriptedMenu
Admin.GetStatDiet().Set(2500); Admin.GetStatDiet().Set(2500);
Admin.GetStatSpecialty().Set(1); Admin.GetStatSpecialty().Set(1);
Admin.SetBleedingBits(0); Admin.SetBleedingBits(0);
TL().status(sender, sender.GetName() + " Healed"); // TL().status(sender, sender.GetName() + " Healed");
} }
} }
break; break;
@ -420,7 +420,7 @@ class AdminMenu //extends UIScriptedMenu
if ( selectedIdentity.GetName() == PlayerName ) if ( selectedIdentity.GetName() == PlayerName )
{ {
selectedPlayer.RemoveAllItems(); selectedPlayer.RemoveAllItems();
TL().status(sender, selectedIdentity.GetName() + " Striped"); // TL().status(sender, selectedIdentity.GetName() + " Striped");
} }
} }
} }
@ -446,7 +446,7 @@ class AdminMenu //extends UIScriptedMenu
if ( selectedIdentity.GetName() == PlayerName ) if ( selectedIdentity.GetName() == PlayerName )
{ {
Targettpto.SetPosition( AdminPos ); Targettpto.SetPosition( AdminPos );
TL().status(sender, PlayerName + " Teleported"); // TL().status(sender, PlayerName + " Teleported");
} }
} }
} }
@ -466,7 +466,7 @@ class AdminMenu //extends UIScriptedMenu
if ( players.Get(zm).GetIdentity().GetName() == PlayerName ) if ( players.Get(zm).GetIdentity().GetName() == PlayerName )
{ {
Admin.SetPosition(players.Get(zm).GetPosition()); Admin.SetPosition(players.Get(zm).GetPosition());
TL().status(sender, "Telepported to " + PlayerName); // TL().status(sender, "Telepported to " + PlayerName);
} }
} }
} }
@ -499,7 +499,7 @@ class AdminMenu //extends UIScriptedMenu
ofixPlayerPos = SnapToGround( ofixPlayerPos ); ofixPlayerPos = SnapToGround( ofixPlayerPos );
Admin.SetPosition(ofixPlayerPos); Admin.SetPosition(ofixPlayerPos);
TL().status(sender, "Telepported to " + ofixPlayerPos.ToString(false) ); // TL().status(sender, "Telepported to " + ofixPlayerPos.ToString(false) );
} }
} }
break; break;
@ -520,7 +520,7 @@ class AdminMenu //extends UIScriptedMenu
if ( Admin != NULL) if ( Admin != NULL)
{ {
Admin.SetPosition(reqpos); Admin.SetPosition(reqpos);
TL().status(sender, "Telepported to " + reqpos.ToString(false) ); // TL().status(sender, "Telepported to " + reqpos.ToString(false) );
} }
} }
break; break;
@ -533,7 +533,7 @@ class AdminMenu //extends UIScriptedMenu
{ {
int tpCount = TeleportAllPlayersTo(Admin); int tpCount = TeleportAllPlayersTo(Admin);
string msgc = "All " + tpCount.ToString() + " Players Teleported here"; string msgc = "All " + tpCount.ToString() + " Players Teleported here";
TL().status(sender, msgc ); // TL().status(sender, msgc );
} }
} }
break; break;
@ -564,7 +564,7 @@ class AdminMenu //extends UIScriptedMenu
MyNiva.Fill( CarFluid.OIL, MyNiva.GetFluidCapacity( CarFluid.OIL ) ); MyNiva.Fill( CarFluid.OIL, MyNiva.GetFluidCapacity( CarFluid.OIL ) );
MyNiva.Fill( CarFluid.BRAKE, MyNiva.GetFluidCapacity( CarFluid.BRAKE ) ); MyNiva.Fill( CarFluid.BRAKE, MyNiva.GetFluidCapacity( CarFluid.BRAKE ) );
MyNiva.Fill( CarFluid.COOLANT, MyNiva.GetFluidCapacity( CarFluid.COOLANT ) ); MyNiva.Fill( CarFluid.COOLANT, MyNiva.GetFluidCapacity( CarFluid.COOLANT ) );
TL().status(sender, "Car spawned and filled" ); // TL().status(sender, "Car spawned and filled" );
} }
} }
@ -598,7 +598,7 @@ class AdminMenu //extends UIScriptedMenu
toBeFilled.Fill( CarFluid.OIL, oilReq ); toBeFilled.Fill( CarFluid.OIL, oilReq );
toBeFilled.Fill( CarFluid.COOLANT, coolantReq ); toBeFilled.Fill( CarFluid.COOLANT, coolantReq );
toBeFilled.Fill( CarFluid.BRAKE, brakeReq ); toBeFilled.Fill( CarFluid.BRAKE, brakeReq );
TL().status(sender, "Car filled" ); // TL().status(sender, "Car filled" );
} }
} }
} }
@ -613,7 +613,7 @@ class AdminMenu //extends UIScriptedMenu
{ {
//TODO CHANGEABLE //TODO CHANGEABLE
GetGame().GetWorld().SetDate( 1988, 5, 23, 12, 0 ); GetGame().GetWorld().SetDate( 1988, 5, 23, 12, 0 );
TL().status(sender, "Time Set to Day" ); // TL().status(sender, "Time Set to Day" );
} }
} }
break; break;
@ -625,7 +625,7 @@ class AdminMenu //extends UIScriptedMenu
if ( Admin != NULL) if ( Admin != NULL)
{ {
GetGame().GetWorld().SetDate( 1988, 9, 23, 22, 0 ); GetGame().GetWorld().SetDate( 1988, 9, 23, 22, 0 );
TL().status(sender, "Time Set to Night" ); // TL().status(sender, "Time Set to Night" );
} }
} }
break; break;
@ -644,7 +644,7 @@ class AdminMenu //extends UIScriptedMenu
if ( Target.GetIdentity().GetName() == PlayerName ) if ( Target.GetIdentity().GetName() == PlayerName )
{ {
Target.SetHealth(0); Target.SetHealth(0);
TL().status(sender, PlayerName + "Killed" ); // TL().status(sender, PlayerName + "Killed" );
} }
} }
} }
@ -664,7 +664,7 @@ class AdminMenu //extends UIScriptedMenu
PlayerBase Target1 = PlayerBase.Cast(players.Get(ig1)); PlayerBase Target1 = PlayerBase.Cast(players.Get(ig1));
Target1.SetHealth(0); Target1.SetHealth(0);
} }
TL().status(sender, "All Player Killed" ); // TL().status(sender, "All Player Killed" );
} }
} }
break; break;
@ -695,7 +695,7 @@ class AdminMenu //extends UIScriptedMenu
Target2.GetStatSpecialty().Set(1); Target2.GetStatSpecialty().Set(1);
Target2.SetBleedingBits(0); Target2.SetBleedingBits(0);
} }
TL().status(sender, "All Player Healed" ); // TL().status(sender, "All Player Healed" );
} }
} }
break; break;
@ -713,7 +713,7 @@ class AdminMenu //extends UIScriptedMenu
PlayerBase Target3 = PlayerBase.Cast(players.Get(ig3)); PlayerBase Target3 = PlayerBase.Cast(players.Get(ig3));
Target3.RemoveAllItems(); Target3.RemoveAllItems();
} }
TL().status(sender, "All Player Striped" ); // TL().status(sender, "All Player Striped" );
} }
} }
@ -730,8 +730,8 @@ class AdminMenu //extends UIScriptedMenu
Admin = GetServerMission().IsAdminID(sender.GetName(), sender); Admin = GetServerMission().IsAdminID(sender.GetName(), sender);
if ( Admin != NULL) if ( Admin != NULL)
{ {
GetFileHandler().SetPermission("DisableStamina", PermissionType.DISALLOW, GetPlayerIdentityFromName(PlayerName).GetId()); GetFileHandler().SetPermission("DisableStamina", PermissionTypeN.DISALLOW, GetPlayerIdentityFromName(PlayerName).GetId());
TL().status(sender, "Stamina reset Removed for " + PlayerName); // TL().status(sender, "Stamina reset Removed for " + PlayerName);
} }
} }
break; break;
@ -744,8 +744,8 @@ class AdminMenu //extends UIScriptedMenu
Admin = GetServerMission().IsAdminID(sender.GetName(), sender); Admin = GetServerMission().IsAdminID(sender.GetName(), sender);
if ( Admin != NULL) if ( Admin != NULL)
{ {
GetFileHandler().SetPermission("DisableStamina", PermissionType.ALLOW, GetPlayerIdentityFromName(PlayerName).GetId()); GetFileHandler().SetPermission("DisableStamina", PermissionTypeN.ALLOW, GetPlayerIdentityFromName(PlayerName).GetId());
TL().status(sender, "Stamina reset Added for " + PlayerName); // TL().status(sender, "Stamina reset Added for " + PlayerName);
} }
} }
break; break;
@ -813,7 +813,7 @@ class AdminMenu //extends UIScriptedMenu
{ {
Msgparam = new Param1<string>( MSG ); Msgparam = new Param1<string>( MSG );
GetGame().RPCSingleParam(NULL , ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, selectedIdentity); GetGame().RPCSingleParam(NULL , ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, selectedIdentity);
TL().status(sender, "Message Sent to " + selectedIdentity.GetName()); // TL().status(sender, "Message Sent to " + selectedIdentity.GetName());
} }
} }
} }

View File

@ -66,7 +66,7 @@ class ChatModules
{ {
Admin = players.Get(i); Admin = players.Get(i);
AdminIdentity = Admin.GetIdentity(); AdminIdentity = Admin.GetIdentity();
GetFileHandler().SetPermission("Admin", PermissionType.ALLOW, AdminIdentity.GetId()); GetFileHandler().SetPermission("Admin", PermissionTypeN.ALLOW, AdminIdentity.GetId());
GetFileHandler().SetConfigType("Setup", "false"); GetFileHandler().SetConfigType("Setup", "false");
//TL().player(AdminIdentity, "Admin Set please relog to save Config !"); //TL().player(AdminIdentity, "Admin Set please relog to save Config !");
return; return;