mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
build: v5.2.3.5
This commit is contained in:
parent
def1545d8a
commit
1b216bf618
5 changed files with 119 additions and 67 deletions
|
|
@ -14,10 +14,10 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="Feature">
|
<PropertyGroup Label="Feature">
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>5.2.3.3</AssemblyVersion>
|
<AssemblyVersion>5.2.3.5</AssemblyVersion>
|
||||||
<FileVersion>5.2.3.3</FileVersion>
|
<FileVersion>5.2.3.5</FileVersion>
|
||||||
<Description>XIVLauncher addon injection</Description>
|
<Description>XIVLauncher addon injection</Description>
|
||||||
<Version>5.2.3.3</Version>
|
<Version>5.2.3.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
<DocumentationFile></DocumentationFile>
|
<DocumentationFile></DocumentationFile>
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="Feature">
|
<PropertyGroup Label="Feature">
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>5.2.3.3</AssemblyVersion>
|
<AssemblyVersion>5.2.3.5</AssemblyVersion>
|
||||||
<Version>5.2.3.3</Version>
|
<Version>5.2.3.5</Version>
|
||||||
<FileVersion>5.2.3.3</FileVersion>
|
<FileVersion>5.2.3.5</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup Label="Resources">
|
<ItemGroup Label="Resources">
|
||||||
<None Include="$(SolutionDir)/Resources/**/*" CopyToOutputDirectory="PreserveNewest" Visible="false" />
|
<None Include="$(SolutionDir)/Resources/**/*" CopyToOutputDirectory="PreserveNewest" Visible="false" />
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,13 @@ namespace Dalamud
|
||||||
HelpMessage = "ImGui DEBUG",
|
HelpMessage = "ImGui DEBUG",
|
||||||
ShowInHelp = false
|
ShowInHelp = false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Only april fools 2021
|
||||||
|
this.dalamud.CommandManager.AddHandler("/dontfoolme", new CommandInfo(this.OnDisableAprilFools2021Command)
|
||||||
|
{
|
||||||
|
HelpMessage = "Disable April Fools 2021",
|
||||||
|
ShowInHelp = true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUnloadCommand(string command, string arguments)
|
private void OnUnloadCommand(string command, string arguments)
|
||||||
|
|
@ -248,5 +255,11 @@ namespace Dalamud
|
||||||
private void OnOpenSettingsCommand(string command, string arguments) {
|
private void OnOpenSettingsCommand(string command, string arguments) {
|
||||||
this.dalamud.DalamudUi.OpenSettings();
|
this.dalamud.DalamudUi.OpenSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDisableAprilFools2021Command(string command, string arguments)
|
||||||
|
{
|
||||||
|
if (this.dalamud.Fools != null)
|
||||||
|
this.dalamud.Fools.IsEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Dalamud
|
||||||
private readonly Stopwatch tippyFrameTimer = new Stopwatch();
|
private readonly Stopwatch tippyFrameTimer = new Stopwatch();
|
||||||
private readonly Stopwatch tippyLogicTimer = new Stopwatch();
|
private readonly Stopwatch tippyLogicTimer = new Stopwatch();
|
||||||
|
|
||||||
public bool IsEnabled = true;
|
public bool IsEnabled = false;
|
||||||
|
|
||||||
public Fools2021(Dalamud dalamud)
|
public Fools2021(Dalamud dalamud)
|
||||||
{
|
{
|
||||||
|
|
@ -40,10 +40,13 @@ namespace Dalamud
|
||||||
|
|
||||||
this.dalamud.ClientState.OnLogin += (sender, args) => {
|
this.dalamud.ClientState.OnLogin += (sender, args) => {
|
||||||
this.isTippyDrawing = true;
|
this.isTippyDrawing = true;
|
||||||
|
this.IsEnabled = true;
|
||||||
this.tippyLogicTimer.Restart();
|
this.tippyLogicTimer.Restart();
|
||||||
};
|
};
|
||||||
this.dalamud.ClientState.OnLogout += (sender, args) => {
|
this.dalamud.ClientState.OnLogout += (sender, args) => {
|
||||||
this.isTippyDrawing = false;
|
this.isTippyDrawing = false;
|
||||||
|
this.frames = 0;
|
||||||
|
this.IsEnabled = false;
|
||||||
|
|
||||||
this.tippyText = string.Empty;
|
this.tippyText = string.Empty;
|
||||||
this.tippyState = TippyState.BeforeIntro;
|
this.tippyState = TippyState.BeforeIntro;
|
||||||
|
|
@ -65,25 +68,44 @@ namespace Dalamud
|
||||||
if (!IsEnabled)
|
if (!IsEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.frames < 2000)
|
try {
|
||||||
{
|
/*
|
||||||
ImGui.SetNextWindowSize(new Vector2(this.welcomeTex.Width, this.welcomeTex.Height) * ImGui.GetIO().FontGlobalScale * WelcomeTexScale, ImGuiCond.Always);
|
if (this.frames < 1900) {
|
||||||
|
|
||||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0f, 0f));
|
var windowSize = new Vector2(this.welcomeTex.Width, this.welcomeTex.Height) *
|
||||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0f);
|
ImGui.GetIO().FontGlobalScale *
|
||||||
|
WelcomeTexScale;
|
||||||
|
ImGui.SetNextWindowSize(windowSize, ImGuiCond.Always);
|
||||||
|
|
||||||
ImGui.Begin("Please wait...",
|
var screenSize = ImGui.GetIO().DisplaySize;
|
||||||
ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoTitleBar);
|
ImGui.SetNextWindowPos(new Vector2((screenSize.X / 2) - windowSize.X / 2, (screenSize.Y / 2) - windowSize.Y / 2), ImGuiCond.Always);
|
||||||
|
|
||||||
ImGui.Image(this.welcomeTex.ImGuiHandle, new Vector2(this.welcomeTex.Width, this.welcomeTex.Height) * ImGui.GetIO().FontGlobalScale * WelcomeTexScale);
|
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0f, 0f));
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0f);
|
||||||
|
|
||||||
ImGui.End();
|
ImGui.Begin("Please wait...",
|
||||||
|
ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar |
|
||||||
|
ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoCollapse |
|
||||||
|
ImGuiWindowFlags.NoTitleBar);
|
||||||
|
|
||||||
ImGui.PopStyleVar(2);
|
ImGui.Image(this.welcomeTex.ImGuiHandle,
|
||||||
|
new Vector2(this.welcomeTex.Width, this.welcomeTex.Height) *
|
||||||
|
ImGui.GetIO().FontGlobalScale * WelcomeTexScale);
|
||||||
|
|
||||||
|
ImGui.End();
|
||||||
|
|
||||||
|
ImGui.PopStyleVar(2);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.frames++;
|
||||||
|
|
||||||
|
if (this.isTippyDrawing)
|
||||||
|
DrawTippy();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.Error(ex, "Fools exception OnDraw caught");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.frames++;
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
ImGui.Begin("Tippy AI debug");
|
ImGui.Begin("Tippy AI debug");
|
||||||
|
|
||||||
|
|
@ -119,8 +141,7 @@ namespace Dalamud
|
||||||
ImGui.End();
|
ImGui.End();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (this.isTippyDrawing)
|
|
||||||
DrawTippy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isTippyDrawing = false;
|
private bool isTippyDrawing = false;
|
||||||
|
|
@ -246,14 +267,40 @@ namespace Dalamud
|
||||||
"Piety matters as much as tenacity."
|
"Piety matters as much as tenacity."
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Dictionary<uint, string[]> jobTipDict = new Dictionary<uint, string[]>() {
|
private static readonly string[] GunTips = new[] {
|
||||||
{ 1, PldTips },
|
"Much like doing a \"brake check\" on the\nroad, you can do a \"heal check\"\nin-game! \n\nJust pop Superbolide at a random time,\npreferably about five seconds before \nraidwide damage.",
|
||||||
|
|
||||||
{ 33, AstTips }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private string currentTip = string.Empty;
|
private static Dictionary<uint, string[]> jobTipDict = new Dictionary<uint, string[]>() {
|
||||||
private long lastTipFrame = 0;
|
{ 1, PldTips },
|
||||||
|
{ 2, MnkTips },
|
||||||
|
{ 3, WarTips },
|
||||||
|
{ 4, DrgTips },
|
||||||
|
{ 5, BrdTips },
|
||||||
|
{ 6, WhmTips },
|
||||||
|
{ 7, BlmTips },
|
||||||
|
|
||||||
|
{ 19, PldTips },
|
||||||
|
{ 20, MnkTips },
|
||||||
|
{ 21, WarTips },
|
||||||
|
{ 22, DrgTips },
|
||||||
|
{ 23, BrdTips },
|
||||||
|
{ 24, WhmTips },
|
||||||
|
{ 25, BlmTips },
|
||||||
|
{ 26, SchTips.Concat(SmnTips).ToArray() },
|
||||||
|
{ 27, SmnTips },
|
||||||
|
{ 28, SchTips },
|
||||||
|
{ 29, NinTips },
|
||||||
|
{ 30, NinTips },
|
||||||
|
{ 31, BrdTips },
|
||||||
|
|
||||||
|
{ 33, AstTips },
|
||||||
|
{ 34, SamTips },
|
||||||
|
|
||||||
|
{ 36, BluTips },
|
||||||
|
{ 37, GunTips },
|
||||||
|
{ 38, DncTips }
|
||||||
|
};
|
||||||
|
|
||||||
private string tippyText = string.Empty;
|
private string tippyText = string.Empty;
|
||||||
private bool showTippyButton = false;
|
private bool showTippyButton = false;
|
||||||
|
|
@ -287,7 +334,7 @@ namespace Dalamud
|
||||||
|
|
||||||
switch (tippyState) {
|
switch (tippyState) {
|
||||||
case TippyState.Tips:
|
case TippyState.Tips:
|
||||||
if (this.tippyLogicTimer.ElapsedMilliseconds > 120000 && string.IsNullOrEmpty(this.tippyText))
|
if (this.tippyLogicTimer.ElapsedMilliseconds > 600000 && string.IsNullOrEmpty(this.tippyText)) // New tip every 10 minutes
|
||||||
SetNewTip();
|
SetNewTip();
|
||||||
break;
|
break;
|
||||||
case TippyState.Timeout:
|
case TippyState.Timeout:
|
||||||
|
|
@ -497,24 +544,35 @@ namespace Dalamud
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Queue<string> lastGeneralTips = new Queue<string>();
|
private Queue<string> lastTips = new Queue<string>();
|
||||||
|
|
||||||
private string GetGeneralTip()
|
private string GetGeneralTip()
|
||||||
{
|
{
|
||||||
var gti = this.rand.Next(0, GeneralTips.Length);
|
var lp = this.dalamud.ClientState.LocalPlayer;
|
||||||
var generalTip = GeneralTips[gti];
|
|
||||||
|
|
||||||
while (this.lastGeneralTips.Any(x => x == generalTip)) {
|
var classJob = 0u;
|
||||||
gti = this.rand.Next(0, GeneralTips.Length);
|
if (lp != null)
|
||||||
generalTip = GeneralTips[gti];
|
classJob = lp.ClassJob.Id;
|
||||||
|
|
||||||
|
var tAry = GeneralTips;
|
||||||
|
|
||||||
|
if (jobTipDict.TryGetValue(classJob, out var ccTips))
|
||||||
|
tAry = tAry.Concat(ccTips).Concat(ccTips).ToArray(); // Concat job tips twice so they have a greater chance of being seen
|
||||||
|
|
||||||
|
var index = this.rand.Next(0, tAry.Length);
|
||||||
|
var tip = tAry[index];
|
||||||
|
|
||||||
|
while (this.lastTips.Any(x => x == tip)) {
|
||||||
|
index = this.rand.Next(0, tAry.Length);
|
||||||
|
tip = tAry[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastGeneralTips.Enqueue(generalTip);
|
this.lastTips.Enqueue(tip);
|
||||||
|
|
||||||
if (this.lastGeneralTips.Count > 5)
|
if (this.lastTips.Count > 5)
|
||||||
this.lastGeneralTips.Dequeue();
|
this.lastTips.Dequeue();
|
||||||
|
|
||||||
return generalTip;
|
return tip;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetNewTip()
|
private void SetNewTip()
|
||||||
|
|
@ -529,8 +587,6 @@ namespace Dalamud
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var lp = this.dalamud.ClientState.LocalPlayer;
|
|
||||||
|
|
||||||
var generalTip = GetGeneralTip();
|
var generalTip = GetGeneralTip();
|
||||||
|
|
||||||
var choice = this.rand.Next(0, 28);
|
var choice = this.rand.Next(0, 28);
|
||||||
|
|
@ -538,20 +594,7 @@ namespace Dalamud
|
||||||
|
|
||||||
Log.Information($"Choice: {choice}");
|
Log.Information($"Choice: {choice}");
|
||||||
|
|
||||||
var classJob = 14u;
|
if (choice == 1 || choice == 2) {
|
||||||
if (lp != null)
|
|
||||||
classJob = lp.ClassJob.Id;
|
|
||||||
|
|
||||||
var hasJobTips = jobTipDict.TryGetValue(classJob, out var ccTips);
|
|
||||||
|
|
||||||
if (choice < 8)
|
|
||||||
{
|
|
||||||
this.tippyText = generalTip;
|
|
||||||
|
|
||||||
PlayTada();
|
|
||||||
this.showTippyButton = true;
|
|
||||||
}
|
|
||||||
else if (choice == 9 || choice == 10) {
|
|
||||||
this.tippyState = TippyState.Timeout;
|
this.tippyState = TippyState.Timeout;
|
||||||
this.tippyText = "Analyzing ERP logs...";
|
this.tippyText = "Analyzing ERP logs...";
|
||||||
SetTippyAnim(TippyAnimState.Reading, true);
|
SetTippyAnim(TippyAnimState.Reading, true);
|
||||||
|
|
@ -561,7 +604,7 @@ namespace Dalamud
|
||||||
|
|
||||||
PlayChord();
|
PlayChord();
|
||||||
}
|
}
|
||||||
else if (choice == 11) {
|
else if (choice == 3 || choice == 5) {
|
||||||
this.tippyState = TippyState.Timeout;
|
this.tippyState = TippyState.Timeout;
|
||||||
this.tippyText = "I'm always watching.";
|
this.tippyText = "I'm always watching.";
|
||||||
SetTippyAnim(TippyAnimState.CheckingYouOut, true);
|
SetTippyAnim(TippyAnimState.CheckingYouOut, true);
|
||||||
|
|
@ -571,7 +614,7 @@ namespace Dalamud
|
||||||
|
|
||||||
PlayChord();
|
PlayChord();
|
||||||
}
|
}
|
||||||
else if (choice == 12)
|
else if (choice == 4 || choice == 6)
|
||||||
{
|
{
|
||||||
this.tippyState = TippyState.Parse;
|
this.tippyState = TippyState.Parse;
|
||||||
this.tippyText = "It seems like you are parsing grey.\n\nDo you want me to help you play your\njob better?";
|
this.tippyText = "It seems like you are parsing grey.\n\nDo you want me to help you play your\njob better?";
|
||||||
|
|
@ -584,15 +627,7 @@ namespace Dalamud
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (hasJobTips)
|
this.tippyText = generalTip;
|
||||||
{
|
|
||||||
var ti = rand.Next(0, ccTips.Length);
|
|
||||||
this.tippyText = ccTips[ti];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.tippyText = generalTip;
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayTada();
|
PlayTada();
|
||||||
this.showTippyButton = true;
|
this.showTippyButton = true;
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,11 @@ namespace Dalamud.Interface
|
||||||
{
|
{
|
||||||
OpenChangelog();
|
OpenChangelog();
|
||||||
}
|
}
|
||||||
ImGui.MenuItem("Draw Tippy", "", ref this.dalamud.Fools.IsEnabled);
|
|
||||||
|
if (this.dalamud.Fools != null) {
|
||||||
|
ImGui.MenuItem("Draw Tippy", "", ref this.dalamud.Fools.IsEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
if (ImGui.MenuItem("Unload Dalamud"))
|
if (ImGui.MenuItem("Unload Dalamud"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue