SSTUTools.SSTUModInterop.updatePartResourceDisplay C# (CSharp) Méthode

updatePartResourceDisplay() public static méthode

public static updatePartResourceDisplay ( Part part ) : void
part Part
Résultat void
        public static void updatePartResourceDisplay(Part part)
        {
            if (HighLogic.LoadedSceneIsEditor && EditorLogic.fetch == null) { return; }
            if (HighLogic.LoadedSceneIsFlight && FlightDriver.fetch == null) { return; }
            try
            {
                if (UIPartActionController.Instance != null)
                {
                    UIPartActionWindow window = UIPartActionController.Instance.GetItem(part);
                    if (window != null) { window.displayDirty = true; }
                }
            }
            catch (Exception e)
            {
                MonoBehaviour.print("ERROR: Caught exception while updating part resource display: " + e.Message);
            }
        }

Usage Example

Exemple #1
0
        private void updateResourceAmounts(double mult)
        {
            int len = part.Resources.Count;

            for (int i = 0; i < len; i++)
            {
                part.Resources[i].maxAmount *= mult;
            }
            SSTUModInterop.updatePartResourceDisplay(part);
        }
All Usage Examples Of SSTUTools.SSTUModInterop::updatePartResourceDisplay