fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
a8034e9
v2.1.1b
1local SKIN =gui . newSkin ( "dark" ) 2 3SKIN . Background =color ( 41 , 45 , 48 ) 4 5SKIN . PanelBackground =color ( 59 , 63 , 69 ) 6SKIN . PanelBorder =color ( 35 , 37 , 41 ) 7SKIN . PanelFocused =color ( 0 , 162 , 232 ) 8 9SKIN . SubPanelBackground =color ( 72 , 77 , 84 ) 10 11SKIN . FrameBorder =color ( 100 , 100 , 100 ) 12SKIN . FrameControlBar =color ( 225 , 225 , 225 ) 13SKIN . FrameFocusedControlBar =color ( 0 , 162 , 232 ) 14 15SKIN . ButtonBackground =color ( 82 , 89 , 97 ) 16SKIN . ButtonDisabled =color ( 100 , 100 , 100 , 100 ) 17SKIN . ButtonPressed =color ( 0 , 135 , 195 , 100 ) 18SKIN . ButtonHover =color ( 104 , 112 , 122 ) 19 20SKIN . ButtonClosePressed =color ( 243 , 105 , 113 ) 21SKIN . ButtonCloseHover =color ( 248 , 167 , 171 ) 22 23SKIN . TextEntryBackground =color ( 255 , 255 , 255 ) 24SKIN . TextEntryFocused =color ( 0 , 162 , 232 ) 25 26SKIN . ScrollBarGrip =color ( 235 , 235 , 235 ) 27SKIN . ScrollBarGripPressed =color ( 96 , 96 , 96 , 255 ) 28SKIN . ScrollBarGripHover =color ( 166 , 166 , 166 , 255 ) 29 30SKIN . CheckboxBorder =color ( 35 , 37 , 41 ) 31SKIN . CheckboxOff =color ( 200 , 200 , 200 ) 32SKIN . CheckboxOn =color ( 0 , 162 , 232 ) 33 34SKIN . TabActiveColor =color ( 0 , 0 , 0 , 75 ) 35 36SKIN . LabelTextColor =color ( 255 , 255 , 255 ) 37SKIN . LabelShadowColor =color ( 0 , 0 , 0 , 100 ) 38 39SKIN . ToolTipTitleColor =color ( 0 , 178 , 255 ) 40SKIN . ToolTipTitleShadowColor =color ( 0 , 0 , 0 , 100 ) 41 42SKIN . ToolTipBodyColor =color ( 255 , 255 , 255 ) 43SKIN . ToolTipBodyShadowColor =color ( 0 , 0 , 0 , 100 ) 44 45SKIN . CheckImage =graphics . newImage ( "textures/gui/checkmark.png" ) 46 47function SKIN : InitPanel ( panel ) 48panel : SetBGColor ( self . PanelBackground ) 49panel : SetBorderColor ( self . PanelBorder ) 50end 51 52function SKIN : PaintPanel ( panel , w , h ) 53graphics . setColor ( panel : GetBGColor ()) 54graphics . rectangle ( "fill" , 0 , 0 , w , h ) 55end 56 57function SKIN : PaintOverlayPanel ( panel , w , h ) 58graphics . setLineStyle ( "rough" ) 59graphics . setLineWidth ( 1 ) 60 61graphics . setColor ( panel : GetBorderColor ()) 62graphics . innerRectangle ( 0 , 0 , w , h ) 63end 64 65function SKIN : PaintSlider ( panel , w , h ) 66graphics . setColor ( self . Background ) 67graphics . rectangle ( "fill" , 0 , 0 , w , h ) 68 69graphics . setLineStyle ( "rough" ) 70graphics . setLineWidth ( 1 ) 71 72graphics . setColor ( panel : GetBorderColor ()) 73graphics . innerRectangle ( 0 , 0 , w , h ) 74end 75 76function SKIN : PaintOverlayFocusPanel ( panel , w , h ) 77graphics . setLineStyle ( "rough" ) 78graphics . setLineWidth ( 1 ) 79 80if panel : IsEnabled () and panel : HasFocus () then 81graphics . setColor ( self . PanelFocused ) 82graphics . innerRectangle ( 0 , 0 , w , h ) 83else 84graphics . setColor ( panel : GetBorderColor ()) 85graphics . innerRectangle ( 0 , 0 , w , h ) 86end 87end 88 89function SKIN : PaintScrollBarButtonUp ( panel , w , h ) 90self : PaintButton ( panel , w , h ) 91graphics . setColor ( 150 , 150 , 150 , 255 ) 92graphics . polygon ( 'fill' , 4 , 12 , 8 , 4 , 12 , 12 ) 93end 94 95function SKIN : PaintScrollBarButtonDown ( panel , w , h ) 96self : PaintButton ( panel , w , h ) 97graphics . setColor ( 150 , 150 , 150 , 255 ) 98graphics . polygon ( 'fill' , 4 , 4 , 12 , 4 , 8 , 12 ) 99end 100 101function SKIN : PaintScrollBarGrip ( panel , w , h ) 102self : PaintButton ( panel , w , h ) 103end 104 105function SKIN : InitButton ( panel ) 106--[[panel:SetBGColor(self.ButtonBackground) 107panel:SetBorderColor(self.PanelBorder) 108panel:SetPressedColor(self.ButtonPressed) 109panel:SetHoveredColor(self.ButtonHover)]] 110end 111 112function SKIN : InitExitButton ( panel ) 113panel : SetPressedColor ( self . ButtonClosePressed ) 114panel : SetHoveredColor ( self . ButtonCloseHover ) 115end 116 117function SKIN : PaintButton ( panel , w , h ) 118graphics . setColor ( self . ButtonBackground ) 119graphics . rectangle ( "fill" , 0 , 0 , w , h ) 120 121if panel : IsPressed () then 122graphics . setColor ( panel : GetPressedColor () or self . ButtonPressed ) 123graphics . rectangle ( "fill" , 0 , 0 , w , h ) 124elseif panel : IsHovered () then 125graphics . setColor ( panel : GetHoveredColor () or self . ButtonHover ) 126graphics . rectangle ( "fill" , 0 , 0 , w , h ) 127end 128 129graphics . setLineStyle ( "rough" ) 130graphics . setLineWidth ( 1 ) 131 132graphics . setColor ( panel : GetBorderColor () or self . PanelBorder ) 133graphics . innerRectangle ( 0 , 0 , w , h ) 134end 135 136function SKIN : PaintTab ( panel , w , h ) 137local color =self . ButtonBackground 138 139if panel : IsPressed () then 140color =panel : GetPressedColor () or self . ButtonPressed 141elseif panel : IsHovered () then 142color =panel : GetHoveredColor () or self . ButtonHover 143end 144 145graphics . setColor ( panel : GetBorderColor () or self . PanelBorder ) 146graphics . roundRect ( 0 , 0 , w , h + 4 , 4 ) 147 148graphics . setColor ( color ) 149graphics . roundRect ( 1 , 1 , w - 2 , h + 3 , 4 ) 150 151if panel : IsActive () then 152graphics . setColor ( panel : GetActiveColor () or self . TabActiveColor ) 153graphics . roundRect ( 1 , 1 , w - 2 , h + 3 , 4 ) 154end 155end 156 157function SKIN : PaintOverlayButton ( panel , w , h ) 158if not panel : IsEnabled () then 159graphics . setColor ( self . ButtonDisabled ) 160graphics . rectangle ( "fill" , 0 , 0 , w , h ) 161end 162end 163 164function SKIN : PaintFrame ( panel , w , h ) 165graphics . setColor ( self . Background ) 166graphics . rectangle ( "fill" , 0 , 0 , w , h ) 167 168graphics . setColor ( panel : HasFocus ( true ) and self . FrameFocusedControlBar or self . FrameControlBar ) 169graphics . rectangle ( "fill" , 0 , 0 , w , 32 ) 170 171graphics . setLineStyle ( "rough" ) 172graphics . setLineWidth ( 1 ) 173 174--[[graphics.setColor(255, 255, 255, 255) 175graphics.innerRectangle(0, 1, w, h - 2)]] 176 177graphics . setColor ( panel . m_cBordercolor or self . FrameBorder ) 178graphics . innerRectangle ( 0 , 0 , w , h ) 179end 180 181function SKIN : PaintTextEntry ( panel , w , h ) 182graphics . setColor ( self . TextEntryBackground ) 183graphics . rectangle ( "fill" , 0 , 0 , w , h ) 184 185graphics . setLineStyle ( "rough" ) 186graphics . setLineWidth ( 1 ) 187 188if panel : HasFocus () then 189graphics . setColor ( self . TextEntryFocused ) 190graphics . innerRectangle ( 0 , 0 , w , h ) 191else 192graphics . setColor ( panel : GetBorderColor ()) 193graphics . innerRectangle ( 0 , 0 , w , h ) 194end 195end 196 197function SKIN : PaintCheckBox ( panel , w , h ) 198graphics . setColor ( panel : IsToggled () and self . CheckboxOn or self . CheckboxOff ) 199graphics . rectangle ( "fill" , 4 , 4 , h - 8 , h - 8 ) 200 201if panel : IsToggled () then 202graphics . setColor ( 255 , 255 , 255 , 255 ) 203graphics . easyDraw ( self . CheckImage , 4 , 4 , 0 , h - 8 , h - 8 ) 204end 205 206graphics . setLineStyle ( "rough" ) 207graphics . setLineWidth ( 1 ) 208 209graphics . setColor ( self . CheckboxBorder ) 210graphics . rectangle ( "line" , 4 , 4 , h - 8 , h - 8 ) 211end 212 213function SKIN : PaintRadioBox ( panel , w , h ) 214graphics . setColor ( panel : IsToggled () and self . CheckboxOn or self . CheckboxOff ) 215graphics . circle ( "fill" , 12 , 12 , h / 2 - 6 , 32 ) 216 217graphics . setLineStyle ( "smooth" ) 218graphics . setLineWidth ( 1 ) 219 220graphics . setColor ( self . CheckboxBorder ) 221graphics . circle ( "line" , 12 , 12 , h / 2 - 6 , 32 ) 222end 223 224function SKIN : InitHorizontalSelect ( panel ) 225panel : SetBGColor ( self . PanelBackground ) 226panel : SetBorderColor ( self . PanelBorder ) 227end 228 229function SKIN : InitLabel ( label ) 230label : SetTextColor ( self . LabelTextColor ) 231label : SetShadowColor ( self . LabelShadowColor ) 232end 233 234function SKIN : InitSubPanel ( panel ) 235panel : SetBGColor ( self . SubPanelBackground ) 236end 237 238function SKIN : InitTooltip ( tooltip ) 239tooltip : SetTooltipColor ( self . SubPanelBackground ) 240end 241 242function SKIN : InitTooltipTitle ( title ) 243title : SetShadowColor ( self . LabelShadowColor ) 244title : SetTextColor ( self . ToolTipTitleColor ) 245end 246 247function SKIN : InitTooltipBody ( body ) 248body : SetShadowColor ( self . LabelShadowColor ) 249body : SetTextColor ( self . ToolTipBodyColor ) 250end