/// <summary> /// Initializes a new instance of the <see cref="FunctionOverride"/> class. /// </summary> /// <param name="baseName">The name of the base function.</param> /// <param name="nameType">The type of the baseName parameter.</param> /// <param name="baseExtension">The extensions of the base function.</param> /// <param name="newVersion">The new version that the function was introduced in.</param> /// <param name="obsoletionReason">The reason the function has been made obsolete.</param> /// <param name="newReturnType">The new return type.</param> /// <param name="parameterOverrides">The parameter overrides.</param> public FunctionOverride ( [NotNull] string baseName, OverrideNameType nameType, [CanBeNull] string baseExtension, [CanBeNull] Version newVersion, [CanBeNull] string obsoletionReason, [CanBeNull] TypeSignature newReturnType, [NotNull] IReadOnlyList <ParameterOverride> parameterOverrides ) { BaseName = baseName ?? throw new ArgumentNullException(nameof(baseName)); NameType = nameType; BaseExtension = baseExtension; NewVersion = newVersion; ObsoletionReason = obsoletionReason; NewReturnType = newReturnType; ParameterOverrides = parameterOverrides ?? throw new ArgumentNullException(nameof(parameterOverrides)); }
private void RestoreObserverOverrides(Dictionary <NwPlayer, PlayerNameOverride> nameOverrides, OverrideNameType nameType) { foreach ((NwPlayer? targetPlayer, PlayerNameOverride? nameOverride) in nameOverrides) { RestoreNameOverride(targetPlayer, nameOverride, nameType); } }
private void RestoreNameOverride(NwPlayer?targetPlayer, PlayerNameOverride?nameOverride, OverrideNameType nameType) { if (nameOverride == null || targetPlayer == null || !IsValidCreature(targetPlayer.ControlledCreature)) { return; } CNWSCreature?targetCreature = targetPlayer.ControlledCreature; if (targetCreature == null) { return; } if (renameOriginalNames.TryGetValue(targetPlayer, out OriginalNames? originalName)) { if (nameType != OverrideNameType.Original) { targetCreature.m_pStats.m_lsFirstName = originalName.FirstName; targetCreature.m_pStats.m_lsLastName = originalName.LastName; } targetCreature.m_sDisplayName = OverwriteDisplayName ? nameOverride.CharacterNameInternal : "".ToExoString(); } }
private void ApplyNameOverride(NwPlayer?targetPlayer, PlayerNameOverride?nameOverride, OverrideNameType nameType) { if (nameOverride == null || targetPlayer == null || !IsValidCreature(targetPlayer.ControlledCreature)) { return; } CNWSCreature targetCreature = targetPlayer.ControlledCreature !; switch (nameType) { case OverrideNameType.Character: targetCreature.m_pStats.m_lsFirstName = nameOverride.CharacterNameInternal.ToExoLocString(); targetCreature.m_pStats.m_lsLastName = "".ToExoLocString(); break; case OverrideNameType.Player: targetCreature.m_pStats.m_lsFirstName = nameOverride.PlayerNameInternal.ToExoLocString(); targetCreature.m_pStats.m_lsLastName = "".ToExoLocString(); break; } targetCreature.m_sDisplayName = nameOverride.CharacterNameInternal; }
/// <summary> /// Initializes a new instance of the <see cref="RemoveOverride"/> class. /// </summary> /// <param name="name">The name.</param> /// <param name="type">The name type.</param> public RemoveOverride(string name, OverrideNameType type) { Name = name; NameType = type; }