Compare commits
No commits in common. "dev" and "main" have entirely different histories.
@ -12,7 +12,7 @@ public interface IWhen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class WhenNodeDeserialiser : INodeDeserializer {
|
public class WhenNodeDeserialiser : INodeDeserializer {
|
||||||
public bool Deserialize(IParser reader, Type expectedType, Func<IParser, Type, object?> nestedObjectDeserializer, out object? value, ObjectDeserializer rootDeserializer) {
|
public bool Deserialize(IParser reader, Type expectedType, Func<IParser, Type, object?> nestedObjectDeserializer, out object? value) {
|
||||||
if (expectedType != typeof(IWhen)) {
|
if (expectedType != typeof(IWhen)) {
|
||||||
value = null;
|
value = null;
|
||||||
return false;
|
return false;
|
||||||
@ -27,7 +27,6 @@ public class WhenNodeDeserialiser : INodeDeserializer {
|
|||||||
value = name.Value switch {
|
value = name.Value switch {
|
||||||
"quest" => nestedObjectDeserializer(reader, typeof(WhenQuest)),
|
"quest" => nestedObjectDeserializer(reader, typeof(WhenQuest)),
|
||||||
"level" => nestedObjectDeserializer(reader, typeof(WhenLevel)),
|
"level" => nestedObjectDeserializer(reader, typeof(WhenLevel)),
|
||||||
"sex" => nestedObjectDeserializer(reader, typeof(WhenSex)),
|
|
||||||
_ => throw new YamlException($"invalid when: unknown type \"{name.Value}\""),
|
_ => throw new YamlException($"invalid when: unknown type \"{name.Value}\""),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
using YamlDotNet.Serialization;
|
||||||
|
|
||||||
namespace TimePasses.Model;
|
namespace TimePasses.Model;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
@ -33,7 +33,7 @@ internal class ReplacementTextConverter : IYamlTypeConverter {
|
|||||||
return type == typeof(ReplacementText);
|
return type == typeof(ReplacementText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object? ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer) {
|
public object? ReadYaml(IParser parser, Type type) {
|
||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
if (parser.Current is Scalar) {
|
if (parser.Current is Scalar) {
|
||||||
AddItem();
|
AddItem();
|
||||||
@ -60,7 +60,7 @@ internal class ReplacementTextConverter : IYamlTypeConverter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer) {
|
public void WriteYaml(IEmitter emitter, object? value, Type type) {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class WhenLevelConverter : IYamlTypeConverter {
|
|||||||
return type == typeof(WhenLevel);
|
return type == typeof(WhenLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer) {
|
public object ReadYaml(IParser parser, Type type) {
|
||||||
parser.Consume<MappingStart>();
|
parser.Consume<MappingStart>();
|
||||||
|
|
||||||
ReplacementText? text = null;
|
ReplacementText? text = null;
|
||||||
@ -45,7 +45,7 @@ public class WhenLevelConverter : IYamlTypeConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key.Value == "text") {
|
if (key.Value == "text") {
|
||||||
text = (ReplacementText?) ReplacementTextConverter.Instance.ReadYaml(parser, type, rootDeserializer);
|
text = (ReplacementText?) ReplacementTextConverter.Instance.ReadYaml(parser, type);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ public class WhenLevelConverter : IYamlTypeConverter {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer) {
|
public void WriteYaml(IEmitter emitter, object? value, Type type) {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
using Dalamud.Game.ClientState.Objects.Enums;
|
|
||||||
using YamlDotNet.Serialization;
|
|
||||||
|
|
||||||
namespace TimePasses.Model;
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public class WhenSex : IWhen {
|
|
||||||
[YamlMember(Alias = "is")]
|
|
||||||
public Sex Sex { get; init; }
|
|
||||||
public ReplacementText Text { get; init; }
|
|
||||||
public bool Slowly { get; init; }
|
|
||||||
|
|
||||||
public bool IsValid(Plugin plugin) {
|
|
||||||
if (plugin.ClientState.LocalPlayer is not { } player) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return player.Customize[(int) CustomizeIndex.Gender] == (byte) this.Sex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public enum Sex : byte {
|
|
||||||
Female = 1,
|
|
||||||
Male = 0,
|
|
||||||
}
|
|
@ -39,7 +39,7 @@ public sealed class Plugin : IDalamudPlugin {
|
|||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
private static class Signatures {
|
private static class Signatures {
|
||||||
internal const string GetBalloonRow = "E8 ?? ?? ?? ?? 48 85 C0 0F 84 ?? ?? ?? ?? 48 89 B4 24 ?? ?? ?? ?? 48 8B C8";
|
internal const string GetBalloonRow = "E8 ?? ?? ?? ?? 48 85 C0 74 4D 48 89 5C 24";
|
||||||
}
|
}
|
||||||
|
|
||||||
private delegate nint GetBalloonRowDelegate(uint rowId);
|
private delegate nint GetBalloonRowDelegate(uint rowId);
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DalamudPackager" Version="2.1.13" />
|
<PackageReference Include="DalamudPackager" Version="2.1.12" />
|
||||||
<PackageReference Include="YamlDotNet" Version="16.0.0" />
|
<PackageReference Include="YamlDotNet" Version="15.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
12
packages.lock.json
Executable file → Normal file
12
packages.lock.json
Executable file → Normal file
@ -4,15 +4,15 @@
|
|||||||
"net8.0-windows7.0": {
|
"net8.0-windows7.0": {
|
||||||
"DalamudPackager": {
|
"DalamudPackager": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.1.13, )",
|
"requested": "[2.1.12, )",
|
||||||
"resolved": "2.1.13",
|
"resolved": "2.1.12",
|
||||||
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
|
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
|
||||||
},
|
},
|
||||||
"YamlDotNet": {
|
"YamlDotNet": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[16.0.0, )",
|
"requested": "[15.3.0, )",
|
||||||
"resolved": "16.0.0",
|
"resolved": "15.3.0",
|
||||||
"contentHash": "kZ4jR5ltFhnjaUqK9x81zXRIUTH4PTXTTEmJDNQdkDLQhcv+2Nl19r0dCSvPW1mstOYBfXTnjdieRbUO6gHMDw=="
|
"contentHash": "F93japYa9YrJ59AZGhgdaUGHN7ITJ55FBBg/D/8C0BDgahv/rQD6MOSwHxOJJpon1kYyslVbeBrQ2wcJhox01w=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,9 @@ definitions:
|
|||||||
# # id (uint) (required)
|
# # id (uint) (required)
|
||||||
# # This is the ID from the Balloon excel sheet
|
# # This is the ID from the Balloon excel sheet
|
||||||
# - id: 123
|
# - id: 123
|
||||||
# # text (string/list) (optional)
|
# # text (string) (optional)
|
||||||
# # This text will be used instead of the normal text if there either are
|
# # This text will be used instead of the normal text if there either are
|
||||||
# # no entries in the "when" section or if none of them match.
|
# # no entries in the "when" section or if none of them match.
|
||||||
# # If this is a list, an entry will be chosen at random each time the
|
|
||||||
# # balloon appears.
|
|
||||||
# text: |-
|
# text: |-
|
||||||
# It's not so bad
|
# It's not so bad
|
||||||
# being green.
|
# being green.
|
||||||
@ -37,12 +35,10 @@ definitions:
|
|||||||
# # Inside the level object you should specify the comparator and the
|
# # Inside the level object you should specify the comparator and the
|
||||||
# # text. The comparator can be greaterThan, lessThan, or equalTo.
|
# # text. The comparator can be greaterThan, lessThan, or equalTo.
|
||||||
# greaterThan: 49
|
# greaterThan: 49
|
||||||
# # text (string/list) (required)
|
# # text (string) (required)
|
||||||
# text:
|
# text: |-
|
||||||
# - |-
|
|
||||||
# You look like you've
|
# You look like you've
|
||||||
# got some experience.
|
# got some experience.
|
||||||
# - Please don't hurt me!
|
|
||||||
# # quest (list object)
|
# # quest (list object)
|
||||||
# # This when item specifies text that should be displayed depending on
|
# # This when item specifies text that should be displayed depending on
|
||||||
# # the status of a quest.
|
# # the status of a quest.
|
||||||
@ -51,7 +47,7 @@ definitions:
|
|||||||
# # This is the quest ID, visible in the excel sheets or Garland
|
# # This is the quest ID, visible in the excel sheets or Garland
|
||||||
# # Tools.
|
# # Tools.
|
||||||
# id: *patch2.0
|
# id: *patch2.0
|
||||||
# # text (string/list) (required)
|
# # text (string) (required)
|
||||||
# text: |-
|
# text: |-
|
||||||
# I can't believe you made
|
# I can't believe you made
|
||||||
# it out of Porta Decumana!
|
# it out of Porta Decumana!
|
||||||
|
Loading…
Reference in New Issue
Block a user