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

◆ UpdateColors()

void ScriptedWidgetEventHandler::UpdateColors ( )
inlineprivate

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

698 {
699 float alpha = 1;
700 int maxPlayers = m_ServerData.m_MaxPlayers;
701 int whiteColor = ARGBF(1, 1, 1, 1);
702 int populationColor = whiteColor;
703 int populationOutline = 1;
704
705 if (IsOnline())
706 {
707 if (maxPlayers > 0)
708 {
709 int population = m_ServerData.m_CurrentNumberPlayers;
710 float pop_percentage = population / maxPlayers;
711
712 if (pop_percentage >= 1)
713 {
714 populationColor = ARGBF(1, 1, 0, 0);
715 }
716 else if (pop_percentage >= 0.8)
717 {
718 populationColor = ARGBF(1, 1, 0.5, 0);
719 }
720 }
721 }
722 else
723 {
724 alpha = 0.5;
725 populationOutline = 0;
726
727 m_ServerPing.SetColor(whiteColor);
728 }
729
730 m_ServerTime.Show(IsOnline());
731 m_ServerName.SetColor(whiteColor);
732 m_ServerName.SetAlpha(alpha);
733 m_ServerPopulation.SetBold(IsOnline());
734 m_ServerPopulation.SetColor(populationColor);
735 m_ServerPopulation.SetOutline(populationOutline);
736 m_ServerPopulation.SetAlpha(alpha);
737 m_ServerSlots.SetAlpha(alpha);
738 m_ServerPing.SetAlpha(alpha);
739 m_Root.SetAlpha(alpha);
740 }
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().