Skip to content

Commit 39f72b9

Browse files
committed
Removed right click config option
Removed it because it was unneccessary and cluttery.
1 parent 1406b85 commit 39f72b9

11 files changed

Lines changed: 11 additions & 62 deletions

File tree

Common/Configs/Config.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ public class Config : ModConfig
4747
[DefaultValue(true)]
4848
public bool ShowCopyToClipboardButton;
4949

50+
[DefaultValue(true)]
51+
public bool ShowBackToMainMenu;
52+
5053
public enum WorldSize { ExtraSmall, Small, Medium, Large }
5154
[DrawTicks]
5255
[DefaultValue(WorldSize.Small)]
@@ -71,9 +74,6 @@ public enum WorldDifficulty { Normal, Expert, Master, Journey }
7174
[DefaultValue(true)]
7275
public bool LogDebugMessages;
7376

74-
[DefaultValue(true)]
75-
public bool ShowBackToMainMenu;
76-
7777
public override void OnChanged()
7878
{
7979
base.OnChanged();
@@ -105,7 +105,10 @@ private void UpdateMainMenuReloadTooltip()
105105

106106
public static class Conf
107107
{
108-
/// <summary> Quick instance getter. Usage example: Conf.C.Field /// </summary>
108+
/// <summary>
109+
/// Quick instance getter.
110+
/// Usage example: Conf.C.YourField
111+
/// /// </summary>
109112
public static Config C => ModContent.GetInstance<Config>();
110113
}
111114
}

Common/Configs/ConfigElements/ModsConfigElements/ModCheckboxConfig.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ public override void LeftClick(UIMouseEvent evt)
113113
else
114114
{
115115
modsToReload = $"{modsToReload}";
116-
if (Conf.C.RightClickToolOptions)
117-
modsToReload += "\nRight click to reload mods without building any";
116+
modsToReload += "\nRight click to reload mods without building any";
118117
}
119118
sys.mainState.reloadSPButton?.UpdateHoverTextDescription(modsToReload);
120119
sys.mainState.reloadMPButton?.UpdateHoverTextDescription(modsToReload);

Common/Integrations/DragonLens/DragonLensLogPanel.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,14 @@ public class DragonLensLogPanel : Tool
2222

2323
private string GetDescription()
2424
{
25-
if (!Conf.C.RightClickToolOptions)
26-
{
27-
return Loc.Get("LogButton.HoverDescBase");
28-
}
29-
3025
string logFileName = Path.GetFileName(Logging.LogPath);
3126
string result = Loc.Get("LogButton.HoverDescBase");
3227
result += $"\n{Loc.Get("LogButton.HoverDescRightClick", Path.GetFileName(Logging.LogPath))}";
3328
return result;
3429
}
3530

36-
public override bool HasRightClick => Conf.C.RightClickToolOptions;
37-
3831
public override void OnRightClick()
3932
{
40-
if (!Conf.C.RightClickToolOptions) return;
41-
4233
Log.OpenClientLog();
4334
}
4435

Common/Integrations/DragonLens/DragonLensReload.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,18 @@ public class DragonLensReload : Tool
1515

1616
private string GetDescription()
1717
{
18-
if (!Conf.C.RightClickToolOptions)
19-
{
20-
return Loc.Get("ReloadButton.HoverText", string.Join(", ", Conf.C.ModsToReload));
21-
}
22-
2318
string result = $"{Loc.Get("ReloadButton.HoverText", string.Join(", ", Conf.C.ModsToReload))}\n{Loc.Get("ReloadButton.HoverDescRightClick")}";
2419
//result += $"\n{Helpers.LocalizationHelper.GetText("ReloadButton.HoverDescRightClick")}";
2520
return result;
2621
}
2722

28-
public override bool HasRightClick => Conf.C.RightClickToolOptions;
29-
3023
public override async void OnActivate()
3124
{
3225
await ReloadUtilities.SinglePlayerReload();
3326
}
3427

3528
public override async void OnRightClick()
3629
{
37-
if (!Conf.C.RightClickToolOptions)
38-
{
39-
return;
40-
}
41-
4230
ReloadUtilities.forceJustReload = true;
4331
await ReloadUtilities.SinglePlayerReload();
4432
}

Common/Integrations/DragonLens/DragonLensReloadMP.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,11 @@ public class DragonLensReloadMP : Tool
1515

1616
private string GetDescription()
1717
{
18-
if (!Conf.C.RightClickToolOptions)
19-
{
20-
return Loc.Get("ReloadMPButton.HoverText", string.Join(", ", Conf.C.ModsToReload));
21-
}
22-
2318
string result = $"{Loc.Get("ReloadMPButton.HoverText", string.Join(", ", Conf.C.ModsToReload))}\n{Loc.Get("ReloadMPButton.HoverDescRightClick")}";
2419
//result += $"\n{Helpers.LocalizationHelper.GetText("ReloadButton.HoverDescRightClick")}";
2520
return result;
2621
}
2722

28-
public override bool HasRightClick => Conf.C.RightClickToolOptions;
29-
3023
public override async void OnActivate()
3124
{
3225
await ReloadUtilities.MultiPlayerMainReload();

Common/Integrations/DragonLens/DragonLensUIPanel.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ public class DragonLensUIPanel : Tool
2222

2323
private string GetDescription()
2424
{
25-
if (!Conf.C.RightClickToolOptions)
26-
{
27-
return Loc.Get("UIElementButton.HoverDescBase");
28-
}
29-
3025
string result = Loc.Get("UIElementButton.HoverDescBase");
3126
result += $"\n{Loc.Get("UIElementButton.HoverDescRightClick")}";
3227
return result;
@@ -69,15 +64,8 @@ public override void OnActivate()
6964
}
7065
}
7166

72-
public override bool HasRightClick => Conf.C.RightClickToolOptions;
73-
7467
public override void OnRightClick()
7568
{
76-
if (!Conf.C.RightClickToolOptions)
77-
{
78-
return;
79-
}
80-
8169
UIElementSystem elementSystem = ModContent.GetInstance<UIElementSystem>();
8270
if (elementSystem == null) return;
8371
UIElementState elementState = elementSystem.debugState;

Core/Features/LogFeatures/LogButton.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class LogButton(Asset<Texture2D> spritesheet, string buttonText, string h
1616

1717
public override void RightClick(UIMouseEvent evt)
1818
{
19-
if (!Conf.C.RightClickToolOptions) return;
2019
Log.OpenClientLog();
2120
}
2221
}

Core/Features/Reload/ReloadSPButton.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public override async void RightClick(UIMouseEvent evt)
2323
{
2424
base.RightClick(evt);
2525

26-
if (!Conf.C.RightClickToolOptions) return;
27-
2826
ReloadUtilities.forceJustReload = true;
2927
await ReloadUtilities.SinglePlayerReload();
3028
}

Core/Features/UIElementFeatures/UIElementButton.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public class UIElementButton(Asset<Texture2D> spritesheet, string buttonText, st
1919

2020
public override void RightClick(UIMouseEvent evt)
2121
{
22-
if (!Conf.C.RightClickToolOptions) return;
23-
2422
base.RightClick(evt);
2523

2624
// Toggle all elements

Core/MainState.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ public MainState()
7070
AreButtonsShowing = true; // Show our own collapse and show buttons by default
7171

7272
string uiElementHoverDesc = Loc.Get("UIElementButton.HoverDescBase");
73-
if (Conf.C.RightClickToolOptions)
74-
uiElementHoverDesc += "\n" + Loc.Get("UIElementButton.HoverDescRightClick");
73+
uiElementHoverDesc += "\n" + Loc.Get("UIElementButton.HoverDescRightClick");
7574

7675
string logHoverDesc = Loc.Get("LogButton.HoverDescBase");
77-
if (Conf.C.RightClickToolOptions)
78-
logHoverDesc += "\n" + Loc.Get("LogButton.HoverDescRightClick", Path.GetFileName(Logging.LogPath));
76+
logHoverDesc += "\n" + Loc.Get("LogButton.HoverDescRightClick", Path.GetFileName(Logging.LogPath));
7977

8078
modsButton = AddButton<ModsButton>(
8179
Ass.ButtonMods,
@@ -107,8 +105,7 @@ public MainState()
107105
? Loc.Get("ReloadButton.HoverDescNoMods")
108106
: string.Join(",", Conf.C.ModsToReload);
109107

110-
if (Conf.C.RightClickToolOptions)
111-
reloadHoverMods += "\n" + Loc.Get("ReloadButton.HoverDescRightClick");
108+
reloadHoverMods += "\n" + Loc.Get("ReloadButton.HoverDescRightClick");
112109

113110
if (Main.netMode == NetmodeID.SinglePlayer)
114111
{

0 commit comments

Comments
 (0)