generated from goatcorp/SamplePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from perappu/feature/search
Feature/search
- Loading branch information
Showing
6 changed files
with
109 additions
and
37 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
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,50 @@ | ||
using ImGuiNET; | ||
using WhoSaidWhatNow; | ||
using System.Linq; | ||
using System.Numerics; | ||
using Dalamud.Interface; | ||
using WhoSaidWhatNow.Windows; | ||
using WhoSaidWhatNow.Utils; | ||
|
||
|
||
|
||
public class TabSearch | ||
{ | ||
public TabSearch(MainWindow main) | ||
{ | ||
|
||
main.toggleWindow(true); | ||
|
||
if (ImGui.BeginTabItem("Chat Search")) | ||
{ | ||
ImGui.InputTextWithHint("", "Filter by message content...", ref Plugin.FilterSearch, 40); | ||
|
||
ImGui.BeginChild(MainWindow.ID_PANEL_RIGHT, new Vector2(0, 0), true); | ||
ImGui.BeginGroup(); | ||
|
||
// for all chat entries where the Sender or Message contain a match for our filter; | ||
foreach (var c in Plugin.ChatEntries.Where(c => c.Value.Message.ToLower().Contains(Plugin.FilterSearch.ToLower()) || c.Value.Sender.ToString()!.ToLower().Contains(Plugin.FilterSearch.ToLower()))) | ||
{ | ||
try | ||
{ | ||
// if we are displaying this type of message; | ||
if (Plugin.Config.ChannelToggles[c.Value.Type] == true) | ||
{ | ||
ChatUtils.ShowMessage(c); | ||
} | ||
} | ||
catch | ||
{ | ||
// trying to access a player that doesn't exist, just ignore | ||
} | ||
} | ||
ImGui.EndGroup(); | ||
ImGui.EndChild(); | ||
|
||
ImGui.EndTabItem(); | ||
|
||
} | ||
|
||
|
||
} | ||
} |