Commit 05cb29dc authored by Kegan's avatar Kegan

Notification messages moved to HUD element

parent 15d5c65c
dayzbr\core
\ No newline at end of file
1
\ No newline at end of file
///'scripts.pbo' from Mikero's dos tools, dll version 5.66///
prefix=dayzbr\core
revision=1
Pbo Type is: Arma Unknown pbo typ (no config).
Sha: '5CAF7A50CB0D1CACBB90A6A0DA4EFC47B8998E0D'
//////</HEADER>//////
class CfgPatches
{
class dayzbr_core
{
units[]={};
weapons[]={};
requiredVersion=0.1;
requiredAddons[]={
};
};
};
class CfgMods
{
class dayzbr
{
dir = "dayzbr";
picture = "";
action = "";
hideName = 1;
hidePicture = 1;
name = "DayZ BattleRoyale";
credits = "Kegan, Vulkan, BigBen, Clarkycal, Legodev";
author = "DayZBR Dev Team";
authorID = "0";
version = "1.0";
extra = 0;
type = "mod";
dependencies[] = {"Game", "World", "Mission"};
class defs
{
/*
class imageSets
{
files[]={"fmdbr/gui/imagesets/dayzbr_gui.imageset"};
};
*/
class gameScriptModule
{
value = "";
files[] = {"dayzbr/scripts/scripts/3_Game"};
};
class worldScriptModule
{
value = "";
files[] = {"dayzbr/scripts/scripts/4_World"};
};
class missionScriptModule
{
value = "";
files[] = {"dayzbr/scripts/scripts/5_Mission"};
};
};
};
};
This source diff could not be displayed because it is too large. You can view the blob instead.
modded class IngameHud
{
ref TextWidget m_BrNotificationWidget;
ref WidgetFadeTimer fade_timer_notification;
override void Init( Widget hud_panel_widget )
{
super.Init(hud_panel_widget);
m_BrNotificationWidget = m_HudPanelWidget.FindAnyWidget("BrNotificationWidget");
}
void DisplayNotification(string notification)
{
m_BrNotificationWidget.SetText(notification);
//instant fade in
if(fade_timer_notification)
{
m_FadeTimers.RemoveItem(fade_timer_notification);
}
m_BrNotificationWidget.SetAlpha(1);
m_BrNotificationWidget.Show(true);
//fade out over 10 seconds
fade_timer_notification = new WidgetFadeTimer;
fade_timer_notification.FadeOut(m_BrNotificationWidget, 10, false);
m_FadeTimers.Insert(fade_timer_notification);
}
}
......@@ -28,6 +28,30 @@ modded class MissionGameplay
override void OnInit()
{
//initialize our own custom HUD layout
if ( !m_HudRootWidget )
{
m_HudRootWidget = GetGame().GetWorkspace().CreateWidgets("dayzbr/gui/layouts/br_hud.layout");
m_HudRootWidget.Show(false);
m_Chat.Init(m_HudRootWidget.FindAnyWidget("ChatFrameWidget"));
m_ActionMenu.Init( m_HudRootWidget.FindAnyWidget("ActionsPanel"), TextWidget.Cast( m_HudRootWidget.FindAnyWidget("DefaultActionWidget") ) );
m_Hud.Init( m_HudRootWidget.FindAnyWidget("HudPanel") );
m_MicrophoneIcon = ImageWidget.Cast( m_HudRootWidget.FindAnyWidget("mic") );
// notification window
m_NotificationWidget = new NotificationMessage( m_HudRootWidget );
// chat channel
m_ChatChannelArea = m_HudRootWidget.FindAnyWidget("ChatChannelPanel");
m_ChatChannelText = TextWidget.Cast( m_HudRootWidget.FindAnyWidget("ChatChannelText") );
}
//call base init (this will not create a second layout do to the if check)
super.OnInit();
GetRPCManager().AddRPC( RPC_DAYZBR_NAMESPACE, "SendGlobalMessage", this );
......@@ -54,14 +78,16 @@ modded class MissionGameplay
if(msg.Contains(me.my_round))
{
msg.Replace(me.my_round + ": ","");
m_Chat.Add("Server",msg);
m_Hud.DisplayNotification(msg);
//m_Chat.Add("Server",msg);
}
}
}
else
{
msg.Replace("ALL: ","");
m_Chat.Add("Server",msg);
m_Hud.DisplayNotification(msg);
//m_Chat.Add("Server",msg);
}
}
......@@ -77,8 +103,9 @@ modded class MissionGameplay
PlayerBase player = PlayerBase.Cast( target );
if ( !player ) return;
m_Chat.Add("Server",data.param1);
m_Hud.DisplayNotification(data.param1);
//m_Chat.Add("Server",data.param1);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment