DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdateColors()

void ScriptedWidgetEventHandler::UpdateColors ( )
inlineprivate

См. определение в файле ServerBrowserEntry.c строка 701

702 {
703 float alpha = 1;
704 int maxPlayers = m_ServerData.m_MaxPlayers;
705 int whiteColor = ARGBF(1, 1, 1, 1);
706 int populationColor = whiteColor;
707 int populationOutline = 1;
708
709 if (IsOnline())
710 {
711 if (maxPlayers > 0)
712 {
713 int population = m_ServerData.m_CurrentNumberPlayers;
714 float pop_percentage = population / maxPlayers;
715
716 if (pop_percentage >= 1)
717 {
718 populationColor = ARGBF(1, 1, 0, 0);
719 }
720 else if (pop_percentage >= 0.8)
721 {
722 populationColor = ARGBF(1, 1, 0.5, 0);
723 }
724 }
725 }
726 else
727 {
728 alpha = 0.5;
729 populationOutline = 0;
730
731 m_ServerPing.SetColor(whiteColor);
732 }
733
734 m_ServerTime.Show(IsOnline());
735 m_ServerName.SetColor(whiteColor);
736 m_ServerName.SetAlpha(alpha);
737 m_ServerPopulation.SetBold(IsOnline());
738 m_ServerPopulation.SetColor(populationColor);
739 m_ServerPopulation.SetOutline(populationOutline);
740 m_ServerPopulation.SetAlpha(alpha);
741 m_ServerSlots.SetAlpha(alpha);
742 m_ServerPing.SetAlpha(alpha);
743 m_Root.SetAlpha(alpha);
744 }
TextWidget m_ServerPopulation
Определения ServerBrowserEntry.c:8
Widget m_Root
Определения SizeToChild.c:9
TextWidget m_ServerSlots
Определения ServerBrowserEntry.c:9
ImageWidget m_ServerTime
Определения ServerBrowserEntry.c:11
TextWidget m_ServerName
Определения ServerBrowserEntry.c:7
TextWidget m_ServerPing
Определения ServerBrowserEntry.c:10
ref GetServersResultRow m_ServerData
Определения ServerBrowserEntry.c:34
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Определения proto.c:332

Перекрестные ссылки ARGBF(), IsOnline(), m_Root, m_ServerData, m_ServerName, m_ServerPing, m_ServerPopulation, m_ServerSlots и m_ServerTime.

Используется в Darken(), Lighten() и Preview().