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

◆ UpdateColors()

void ScriptedWidgetEventHandler::UpdateColors ( )
inlineprivate

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

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