diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1f5801bdf5..fe62de37c7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7aa2321b12..0000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Deploy - -on: - workflow_dispatch: - # workflow_run: - # branches: [main] - # workflows: [Build-Test] - # types: - # - completed - - -env: - CUO_ASSEMBLY_VERSION: '0.1.11.${{ github.run_number }}' - CUO_OUTPUT_PATH: '../../bin/dist' - CUO_PROJECT_PATH: "src/ClassicUO.Client/ClassicUO.Client.csproj" - CUO_ZIP_NAME: "ClassicUO-dev-preview-release.zip" - - DOTNET_NOLOGO: false - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - NUGET_XMLDOC_MODE: skip - -jobs: - build: - #if: ${{ github.event.workflow_run.conclusion == 'success' }} && "${{ env.GITHUB_REPOSITORY }}" == 'ClassicUO/ClassicUO' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest ] - - steps: - - uses: actions/checkout@v2 - - - 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 - with: - dotnet-version: 7.0.x - include-prerelease: true - - - name: Build - run: dotnet publish ${{ env.CUO_PROJECT_PATH }} -c Release -o ${{ env.CUO_OUTPUT_PATH }} -p:IS_DEV_BUILD=true -p:AssemblyVersion=${{ env.CUO_ASSEMBLY_VERSION }} -p:FileVersion=${{ env.CUO_ASSEMBLY_VERSION }} - - - name: Create manifest - run: | - dotnet run --project tools/ManifestCreator/ManifestCreator.csproj "${{ env.CUO_OUTPUT_PATH }}" "dev-preview" "${{ env.CUO_ZIP_NAME }}" - mkdir upload - mv manifest.xml upload - - - name: Create package - uses: thedoctor0/zip-release@master - with: - type: 'zip' - directory: ${{ env.CUO_OUTPUT_PATH }} - filename: ${{ env.CUO_ZIP_NAME }} - exclusions: '*.zip manifest.xml' - - - name: Move output - run: mv "${{ env.CUO_OUTPUT_PATH }}/${{ env.CUO_ZIP_NAME }}" upload - - - name: Remove old Release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 - with: - delete_release: true - tag_name: ClassicUO-dev-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Release - uses: ncipollo/release-action@v1 - with: - artifacts: "upload/${{ env.CUO_ZIP_NAME }}" - name: 'ClassicUO dev preview' - body: 'This build may not be safe: use it at your own risk.' - prerelease: true - tag: ClassicUO-dev-release - token: ${{ secrets.GITHUB_TOKEN }} - - - name: FTP Deploy - uses: SamKirkland/FTP-Deploy-Action@4.3.2 - with: - server: ftp.classicuo.eu - username: ${{ secrets.FTP_USER }} - password: ${{ secrets.FTP_PSW }} - protocol: ftps - server-dir: /www.classicuo.eu/dev/deploy/ - local-dir: upload/ - diff --git a/.github/workflows/tuo-deploy.yml b/.github/workflows/tuo-deploy.yml index 3be090fe56..d9f4bf5129 100644 --- a/.github/workflows/tuo-deploy.yml +++ b/.github/workflows/tuo-deploy.yml @@ -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 diff --git a/.github/workflows/tuo-dev-deploy.yml b/.github/workflows/tuo-dev-deploy.yml index 3e75667653..b052c1ec95 100644 --- a/.github/workflows/tuo-dev-deploy.yml +++ b/.github/workflows/tuo-dev-deploy.yml @@ -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 @@ -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 diff --git a/src/ClassicUO.Client/ClassicUO.Client.csproj b/src/ClassicUO.Client/ClassicUO.Client.csproj index f22236e4cb..ef724ed285 100644 --- a/src/ClassicUO.Client/ClassicUO.Client.csproj +++ b/src/ClassicUO.Client/ClassicUO.Client.csproj @@ -5,8 +5,8 @@ cuoicon.ico ClassicUO ClassicUO - 3.21.1 - 3.21.1 + 3.21.2 + 3.21.2 diff --git a/src/ClassicUO.Client/Game/UI/Controls/Control.cs b/src/ClassicUO.Client/Game/UI/Controls/Control.cs index f418e60e2d..b591bb7ab7 100644 --- a/src/ClassicUO.Client/Game/UI/Controls/Control.cs +++ b/src/ClassicUO.Client/Game/UI/Controls/Control.cs @@ -1063,6 +1063,12 @@ public virtual void Dispose() } IsDisposed = true; + AfterDispose(); } + + /// + /// Called after the control has been disposed. + /// + public virtual void AfterDispose() { } } } \ No newline at end of file diff --git a/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs b/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs index e882506029..f222daa0ab 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs @@ -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) { @@ -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) @@ -83,6 +85,7 @@ public virtual void SetNewMobile(uint serial) Children.Clear(); BuildGump(); + HasBeenBuilt = true; } } @@ -140,18 +143,13 @@ protected set { } 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) { @@ -181,6 +179,7 @@ public override void Restore(XmlElement xml) { _name = World.Player.Name; BuildGump(); + HasBeenBuilt = true; } else if (ProfileManager.CurrentProfile.SaveHealthbars) { @@ -201,6 +200,7 @@ public override void Restore(XmlElement xml) _outOfRange = true; BuildGump(); + HasBeenBuilt = true; } else { @@ -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)) @@ -535,6 +540,7 @@ protected override void UpdateContents() if (_textBox != null) { _textBox.MouseUp -= TextBoxOnMouseUp; + _textBox.Dispose(); } _textBox = null; @@ -546,7 +552,7 @@ public override void Update() { base.Update(); - if (IsDisposed) + if (IsDisposed || !HasBeenBuilt) { return; } @@ -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; @@ -636,7 +642,10 @@ public override void Update() } } - _bars[0].IsVisible = false; + if (_bars[0] != null) + { + _bars[0].IsVisible = false; + } } } @@ -1577,6 +1586,7 @@ protected override void UpdateContents() if (_textBox != null) { _textBox.MouseUp -= TextBoxOnMouseUp; + _textBox.Dispose(); } _textBox = null; @@ -1826,7 +1836,7 @@ public override void Update() { base.Update(); - if (IsDisposed /* || (_textBox != null && _textBox.IsDisposed)*/) + if (IsDisposed || !HasBeenBuilt) { return; } @@ -1903,7 +1913,10 @@ public override void Update() } } - _bars[0].IsVisible = false; + if (_bars[0] != null) + { + _bars[0].IsVisible = false; + } } } @@ -2090,7 +2103,6 @@ public override void Update() } } - if (_bars.Length > 0 && _bars[0].Hue != hpForegroundHue) //HP Foreground { _bars[0].Hue = hpForegroundHue; diff --git a/src/ClassicUO.Client/Game/UI/Gumps/ModernOptionsGump.cs b/src/ClassicUO.Client/Game/UI/Gumps/ModernOptionsGump.cs index 0db0ccfd32..374ae32954 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/ModernOptionsGump.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/ModernOptionsGump.cs @@ -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; } } diff --git a/src/ClassicUO.Client/Game/UI/Gumps/VersionHistory.cs b/src/ClassicUO.Client/Game/UI/Gumps/VersionHistory.cs index da5442db10..623446d798 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/VersionHistory.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/VersionHistory.cs @@ -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" +