Browse Source

fix GuiIconButtonCtrl not taking borderThickness entires

AzaezelX 2 năm trước cách đây
mục cha
commit
76a7b024e8

+ 12 - 6
Engine/source/gui/buttons/guiIconButtonCtrl.cpp

@@ -247,8 +247,10 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect )
       }
       else
       {
-         drawer->drawRectFill(boundsRect, mProfile->mFillColorHL);
-         drawer->drawRect(boundsRect, mProfile->mBorderColorHL);
+         if (mProfile->mBorder != 0)
+            renderFilledBorder(boundsRect, mProfile->mBorderColorHL, mProfile->mFillColorHL, mProfile->mBorderThickness);
+         else
+            GFX->getDrawUtil()->drawRectFill(boundsRect, mProfile->mFillColorHL);
       }
    }
    else
@@ -266,13 +268,17 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect )
       {
          if (mActive)
          {
-            drawer->drawRectFill(boundsRect, mProfile->mFillColor);
-            drawer->drawRect(boundsRect, mProfile->mBorderColor);
+            if (mProfile->mBorder != 0)
+               renderFilledBorder(boundsRect, mProfile->mBorderColor, mProfile->mFillColor, mProfile->mBorderThickness);
+            else
+               GFX->getDrawUtil()->drawRectFill(boundsRect, mProfile->mFillColor);
          }
          else
          {
-            drawer->drawRectFill(boundsRect, mProfile->mFillColorNA);
-            drawer->drawRect(boundsRect, mProfile->mBorderColorNA);
+            if (mProfile->mBorder != 0)
+               renderFilledBorder(boundsRect, mProfile->mBorderColorNA, mProfile->mFillColorNA, mProfile->mBorderThickness);
+            else
+               GFX->getDrawUtil()->drawRectFill(boundsRect, mProfile->mFillColor);
          }
       }
    }

+ 10 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.tscript

@@ -6,6 +6,7 @@ singleton GuiControlProfile(AssetBrowserPreviewImageAsset : ToolsGuiDefaultProfi
    border = true;
    borderColor   = "230 126 0 255";
    borderColorNA = "230 126 0 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultProfile)
@@ -16,6 +17,7 @@ singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultPr
    border = true;
    borderColor   = "0 100 0 255";
    borderColorNA = "0 100 0 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfile)
@@ -26,6 +28,7 @@ singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfi
    border = true;
    borderColor   = "0 0 200 255";
    borderColorNA = "0 0 200 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDefaultProfile)
@@ -36,6 +39,7 @@ singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDef
    border = true;
    borderColor   = "0 0 200 255";
    borderColorNA = "0 0 200 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfile)
@@ -46,6 +50,7 @@ singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfi
    border = true;
    borderColor   = "75 101 135 255";
    borderColorNA = "75 101 135 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultProfile)
@@ -56,6 +61,7 @@ singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultPro
    border = true;
    borderColor   = "200 198 198 255";
    borderColorNA = "200 198 198 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDefaultProfile)
@@ -66,6 +72,7 @@ singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDe
    border = true;
    borderColor   = "200 198 198 255";
    borderColorNA = "200 198 198 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefaultProfile)
@@ -76,6 +83,7 @@ singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefau
    border = true;
    borderColor   = "0 76 135 255";
    borderColorNA = "0 76 135 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile)
@@ -86,6 +94,7 @@ singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile
    border = true;
    borderColor   = "17 5 44 255";
    borderColorNA = "17 5 44 255";
+   borderThickness = 5;
 };
 
 singleton GuiControlProfile(AssetBrowserPreviewLevelAsset : ToolsGuiDefaultProfile)
@@ -96,4 +105,5 @@ singleton GuiControlProfile(AssetBrowserPreviewLevelAsset : ToolsGuiDefaultProfi
    border = true;
    borderColor   = "0 208 186 255";
    borderColorNA = "0 208 186 255";
+   borderThickness = 5;
 };