Exemplo n.º 1
0
        private void UpdateSelectedObject()
        {
            lock (instanceMutationLock) {
                if (previouslySelectedLGO != null && previouslySelectedLGO.GroundingGeometryEntity != null)
                {
                    Entity prevEntity = currentLevel.GetEntityRepresentation(previouslySelectedLGO.GroundingGeometryEntity);
                    if (prevEntity is PresetMovementEntity)
                    {
                        ((PresetMovementEntity)prevEntity).Unpause();
                    }
                }
                LevelGameObject previousGO = previouslySelectedLGO;
                LevelGameObject selectedGO = objectList.SelectedItem as LevelGameObject;
                if (selectedGO == null)
                {
                    curObjDescTextBox.Text = String.Empty;
                    SetGOControlEnabledState(false);
                    previouslySelectedLGO = null;
                    return;
                }
                if (selectedGO.GroundingGeometryEntity != null && !selectedGO.GroundingGeometryEntity.IsStatic)
                {
                    PresetMovementEntity pme = (PresetMovementEntity)currentLevel.GetEntityRepresentation(selectedGO.GroundingGeometryEntity);
                    pme.Pause(selectedGO.GroundingGeometryEntity.InitialMovementStep);
                }

                previouslySelectedLGO  = selectedGO;
                curObjDescTextBox.Text = selectedGO.LongDescription;
                SetGOControlEnabledState(true);
                bindButton.Text            = selectedGO.GroundingGeometryEntity == null ? "Bind" : "Unbind";
                simpleBindingCheck.Checked = selectedGO.UseSimpleGrounding;

                UpdateCustomPropertiesBox(previousGO, selectedGO);
            }
        }