Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

HintModule #2728

Closed
wants to merge 7 commits into from
Closed

HintModule #2728

wants to merge 7 commits into from

Conversation

theDevJade
Copy link
Contributor

Added a hint module, allowing without any modifications to any plugins, multiple hints to be displayed concurrently. Supports all rich text tags and uses patches, can be enabled and disabled at will. Utilizes RueI code (license permits)

# Conflicts:
#	Exiled.Events/Extra/CoroutineManager.cs
#	Exiled.Events/Extra/Events/EventGroup.cs
#	Exiled.Events/Extra/Events/EventScanner.cs
#	Exiled.Events/Extra/FeatureGroup.cs
@github-actions github-actions bot added regarding-api An issue or PR targeting the Exiled API project CustomModules An issue or PR targeting the Exiled Custom Modules project labels Jul 18, 2024
@xNexusACS xNexusACS added the enhancement New feature or request label Jul 18, 2024
@iamalexrouse
Copy link
Contributor

... If this is allowed to be tested, I'm gonna throw.

The main issue is that it doesn't match the styling of the rest of the project structure.

this.Content = content;
this.Duration = duration;
this.Show = show;
this.Parameters = parameters ?? new HintParameter[] { new StringHintParameter(this.Content) };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary here

get => parameters ??= new HintParameter[] { new StringHintParameter(Content) };
set => parameters = value;
get => this.parameters ??= new HintParameter[] { new StringHintParameter(this.Content) };
set => this.parameters = value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -87,6 +87,6 @@ public HintParameter[] Parameters
/// Returns the hint in a human-readable format.
/// </summary>
/// <returns>A string containing hint-related data.</returns>
public override string ToString() => $"({Content}) {Duration}";
public override string ToString() => $"({this.Content}) {this.Duration}";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

return;
TextHint hint = new TextHint(hintText, [new StringHintParameter(hintText)], null);
connectionToClient.Send(new HintMessage(hint));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to leave a blank line after the returns and the new InvalidOperationException

Tuple<Hint, List<Player>, long> item = hints[se];
if (!item.Item2.Contains(keyValuePair.Key))
continue;
if ((item.Item3 - DateTimeOffset.UtcNow.ToUnixTimeSeconds()) > item.Item1.Duration)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here for the continue up here

using RueI.Elements;
using RueI.Parsing;
using RueI.Parsing.Records;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this should be with the other ones, also why using 2 Hints Namespaces

<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resources?

public override void OnEnabled()
{
harmony = new Harmony("exiled.hints");
if (CustomHints.OnEnabled.BoundDelegates.ContainsKey(this)) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return under the if

private void OnModuleDisable(ModuleInfo info)
{
harmony.UnpatchAll();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

harmony.UnpatchAll(harmony.Id)

// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the assemblyinfo is not needed here.

Copy link
Contributor

@ITeMbI4 ITeMbI4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you integrate a plugin to the exiled? I disagree.
In my opinion, Exiled don't need this. If someone wants custom hints, he will download a plugin.

@@ -282,7 +282,7 @@ private set
/// <summary>
/// Gets the <see cref="Hints.HintDisplay"/> of the player.
/// </summary>
public HintDisplay HintDisplay { get; private set; }
public Hints.HintDisplay HintDisplay { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to do this?

@IkaOverride
Copy link
Contributor

IkaOverride commented Jul 18, 2024

We got a plugin in Exiled before GTA VI ‼️🔥

Seriously, this is a bad idea. This is just a copy and paste of Ruei, what's the point. And you can just use Ruei in this case. Rue even said no to take any part of their plugin, but you did it anyway.

You said you were just "taking the parser of Ruei" but this is a full copy and paste, what is this. This is the worst idea to implement into Exiled

@6hundred9
Copy link
Member

@Ruemena lmao

@xNexusACS xNexusACS closed this Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CustomModules An issue or PR targeting the Exiled Custom Modules project enhancement New feature or request regarding-api An issue or PR targeting the Exiled API project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants