RealFuels.Tanks.ModuleFuelTanks.MarkWindowDirty C# (CSharp) Method

MarkWindowDirty() private method

private MarkWindowDirty ( ) : void
return void
        internal void MarkWindowDirty()
        {
            UIPartActionWindow action_window;
            if (UIPartActionController.Instance == null) {
                // no controller means no window to mark dirty
                return;
            }
            action_window = UIPartActionController.Instance.GetItem(part);
            if (action_window == null) {
                return;
            }
            action_window.displayDirty = true;
        }

Usage Example

Esempio n. 1
0
        void UpdateTank(FuelTank tank)
        {
            if (GUILayout.Button("Update", GUILayout.Width(53)))
            {
                string trimmed = tank.maxAmountExpression.Trim();

                if (trimmed == "")
                {
                    tank.maxAmount = 0;
                    //Debug.LogWarning ("[MFT] Removing tank as empty input " + tank.name + " amount: " + tank.maxAmountExpression ?? "null");
                }
                else
                {
                    double tmp;
                    if (double.TryParse(trimmed, out tmp))
                    {
                        tank.maxAmount = tmp;

                        if (tmp != 0)
                        {
                            tank.amount = tank.fillable ? tank.maxAmount : 0;

                            // Need to round-trip the value
                            tank.maxAmountExpression = tank.maxAmount.ToString();
                            //Debug.LogWarning ("[MFT] Updating maxAmount " + tank.name + " amount: " + tank.maxAmountExpression ?? "null");
                        }
                    }
                }
                GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship);
                tank_module.MarkWindowDirty();
            }
        }