Skip to content

Commit

Permalink
Merge pull request #210 from bittiez/dev
Browse files Browse the repository at this point in the history
v3.19.0
  • Loading branch information
bittiez committed Jan 12, 2024
2 parents 8f09353 + 6b0cf2a commit 29e8c93
Show file tree
Hide file tree
Showing 13 changed files with 207 additions and 120 deletions.
1 change: 0 additions & 1 deletion src/ClassicUO.Assets/TrueTypeLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;

namespace ClassicUO.Assets
Expand Down
4 changes: 2 additions & 2 deletions src/ClassicUO.Client/ClassicUO.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<ApplicationIcon>cuoicon.ico</ApplicationIcon>
<AssemblyName>ClassicUO</AssemblyName>
<RootNamespace>ClassicUO</RootNamespace>
<AssemblyVersion>3.18.0</AssemblyVersion>
<FileVersion>3.18.0</FileVersion>
<AssemblyVersion>3.19.0</AssemblyVersion>
<FileVersion>3.19.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
17 changes: 17 additions & 0 deletions src/ClassicUO.Client/Configuration/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace ClassicUO.Configuration
public class Language
{
public ModernOptionsGumpLanguage GetModernOptionsGumpLanguage { get; set; } = new ModernOptionsGumpLanguage();
public ErrorsLanguage ErrorsLanguage { get; set; } = new ErrorsLanguage();
public MapLanguage MapLanguage { get; set; } = new MapLanguage();

[JsonIgnore]
public static Language Instance { get; private set; } = new Language();
Expand All @@ -27,6 +29,8 @@ public static void Load()

private static void CreateNewLanguageFile()
{
Directory.CreateDirectory(Path.Combine(CUOEnviroment.ExecutablePath, "Data"));

string defaultLanguage = JsonSerializer.Serialize<Language>(Instance, new JsonSerializerOptions() { WriteIndented = true });
File.WriteAllText(languageFilePath, defaultLanguage);
}
Expand Down Expand Up @@ -470,6 +474,7 @@ public class TazUO
public string RegularPlayerOpacity { get; set; } = "Regular player opacity";
public string AutoFollowDistance { get; set; } = "Auto follow distance";
public string DisableMouseInteractionsForOverheadText { get; set; } = "Disable mouse interactions for overhead text";
public string OverridePartyMemberHues { get; set; } = "Override party member body hues with friendly hue";
#endregion

#region Misc
Expand Down Expand Up @@ -501,6 +506,7 @@ public class TazUO
public string PlayerOffsetX { get; set; } = "Player Offset X";
public string PlayerOffsetY { get; set; } = "Player Offset Y";
public string UseLandTexturesWhereAvailable { get; set; } = "Use land textures where available(Experimental)";
public string SOSGumpID { get; set; } = "SOS Gump ID";
#endregion

#region Tooltips
Expand Down Expand Up @@ -555,4 +561,15 @@ public class TazUO
#endregion
}
}

public class ErrorsLanguage
{
public string CommandNotFound { get; set; } = "Command was not found: {0}";
}

public class MapLanguage
{
public string Follow { get; set; } = "Follow";
public string Yourself { get; set; } = "Yourself";
}
}
39 changes: 21 additions & 18 deletions src/ClassicUO.Client/Configuration/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public sealed class Profile
public ushort InvulnerableHue { get; set; } = 0x0030;
public ushort AltJournalBackgroundHue { get; set; } = 0x0000;
public ushort AltGridContainerBackgroundHue { get; set; } = 0x0000;
public bool OverridePartyAndGuildHue { get; set; } = false;

// visual
public bool EnabledCriminalActionQuery { get; set; } = true;
Expand Down Expand Up @@ -490,7 +491,7 @@ public int CoolDownConditionCount
public int HealthLineSizeMultiplier { get; set; } = 1;

public bool OpenHealthBarForLastAttack { get; set; } = true;
[JsonConverter(typeof(Point2Converter))]
[JsonConverter(typeof(Point2Converter))]
public Point LastTargetHealthBarPos { get; set; } = Point.Zero;
public ushort ToolTipBGHue { get; set; } = 0;

Expand Down Expand Up @@ -523,14 +524,14 @@ public int CoolDownConditionCount

public static uint GumpsVersion { get; private set; }

[JsonConverter(typeof(Point2Converter))]
[JsonConverter(typeof(Point2Converter))]
public Point InfoBarSize { get; set; } = new Point(400, 20);
public bool InfoBarLocked { get; set; } = false;
public string InfoBarFont { get; set; } = "Roboto-Regular";
public int InfoBarFontSize { get; set; } = 18;

public int LastJournalTab { get; set; } = 0;
public Dictionary<string, MessageType[]> JournalTabs { get; set; } = new Dictionary<string, MessageType[]>()
public Dictionary<string, MessageType[]> JournalTabs { get; set; } = new Dictionary<string, MessageType[]>()
{
{ "All", new MessageType[] {
MessageType.Alliance, MessageType.Command, MessageType.Emote,
Expand All @@ -539,24 +540,24 @@ public int CoolDownConditionCount
MessageType.Regular, MessageType.Spell, MessageType.System,
MessageType.Whisper, MessageType.Yell, MessageType.ChatSystem }
},
{ "Chat", new MessageType[] {
MessageType.Regular,
MessageType.Guild,
MessageType.Alliance,
MessageType.Emote,
MessageType.Party,
MessageType.Whisper,
MessageType.Yell,
MessageType.ChatSystem }
{ "Chat", new MessageType[] {
MessageType.Regular,
MessageType.Guild,
MessageType.Alliance,
MessageType.Emote,
MessageType.Party,
MessageType.Whisper,
MessageType.Yell,
MessageType.ChatSystem }
},
{
"Guild|Party", new MessageType[] {
MessageType.Guild,
MessageType.Alliance,
"Guild|Party", new MessageType[] {
MessageType.Guild,
MessageType.Alliance,
MessageType.Party }
},
{
"System", new MessageType[] {
"System", new MessageType[] {
MessageType.System }
}
};
Expand Down Expand Up @@ -587,6 +588,8 @@ public int CoolDownConditionCount

public double PaperdollScale { get; set; } = 1f;

public uint SOSGumpID { get; set; } = 1915258020;


public void Save(string path, bool saveGumps = true)
{
Expand Down Expand Up @@ -769,7 +772,7 @@ public List<Gump> ReadGumps(string path)
int y = int.Parse(xml.GetAttribute(nameof(y)));
uint serial = uint.Parse(xml.GetAttribute(nameof(serial)));

if(uint.TryParse(xml.GetAttribute("serverSerial"), out uint serverSerial))
if (uint.TryParse(xml.GetAttribute("serverSerial"), out uint serverSerial))
{
UIManager.SavePosition(serverSerial, new Point(x, y));
}
Expand Down Expand Up @@ -835,7 +838,7 @@ public List<Gump> ReadGumps(string path)
break;

case GumpType.PaperDoll:
if(pdolc > 0)
if (pdolc > 0)
{
break;
}
Expand Down
24 changes: 14 additions & 10 deletions src/ClassicUO.Client/Game/GameObjects/Views/MobileView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,17 @@

#endregion

using System;
using System.Collections.Generic;
using ClassicUO.Assets;
using ClassicUO.Configuration;
using ClassicUO.Game.Data;
using ClassicUO.Game.Managers;
using ClassicUO.Game.Scenes;
using ClassicUO.Input;
using ClassicUO.Assets;
using ClassicUO.Renderer;
using ClassicUO.Utility;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;

namespace ClassicUO.Game.GameObjects
{
Expand Down Expand Up @@ -80,14 +79,15 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
drawY += 22;

bool hasShadow = !IsDead && !IsHidden && ProfileManager.CurrentProfile.ShadowsEnabled;
bool inParty = World.Party.Contains(this);

if (AuraManager.IsEnabled)
{
AuraManager.Draw(
batcher,
drawX,
drawY,
ProfileManager.CurrentProfile.PartyAura && World.Party.Contains(this)
ProfileManager.CurrentProfile.PartyAura && inParty
? ProfileManager.CurrentProfile.PartyAuraHue
: Notoriety.GetHue(NotorietyFlag),
depth + 1f
Expand All @@ -102,7 +102,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep

Vector3 hueVec = ShaderHueTranslator.GetHueVector(0, false, AlphaHue / 255f);

if(World.Player == this && ProfileManager.CurrentProfile.PlayerConstantAlpha != 100)
if (World.Player == this && ProfileManager.CurrentProfile.PlayerConstantAlpha != 100)
{
hueVec = ShaderHueTranslator.GetHueVector(0, false, (float)ProfileManager.CurrentProfile.PlayerConstantAlpha / 100f);
}
Expand Down Expand Up @@ -132,7 +132,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
else if (IsHidden)
{
overridedHue = ProfileManager.CurrentProfile.HiddenBodyHue;
hueVec = ShaderHueTranslator.GetHueVector(0, false, ((float)ProfileManager.CurrentProfile.HiddenBodyAlpha/100));
hueVec = ShaderHueTranslator.GetHueVector(0, false, ((float)ProfileManager.CurrentProfile.HiddenBodyAlpha / 100));
}
else
{
Expand Down Expand Up @@ -181,6 +181,10 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
{
overridedHue = Notoriety.GetHue(NotorietyFlag);
}
else if (inParty && ProfileManager.CurrentProfile != null && ProfileManager.CurrentProfile.OverridePartyAndGuildHue)
{
overridedHue = ProfileManager.CurrentProfile.FriendHue;
}
}

ProcessSteps(out byte dir);
Expand Down Expand Up @@ -1365,10 +1369,10 @@ internal static bool IsCovered(Mobile mobile, Layer layer)

break;

/*case Layer.Skirt:
skirt = mobile.FindItemByLayer( Layer.Skirt];
/*case Layer.Skirt:
skirt = mobile.FindItemByLayer( Layer.Skirt];
break;*/
break;*/
}

return false;
Expand Down
5 changes: 3 additions & 2 deletions src/ClassicUO.Client/Game/Managers/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@

#endregion

using System;
using System.Collections.Generic;
using ClassicUO.Configuration;
using ClassicUO.Game.Data;
using ClassicUO.Game.GameObjects;
using ClassicUO.Game.UI.Gumps;
using ClassicUO.Input;
using ClassicUO.Resources;
using ClassicUO.Utility.Logging;
using System;
using System.Collections.Generic;

namespace ClassicUO.Game.Managers
{
Expand Down Expand Up @@ -299,6 +299,7 @@ public static void Execute(string name, params string[] args)
}
else
{
GameActions.Print(string.Format(Language.Instance.ErrorsLanguage.CommandNotFound, name));
Log.Warn($"Command: '{name}' not exists");
}
}
Expand Down
32 changes: 22 additions & 10 deletions src/ClassicUO.Client/Game/Managers/MacroManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@

#endregion

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using ClassicUO.Configuration;
using ClassicUO.Game.Data;
using ClassicUO.Game.GameObjects;
Expand All @@ -47,6 +41,12 @@
using ClassicUO.Utility;
using ClassicUO.Utility.Logging;
using SDL2;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using static SDL2.SDL;

namespace ClassicUO.Game.Managers
Expand Down Expand Up @@ -1850,6 +1850,15 @@ private int Process(MacroObject macro)
CounterBarGump.CurrentCounterBarGump?.GetCounterItem(cIndex)?.Use();
}
break;
case MacroType.ClientCommand:
string command = ((MacroObjectString)macro).Text;

if (!string.IsNullOrEmpty(command))
{
string[] parts = command.Split(' ');
CommandManager.Execute(parts[0], parts);
}
break;
}


Expand Down Expand Up @@ -2131,12 +2140,12 @@ public void Load(XmlElement xml)

XmlElement buttons = xml["controllerbuttons"];

if(buttons != null)
if (buttons != null)
{
List<SDL.SDL_GameControllerButton> savedButtons = new List<SDL_GameControllerButton> ();
List<SDL.SDL_GameControllerButton> savedButtons = new List<SDL_GameControllerButton>();
foreach (XmlElement buttonNum in buttons.GetElementsByTagName("button"))
{
if(int.TryParse(buttonNum.InnerText, out int b))
if (int.TryParse(buttonNum.InnerText, out int b))
{
if (Enum.IsDefined(typeof(SDL_GameControllerButton), b))
{
Expand Down Expand Up @@ -2164,6 +2173,7 @@ public static MacroObject Create(MacroType code)
case MacroType.ModifyUpdateRange:
case MacroType.RazorMacro:
case MacroType.UseCounterBar:
case MacroType.ClientCommand:
obj = new MacroObjectString(code, MacroSubType.MSC_NONE);

break;
Expand Down Expand Up @@ -2339,6 +2349,7 @@ public MacroObject(MacroType code, MacroSubType sub)
case MacroType.ModifyUpdateRange:
case MacroType.RazorMacro:
case MacroType.UseCounterBar:
case MacroType.ClientCommand:
SubMenuType = 2;

break;
Expand Down Expand Up @@ -2456,7 +2467,8 @@ public enum MacroType
CloseCorpses,
UseObject,
LookAtMouse,
UseCounterBar
UseCounterBar,
ClientCommand
}

public enum MacroSubType
Expand Down
8 changes: 4 additions & 4 deletions src/ClassicUO.Client/Game/UI/Controls/ContextMenuControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

#endregion

using System;
using System.Collections.Generic;
using ClassicUO.Game.Managers;
using ClassicUO.Game.UI.Gumps;
using ClassicUO.Input;
using ClassicUO.Renderer;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;

namespace ClassicUO.Game.UI.Controls
{
Expand Down Expand Up @@ -92,7 +92,7 @@ public void Dispose()
}
}

public sealed class ContextMenuItemEntry
public class ContextMenuItemEntry
{
public ContextMenuItemEntry(string text, Action action = null, bool canBeSelected = false, bool defaultValue = false)
{
Expand Down Expand Up @@ -307,7 +307,7 @@ public override void Update()
_label.Width = Width;
}

if(_selectedPic != null)
if (_selectedPic != null)
{
_selectedPic.IsVisible = _entry.IsSelected;
}
Expand Down

0 comments on commit 29e8c93

Please sign in to comment.