Commit 29a40037 authored by Kegan's avatar Kegan

Merge branch '64-exp-update-fixes' into 'staging'

Resolve "EXP Update Fixes."

See merge request DayZ/BattleRoyale!51
parents bc11ebe4 d3a932d5
......@@ -8,8 +8,7 @@ class CfgPatches
requiredAddons[]=
{
"DZ_Data",
"DZ_Sounds_Weapons",
"WeaponPack_Scripts"
"DZ_Sounds_Weapons"
};
};
};
......
modded class LoadingScreen
{
void LoadingScreen(DayZGame game)
{
//the base LoadingScreen constructor was just called, we need to destroy (unlink) the layout it created
if(m_WidgetRoot)
{
m_WidgetRoot.Unlink( ); //destroy this layout data
}
m_DayZGame = game;
//create our own layout
m_WidgetRoot = game.GetWorkspace().CreateWidgets("dayzbr/gui/layouts/br_loading.layout");
Class.CastTo(m_ImageLogoMid, m_WidgetRoot.FindAnyWidget("ImageLogoMid"));
Class.CastTo(m_ImageLogoCorner, m_WidgetRoot.FindAnyWidget("ImageLogoCorner"));
Class.CastTo(m_TextWidgetTitle, m_WidgetRoot.FindAnyWidget("TextWidget"));
Class.CastTo(m_TextWidgetError, m_WidgetRoot.FindAnyWidget("ErrorText"));
Class.CastTo(m_ImageWidgetBackground, m_WidgetRoot.FindAnyWidget("ImageBackground"));
Class.CastTo(m_ImageLoadingIcon, m_WidgetRoot.FindAnyWidget("ImageLoadingIcon"));
//hide these logos
m_ImageLogoMid.Show(false);
m_ImageLogoCorner.Show(false);
m_Counter = 0;
}
void Show()
{
Print("Loading Screen Show");
if ( !m_WidgetRoot.IsVisible() )
{
if ( g_Game.GetUIManager().IsDialogVisible() )
{
g_Game.GetUIManager().HideDialog();
}
if ( g_Game.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU )
{
m_ImageLogoMid.Show(false);
m_ImageLogoCorner.Show(false);
m_ImageWidgetBackground.Show( true );
m_TextWidgetError.Show(true);
}
else
{
m_ImageLogoMid.Show(false);
m_ImageLogoCorner.Show(false);
m_ImageWidgetBackground.Show( true );
m_TextWidgetError.Show(false);
}
m_WidgetRoot.Show( true );
m_TextWidgetTitle.SetText( "" );
m_TextWidgetError.SetText( "" );
}
}
}
\ No newline at end of file
/*
modded class EmoteManager
{
//ref BattleRoyaleRound m_BattleRoyaleRound;
......@@ -7,7 +8,64 @@ modded class EmoteManager
{
Prepare_Players = x;
}
override void SetEmoteLockState(bool state)
{
//Print("lock state " + state);
if (!m_HandInventoryLocation)
{
m_HandInventoryLocation = new InventoryLocation;
m_HandInventoryLocation.SetHands(m_Player,null);
}
if (!state)
{
if (m_Player.GetInventory().HasInventoryReservation(null, m_HandInventoryLocation))
{
//Print("Clearing hand reservation... ");
m_Player.GetInventory().ClearInventoryReservation( null, m_HandInventoryLocation);
}
if ( m_Player.GetActionManager() )
m_Player.GetActionManager().EnableActions();
m_Player.SetInventorySoftLock(false);
if ( m_controllsLocked )
{
if(!Prepare_Players)
{
m_controllsLocked = false;
m_Player.GetInputController().OverrideAimChangeX(false,0);
m_Player.GetInputController().OverrideMovementSpeed(false,0);
}
}
}
else
{
if (!m_Player.GetInventory().HasInventoryReservation(null, m_HandInventoryLocation))
{
m_Player.GetInventory().AddInventoryReservation( null, m_HandInventoryLocation, 10000);
}
if ( m_Player.GetActionManager() )
m_Player.GetActionManager().DisableActions();
m_Player.SetInventorySoftLock(true);
//Movement lock in fullbody anims
//TODO check for better solution to prevent turning on back and borking the animation (surrender)
if (m_Callback && m_Callback.m_IsFullbody && !m_controllsLocked && m_CurrentGestureID == ID_EMOTE_SURRENDER)
{
m_controllsLocked = true;
//m_Player.GetInputController().OverrideAimChangeX(true,0);
//m_Player.GetInputController().OverrideMovementSpeed(true,0);
}
}
m_EmoteLockState = state;
}
override void OnEmoteEnd()
{
if ( m_ItemToHands )
......@@ -22,33 +80,47 @@ modded class EmoteManager
return;
}
if ( m_BelayedEmote )
//surrender "state" switch
if ( m_CurrentGestureID == ID_EMOTE_SURRENDER )
{
if ( m_PreviousGestureID != m_BelayedEmoteID )
m_IsSurrendered = !m_IsSurrendered;
if ( !m_IsSurrendered )
{
PickEmote(m_BelayedEmoteID);
//PlayEmote(m_BelayedEmoteID);
SetEmoteLockState(false);
}
else
{
SetEmoteLockState(true);
}
m_BelayedEmoteID = -1;
m_BelayedEmote = false;
}
else
if ( m_IsSurrendered )
{
if ( m_Player.GetActionManager() ) m_Player.GetActionManager().EnableActions();
m_Player.m_InventorySoftLocked = false;
if ( m_controllsLocked )
if (m_BelayedEmote)
{
if(!Prepare_Players)
{
m_controllsLocked = false;
m_Player.GetInputController().OverrideAimChangeX(false,0);
m_Player.GetInputController().OverrideMovementSpeed(false,0);
}
m_BelayedEmoteSlot = -1;
m_BelayedEmote = false;
}
return;
}
SetEmoteLockState(false);
if ( m_BelayedEmote )
{
if (!m_IsSurrendered)
{
PickEmote(m_BelayedEmoteSlot);
//PlayEmote(m_BelayedEmoteSlot);
}
m_BelayedEmoteSlot = -1;
m_BelayedEmote = false;
}
//! back to the default - shoot from camera - if not set already
if (!m_Player.IsShootingFromCamera()) m_Player.OverrideShootFromCamera(true);
}
};
*/
\ No newline at end of file
......@@ -62,8 +62,8 @@ class ActionDrinkMonsta: ActionDrink
void ActionDrinkMonsta()
{
m_CallbackClass = ActionDrinkMonstaCB;
m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DRINKCAN;
m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DRINKCAN;
m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DRINK;
m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DRINK;
}
override int GetType()
......
......@@ -71,8 +71,8 @@ class ActionDrinkMonstaStamina: ActionDrink
void ActionDrinkMonstaStamina()
{
m_CallbackClass = ActionDrinkMonstaStaminaCB;
m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DRINKCAN;
m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DRINKCAN;
m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DRINK;
m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DRINK;
}
override int GetType()
......
......@@ -9,13 +9,9 @@ modded class PlayerBase
ref BattleRoyaleBase BR_BASE;
void OnScheduledTick(float deltaTime)
override void OnScheduledTick(float deltaTime)
{
if( !IsPlayerSelected() || !IsAlive() ) return;
if( m_ModifiersManager ) m_ModifiersManager.OnScheduledTick(deltaTime);
if( m_NotifiersManager ) m_NotifiersManager.OnScheduledTick();
if( m_TrasferValues ) m_TrasferValues.OnScheduledTick(deltaTime);
if( m_DisplayStatus ) m_DisplayStatus.OnScheduledTick();
super.OnScheduledTick(deltaTime);
if( GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER)
{
......@@ -27,40 +23,7 @@ modded class PlayerBase
override void EEKilled( Object killer )
{
super.EEKilled(killer);
/*
Print("EEKilled, you have died");
if( GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT )
{
// @NOTE: this branch does not happen, EEKilled is called only on server
if( GetGame().GetPlayer() == this )
{
super.EEKilled( killer );
}
if (GetHumanInventory().GetEntityInHands())
GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ServerDropEntity,1000,false,( GetHumanInventory().GetEntityInHands() ));
}
else if( GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER)//server
{
if( GetBleedingManager() ) delete GetBleedingManager();
if( GetHumanInventory().GetEntityInHands() )
GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ServerDropEntity,1000,false,( GetHumanInventory().GetEntityInHands() ));
}
if ( GetSoftSkillManager() )
{
delete GetSoftSkillManager();
}
GetStateManager().OnPlayerKilled();
// kill character in database
if (GetHive())
{
GetHive().CharacterKill(this);
}
*/
if( GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER)
{
if(BR_BASE)
......
......@@ -33,11 +33,15 @@ class BattleRoyale extends BattleRoyaleBase
ref ScriptCallQueue br_CallQueue;
MissionGameplay gameplay_class;
bool hasInit;
//NOTE missionserver is passed in the event that we need it in the future (it is unused at this momemnt)
void BattleRoyale(MissionServer server_class)
void BattleRoyale(MissionGameplay server_class)
{
GetRPCManager().AddRPC( RPC_DAYZBR_NAMESPACE, "GlobalChat", this );
if ( GetGame().IsServer() )
{
hasInit = false;
......@@ -58,9 +62,47 @@ class BattleRoyale extends BattleRoyaleBase
} else
{
hasInit = true;
gameplay_class = server_class;
}
}
//Global Chat handling (need to directly add chat messages to chat)
//TODO: if this works, use more in depth chat add functionality?
void GlobalChat(CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target)
{
Param2< string , string> data;
if( !ctx.Read( data ) ) return;
if(type == CallType.Client)
{
if(! GetGame().GetPlayer() ) return;
PlayerBase me = PlayerBase.Cast(GetGame().GetPlayer());
if(!me) return;
if(!gameplay_class.m_Chat) return;
gameplay_class.m_Chat.Add("(Global) " + data.param1,data.param2);
}
if(type == CallType.Server)
{
if(!target) return;
PlayerBase targetBase = PlayerBase.Cast(target);
if(!targetBase) return;
if(!targetBase.GetIdentity()) return;
ref Param2<string,string> value_strings = new Param2<string, string>( targetBase.GetIdentity().GetName(), data.param1 );
GetRPCManager().SendRPC( RPC_DAYZBR_NAMESPACE, "GlobalChat", value_strings, false );
}
}
void OnInit()
{
if ( !GetGame().IsServer() ) return;
......
......@@ -193,8 +193,8 @@ class BattleRoyaleRound
player.SetHealth("", "Blood", player.GetMaxHealth("", "Blood"));
player.SetHealth("", "Shock", player.GetMaxHealth("", "Shock"));
// GetStatStomachSolid + GetStatStomachWater > 1000 == STUFFED!
player.GetStatStomachSolid().Set(250);
// GetStatStomachVolume + GetStatStomachWater > 1000 == STUFFED!
player.GetStatStomachVolume().Set(250);
player.GetStatStomachWater().Set(250);
// for bone regen: water = 2500 and energy = 4000 so 5000 should be ok
......@@ -206,7 +206,7 @@ class BattleRoyaleRound
// default body temperature is 37.4 -> HYPOTHERMIC_TEMPERATURE_TRESHOLD = 35.8
player.GetStatTemperature().Set(37.4);
//player.GetStatTemperature().Set(37.4);
// BURNING_TRESHOLD = 199 -> 100 should be fine
player.GetStatHeatComfort().Set(100);
......@@ -265,7 +265,7 @@ class BattleRoyaleRound
m_DeadBodies.Clear();
master_index = m_RoundPlayers.Count();
Prepare_Players = true;
EmoteManager.m_Prepare_Players(true);
//EmoteManager.m_Prepare_Players(true);
}
......@@ -488,7 +488,7 @@ class BattleRoyaleRound
if(!RoundStarted)
{
EmoteManager.m_Prepare_Players(false);
//EmoteManager.m_Prepare_Players(false);
//Round is over, clean up match,
round_CallQueue.Remove(this.CheckRoundEnd);
......
static string BattleRoyaleZoneFolderSaveLocation = "$profile:/BRZones";
class BattleRoyaleZoneData
......
modded class Chat
{
//custom BR method for adding text to chat
void Add(string text)
{
ChatMessageEventParams msgParams = new ChatMessageEventParams(0,text,"","");
Add(msgParams);
}
void Add(string name, string text)
{
ChatMessageEventParams msgParams = new ChatMessageEventParams(0,name,text,"");
Add(msgParams);
}
}
\ No newline at end of file
class BrChatMenu extends ChatInputMenu
{
EditBoxWidget new_m_edit_box;
TextWidget new_m_channel_text;
ref Timer new_m_close_timer;
protected EditBoxWidget new_m_edit_box;
protected TextWidget new_m_channel_text;
protected ref Timer new_m_close_timer;
static int m_current_channel = 0;
protected MissionGameplay new_m_mission;
void BrChatMenu()
void BrChatMenu(MissionBase m_mission)
{
new_m_mission = MissionGameplay.Cast(m_mission);
new_m_close_timer = new Timer();
}
......@@ -17,7 +19,6 @@ class BrChatMenu extends ChatInputMenu
new_m_edit_box = EditBoxWidget.Cast( layoutRoot.FindAnyWidget("InputEditBoxWidget") );
new_m_channel_text = TextWidget.Cast( layoutRoot.FindAnyWidget("ChannelText") );
new_m_channel_text.Show(true);
UpdateChannel();
......@@ -40,23 +41,24 @@ class BrChatMenu extends ChatInputMenu
string text = new_m_edit_box.GetText();
BRLOG("Chat message: " + text);
if (text != "")
{
bool test_global_chat = false; //TODO: flip this to true if you want to test global chat through ChatPlayer
if(m_current_channel == 1 && !test_global_chat)
if(BrChatMenu.m_current_channel == 1)
{
//Global Chat RPC
ref Param1<string> value_string = new Param1<string>(text);
GetRPCManager().SendRPC( RPC_DAYZBR_NAMESPACE, "GlobalChat", value_string, false, null, GetGame().GetPlayer() );
ref Param2<string,string> value_strings = new Param2<string,string>(text,"not_used");
GetRPCManager().SendRPC( RPC_DAYZBR_NAMESPACE, "GlobalChat", value_strings, false, null, GetGame().GetPlayer() );
}
else
{
//Local chat
GetGame().ChatPlayer(m_current_channel, text);
GetGame().ChatPlayer(0, text);
}
}
new_m_close_timer.Run(0.1, this, "Close");
GetGame().GetMission().HideChat();
return true;
}
......@@ -65,42 +67,72 @@ class BrChatMenu extends ChatInputMenu
{
}
override void Update(float timeslice)
{
GetGame().GetInput().DisableKey(KeyCode.KC_RETURN);
if(GetGame().GetInput().GetAction(UANextAction,false) > 0)
if(KeyState(KeyCode.KC_NEXT) > 0)
{
switch(m_current_channel)
ClearKey(KeyCode.KC_NEXT);
switch(BrChatMenu.m_current_channel)
{
case 0:
m_current_channel = 1;
BrChatMenu.m_current_channel = 1;
break;
case 1:
m_current_channel = 0;
BrChatMenu.m_current_channel = 0;
break;
}
UpdateChannel();
}
if(GetGame().GetInput().GetAction(UAPrevAction,false) > 0)
if(KeyState(KeyCode.KC_PRIOR) > 0)
{
switch(m_current_channel)
ClearKey(KeyCode.KC_PRIOR);
switch(BrChatMenu.m_current_channel)
{
case 0:
m_current_channel = 1;
BrChatMenu.m_current_channel = 1;
break;
case 1:
m_current_channel = 0;
BrChatMenu.m_current_channel = 0;
break;
}
UpdateChannel();
}
GetGame().GetInput().DisableKey(KeyCode.KC_RETURN);
}
override void UpdateChannel()
{
new_m_channel_text.SetText(GetChannelName(m_current_channel));
if(new_m_mission)
{
new_m_mission.m_ChatChannelText.SetText(BrChatMenu.GetChannelNameInt(BrChatMenu.m_current_channel));
new_m_mission.m_ChatChannelFadeTimer.FadeIn(new_m_mission.m_ChatChannelArea, 0.5, true);
new_m_mission.m_ChatChannelHideTimer.Run(2, new_m_mission.m_ChatChannelFadeTimer, "FadeOut", new Param3<Widget, float, bool>(new_m_mission.m_ChatChannelArea, 0.5, true));
}
}
static string GetChannelNameInt(int channel)
{
switch(channel)
{
case 0:
return "Direct"; //This is actually "None" the default value for dayz
case 1:
return "Global";
case 3:
return "Radio";
case 6:
return "Direct";
case 18:
return "Status";
case 19:
return "System";
}
return "";
}
override static string GetChannelName(ChatChannel channel)
{
switch(channel)
......
......@@ -35,10 +35,7 @@ class NewGesturesMenu extends UIScriptedMenu
m_Base = base;
m_GestureItems = new ref array<ref GestureMenuItem>;
if ( !instance )
{
instance = this;
}
instance = this;
}
void ~NewGesturesMenu()
......
modded class InGameMenu
{
override Widget Init()
{
layoutRoot = GetGame().GetWorkspace().CreateWidgets("dayzbr/gui/layouts/br_ingamemenu.layout");
TextWidget version_widget = TextWidget.Cast( layoutRoot.FindAnyWidget("version") );
m_ContinueButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "continuebtn" ) );
m_ExitButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "exitbtn" ) );
m_RestartButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "restartbtn" ) );
m_OptionsButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "optionsbtn" ) );
string version;
GetGame().GetVersion( version );
version = "#main_menu_version" + " " + version;
version_widget.SetText( version );
ButtonWidget restart_btn;
Class.CastTo(restart_btn, layoutRoot.FindAnyWidgetById(IDC_INT_RETRY));
PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
bool player_is_alive = false;
if (player)
{
int life_state = player.GetPlayerState();
if (life_state == EPlayerStates.ALIVE)
{
player_is_alive = true;
}
}
if (GetGame().IsMultiplayer())
{
restart_btn.SetText("#main_menu_respawn");
}
else
{
restart_btn.SetText("#main_menu_restart");
}
if ( GetGame().IsMultiplayer() && !( GetGame().CanRespawnPlayer() || ( player && player.IsUnconscious() ) ) )
{
restart_btn.Enable(false);
}
Mission mission = GetGame().GetMission();
if ( mission )
{
IngameHud hud = IngameHud.Cast( mission.GetHud() );
if ( hud )
{
hud.ToggleHud( false, true );
hud.ToggleQuickBar( false, true );
}
}
return layoutRoot;
}
}
\ No newline at end of file
modded class LoadingMenu
{
override Widget Init()
{
layoutRoot = GetGame().GetWorkspace().CreateWidgets("dayzbr/gui/layouts/br_loading.layout");
m_label = TextWidget.Cast( layoutRoot.FindAnyWidget("TextWidget") );
m_progressBar = ProgressBarWidget.Cast( layoutRoot.FindAnyWidget("ProgressBarWidget") );
m_image = ImageWidget.Cast( layoutRoot.FindAnyWidget("ImageBackground") );
return layoutRoot;
}
}
modded class MainMenu
{
override Widget Init()
{
layoutRoot = GetGame().GetWorkspace().CreateWidgets( "dayzbr/gui/layouts/br_main_menu.layout" );
m_Play = layoutRoot.FindAnyWidget( "play" );
m_ChooseServer = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "choose_server" ) );
m_CustomizeCharacter = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "customize_character" ) );
m_PlayVideo = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "play_video" ) );
m_Tutorials = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "tutorials" ) );
m_StatButton = layoutRoot.FindAnyWidget( "stat_button" );
m_MessageButton = layoutRoot.FindAnyWidget( "message_button" );
m_SettingsButton = layoutRoot.FindAnyWidget( "settings_button" );
m_Exit = layoutRoot.FindAnyWidget( "exit_button" );
m_NewsFeedOpen = layoutRoot.FindAnyWidget( "news_feed_open" );
m_NewsFeedClose = layoutRoot.FindAnyWidget( "news_feed_close" );
m_CharacterStatsOpen = layoutRoot.FindAnyWidget( "character_stats_open" );
m_CharacterStatsClose = layoutRoot.FindAnyWidget( "character_stats_close" );
m_PrevCharacter = layoutRoot.FindAnyWidget( "prev_character" );
m_NextCharacter = layoutRoot.FindAnyWidget( "next_character" );
m_Version = TextWidget.Cast( layoutRoot.FindAnyWidget( "version" ) );
m_CharacterRotationFrame = layoutRoot.FindAnyWidget( "character_rotation_frame" );
m_LastPlayedTooltip = layoutRoot.FindAnyWidget( "last_server_info" );
m_LastPlayedTooltipLabel = m_LastPlayedTooltip.FindAnyWidget( "last_server_info_label" );
m_LastPlayedTooltipIP = TextWidget.Cast( m_LastPlayedTooltip.FindAnyWidget( "last_server_info_ip" ) );
m_LastPlayedTooltipPort = TextWidget.Cast( m_LastPlayedTooltip.FindAnyWidget( "last_server_info_port" ) );
m_LastPlayedTooltipTimer = new WidgetFadeTimer();
m_Newsfeed = new MainMenuNewsfeed( layoutRoot.FindAnyWidget( "news_feed_root" ) );
m_Stats = new MainMenuStats( layoutRoot.FindAnyWidget( "character_stats_root" ) );
m_Mission = MissionMainMenu.Cast( GetGame().GetMission() );
m_ScenePC = m_Mission.GetIntroScenePC();
if( m_ScenePC )
m_ScenePC.ResetIntroCamera();
m_PlayerName = TextWidget.Cast( layoutRoot.FindAnyWidget("character_name_text") );
Refresh();
string version;
GetGame().GetVersion( version );
version = "#main_menu_version" + " " + version;
m_Version.SetText( version );
GetGame().GetUIManager().ScreenFadeOut(0);
SetFocus( layoutRoot );
return layoutRoot;
}
}
\ No newline at end of file