private void UpdatePortInfo(CModulePortInterface _ModulePortInterface) { m_SelectedPortSize = _ModulePortInterface.PortSize; // Set the size UpdateSizeInfo(m_SelectedPortSize, m_SmallPortSprite, m_MediumPortSprite, m_LargePortSprite); }
private void OnDUIBuildButtonPressed() { CModulePortInterface currentPort = m_DUIModuleCreationRoot.CurrentPortSelected.GetComponent <CModulePortInterface>(); CShipNaniteSystem sns = CGameShips.Ship.GetComponent <CShipNaniteSystem>(); if (sns.IsEnoughNanites(m_DUIModuleCreationRoot.SelectedModuleCost) || m_Debug) { // Minus the amount if (!m_Debug) { sns.DeductNanites(m_DUIModuleCreationRoot.SelectedModuleCost); } // Debug: Create the module instantly currentPort.CreateModule(m_DUIModuleCreationRoot.SelectedModuleType); // Deactivate the UI m_DUIActive.Set(false); } }
private void OpenDui(GameObject _InteractableObject) { if (_InteractableObject != null && !IsDUIActive && !m_Transitioning) { // Only conserned with selecting module ports CModulePortInterface mpi = _InteractableObject.GetComponent <CModulePortInterface>(); if (mpi != null) { // Register movement events CUserInput.SubscribeClientInputChange(CUserInput.EInput.MoveGround_Forward, OnPlayerMovement); CUserInput.SubscribeClientInputChange(CUserInput.EInput.MoveGround_Backwards, OnPlayerMovement); CUserInput.SubscribeClientInputChange(CUserInput.EInput.MoveGround_StrafeLeft, OnPlayerMovement); CUserInput.SubscribeClientInputChange(CUserInput.EInput.MoveGround_StrafeRight, OnPlayerMovement); CUserInput.SubscribeClientInputChange(CUserInput.EInput.MoveGround_Jump, OnPlayerMovement); // Change the port selected on the UI m_DUIModuleCreationRoot.SetSelectedPort(_InteractableObject.GetComponent <CNetworkView>().ViewId); // Make the UI active m_DUIActive.Set(true); } } }