From 3a0895bfd1c3fe494b1798234839e7f4514b06c4 Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Mon, 23 Nov 2020 17:41:01 +0100 Subject: [PATCH] Added button type cancel description --- d2core/d2ui/button.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/d2core/d2ui/button.go b/d2core/d2ui/button.go index f2b54c03..78859fcb 100644 --- a/d2core/d2ui/button.go +++ b/d2core/d2ui/button.go @@ -49,6 +49,7 @@ const ( ButtonTypeLeftArrow ButtonType = 29 ButtonTypeRightArrow ButtonType = 30 ButtonTypeQuary ButtonType = 31 + ButtonTypeTest ButtonType = 32 ButtonNoFixedWidth int = -1 ButtonNoFixedHeight int = -1 @@ -138,6 +139,10 @@ const ( buttonTallSegmentsY = 1 buttonTallTextOffset = 5 + buttonCancelSegmentsX = 1 + buttonCancelSegmentsY = 1 + buttonCancelTextOffset = 1 + buttonOkCancelSegmentsX = 1 buttonOkCancelSegmentsY = 1 buttonOkCancelDisabledFrame = -1 @@ -181,6 +186,21 @@ const ( // nolint:funlen // cant reduce func getButtonLayouts() map[ButtonType]ButtonLayout { return map[ButtonType]ButtonLayout{ + ButtonTypeTest: { + XSegments: 2, + YSegments: 2, + DisabledFrame: -1, + DisabledColor: lightGreyAlpha75, + TextOffset: buttonWideTextOffset, + ResourceName: d2resource.NarrowButtonBlank, + PaletteName: d2resource.PaletteUnits, + FontPath: d2resource.FontExocet10, + AllowFrameChange: true, + HasImage: true, + FixedWidth: ButtonNoFixedWidth, + FixedHeight: ButtonNoFixedHeight, + LabelColor: greyAlpha100, + }, ButtonTypeWide: { XSegments: buttonWideSegmentsX, YSegments: buttonWideSegmentsY, @@ -196,6 +216,21 @@ func getButtonLayouts() map[ButtonType]ButtonLayout { FixedHeight: ButtonNoFixedHeight, LabelColor: greyAlpha100, }, + ButtonTypeCancel: { + XSegments: buttonCancelSegmentsX, + YSegments: buttonCancelSegmentsY, + DisabledFrame: 0, + DisabledColor: lightGreyAlpha75, + TextOffset: buttonCancelTextOffset, + ResourceName: d2resource.CancelButton, + PaletteName: d2resource.PaletteUnits, + FontPath: d2resource.FontExocet10, + AllowFrameChange: true, + HasImage: true, + FixedWidth: ButtonNoFixedWidth, + FixedHeight: ButtonNoFixedHeight, + LabelColor: greyAlpha100, + }, ButtonTypeShort: { XSegments: buttonShortSegmentsX, YSegments: buttonShortSegmentsY,