Announcement

Collapse
No announcement yet.

References inside widget cause editor performance loss

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    References inside widget cause editor performance loss

    Heres video
    https://www.youtube.com/watch?v=Ig9b9Aj8Ods

    i have few custom UUserWidgets, ill post code of it under, heres the point, im trying to store UUI_INTERACTABLE_WIDGET references inside UUI_INTERACTABLE_WIDGET using struct named FUI_CONTROL_TICKED, it has 2 public UUI_INTERACTABLE_WIDGET* variables, im assigning them thru UE4 editor inside other widget, when im starting assigning them everything is ok, but more variables is assigned, less performance editor shows when UUI_INTERACTABLE_WIDGET is selected inside the editor, if i select other UUI_INTERACTABLE_WIDGET without those variables assigned performance goes back to normal, it shown in video i posted above, any ideas what could cause this performance loss? More widgets i assign, less performance i get.

    // Fill out your copyright notice in the Description page of Project Settings.

    Code:
    #pragma once
    
    #include "CoreMinimal.h"
    #include "Blueprint/UserWidget.h"
    #include "UI_OBJECT.generated.h"
    
    // ORIENTATION PROTOCOL
    USTRUCT(BlueprintType)
    struct FUI_IDENTITY
    {
    GENERATED_BODY()
    
    private:
    
    UPROPERTY() TArray<FString> ELEMENTS;
    
    public:
    
    FUI_IDENTITY() { ; }
    FUI_IDENTITY(TArray<FString> _ELEMENTS) : ELEMENTS(_ELEMENTS) { ; }
    
    FString GET_ELEMENT(uint8 _INDEX)
    {
    return (_INDEX < ELEMENTS.Num()) ? ELEMENTS[_INDEX] : "";
    };
    
    int NUMBER_OF_ELEMENTS()
    {
    return ELEMENTS.Num();
    };
    
    };
    
    class USizeBox;
    
    UCLASS(Abstract)
    class POINTCONFLICT_API UUI_OBJECT : public UUserWidget
    {
    GENERATED_BODY()
    
    public:
    
    virtual void NativePreConstruct() override;
    virtual void NativeConstruct() override;
    
    UPROPERTY() FString ID; /* C++ ONLY */
    UPROPERTY() FUI_IDENTITY IDENTITY;
    /* LATINIC LATTERS ONLY! USED TO GROUP WIDGETS AND GENERATE COMMAND CODES */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") FString FAMILY; /* LOCALIZED NAME OF INTERACTABLE OBJECT */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") FText TITLE; /* IS WIDGET USING CUSTOM SIZE SETTINGS? */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") bool USE_CUSTOM_SIZE; /* CUSTOM SIZE */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") FVector2D CUSTOM_SIZE; /* IS UI OBJECT ENABLED OR NOT?*/
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") bool IS_ENABLED = true;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") USizeBox* SPACE;
    
    UFUNCTION(BlueprintCallable, Category = "- FLOW") virtual void UPDATE() { ; }
    UFUNCTION() void ENABLE_OR_DISABLE(bool _ENABLE_OR_DISABLE);
    
    };
    Code:
    #include "UI_OBJECT.h"
    #include "Components/SizeBox.h"
    #include "Engine.h"
    
    void UUI_OBJECT::NativePreConstruct()
    {
    Super::NativePreConstruct();
    if (USE_CUSTOM_SIZE)
    {
    SPACE->SetWidthOverride(CUSTOM_SIZE.X);
    SPACE->SetHeightOverride(CUSTOM_SIZE.Y);
    }
    else
    {
    SPACE->ClearWidthOverride();
    SPACE->ClearHeightOverride();
    }
    }
    
    void UUI_OBJECT::NativeConstruct()
    {
    Super::NativeConstruct();
    UPDATE();
    }
    
    void UUI_OBJECT::ENABLE_OR_DISABLE(bool _ENABLE_OR_DISABLE)
    {
    if (IS_ENABLED != _ENABLE_OR_DISABLE)
    {
    IS_ENABLED = _ENABLE_OR_DISABLE;
    UPDATE();
    }
    }
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #pragma once
    
    #include "CoreMinimal.h"
    #include "UI_OBJECT.h"
    #include "Components/WidgetSwitcher.h"
    #include "UI_INTERACTABLE_OBJECT.generated.h"
    
    UENUM(BlueprintType)
    enum class EUI_INTERACTION_TYPE : uint8
    {
    CLICK UMETA(DisplayName = "CLICK"),
    TURN UMETA(DisplayName = "TURN"),
    PRESS UMETA(DisplayName = "PRESS")
    };
    
    UENUM(BlueprintType)
    enum class EUI_SELECTION_GROUP : uint8
    {
    NONE UMETA(DisplayName = "NONE"),
    SECTION UMETA(DisplayName = "SECTION"),
    SUBSECTION UMETA(DisplayName = "SUBSECTION"),
    CONTENT UMETA(DisplayName = "CONTENT")
    };
    
    // UI INTERACTION STATE
    UENUM(BlueprintType)
    enum class EUI_INTERACTION_STATE : uint8
    {
    REGULAR UMETA(DisplayName = "REGULAR"),
    HOVERED UMETA(DisplayName = "HOVERED"),
    SELECTED UMETA(DisplayName = "SELECTED"),
    DISABLED UMETA(DisplayName = "DISABLED"),
    HOVERED_AND_SELECTED UMETA(DisplayName = "HOVERED_AND_SELECTED"),
    HOVERED_AND_DISABLED UMETA(DisplayName = "HOVERED_AND_DISABLED")
    };
    
    class UUI_INTERACTABLE_OBJECT;
    
    // CONTROL TICKET
    USTRUCT(BlueprintType)
    struct FUI_CONTROL_TICKET
    {
    GENERATED_BODY()
    
    public:
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay) UUI_INTERACTABLE_OBJECT* FOCUS;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay) UUI_INTERACTABLE_OBJECT* TARGET;
    
    FUI_CONTROL_TICKET() { ; }
    };
    
    class UGridPanel;
    
    // INTERACTABLE OBJECT
    UCLASS(Abstract)
    class POINTCONFLICT_API UUI_INTERACTABLE_OBJECT : public UUI_OBJECT
    {
    GENERATED_BODY()
    
    public:
    
    virtual void NativePreConstruct() override;
    virtual void NativeConstruct() override;
    virtual void NativeOnMouseEnter(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
    virtual FReply NativeOnMouseButtonDown(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
    
    virtual void UPDATE() override { ; }
    /* CLICK, TURN or PRESS */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") EUI_INTERACTION_TYPE INTERACTION_TYPE; /* WORKS ONLY WITH INTERACTION_TYPE::TURN */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") EUI_SELECTION_GROUP INTERACTION_GROUP; /* COMMAND EXECUTES ON INTERACTION */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") FString EXECUTES; /* IF(NULL) = NO SWITCH */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") UWidgetSwitcher* EXPLORER; /* INDEX OF PAGE YOU WANT TO SWITCH TO */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") uint8 PAGE_INDEX; /* SUBSELECTION 0 = FIRST, 1 = LAST */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") UUI_INTERACTABLE_OBJECT* SUBSELECT; /* nullptr = NO CONTEXT*/
    UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "DEFAULT") UGridPanel* CONTEXT;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "CONTROL PROTOCOL") TArray<FUI_CONTROL_TICKET> UP_TICKET;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "CONTROL PROTOCOL") TArray<FUI_CONTROL_TICKET> DOWN_TICKET;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "CONTROL PROTOCOL") TArray<FUI_CONTROL_TICKET> LEFT_TICKET;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "CONTROL PROTOCOL") TArray<FUI_CONTROL_TICKET> RIGHT_TICKET;
    
    UPROPERTY() bool IS_HOVERED;
    UPROPERTY() bool IS_SELECTED;
    UPROPERTY() bool IS_PRESSED;
    
    UFUNCTION() void HOVER_OR_DEHOVER(bool _HOVER_OR_DEHOVER);
    UFUNCTION() void SELECT_OR_DESELECT(bool _SELECT_OR_DESELECT);
    UFUNCTION() void CLICK();
    
    };
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    
    #include "UI_INTERACTABLE_OBJECT.h"
    #include <PointConflict/CORE/CORE_GAME_MODE.h>
    #include <PointConflict/UI/UI_MAIN_MENU.h>
    
    void UUI_INTERACTABLE_OBJECT::NativePreConstruct()
    {
    Super::NativePreConstruct();
    }
    
    void UUI_INTERACTABLE_OBJECT::NativeConstruct()
    {
    Super::NativeConstruct();
    }
    
    void UUI_INTERACTABLE_OBJECT::NativeOnMouseEnter(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent)
    {
    ((ACORE_GAME_MODE*)GetWorld()->GetAuthGameMode())->MAIN_MENU_WIDGET->HOVER_INTERACTABLE_OBJECT(this);
    }
    
    FReply UUI_INTERACTABLE_OBJECT::NativeOnMouseButtonDown(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent)
    {
    ((ACORE_GAME_MODE*)GetWorld()->GetAuthGameMode())->MAIN_MENU_WIDGET->INTERACT_WITH_INTERACTABLE_OBJECT(this);
    return FReply::Handled();
    }
    
    void UUI_INTERACTABLE_OBJECT::HOVER_OR_DEHOVER(bool _HOVER_OR_DEHOVER)
    {
    if (IS_HOVERED != _HOVER_OR_DEHOVER)
    {
    IS_HOVERED = _HOVER_OR_DEHOVER;
    UPDATE();
    }
    }
    
    void UUI_INTERACTABLE_OBJECT::SELECT_OR_DESELECT(bool _SELECT_OR_DESELECT)
    {
    if (IS_SELECTED != _SELECT_OR_DESELECT)
    {
    IS_SELECTED = _SELECT_OR_DESELECT;
    UPDATE();
    }
    }
    
    void UUI_INTERACTABLE_OBJECT::CLICK()
    {
    
    }
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #pragma once
    
    #include "CoreMinimal.h"
    #include "UI_INTERACTABLE_OBJECT.h"
    #include "UI_BUTTON.generated.h"
    
    class UTextBlock;
    class UBorder;
    
    UCLASS(Abstract)
    class POINTCONFLICT_API UUI_BUTTON : public UUI_INTERACTABLE_OBJECT
    {
    GENERATED_BODY()
    
    public:
    
    virtual void NativePreConstruct() override;
    virtual void NativeConstruct() override;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") UObject* DEFAULT_FONT;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") int DEFAULT_FONT_SIZE = 18;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") int DEFAULT_FONT_COLOR = 4;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UTextBlock* BUTTON_TITLE;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UBorder* BUTTON_BORDER;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UBorder* BUTTON_BACKGROUND;
    
    virtual void UPDATE() override;
    
    };
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #include "UI_BUTTON.h"
    #include "Components/Border.h"
    #include "Components/TextBlock.h"
    #include <PointConflict/UI/UI_MAIN_MENU.h>
    #include <PointConflict/CORE/CORE_GAME_MODE.h>
    #include <PointConflict/CORE/CORE_FUNCTION_LIBRARY.h>
    #include <PointConflict/CORE/CORE_SETTINGS_MANAGER.h>
    #include <PointConflict/CORE/CORE_DATA_TABLE.h>
    #include "Engine.h"
    
    void UUI_BUTTON::NativePreConstruct()
    {
    Super::NativePreConstruct();
    ID = "BUTTON";
    TArray<FString> _IDENTITY =
    {
    /* 0 */ "TITLE_TEXT_FONT",
    /* 1 */ "TITLE_TEXT_SIZE",
    /* 2 */ "TITLE_TEXT_OPACITY",
    /* 3 */ "TITLE_TEXT_COLOR",
    /* 4 */ "TITLE_TEXT_MATERIAL",
    /* 5 */ "TITLE_TEXT_OUTLINE_SIZE",
    /* 6 */ "TITLE_TEXT_OUTLINE_OPACITY",
    /* 7 */ "TITLE_TEXT_OUTLINE_COLOR",
    /* 8 */ "TITLE_TEXT_OUTLINE_MATERIAL",
    /* 9 */ "BORDER_FORM",
    /* 10 */ "BORDER_OPACITY",
    /* 11 */ "BORDER_COLOR",
    /* 12 */ "BACKGROUND_OPACITY",
    /* 13 */ "BACKGROUND_COLOR",
    /* 14 */ "BACKGROUND_MATERIAL"
    };
    IDENTITY = FUI_IDENTITY(_IDENTITY);
    if (DEFAULT_FONT)
    {
    FSlateFontInfo FONT = BUTTON_TITLE->Font;
    FONT.FontObject = DEFAULT_FONT;
    FONT.Size = DEFAULT_FONT_SIZE;
    BUTTON_TITLE->SetFont(FONT);
    }
    BUTTON_TITLE->SetText(TITLE);
    };
    
    void UUI_BUTTON::NativeConstruct()
    {
    Super::NativeConstruct();
    };
    
    void UUI_BUTTON::UPDATE()
    {
    ACORE_GAME_MODE* GAME_MODE = (ACORE_GAME_MODE*)GetWorld()->GetAuthGameMode();
    UCORE_SETTINGS_MANAGER* SETTINGS = GAME_MODE->SETTINGS_MANAGER;
    UCORE_DATA_TABLE* DATA_TABLE = GAME_MODE->DATA_TABLE;
    
    EUI_INTERACTION_STATE STATE = (IS_ENABLED) ? (IS_HOVERED) ? (IS_SELECTED) ? EUI_INTERACTION_STATE::HOVERED_AND_SELECTED : EUI_INTERACTION_STATE::HOVERED : (IS_SELECTED) ? EUI_INTERACTION_STATE::SELECTED : EUI_INTERACTION_STATE::REGULAR : (IS_HOVERED) ? EUI_INTERACTION_STATE::HOVERED_AND_DISABLED : EUI_INTERACTION_STATE::DISABLED;
    
    FSlateFontInfo FONT = BUTTON_TITLE->Font;
    FLinearColor TEXT_COLOR;
    FLinearColor OUTLINE_COLOR;
    FLinearColor BORDER_COLOR;
    FLinearColor BACKGROUND_COLOR;
    
    bool SUCCESS = true;
    
    for (int i = 0; i < IDENTITY.NUMBER_OF_ELEMENTS(); i++)
    {
    FString COMMAND = UCORE_FUNCTION_LIBRARY::CommandCompound("UI", FAMILY, ID, UEnum::GetDisplayValueAsText(STATE).ToString(), IDENTITY.GET_ELEMENT(i));
    uint8 VALUE = 0;
    if (SETTINGS->GET_VALUE(COMMAND, VALUE))
    {
    switch (i)
    {
    case 0: // FONT
    if (DATA_TABLE->FONTS[VALUE].FONT) FONT.FontObject = DATA_TABLE->FONTS[VALUE].FONT;
    break;
    case 1: // SIZE
    FONT.Size = VALUE;
    break;
    case 2: // OPACITY
    TEXT_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 3: // COLOR
    TEXT_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, TEXT_COLOR.A);
    break;
    case 4: // MATERIAL
    FONT.FontMaterial = DATA_TABLE->MATERIALS[VALUE].MATERIAL;
    break;
    case 5: // OUTLINE SIZE
    FONT.OutlineSettings.OutlineSize = VALUE;
    break;
    case 6: // OUTLINE OPACITY
    OUTLINE_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 7: // OUTLINE COLOR
    OUTLINE_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, OUTLINE_COLOR.A);
    break;
    case 8: // OUTLINE MATERIAL
    FONT.OutlineSettings.OutlineMaterial = DATA_TABLE->MATERIALS[VALUE].MATERIAL;
    break;
    case 9: // BORDER FORM
    BUTTON_BORDER->SetBrushFromTexture(DATA_TABLE->BORDER_FORMS[VALUE].BORDER_FORM);
    break;
    case 10: // BORDER OPACITY
    BORDER_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 11: // BORDER COLOR
    BORDER_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, BORDER_COLOR.A);
    break;
    case 12: // BACKGROUND OPACITY
    BACKGROUND_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 13: // BACKGROUND COLOR
    BACKGROUND_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, BACKGROUND_COLOR.A);
    break;
    case 14: // BACKGROUND MATERIAL
    BUTTON_BACKGROUND->SetBrushFromMaterial(DATA_TABLE->MATERIALS[VALUE].MATERIAL);
    break;
    default:
    break;
    }
    }
    else
    {
    GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, FString("ERROR: CAN'T FIND " + COMMAND));
    SUCCESS = false;
    break;
    }
    };
    
    if (SUCCESS)
    {
    BUTTON_TITLE->SetText(TITLE);
    FONT.OutlineSettings.OutlineColor = OUTLINE_COLOR;
    BUTTON_TITLE->SetFont(FONT);
    BUTTON_TITLE->SetColorAndOpacity(TEXT_COLOR);
    BUTTON_BORDER->SetBrushColor(BORDER_COLOR);
    BUTTON_BACKGROUND->SetBrushColor(BACKGROUND_COLOR);
    }
    };
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #pragma once
    
    #include "CoreMinimal.h"
    #include "UI_INTERACTABLE_OBJECT.h"
    #include "UI_PLAYER_ICON.generated.h"
    
    class UImage;
    class UBorder;
    
    // REVERSE TYPE
    UENUM(BlueprintType)
    enum class EUI_PLAYER_ICON_ALIGNMENT : uint8
    {
    SELF UMETA(DisplayName = "SELF"),
    ALLY UMETA(DisplayName = "ALLY"),
    ENEMY UMETA(DisplayName = "ENEMY")
    };
    
    
    UCLASS(Abstract)
    class POINTCONFLICT_API UUI_PLAYER_ICON : public UUI_INTERACTABLE_OBJECT
    {
    GENERATED_BODY()
    
    public:
    
    virtual void NativePreConstruct() override;
    virtual void NativeConstruct() override;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "DEFAULT") EUI_PLAYER_ICON_ALIGNMENT ALIGNMENT;
    
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UBorder* PLAYER_ICON_BORDER;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UBorder* PLAYER_ICON_BACKGROUND;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UImage* PLAYER_ICON_IMAGE;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category = "BINDINGS") UImage* ALIGNMENT_LINE;
    
    virtual void UPDATE() override;
    
    };
    Code:
    #include "UI_PLAYER_ICON.h"
    #include "UI_MAIN_MENU.h"
    #include <PointConflict/CORE/CORE_GAME_MODE.h>
    #include <PointConflict/CORE/CORE_DATA_TABLE.h>
    #include <PointConflict/CORE/CORE_SETTINGS_MANAGER.h>
    #include <PointConflict/CORE/CORE_FUNCTION_LIBRARY.h>
    #include "Components/Border.h"
    #include "Components/Image.h"
    #include "Engine.h"
    
    void UUI_PLAYER_ICON::NativePreConstruct()
    {
    Super::NativePreConstruct();
    ID = "PLAYER_ICON";
    TArray<FString> _IDENTITY =
    {
    /* 0 */ "BORDER_FORM",
    /* 1 */ "BORDER_OPACITY",
    /* 2 */ "BORDER_COLOR",
    /* 3 */ "BACKGROUND_OPACITY",
    /* 4 */ "BACKGROUND_COLOR",
    /* 5 */ "BACKGROUND_MATERIAL",
    /* 6 */ "ICON_OPACITY",
    /* 7 */ "ALIGNMENT_LINE_OPACITY",
    /* 8 */ "ALIGNMENT_LINE_COLOR"
    };
    IDENTITY = FUI_IDENTITY(_IDENTITY);
    };
    
    void UUI_PLAYER_ICON::NativeConstruct()
    {
    Super::NativeConstruct();
    
    };
    
    void UUI_PLAYER_ICON::UPDATE()
    {
    ACORE_GAME_MODE* GAME_MODE = (ACORE_GAME_MODE*)GetWorld()->GetAuthGameMode();
    UCORE_SETTINGS_MANAGER* SETTINGS = GAME_MODE->SETTINGS_MANAGER;
    UCORE_DATA_TABLE* DATA_TABLE = GAME_MODE->DATA_TABLE;
    
    EUI_INTERACTION_STATE STATE = (IS_ENABLED) ? (IS_HOVERED) ? (IS_SELECTED) ? EUI_INTERACTION_STATE::HOVERED_AND_SELECTED : EUI_INTERACTION_STATE::HOVERED : (IS_SELECTED) ? EUI_INTERACTION_STATE::SELECTED : EUI_INTERACTION_STATE::REGULAR : (IS_HOVERED) ? EUI_INTERACTION_STATE::HOVERED_AND_DISABLED : EUI_INTERACTION_STATE::DISABLED;
    
    FLinearColor BORDER_COLOR;
    FLinearColor BACKGROUND_COLOR;
    
    bool SUCCESS = true;
    
    for (int i = 0; i < IDENTITY.NUMBER_OF_ELEMENTS(); i++)
    {
    FString COMMAND = UCORE_FUNCTION_LIBRARY::CommandCompound("UI", FAMILY, ID, (i != 8) ? UEnum::GetDisplayValueAsText(STATE).ToString() : UEnum::GetDisplayValueAsText(ALIGNMENT).ToString(), IDENTITY.GET_ELEMENT(i));
    uint8 VALUE = 0;
    if (SETTINGS->GET_VALUE(COMMAND, VALUE))
    {
    switch (i)
    {
    case 0: // BORDER FORM
    PLAYER_ICON_BORDER->SetBrushFromTexture(DATA_TABLE->BORDER_FORMS[VALUE].BORDER_FORM);
    break;
    case 1: // BORDER OPACITY
    BORDER_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 2: // BORDER COLOR
    BORDER_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, BORDER_COLOR.A);
    break;
    case 3: // BACKGROUND OPACITY
    BACKGROUND_COLOR.A = UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE);
    break;
    case 4: // BACKGROUND COLOR
    BACKGROUND_COLOR = UCORE_FUNCTION_LIBRARY::MixColorAndOpacity(DATA_TABLE->COLORS[VALUE].COLOR, BACKGROUND_COLOR.A);
    break;
    case 5: // BACKGROUND MATERIAL
    PLAYER_ICON_BACKGROUND->SetBrushFromMaterial(DATA_TABLE->MATERIALS[VALUE].MATERIAL);
    break;
    case 6: // ICON OPACITY
    PLAYER_ICON_IMAGE->SetOpacity(UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE));
    break;
    case 7: // ALIGNMENT LINE OPACITY
    ALIGNMENT_LINE->SetOpacity(UCORE_FUNCTION_LIBRARY::ConvertIntegerValueToOpacity(VALUE));
    break;
    case 8: // ALIGNMENT LINE COLOR
    ALIGNMENT_LINE->SetBrushTintColor(DATA_TABLE->COLORS[VALUE].COLOR);
    break;
    default:
    break;
    }
    }
    else
    {
    GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, FString("ERROR: CAN'T FIND " + COMMAND));
    SUCCESS = false;
    break;
    }
    };
    
    if (SUCCESS)
    {
    PLAYER_ICON_BORDER->SetBrushColor(BORDER_COLOR);
    PLAYER_ICON_BACKGROUND->SetBrushColor(BACKGROUND_COLOR);
    }
    };

    #2
    Heres one more issue with those classes btw https://www.youtube.com/watch?v=_7Ji...ature=youtu.be
    When im trying to copy/paste UGridPanel with my custom widgets inside, engine crashes, but if i copy my widgets to grid panel directly everything goes ok, any ideas what cause that?
    Last edited by Repin Design; 08-02-2020, 05:04 PM.

    Comment

    Working...
    X