Skip to content

Commit

Permalink
Merge pull request #219 from bittiez/dev
Browse files Browse the repository at this point in the history
v3.21.2
  • Loading branch information
bittiez committed Feb 21, 2024
2 parents b0c8508 + 0e88a9a commit 004adfb
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 132 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ windows-latest, macos-latest, ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get submodules
run: |
git config --global url."https://".insteadOf git://
git submodule update --init --recursive
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
include-prerelease: true
dotnet-version: 8.0.x

- name: Restore
run: dotnet restore
Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/deploy.yml

This file was deleted.

13 changes: 6 additions & 7 deletions .github/workflows/tuo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,26 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ windows-latest, macos-latest, ubuntu-latest ]


steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Get submodules
run: |
git config --global url."https://".insteadOf git://
git submodule update --init --recursive
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
include-prerelease: true
dotnet-version: 8.0.x

- name: Build
run: dotnet publish ${{ env.CUO_PROJECT_PATH }} -c Release -o ${{ env.CUO_OUTPUT_PATH }} -p:IS_DEV_BUILD=true
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/tuo-dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ windows-latest, macos-latest, ubuntu-latest ]

steps:
- uses: actions/checkout@v4
Expand All @@ -55,11 +55,10 @@ jobs:
git config --global url."https://".insteadOf git://
git submodule update --init --recursive
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
include-prerelease: true
dotnet-version: 8.0.x

- name: Build
run: dotnet publish ${{ env.CUO_PROJECT_PATH }} -c Release -o ${{ env.CUO_OUTPUT_PATH }} -p:IS_DEV_BUILD=true
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.21.1</AssemblyVersion>
<FileVersion>3.21.1</FileVersion>
<AssemblyVersion>3.21.2</AssemblyVersion>
<FileVersion>3.21.2</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
6 changes: 6 additions & 0 deletions src/ClassicUO.Client/Game/UI/Controls/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,12 @@ public virtual void Dispose()
}

IsDisposed = true;
AfterDispose();
}

/// <summary>
/// Called after the control has been disposed.
/// </summary>
public virtual void AfterDispose() { }
}
}
48 changes: 30 additions & 18 deletions src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ internal abstract class BaseHealthBarGump : AnchorableGump

public bool IsLastAttackBar { get; set; } = false;
public static BaseHealthBarGump LastAttackBar { get; set; }
protected bool HasBeenBuilt { get; set; } = false;

protected BaseHealthBarGump(Entity entity) : this(0, 0)
{
Expand All @@ -71,6 +72,7 @@ protected BaseHealthBarGump(Entity entity) : this(0, 0)
_isDead = entity is Mobile mm && mm.IsDead;

BuildGump();
HasBeenBuilt = true;
}

public virtual void SetNewMobile(uint serial)
Expand All @@ -83,6 +85,7 @@ public virtual void SetNewMobile(uint serial)

Children.Clear();
BuildGump();
HasBeenBuilt = true;
}
}

Expand Down Expand Up @@ -140,18 +143,13 @@ private new bool IsLocked

protected abstract void BuildGump();

//public override void AfterDispose()
//{
// base.AfterDispose();

public override void Dispose()
{
/*if (TargetManager.LastAttack != LocalSerial)
{
GameActions.SendCloseStatus(LocalSerial);
}*/

_textBox?.Dispose();
_textBox = null;
base.Dispose();
}
// _textBox?.Dispose();
// _textBox = null;
//}

protected override void OnMove(int x, int y)
{
Expand Down Expand Up @@ -181,6 +179,7 @@ public override void Restore(XmlElement xml)
{
_name = World.Player.Name;
BuildGump();
HasBeenBuilt = true;
}
else if (ProfileManager.CurrentProfile.SaveHealthbars)
{
Expand All @@ -201,6 +200,7 @@ public override void Restore(XmlElement xml)

_outOfRange = true;
BuildGump();
HasBeenBuilt = true;
}
else
{
Expand Down Expand Up @@ -410,6 +410,11 @@ protected override void OnMouseOver(int x, int y)

public override bool Draw(UltimaBatcher2D batcher, int x, int y)
{
if (IsDisposed)
{
return false;
}

base.Draw(batcher, x, y);

if (Keyboard.Alt && UIManager.MouseOverControl != null && (UIManager.MouseOverControl == this || UIManager.MouseOverControl.RootParent == this))
Expand Down Expand Up @@ -535,6 +540,7 @@ protected override void UpdateContents()
if (_textBox != null)
{
_textBox.MouseUp -= TextBoxOnMouseUp;
_textBox.Dispose();
}

_textBox = null;
Expand All @@ -546,7 +552,7 @@ public override void Update()
{
base.Update();

if (IsDisposed)
if (IsDisposed || !HasBeenBuilt)
{
return;
}
Expand Down Expand Up @@ -619,12 +625,12 @@ public override void Update()
}
}

if (_background.Hue != 912)
if (_background != null && _background.Hue != 912)
{
_background.Hue = 912;
}

if (_hpLineRed.LineColor != HPB_COLOR_GRAY)
if (_hpLineRed != null && _hpLineRed.LineColor != HPB_COLOR_GRAY)
{
_hpLineRed.LineColor = HPB_COLOR_GRAY;

Expand All @@ -636,7 +642,10 @@ public override void Update()
}
}

_bars[0].IsVisible = false;
if (_bars[0] != null)
{
_bars[0].IsVisible = false;
}
}
}

Expand Down Expand Up @@ -1577,6 +1586,7 @@ protected override void UpdateContents()
if (_textBox != null)
{
_textBox.MouseUp -= TextBoxOnMouseUp;
_textBox.Dispose();
}

_textBox = null;
Expand Down Expand Up @@ -1826,7 +1836,7 @@ public override void Update()
{
base.Update();

if (IsDisposed /* || (_textBox != null && _textBox.IsDisposed)*/)
if (IsDisposed || !HasBeenBuilt)
{
return;
}
Expand Down Expand Up @@ -1903,7 +1913,10 @@ public override void Update()
}
}

_bars[0].IsVisible = false;
if (_bars[0] != null)
{
_bars[0].IsVisible = false;
}
}
}

Expand Down Expand Up @@ -2090,7 +2103,6 @@ public override void Update()
}
}


if (_bars.Length > 0 && _bars[0].Hue != hpForegroundHue) //HP Foreground
{
_bars[0].Hue = hpForegroundHue;
Expand Down
7 changes: 5 additions & 2 deletions src/ClassicUO.Client/Game/UI/Gumps/ModernOptionsGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5104,16 +5104,19 @@ protected override void OnMouseEnter(int x, int y)

protected override void OnMouseWheel(MouseEventType delta)
{
if (IsDisposed || _scrollBar == null)
{
return;
}

switch (delta)
{
case MouseEventType.WheelScrollUp:
_scrollBar.Value -= _scrollBar.ScrollStep;

break;

case MouseEventType.WheelScrollDown:
_scrollBar.Value += _scrollBar.ScrollStep;

break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/ClassicUO.Client/Game/UI/Gumps/VersionHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace ClassicUO.Game.UI.Gumps
internal class VersionHistory : Gump
{
private static string[] updateTexts = {
"/c[white][3.21.2]/cd\n" +
"-A bugfix release for 3.21 causing crashes",

"/c[white][3.21.0]/cd\n" +
"- A few bug fixes\n" +
"- A few fixes from CUO\n" +
Expand Down

0 comments on commit 004adfb

Please sign in to comment.