diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-10-04 00:11:22 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-10-04 00:13:25 -0700 |
| commit | 025ea5f2c7b24b57c4f451c8b513781db1b3d275 (patch) | |
| tree | 90c9ae3c54bc4523fb8d501e2b642d23d2674e79 | |
| parent | 75f1e57ce018bdafd1d6013737d028aee0b6d602 (diff) | |
add miniguide for how to setup plugin
| -rw-r--r-- | DiscordToXIV/DiscordToXIV.json | 4 | ||||
| -rw-r--r-- | DiscordToXIV/Plugin.cs | 2 | ||||
| -rw-r--r-- | DiscordToXIV/Windows/MainWindow.cs | 113 |
3 files changed, 112 insertions, 7 deletions
diff --git a/DiscordToXIV/DiscordToXIV.json b/DiscordToXIV/DiscordToXIV.json index b88744c..e3fa843 100644 --- a/DiscordToXIV/DiscordToXIV.json +++ b/DiscordToXIV/DiscordToXIV.json @@ -5,8 +5,6 @@ "Description": "XIVToDiscord? Why not DiscordToXIV. This plugin allows you to bring Discord messages into FFXIV and send text from FFXIV to Discord!\n**Requires BetterDiscord**", "ApplicableVersion": "any", "Tags": [ - "sample", - "plugin", - "goats" + "discord" ] } diff --git a/DiscordToXIV/Plugin.cs b/DiscordToXIV/Plugin.cs index c7eb4ef..5e96953 100644 --- a/DiscordToXIV/Plugin.cs +++ b/DiscordToXIV/Plugin.cs @@ -295,6 +295,8 @@ public sealed class Plugin : IDalamudPlugin } } + public bool GetIsWebSocketServerRunning() => IsWebSocketServerRunning; + public void ToggleConfigUI() => ConfigWindow.Toggle(); public void ToggleMainUI() => MainWindow.Toggle(); diff --git a/DiscordToXIV/Windows/MainWindow.cs b/DiscordToXIV/Windows/MainWindow.cs index a636553..da2b7c9 100644 --- a/DiscordToXIV/Windows/MainWindow.cs +++ b/DiscordToXIV/Windows/MainWindow.cs @@ -1,10 +1,12 @@ using System; +using System.Diagnostics; using System.Numerics; using Dalamud.Interface.Internal; using Dalamud.Interface.Utility; using Dalamud.Interface.Windowing; using Dalamud.Plugin.Services; using DiscordToXIV; +using FFXIVClientStructs.FFXIV.Component.Shell; using ImGuiNET; namespace DiscordTOXIV.Windows; @@ -14,7 +16,7 @@ public class MainWindow : Window, IDisposable private Plugin Plugin; public MainWindow(Plugin plugin) - : base("DiscordToXIV###DiscordToXIVMainWindow", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse) + : base("DiscordToXIV###DiscordToXIVMainWindow") { SizeConstraints = new WindowSizeConstraints { @@ -28,8 +30,111 @@ public class MainWindow : Window, IDisposable public override void Draw() { - ImGui.Text("DiscordToXIV"); - ImGui.Text("Nothing much here for now... Use /pdiscordtoxiv <port> to start the server"); - ImGui.Text("Stop the server: /pdiscordtoxiv stop"); + ImGui.SetWindowFontScale(1.5f); + ImGui.Text("DiscordToXIV - Help"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("Welcome. This mini-guide will help you get started with DiscordToXIV."); + if (ImGui.Button("View this guide on GitHub (its more readable)")) + { + Process.Start(new ProcessStartInfo("https://github.com/pinapelz/discord-to-xiv/blob/master/SETUP.md") + { + UseShellExecute = true, + }); + } + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("1. Set up BetterDiscord"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("This plugin requires a Discord client with BetterDiscord so that Dalamud can communicate with it"); + ImGui.Text("Follow the instructions on their website, it'll patch into your existing Discord client"); + if (ImGui.Button("BetterDiscord Website")) + { + Process.Start(new ProcessStartInfo("https://betterdiscord.app/ ") + { + UseShellExecute = true, + }); + } + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("2. Download and install the BetterDiscord plugin"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("Install the BDFireToWebsocket plugin"); + ImGui.Text("This is required so Dalamud knows when you get a new message"); + ImGui.Text("Download the .js file from the link below and put it in your BetterDiscord plugins folder"); + ImGui.Text("You can access this in your BetterDiscord client by going to Settings -> Plugins -> Open Plugin Folder"); + if (ImGui.Button("BDFireToWebsocket Plugin")) + { + Process.Start(new ProcessStartInfo("https://github.com/pinapelz/BDFireToWebsocket/blob/7b2752d529cf3c6b5115c200aeb7b6f684ce807b/BDFireToWebsocket.plugin.js") + { + UseShellExecute = true, + }); + } + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("3. Configure BDFireToWebsocket Plugin"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("Click on the settings icon for the BDFireToWebsocket plugin in BetterDiscord in the plugins menu"); + ImGui.Spacing(); + ImGui.Text("For Websocket address you can leave it as the default unless you know what you're doing"); + ImGui.Spacing(); + ImGui.Text("Channel IDs controls which messages are sent to Dalamud"); + ImGui.Text("I suggest leaving this empty and then filtering which channels you want from the Dalamud plugin instead"); + ImGui.Spacing(); + ImGui.Text("Make sure to add your own User ID so that messages you sent get filtered out! (otherwise you'll see your own messages in game)"); + ImGui.Text("You can get your User ID by right clicking on your name anywhere in Discord and clicking 'Copy ID'"); + + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("4. Configure DiscordToXIV Plugin"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("Head back into game and run '/pdiscordtoxiv config'"); + ImGui.Text("This will open the plugin settings window where you can configure the plugin to your liking"); + ImGui.Spacing(); + ImGui.Text("You'll need to set nicknames for each chat channel so their names don't show up as a bunch of numbers"); + ImGui.Text("You can get the channel ID by right clicking on any server channel or even DM channel and clicking 'Copy Channel ID'"); + ImGui.Text("Ex. #general-ffxiv -> 12345564323454"); + ImGui.Spacing(); + ImGui.Text("(Optional). You can also set up a Discord Auth Token if you want to send messages from the game to Discord"); + ImGui.Text("I won't get into how to get this token since its slightly more risky, but you can find guides online"); + ImGui.Text("If you do set it up. I'll have instructions on how to use it later down"); + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("5. Good to GO!"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("Almost done now! run /pdiscordtoxiv"); + ImGui.Text("You should see a message in chat letting you know that the server is running"); + ImGui.Text("Head back into your BetterDiscord plugins and click the settings icon for BDToFireWebsocket again"); + ImGui.Text("Click 'Reconnect to Websocket Server'"); + ImGui.Spacing(); + ImGui.Text("You should now see a message in game letting you know that the connection is successful!"); + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.SetWindowFontScale(1.2f); + ImGui.Text("(Optional) 6. Sending Discord messages"); + ImGui.SetWindowFontScale(1.0f); + ImGui.Text("If you set up the Discord Auth Token you can now send messages from the game to Discord"); + ImGui.Text("First you'll need to 'focus' on a chat channel by typing '/pdtxset <channel_id>'"); + ImGui.Text("You must use the numerical channel ID here not a nickname"); + ImGui.Spacing(); + ImGui.Text("Then you can send messages by typing '/pdtxsend <message>'"); + ImGui.Text("This will send the message to the focused channel"); + ImGui.Spacing(); + ImGui.Text("My suggestion for using this is to setup different macros to focus in on different channels"); + ImGui.Text("This will make it easier to send messages to different channels without having to type the channel ID each time"); + + + + } } |
