Zircon icon indicating copy to clipboard operation
Zircon copied to clipboard

DXItemCell in-front of BeltDialog

Open josh-74 opened this issue 1 year ago • 8 comments

//

josh-74 avatar Oct 15 '24 15:10 josh-74

Closed

josh-74 avatar Oct 21 '24 02:10 josh-74

I assume this is still an issue which needs fixing? If not please specify the reason for closing it

Suprcode avatar Oct 21 '24 07:10 Suprcode

To reproduce the issue, (atleast for me), Create 10 healthpotions, and assign them to slots 1-4 on your belt, log out and back in.

wait about 5-10 seconds, the slot 1 image seems to fade out (like the fade system text).

https://github.com/user-attachments/assets/39e636db-7a3e-4685-84ee-13282927ba9e

phoenixvdp avatar Oct 21 '24 08:10 phoenixvdp

I assume this is still an issue which needs fixing? If not please specify the reason for closing it

Issue's fixed within the provided notepad apologies for closing it

To reproduce the issue, (atleast for me), Create 10 healthpotions, and assign them to slots 1-4 on your belt, log out and back in.

wait about 5-10 seconds, the slot 1 image seems to fade out (like the fade system text).

belt_icon.mp4

You'll need to download the latest files in-order to get the past the error that you're seeing.

josh-74 avatar Oct 21 '24 08:10 josh-74

I still had an issue with the beltdialog after trying the above changes, but it was specific to when I had 1 slot showing on the beltdialog and only on the initial load of the UI, it self-corrected on resize. I have since fixed this on my code and have left the code here incase it's helpful for fixing the issue in the base source.

BeltDialog.cs.txt

phoenixvdp avatar Oct 21 '24 12:10 phoenixvdp

I've added in the above changes, and it does indeed bring back the slot 1 transparent issue. I think the previous change just coincidentally fixed it in certain scenarios. Still not sure what's causing that, but will leave this ticket open until its resolved again.

Suprcode avatar Oct 27 '24 21:10 Suprcode

Seems to be fixed now with the addition of @phoenixvdp changes. The invisibility and 1 slot position both seem to be working correctly now.

Suprcode avatar Oct 28 '24 11:10 Suprcode

Reopening as issue has appeared again

Suprcode avatar Oct 30 '24 18:10 Suprcode

private void FadeOutChatHistory() { if (!Panel.FadeOutCheckBox.Checked && chatFade == 1F) return;

// Ensure the chat is visible and active
if (!GameScene.Game.ChatTextBox.Visible || GameScene.Game.ChatTextBox.TextBox != DXTextBox.ActiveTextBox)
    return;

if (HideChat && nextFadeCheck < CEnvir.Now && chatFade > 0F)
{
    chatFade -= 0.2F;
    chatFade = Math.Max(0F, chatFade);

    // Only fade chat messages using History
    foreach (var item in History)
    {
        if (item?.Label != null)
        {
            item.Label.Opacity = chatFade;
        }
    }

    nextFadeCheck = CEnvir.Now.AddMilliseconds(100);
    return;
}

bool hideChat = false;

DXTabControl tab = TabButton.Parent as DXTabControl;

if (tab?.SelectedTab == this &&
    !GameScene.Game.ChatOptionsBox.Visible &&
    GameScene.Game.ChatTextBox.TextBox != DXTextBox.ActiveTextBox &&
    Panel.FadeOutCheckBox.Checked &&
    Panel.TransparentCheckBox.Checked)
{
    var newest = History.LastOrDefault();
    if (newest != null && newest.SentDate < CEnvir.Now.AddSeconds(-10))
    {
        hideChat = true;
    }
}

HideChat = hideChat;

}

this partially fixed it, it still discolors when Pressing "options" in the chat settings though

Xzoviac avatar May 13 '25 14:05 Xzoviac

`public void TransparencyChanged() {

if (Panel.TransparentCheckBox.Checked)
{
    ScrollBar.Visible = false;
    DrawTexture = false;
    DrawOtherBorder = false;
    AllowResize = false;

    if (CurrentTabControl.SelectedTab == this)
    {

        foreach (DXButton button in CurrentTabControl.TabButtons)
        {
            // Check if the parent grid of the button is not a Belt grid type
            var parentGrid = button.Parent as DXItemGrid;
            if (parentGrid != null && parentGrid.GridType != GridType.Belt)
            {
                button.Opacity = 0.5f; // Apply transparency
            }
        }
    }

    // Apply opacity change to labels that are NOT part of the belt
    foreach (var label in History.Select(x => x.Label).Where(label => label != null))
    {
        var parentGrid = label.Parent as DXItemGrid;
        if (parentGrid != null && parentGrid.GridType != GridType.Belt)
        {
            label.Opacity = 0.5f; // Apply transparency to non-belt labels
        }
    }
}
else
{

    ScrollBar.Visible = true;
    DrawTexture = true;
    AllowResize = true;
    DrawOtherBorder = true;

    if (CurrentTabControl.SelectedTab == this)
    {
        // Reset opacity for buttons that are NOT part of the belt
        foreach (DXButton button in CurrentTabControl.TabButtons)
        {
            var parentGrid = button.Parent as DXItemGrid;
            if (parentGrid != null && parentGrid.GridType != GridType.Belt)
            {
                button.Opacity = 1f; // Reset opacity
            }
        }
    }

    // Reset opacity for labels that are NOT part of the belt
    foreach (var label in History.Select(x => x.Label).Where(label => label != null))
    {
        var parentGrid = label.Parent as DXItemGrid;
        if (parentGrid != null && parentGrid.GridType != GridType.Belt)
        {
            label.Opacity = 1f; // Reset opacity for non-belt labels
        }
    }
}

// Update label colors after transparency change
foreach (DXLabel label in History.Select(x => x.Label))
{
    UpdateColours(label);
}

}`

This fixes the transparency when pressing "options" but breaks the transparency of the chat tabs , cant find a way to fix both. i think its better not to use this bit, as the belt slot 1 only dims slightly when options is open, and its better then chat tabs with out transparancy

Xzoviac avatar May 13 '25 17:05 Xzoviac