diff --git a/Plugins/Editor/Resources/GUI/WinBtnClose.png b/Plugins/Editor/Resources/GUI/WinBtnClose.png new file mode 100644 index 0000000..10c0b33 Binary files /dev/null and b/Plugins/Editor/Resources/GUI/WinBtnClose.png differ diff --git a/Plugins/Editor/Resources/GUI/WinBtnClose.png.meta b/Plugins/Editor/Resources/GUI/WinBtnClose.png.meta new file mode 100644 index 0000000..759dd21 --- /dev/null +++ b/Plugins/Editor/Resources/GUI/WinBtnClose.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 1e53da2a5e9c1d04f9b45fa9e931f86e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 1 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs index db304c4..482a4a5 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs @@ -151,7 +151,7 @@ static void OnEditModeSelectionSceneGUI() buttonArea.y = 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Clip.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Clip.GUI.cs index 075a802..b992e6c 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Clip.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Clip.GUI.cs @@ -60,7 +60,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeClip tool) buttonArea.y += 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Edit.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Edit.GUI.cs index 8b0973e..b42a5b9 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Edit.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Edit.GUI.cs @@ -47,7 +47,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeMeshEdit tool) buttonArea.y += 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Generate.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Generate.GUI.cs index 0e5f634..6adc444 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Generate.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Generate.GUI.cs @@ -48,7 +48,7 @@ public static bool OnSceneGUI(Rect windowRect, EditModeGenerate tool) buttonArea.y += 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Place.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Place.GUI.cs index 5d20cac..b75d306 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Place.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Place.GUI.cs @@ -48,7 +48,7 @@ public static void OnSceneGUI(Rect windowRect, EditModePlace tool) buttonArea.y += 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Surface.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Surface.GUI.cs index b306e90..6a94254 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Surface.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModes/EditMode.Surface.GUI.cs @@ -1083,7 +1083,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeSurface tool) buttonArea.y += 2; buttonArea.height = 13; buttonArea.width = 13; - if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose")) + if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose)) EditModeToolWindowSceneGUI.GetWindow(); TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea); diff --git a/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs b/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs index c97399e..5e1cc50 100644 --- a/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs +++ b/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs @@ -92,6 +92,8 @@ internal static class CSG_GUIStyleUtility public static GUIStyle unpaddedWindow; + public static GUIStyle winBtnClose; + public static GUILayoutOption[] ContentEmpty = new GUILayoutOption[0]; @@ -364,6 +366,21 @@ public static void InitStyles() selectionRectStyle = GetStyle("selectionRect"); + winBtnClose = new GUIStyle(GUI.skin.verticalScrollbarUpButton); + winBtnClose.normal.background = Resources.Load("GUI/WinBtnClose"); + winBtnClose.onActive.background = + winBtnClose.onFocused.background = + winBtnClose.onNormal.background = + winBtnClose.onHover.background = + winBtnClose.hover.background = + winBtnClose.focused.background = + winBtnClose.active.background = null; + winBtnClose.fixedHeight = 16f; + winBtnClose.fixedWidth = 16f; + winBtnClose.overflow.bottom = 0; + winBtnClose.overflow.top = 0; + winBtnClose.overflow.right = 0; + winBtnClose.overflow.left = 0; var redToolbarDropDown = GetStyle("toolbarDropDown");