-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal refactoring and better DTR bar
- Loading branch information
1 parent
d132fa3
commit 136af1e
Showing
15 changed files
with
204 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,47 @@ | ||
namespace PrincessRTFM.WoLua.Constants; | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using Dalamud.Game.Text; | ||
using Dalamud.Game.Text.SeStringHandling; | ||
|
||
using PrincessRTFM.WoLua.Lua; | ||
|
||
public static class StatusText { | ||
public static string IconPlugin { get; } = SeIconChar.CrossWorld.ToIconString(); | ||
public static string IconScripts { get; } = SeIconChar.CrossWorld.ToIconString(); | ||
public static string IconInitialising { get; } = SeIconChar.Experience.ToIconString(); | ||
public static string IconLoadingScripts { get; } = SeIconChar.Clock.ToIconString(); | ||
public static string IconErrored { get; } = SeIconChar.Cross.ToIconString(); | ||
public static string IconDisposing { get; } = SeIconChar.ExperienceFilled.ToIconString(); | ||
|
||
public static SeString Initialising { get; } = $"{IconPlugin} {IconInitialising}"; | ||
public static SeString LoadingScripts { get; } = $"{IconPlugin} {IconLoadingScripts}"; | ||
public static SeString Initialising { get; } = $"{IconScripts} {IconInitialising}"; | ||
public static SeString LoadingScripts { get; } = $"{IconScripts} {IconLoadingScripts}"; | ||
public static SeString Scripts { | ||
get { | ||
IEnumerable<ScriptContainer> scripts = Service.Scripts.Values; | ||
int total = Service.Scripts.Count; | ||
int loaded = scripts.Where(c => c.Active).Count(); | ||
int loaded = Service.Scripts.Values.Where(c => c.Active).Count(); | ||
int failed = total - loaded; | ||
#if DEBUG | ||
return $"{IconPlugin}{loaded}/{total} {IconErrored}{failed}"; | ||
return $"{IconScripts}{loaded}/{total} {IconErrored}{failed}"; | ||
#else | ||
return loaded == total | ||
? $"{IconPlugin}{loaded}" | ||
: $"{IconPlugin}{loaded}/{total} {IconErrored}{failed}"; | ||
? $"{IconScripts}{loaded}" | ||
: $"{IconScripts}{loaded}/{total} {IconErrored}{failed}"; | ||
#endif | ||
} | ||
} | ||
public static SeString Disposing { get; } = $"{IconPlugin} {IconDisposing}"; | ||
public static SeString Disposing { get; } = $"{IconScripts} {IconDisposing}"; | ||
|
||
public static SeString TooltipInitialising { get; } = $"{Plugin.Name} initialising, please wait..."; | ||
public static SeString TooltipLoadingScripts { get; } = "Loading scripts..."; | ||
public static SeString TooltipLoaded { | ||
get { | ||
int totalCount = Service.Scripts.Count; | ||
string totalNoun = totalCount == 1 ? "script" : "scripts"; | ||
int loadedCount = Service.Scripts.Values.Where(c => c.Active).Count(); | ||
string loadedNoun = loadedCount == 1 ? "script" : "scripts"; | ||
int failedCount = totalCount - loadedCount; | ||
string failedNoun = failedCount == 1 ? "script" : "scripts"; | ||
return $"{totalCount} {totalNoun} found.\n{loadedCount} {loadedNoun} loaded successfully.\n{failedCount} {failedNoun} failed to load.\nClick to reload all scripts."; | ||
} | ||
} | ||
public static SeString TooltipDisposing { get; } = "Shutting down..."; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace PrincessRTFM.WoLua.Lua; | ||
|
||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property)] | ||
internal class LuaGlobalAttribute: Attribute { | ||
public readonly string Name; | ||
public LuaGlobalAttribute(string name) { | ||
this.Name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.