Skip to content

Commit

Permalink
add mode toggle and full text copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dit-zy committed Nov 25, 2023
1 parent 3c07326 commit d2344bc
Show file tree
Hide file tree
Showing 17 changed files with 631 additions and 92 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "OtterGui"]
path = OtterGui
url = [email protected]:Ottermandias/OtterGui.git
1 change: 1 addition & 0 deletions OtterGui
Submodule OtterGui added at a64327
12 changes: 12 additions & 0 deletions ScoutHelper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScoutHelper", "ScoutHelper\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScoutHelperTests", "ScoutHelperTests\ScoutHelperTests.csproj", "{31CD702B-08BA-4EB3-93D6-C895CD3DCB19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtterGui", "OtterGui\OtterGui.csproj", "{264A8375-1760-4D5B-87D2-9C71AC2D6460}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtterGuiInternal", "OtterGui\OtterGuiInternal\OtterGuiInternal.csproj", "{A14FFD18-747B-4FCC-AD14-5A51A28D4710}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -21,6 +25,14 @@ Global
{31CD702B-08BA-4EB3-93D6-C895CD3DCB19}.Debug|x64.Build.0 = Debug|Any CPU
{31CD702B-08BA-4EB3-93D6-C895CD3DCB19}.Release|x64.ActiveCfg = Release|Any CPU
{31CD702B-08BA-4EB3-93D6-C895CD3DCB19}.Release|x64.Build.0 = Release|Any CPU
{264A8375-1760-4D5B-87D2-9C71AC2D6460}.Debug|x64.ActiveCfg = Debug|Any CPU
{264A8375-1760-4D5B-87D2-9C71AC2D6460}.Debug|x64.Build.0 = Debug|Any CPU
{264A8375-1760-4D5B-87D2-9C71AC2D6460}.Release|x64.ActiveCfg = Release|Any CPU
{264A8375-1760-4D5B-87D2-9C71AC2D6460}.Release|x64.Build.0 = Release|Any CPU
{A14FFD18-747B-4FCC-AD14-5A51A28D4710}.Debug|x64.ActiveCfg = Debug|Any CPU
{A14FFD18-747B-4FCC-AD14-5A51A28D4710}.Debug|x64.Build.0 = Debug|Any CPU
{A14FFD18-747B-4FCC-AD14-5A51A28D4710}.Release|x64.ActiveCfg = Release|Any CPU
{A14FFD18-747B-4FCC-AD14-5A51A28D4710}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 9 additions & 0 deletions ScoutHelper.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002ECSharp_002EContextActions_002EMisc_002ESurroundWithQuotesAction/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002ECSharp_002EContextActions_002ENullPropagationToIfStatementAction/@EntryIndexedValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AFTER_BLOCK_STATEMENTS/@EntryValue">0</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_CATCH_ON_NEW_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ELSE_ON_NEW_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FINALLY_ON_NEW_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_EQ/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_PARAMETERS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue">True</s:Boolean>
Expand Down
9 changes: 6 additions & 3 deletions ScoutHelper/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Configuration : IPluginConfiguration {

// the below exist just to make saving less cumbersome
[NonSerialized]
private DalamudPluginInterface? _pluginInterface;
private DalamudPluginInterface _pluginInterface = null!;

public int Version { get; set; } = 0;

Expand All @@ -19,11 +19,14 @@ public class Configuration : IPluginConfiguration {
public string BearSiteTrainUrl { get; set; } = "https://tracker.beartoolkit.com/train";
public string BearTrainName { get; set; } = "Scout Helper Train";

public string CopyTemplate { get; set; } = Constants.DefaultCopyTemplate;
public bool IsCopyModeFullText { get; set; } = false;

public void Initialize(DalamudPluginInterface pluginInterface) {
this._pluginInterface = pluginInterface;
_pluginInterface = pluginInterface;
}

public void Save() {
_pluginInterface!.SavePluginConfig(this);
_pluginInterface.SavePluginConfig(this);
}
}
12 changes: 11 additions & 1 deletion ScoutHelper/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,30 @@
namespace ScoutHelper;

public static class Constants {

#region plugin constants

public const string PluginName = "Scout Helper";
public static readonly string PluginVersion;
public static readonly string PluginNamespace = PluginName.Replace(" ", "");

#endregion

#region core constants

public const string DefaultCopyTemplate = "{patch} {#}/{#max} {world} [{tracker}]({link})";

#endregion

#region web constants

public static readonly MediaTypeWithQualityHeaderValue MediaTypeJson =
MediaTypeWithQualityHeaderValue.Parse("application/json");

public static readonly ProductInfoHeaderValue UserAgent = new ProductInfoHeaderValue(
PluginNamespace,
PluginVersion
);

#endregion

static Constants() {
Expand Down
119 changes: 114 additions & 5 deletions ScoutHelper/Localization/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 48 additions & 5 deletions ScoutHelper/Localization/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@
<value>Bear Toolkit</value>
</data>
<data name="MainWindowTitle" xml:space="preserve">
<value>Scout Helper</value>
<value>SCOUT HELPER</value>
</data>
<data name="ConfigWindowTitle" xml:space="preserve">
<value>Scout Helper Settings</value>
</data>
<data name="ConfigWindowContent" xml:space="preserve">
<value>At this time there are no configurable settings for Scout Helper, but there will be in the future. Please use command `/scouth` to open the Scout Helper window.</value>
<value>SCOUT HELPER SETTINGS</value>
</data>
<data name="BearButtonTooltip" xml:space="preserve">
<value>Generate a Bear Toolkit link from the Hunt Helper train recorder.</value>
Expand All @@ -39,4 +36,50 @@
<data name="SirenButtonTooltip" xml:space="preserve">
<value>Siren Hunts is not yet implemented. Coming soon!</value>
</data>
<data name="CopyModeLinkButton" xml:space="preserve">
<value>link</value>
</data>
<data name="CopyModeFullTextButton" xml:space="preserve">
<value>full-text</value>
</data>
<data name="MainWindowSectionLabelMode" xml:space="preserve">
<value>MODE</value>
</data>
<data name="MainWindowSectionLabelGenerators" xml:space="preserve">
<value>GENERATORS</value>
</data>
<data name="ConfigWindowSectionLabelFullText" xml:space="preserve">
<value>FULL-TEXT TEMPLATE</value>
</data>
<data name="CopyModeTooltipSummary" xml:space="preserve">
<value>The copy mode that tracker generators will use when generating tracker links.</value>
</data>
<data name="CopyModeTooltipLinkDesc" xml:space="preserve">
<value>only copies the generated tracker link to your clipboard</value>
</data>
<data name="CopyModeTooltipFullTextDesc" xml:space="preserve">
<value>copies a full-text template to your clipboard, which can contain data about the scouted marks beyond just the tracker link. click on the '?' currently underneath your mouse, to open the SCOUT HELPER settings and configure the template, or open the settings from the Dalamud plugin installer screen.</value>
</data>
<data name="ConfigWindowPreviewLabel" xml:space="preserve">
<value>PREVIEW:</value>
</data>
<data name="ConfigWindowTemplateDesc" xml:space="preserve">
<value>Configure the template used by the full-text copy mode. When the full-text mode is selected, this template is what will be copied to your clipboard, rather than just the generated tracker link. Variables can be referenced by surrounding them with curly braces (e.g. "{link}"), and the following variables are available:</value>
</data>
<data name="ConfigWindowTemplateVariables" xml:space="preserve">
<value>{#} - the number of hunt marks in the train.

{#max} - the maximum possible number of hunt marks in the patch.

{link} - the generated tracker link \(≧▽≦)/

{patch} - the latest patch contained in the recorded train. If there are 6 HW marks and 1 SHB mark in the train, the patch will be SHB.

{tracker} - the name of the tracker used (e.g. "bear").

{world} - the current world you are in. Make sure to use the link generator before you change worlds, if you include this in your template ;P</value>
</data>
<data name="ConfigWindowDescriptionLabel" xml:space="preserve">
<value>DESCRIPTION:</value>
</data>
</root>
Loading

0 comments on commit d2344bc

Please sign in to comment.