private static void ResetShoutout(SaveSlot saveslot, int index) { var defaultValue = MhwDefaultValues.GetDefaultShoutoutValue(saveslot.SaveSlotIndex); saveslot.Native.Shoutouts[index].Length = 0; // Might not be needed. saveslot.Native.Shoutouts[index].Value = defaultValue; }
public void Reset() { var defaultValue = MhwDefaultValues.GetDefaultShoutoutValue(saveSlot.SaveSlotIndex); saveSlot.Native.Shoutouts[index].Length = 0; saveSlot.Native.Shoutouts[index].Value = defaultValue; UpdateValue(); }
private void UpdateValue() { var defaultValue = MhwDefaultValues.GetDefaultShoutoutValue(saveSlot.SaveSlotIndex); var value = saveSlot.Native.Shoutouts[index].Value; if (value.SequenceEqual(defaultValue)) { Value = "(default value)"; } else { var len = saveSlot.Native.Shoutouts[index].Length; Value = Encoding.UTF8.GetString(value.Take(len).ToArray()); } }
private static string ShoutoutToString(SaveSlot saveslot, int index) { var defaultValue = MhwDefaultValues.GetDefaultShoutoutValue(saveslot.SaveSlotIndex); string str; if (saveslot.Native.Shoutouts[index].Value.SequenceEqual(defaultValue)) { str = "(default value)"; } else { str = Encoding.UTF8.GetString(saveslot.Native.Shoutouts[index].Value); } return($"{index + 1} - {str}"); }