private void _InitializeGameUI() { m_lastShownLogicTime = new Core.Common.GameLogicTime(-1); m_lastShownSubscribers = 0; m_lastShownMoney = 0; m_lastShownHealth = 0; m_lastShownMental = 0; lbliStreamingStatus.Text = m_kTextMessageNoStreaming; lbliStreamingStatus.BackColor = m_kColorNoStreaming; m_lastShownIsStreaming = false; m_inventoryUIWaitingQueue = new ConcurrentQueue <InventoryListItemEntry>(); _InitializeLogSystem(); }
/// <summary> /// Initialize default state /// </summary> public MetaLogicState() { NextPayTime = Contents.Meta.MetaConstants.kChannelPayStart; }
private void _GameUIUpdateFunc() { lock (m_uiUpdateStateLock) { if (m_isUIUpdating) { return; } m_isUIUpdating = true; } try { Core.Common.GameLogicTime currentGameTime = m_game.WorldState.LogicTime; if (currentGameTime != m_lastShownLogicTime) { lbliCurrentTime.Text = string.Format("{0}일째 ({1}) {2:00}:{3:00}", currentGameTime.Days + 1, currentGameTime.DayOfWeek, currentGameTime.Hours, currentGameTime.Minutes); m_lastShownLogicTime.Set(currentGameTime); } long currentSubscriberNumber = m_game.MyChannel.SubscriberNumber; if (currentSubscriberNumber != m_lastShownSubscribers) { lbliSubscribers.Text = currentSubscriberNumber.ToString(); m_lastShownSubscribers = currentSubscriberNumber; } long currentMoney = m_game.Protagonist.CurrentMoney; if (currentMoney != m_lastShownMoney) { lbliMoney.Text = currentMoney.ToString(); m_lastShownMoney = currentMoney; } int currentShowingHealth = (int)(m_game.Protagonist.HealthState * 100.0); if (currentShowingHealth != m_lastShownHealth) { lbliHealth.Text = currentShowingHealth.ToString(); m_lastShownHealth = currentShowingHealth; } int currentShowingMental = (int)(m_game.Protagonist.MentalState * 100.0); if (currentShowingMental != m_lastShownMental) { lbliMental.Text = currentShowingMental.ToString(); m_lastShownMental = currentShowingMental; } bool isStreaming = (m_game.MyChannel.CurrentStreaming != null); if (isStreaming != m_lastShownIsStreaming) { if (isStreaming) { lbliStreamingStatus.Text = m_kTextMessageStreaming; lbliStreamingStatus.BackColor = m_kColorStreaming; } else { lbliStreamingStatus.Text = m_kTextMessageNoStreaming; lbliStreamingStatus.BackColor = m_kColorNoStreaming; } m_lastShownIsStreaming = isStreaming; } InventoryListItemEntry queuedItem; while (m_inventoryUIWaitingQueue.TryDequeue(out queuedItem)) { lstMyItems.Items.Add(queuedItem); } } finally { lock (m_uiUpdateStateLock) { m_isUIUpdating = false; } } }