private void UpdatePortInfo(CModulePortInterface _ModulePortInterface) { m_SelectedPortSize = _ModulePortInterface.PortSize; // Set the size UpdateSizeInfo(m_SelectedPortSize, m_SmallPortSprite, m_MediumPortSprite, m_LargePortSprite); }
private void UpdateModuleInfo(CModuleInterface _tempModuleInterface) { // DEBUG: Make a random sentance to describe it string desc = CUtility.LoremIpsum(6, 12, 2, 4, 1); m_SelectedModuleType = _tempModuleInterface.ModuleType; m_SelectedModuleCategory = _tempModuleInterface.ModuleCategory; m_SelectedModuleSize = _tempModuleInterface.ModuleSize; m_SelectedModuleCost = m_SelectedModuleSize == CModuleInterface.ESize.Small ? 400 : 800; // Set the name string name = CUtility.SplitCamelCase(m_SelectedModuleType.ToString()); m_ModuleNameLabel.text = name; // Set the category m_ModuleCategoryLabel.text = m_SelectedModuleCategory.ToString(); // Set the size UpdateSizeInfo(m_SelectedModuleSize, m_SmallModuleSprite, m_MediumModuleSprite, m_LargeModuleSprite); // Set the desc m_ModuleDescLabel.text = desc; // Set the cost m_ModuleCostLabel.text = m_SelectedModuleCost.ToString() + "N"; }
private void UpdateSizeInfo(CModuleInterface.ESize _ModuleSize, UISprite _Small, UISprite _Medium, UISprite _Large) { // Reset all colors to default _Small.color = Color.green; _Medium.color = Color.yellow; _Large.color = Color.red; if (_ModuleSize == CModuleInterface.ESize.Small) { _Medium.color = Color.gray; _Large.color = Color.gray; } else if (_ModuleSize == CModuleInterface.ESize.Medium) { _Small.color = Color.gray; _Large.color = Color.gray; } else if (_ModuleSize == CModuleInterface.ESize.Large) { _Small.color = Color.gray; _Medium.color = Color.gray; } }