/// <summary> /// Sets the initial value of the "Accepts New Materials" option based on the /// settings. Used for newly built storage. /// </summary> public void SetInitialValue() { acceptsNew = ((DeselectMaterialsPatches.Options?.IgnoreFoodBoxes ?? false) && (refrigerator != null || rationBox != null)) ? NewMaterialSetting.Accepts : NewMaterialSetting.Rejects; Game.Instance.userMenu?.Refresh(gameObject); }
/// <summary> /// Called when the building settings are copied. /// </summary> /// <param name="data">The GameObject with the source settings.</param> private void OnCopySettings(object data) { var other = (data as GameObject).GetComponentSafe <NewMaterialsSettings>(); if (other != null) { acceptsNew = other.acceptsNew; Game.Instance.userMenu?.Refresh(gameObject); } }
/// <summary> /// Fired when the user toggles accept/reject new items. /// </summary> private void OnToggleAcceptsItems() { acceptsNew = (acceptsNew == NewMaterialSetting.Accepts) ? NewMaterialSetting. Rejects : NewMaterialSetting.Accepts; Game.Instance.userMenu?.Refresh(gameObject); }
internal NewMaterialsSettings() { acceptsNew = NewMaterialSetting.Default; }