rstrstrst
This commit is contained in:
parent
ae8f2b2235
commit
ee0f2ff021
|
@ -15,8 +15,8 @@ internal class Message {
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string Text { get; init; }
|
public string Text { get; init; }
|
||||||
|
|
||||||
public int PositiveVotes { get; init; }
|
public int PositiveVotes { get; set; }
|
||||||
public int NegativeVotes { get; init; }
|
public int NegativeVotes { get; set; }
|
||||||
public int UserVote { get; set; }
|
public int UserVote { get; set; }
|
||||||
|
|
||||||
internal Vector3 Position => new(this.X, this.Y, this.Z);
|
internal Vector3 Position => new(this.X, this.Y, this.Z);
|
||||||
|
|
|
@ -58,14 +58,14 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DalamudPackager" Version="2.1.8" />
|
<PackageReference Include="DalamudPackager" Version="2.1.8"/>
|
||||||
<PackageReference Include="Fody" Version="6.6.3" PrivateAssets="all" />
|
<PackageReference Include="Fody" Version="6.6.3" PrivateAssets="all"/>
|
||||||
<PackageReference Include="Resourcer.Fody" Version="1.8.0" />
|
<PackageReference Include="Resourcer.Fody" Version="1.8.0"/>
|
||||||
<PackageReference Include="YamlDotNet" Version="12.0.0" />
|
<PackageReference Include="YamlDotNet" Version="12.0.0"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="../server/packs/*.yaml" LinkBase="packs" />
|
<EmbeddedResource Include="../server/packs/elden-ring.yaml" LinkBase="packs"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -10,9 +10,9 @@ public class Pack {
|
||||||
.WithNamingConvention(UnderscoredNamingConvention.Instance)
|
.WithNamingConvention(UnderscoredNamingConvention.Instance)
|
||||||
.Build();
|
.Build();
|
||||||
return new[] {
|
return new[] {
|
||||||
"ffxiv",
|
// "ffxiv",
|
||||||
"elden-ring",
|
"elden-ring",
|
||||||
"dark-souls",
|
// "dark-souls",
|
||||||
}
|
}
|
||||||
.Select(name => {
|
.Select(name => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -32,7 +32,7 @@ internal class MessageList : ITab {
|
||||||
ImGui.TreePush();
|
ImGui.TreePush();
|
||||||
ImGui.TextUnformatted($"Location: {territoryName}");
|
ImGui.TextUnformatted($"Location: {territoryName}");
|
||||||
var appraisals = Math.Max(0, message.PositiveVotes - message.NegativeVotes);
|
var appraisals = Math.Max(0, message.PositiveVotes - message.NegativeVotes);
|
||||||
ImGui.TextUnformatted($"Appraisals: {appraisals} ({message.PositiveVotes} - {message.NegativeVotes}");
|
ImGui.TextUnformatted($"Appraisals: {appraisals:N0} ({message.PositiveVotes:N0} - {message.NegativeVotes:N0})");
|
||||||
if (ImGui.Button($"Delete##{message.Id}")) {
|
if (ImGui.Button($"Delete##{message.Id}")) {
|
||||||
this.Delete(message.Id);
|
this.Delete(message.Id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,25 @@ internal class Viewer {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (resp.IsSuccessStatusCode) {
|
if (resp.IsSuccessStatusCode) {
|
||||||
|
var oldWay = message.UserVote;
|
||||||
|
switch (oldWay) {
|
||||||
|
case 1:
|
||||||
|
message.PositiveVotes -= 1;
|
||||||
|
break;
|
||||||
|
case -1:
|
||||||
|
message.NegativeVotes -= 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (way) {
|
||||||
|
case 1:
|
||||||
|
message.PositiveVotes += 1;
|
||||||
|
break;
|
||||||
|
case -1:
|
||||||
|
message.NegativeVotes += 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
message.UserVote = way;
|
message.UserVote = way;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user