mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Add a link to open the Dalamud Plugin Window when showing out of date plugins warning
This commit is contained in:
parent
57ab45e9f7
commit
cd5cc6aac2
1 changed files with 16 additions and 1 deletions
|
|
@ -24,6 +24,8 @@ namespace Dalamud.Game {
|
|||
|
||||
private readonly Dalamud dalamud;
|
||||
|
||||
private DalamudLinkPayload openInstallerWindowLink;
|
||||
|
||||
private readonly Dictionary<XivChatType, Color> HandledChatTypeColors = new Dictionary<XivChatType, Color> {
|
||||
{XivChatType.CrossParty, Color.DodgerBlue},
|
||||
{XivChatType.Party, Color.DodgerBlue},
|
||||
|
|
@ -87,6 +89,10 @@ namespace Dalamud.Game {
|
|||
|
||||
dalamud.Framework.Gui.Chat.OnCheckMessageHandled += OnCheckMessageHandled;
|
||||
dalamud.Framework.Gui.Chat.OnChatMessage += OnChatMessage;
|
||||
|
||||
this.openInstallerWindowLink = this.dalamud.Framework.Gui.Chat.AddChatLinkHandler("Dalamud", 1001, (i) => {
|
||||
this.dalamud.OpenPluginInstaller();
|
||||
});
|
||||
}
|
||||
|
||||
private void OnCheckMessageHandled(XivChatType type, uint senderid, ref SeString sender, ref SeString message, ref bool isHandled) {
|
||||
|
|
@ -233,7 +239,16 @@ namespace Dalamud.Game {
|
|||
}
|
||||
} else {
|
||||
this.dalamud.Framework.Gui.Chat.PrintChat(new XivChatEntry {
|
||||
MessageBytes = Encoding.UTF8.GetBytes(Loc.Localize("DalamudPluginUpdateRequired", "One or more of your plugins needs to be updated. Please use the /xlplugins command in-game to update them!")),
|
||||
MessageBytes = new SeString(new List<Payload>() {
|
||||
new TextPayload(Loc.Localize("DalamudPluginUpdateRequired", "One or more of your plugins needs to be updated. Please use the /xlplugins command in-game to update them!")),
|
||||
new TextPayload(" ["),
|
||||
new UIForegroundPayload(this.dalamud.Data, 500),
|
||||
this.openInstallerWindowLink,
|
||||
new TextPayload(Loc.Localize("DalamudInstallerHelp", "Open the plugin installer")),
|
||||
RawPayload.LinkTerminator,
|
||||
new UIForegroundPayload(this.dalamud.Data, 0),
|
||||
new TextPayload("]"),
|
||||
}).Encode(),
|
||||
Type = XivChatType.Urgent
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue