mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 20:15:35 -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
@ -10,6 +10,16 @@ namespace ClassicalSharp.Gui.Screens {
|
|||||||
public ClickableScreen(Game game) : base(game) {
|
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) {
|
protected bool HandleMouseClick(Widget[] widgets, int mouseX, int mouseY, MouseButton button) {
|
||||||
// iterate backwards (because last elements rendered are shown over others)
|
// iterate backwards (because last elements rendered are shown over others)
|
||||||
for (int i = widgets.Length - 1; i >= 0; i--) {
|
for (int i = widgets.Length - 1; i >= 0; i--) {
|
||||||
|
@ -132,7 +132,7 @@ namespace ClassicalSharp.Gui.Screens {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Render(double delta) {
|
public override void Render(double delta) {
|
||||||
gfx.Draw2DQuad(0, 0, game.Width, game.Height, new FastColour(60, 60, 60, 160));
|
RenderMenuBounds();
|
||||||
gfx.Texturing = true;
|
gfx.Texturing = true;
|
||||||
title.Render(delta);
|
title.Render(delta);
|
||||||
RenderWidgets(buttons, delta);
|
RenderWidgets(buttons, delta);
|
||||||
|
@ -13,12 +13,6 @@ namespace ClassicalSharp.Gui.Screens {
|
|||||||
protected Widget[] widgets;
|
protected Widget[] widgets;
|
||||||
protected Font titleFont, regularFont;
|
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) {
|
protected int IndexOfWidget(Widget w) {
|
||||||
for (int i = 0; i < widgets.Length; i++) {
|
for (int i = 0; i < widgets.Length; i++) {
|
||||||
if (widgets[i] == w) return i;
|
if (widgets[i] == w) return i;
|
||||||
@ -26,10 +20,6 @@ namespace ClassicalSharp.Gui.Screens {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void RenderMenuBounds() {
|
|
||||||
gfx.Draw2DQuad(0, 0, game.Width, game.Height, topBackCol, bottomBackCol);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Render(double delta) {
|
public override void Render(double delta) {
|
||||||
RenderMenuBounds();
|
RenderMenuBounds();
|
||||||
gfx.Texturing = true;
|
gfx.Texturing = true;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "Widgets.h"
|
#include "Widgets.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Events.h"
|
#include "Events.h"
|
||||||
|
#include "GraphicsCommon.h"
|
||||||
|
|
||||||
void Screen_FreeWidgets(Widget** widgets, UInt32 widgetsCount) {
|
void Screen_FreeWidgets(Widget** widgets, UInt32 widgetsCount) {
|
||||||
if (widgets == NULL) return;
|
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) { }
|
void ClickableScreen_DefaultWidgetSelected(GuiElement* elem, Widget* widget) { }
|
||||||
|
|
||||||
bool ClickableScreen_HandlesMouseDown(GuiElement* elem, Int32 x, Int32 y, MouseButton btn) {
|
bool ClickableScreen_HandlesMouseDown(GuiElement* elem, Int32 x, Int32 y, MouseButton btn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user