Skip to content

Commit 398627a

Browse files
committed
Removed right click config option
Since it was unneccessary and cluttery.
1 parent 1406b85 commit 398627a

18 files changed

Lines changed: 165 additions & 195 deletions

Common/Configs/Config.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public class Config : ModConfig
2020

2121
[Header("ReloadOptions")]
2222

23-
[CustomModConfigItem(typeof(PlayerIndexSliderElement))]
23+
[CustomModConfigItem(typeof(PlayerConfigElement))]
2424
[DefaultValue("")]
2525
public string Player; // player index in Main.PlayerList
2626

27-
[CustomModConfigItem(typeof(WorldIndexSliderElement))]
27+
[CustomModConfigItem(typeof(WorldConfigElement))]
2828
public string World; // world index in Main.WorldList
2929

3030
[DefaultValue(true)]
@@ -47,21 +47,11 @@ public class Config : ModConfig
4747
[DefaultValue(true)]
4848
public bool ShowCopyToClipboardButton;
4949

50-
public enum WorldSize { ExtraSmall, Small, Medium, Large }
51-
[DrawTicks]
52-
[DefaultValue(WorldSize.Small)]
53-
public WorldSize CreateTestWorldSize;
54-
55-
public enum WorldDifficulty { Normal, Expert, Master, Journey }
56-
[DrawTicks]
57-
[DefaultValue(WorldDifficulty.Normal)]
58-
public WorldDifficulty CreateTestWorldDifficulty;
50+
[DefaultValue(true)]
51+
public bool ShowBackToMainMenu;
5952

6053
[Header("Misc")]
6154

62-
[DefaultValue(true)]
63-
public bool RightClickToolOptions;
64-
6555
[DefaultValue(true)]
6656
public bool LogLevelPersistOnReloads;
6757

@@ -71,8 +61,15 @@ public enum WorldDifficulty { Normal, Expert, Master, Journey }
7161
[DefaultValue(true)]
7262
public bool LogDebugMessages;
7363

74-
[DefaultValue(true)]
75-
public bool ShowBackToMainMenu;
64+
public enum WorldSize { ExtraSmall, Small, Medium, Large }
65+
[DrawTicks]
66+
[DefaultValue(WorldSize.Small)]
67+
public WorldSize CreateTestWorldSize;
68+
69+
public enum WorldDifficulty { Normal, Expert, Master, Journey }
70+
[DrawTicks]
71+
[DefaultValue(WorldDifficulty.Normal)]
72+
public WorldDifficulty CreateTestWorldDifficulty;
7673

7774
public override void OnChanged()
7875
{

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/Configs/ConfigElements/PlayerAndWorld/IntPathOptionElement.cs renamed to Common/Configs/ConfigElements/PlayerAndWorld/Old/IntPathOptionElement.cs

File renamed without changes.

Common/Configs/ConfigElements/PlayerAndWorld/PlayerIndexSliderElement.cs renamed to Common/Configs/ConfigElements/PlayerAndWorld/Old/PlayerIndexSliderElement.cs

File renamed without changes.

Common/Configs/ConfigElements/PlayerAndWorld/WorldIndexSliderElement.cs renamed to Common/Configs/ConfigElements/PlayerAndWorld/Old/WorldIndexSliderElement.cs

File renamed without changes.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
//using Microsoft.Xna.Framework.Graphics;
2+
//using ReLogic.Content;
3+
//using Terraria.UI;
4+
5+
//namespace ModReloader.Common.Configs.ConfigElements.PlayerAndWorld;
6+
7+
//public class WorldPreviewElement : UIElement
8+
//{
9+
// private readonly Asset<Texture2D> _BorderTexture;
10+
11+
// private readonly Asset<Texture2D> _BackgroundExpertTexture;
12+
13+
// private readonly Asset<Texture2D> _BackgroundNormalTexture;
14+
15+
// private readonly Asset<Texture2D> _BackgroundMasterTexture;
16+
17+
// private readonly Asset<Texture2D> _BunnyExpertTexture;
18+
19+
// private readonly Asset<Texture2D> _BunnyNormalTexture;
20+
21+
// private readonly Asset<Texture2D> _BunnyCreativeTexture;
22+
23+
// private readonly Asset<Texture2D> _BunnyMasterTexture;
24+
25+
// private readonly Asset<Texture2D> _EvilRandomTexture;
26+
27+
// private readonly Asset<Texture2D> _EvilCorruptionTexture;
28+
29+
// private readonly Asset<Texture2D> _EvilCrimsonTexture;
30+
31+
// private readonly Asset<Texture2D> _SizeSmallTexture;
32+
33+
// private readonly Asset<Texture2D> _SizeMediumTexture;
34+
35+
// private readonly Asset<Texture2D> _SizeLargeTexture;
36+
37+
// private byte _difficulty;
38+
39+
// private byte _evil;
40+
41+
// private byte _size;
42+
43+
// public WorldPreviewElement()
44+
// {
45+
// _BorderTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewBorder");
46+
// _BackgroundNormalTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyNormal1");
47+
// _BackgroundExpertTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyExpert1");
48+
// _BackgroundMasterTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyMaster1");
49+
// _BunnyNormalTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyNormal2");
50+
// _BunnyExpertTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyExpert2");
51+
// _BunnyCreativeTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyCreative2");
52+
// _BunnyMasterTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewDifficultyMaster2");
53+
// _EvilRandomTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewEvilRandom");
54+
// _EvilCorruptionTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewEvilCorruption");
55+
// _EvilCrimsonTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewEvilCrimson");
56+
// _SizeSmallTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewSizeSmall");
57+
// _SizeMediumTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewSizeMedium");
58+
// _SizeLargeTexture = Main.Assets.Request<Texture2D>("Images/UI/WorldCreation/PreviewSizeLarge");
59+
// Width.Set(_BackgroundExpertTexture.Width(), 0f);
60+
// Height.Set(_BackgroundExpertTexture.Height(), 0f);
61+
// }
62+
63+
// public void UpdateOption(byte difficulty, byte evil, byte size)
64+
// {
65+
// _difficulty = difficulty;
66+
// _evil = evil;
67+
// _size = size;
68+
// }
69+
70+
// protected override void DrawSelf(SpriteBatch spriteBatch)
71+
// {
72+
// CalculatedStyle dims = GetDimensions();
73+
// Rectangle target = new Rectangle(
74+
// (int)dims.X,
75+
// (int)dims.Y,
76+
// (int)dims.Width,
77+
// (int)dims.Height
78+
// );
79+
80+
// Color color = Color.White;
81+
82+
// // Pick background based on difficulty
83+
// Texture2D bg = _BackgroundNormalTexture.Value;
84+
// switch (_difficulty)
85+
// {
86+
// case 1:
87+
// bg = _BackgroundExpertTexture.Value;
88+
// color = Color.DarkGray;
89+
// break;
90+
// case 2:
91+
// bg = _BackgroundMasterTexture.Value;
92+
// color = Color.DarkGray;
93+
// break;
94+
// case 3:
95+
// bg = _BackgroundNormalTexture.Value;
96+
// color = Color.White;
97+
// break;
98+
// }
99+
100+
// // Draw each layer scaled into target rectangle
101+
// spriteBatch.Draw(bg, target, Color.White);
102+
103+
// Texture2D sizeTex = _SizeSmallTexture.Value;
104+
// if (_size == 1) sizeTex = _SizeMediumTexture.Value;
105+
// else if (_size == 2) sizeTex = _SizeLargeTexture.Value;
106+
// spriteBatch.Draw(sizeTex, target, color);
107+
108+
// Texture2D evilTex = _EvilRandomTexture.Value;
109+
// if (_evil == 1) evilTex = _EvilCorruptionTexture.Value;
110+
// else if (_evil == 2) evilTex = _EvilCrimsonTexture.Value;
111+
// spriteBatch.Draw(evilTex, target, color);
112+
113+
// Texture2D bunnyTex = _BunnyNormalTexture.Value;
114+
// if (_difficulty == 1) bunnyTex = _BunnyExpertTexture.Value;
115+
// else if (_difficulty == 2) bunnyTex = _BunnyMasterTexture.Value;
116+
// else if (_difficulty == 3) bunnyTex = _BunnyCreativeTexture.Value;
117+
// spriteBatch.Draw(bunnyTex, target, color);
118+
119+
// spriteBatch.Draw(_BorderTexture.Value, target, Color.White);
120+
// }
121+
//}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace ModReloader.Common.Configs.ConfigElements.PlayerAndWorld;
2+
3+
internal class PlayerConfigElement
4+
{
5+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Collections.Generic;
2+
using Terraria.ModLoader.Config.UI;
3+
4+
namespace ModReloader.Common.Configs.ConfigElements.PlayerAndWorld;
5+
6+
internal class WorldConfigElement : DefinitionElement<string>
7+
{
8+
protected override DefinitionOptionElement<string> CreateDefinitionOptionElement()
9+
{
10+
throw new System.NotImplementedException();
11+
}
12+
13+
protected override List<DefinitionOptionElement<string>> CreateDefinitionOptionElementList()
14+
{
15+
throw new System.NotImplementedException();
16+
}
17+
18+
protected override List<DefinitionOptionElement<string>> GetPassedOptionElements()
19+
{
20+
throw new System.NotImplementedException();
21+
}
22+
}

Common/Configs/ConfigElements/PlayerAndWorld/WorldPreviewElement.cs

Lines changed: 0 additions & 121 deletions
This file was deleted.

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

0 commit comments

Comments
 (0)