mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Don't forget to use original background colour for FilesScreen (And child classes) too.
This commit is contained in:
parent
020505dd5c
commit
82b89c6257
@ -8,6 +8,16 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
public abstract class ClickableScreen : Screen {
|
||||
|
||||
public ClickableScreen(Game game) : base(game) {
|
||||
}
|
||||
|
||||
// These were sourced by taking a screenshot of vanilla
|
||||
// Then using paint to extract the colour components
|
||||
// Then using wolfram alpha to solve the glblendfunc equation
|
||||
static FastColour topBackCol = new FastColour(24, 24, 24, 105);
|
||||
static FastColour bottomBackCol = new FastColour(51, 51, 98, 162);
|
||||
|
||||
protected void RenderMenuBounds() {
|
||||
gfx.Draw2DQuad(0, 0, game.Width, game.Height, topBackCol, bottomBackCol);
|
||||
}
|
||||
|
||||
protected bool HandleMouseClick(Widget[] widgets, int mouseX, int mouseY, MouseButton button) {
|
||||
|
@ -132,7 +132,7 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
}
|
||||
|
||||
public override void Render(double delta) {
|
||||
gfx.Draw2DQuad(0, 0, game.Width, game.Height, new FastColour(60, 60, 60, 160));
|
||||
RenderMenuBounds();
|
||||
gfx.Texturing = true;
|
||||
title.Render(delta);
|
||||
RenderWidgets(buttons, delta);
|
||||
|
@ -12,13 +12,7 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
}
|
||||
protected Widget[] widgets;
|
||||
protected Font titleFont, regularFont;
|
||||
|
||||
// These were sourced by taking a screenshot of vanilla
|
||||
// Then using paint to extract the colour components
|
||||
// Then using wolfram alpha to solve the glblendfunc equation
|
||||
static FastColour topBackCol = new FastColour(24, 24, 24, 105);
|
||||
static FastColour bottomBackCol = new FastColour(51, 51, 98, 162);
|
||||
|
||||
|
||||
protected int IndexOfWidget(Widget w) {
|
||||
for (int i = 0; i < widgets.Length; i++) {
|
||||
if (widgets[i] == w) return i;
|
||||
@ -26,10 +20,6 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected void RenderMenuBounds() {
|
||||
gfx.Draw2DQuad(0, 0, game.Width, game.Height, topBackCol, bottomBackCol);
|
||||
}
|
||||
|
||||
public override void Render(double delta) {
|
||||
RenderMenuBounds();
|
||||
gfx.Texturing = true;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "Widgets.h"
|
||||
#include "Game.h"
|
||||
#include "Events.h"
|
||||
#include "GraphicsCommon.h"
|
||||
|
||||
void Screen_FreeWidgets(Widget** widgets, UInt32 widgetsCount) {
|
||||
if (widgets == NULL) return;
|
||||
@ -32,6 +33,17 @@ void Screen_RenderWidgets(Widget** widgets, UInt32 widgetsCount, Real64 delta) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* These were sourced by taking a screenshot of vanilla
|
||||
Then using paint to extract the colour components
|
||||
Then using wolfram alpha to solve the glblendfunc equation */
|
||||
PackedCol Menu_TopBackCol = PACKEDCOL_CONST(24, 24, 24, 105);
|
||||
PackedCol Menu_BottomBackCol = PACKEDCOL_CONST(51, 51, 98, 162);
|
||||
|
||||
void ClickableScreen_RenderMenuBounds(void) {
|
||||
GfxCommon_Draw2DGradient(0, 0, Game_Width, Game_Height, Menu_TopBackCol, Menu_BottomBackCol);
|
||||
}
|
||||
|
||||
void ClickableScreen_DefaultWidgetSelected(GuiElement* elem, Widget* widget) { }
|
||||
|
||||
bool ClickableScreen_HandlesMouseDown(GuiElement* elem, Int32 x, Int32 y, MouseButton btn) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user