Don't forget to use original background colour for FilesScreen (And child classes) too.

This commit is contained in:
UnknownShadow200 2017-11-04 21:38:44 +11:00
parent 020505dd5c
commit 82b89c6257
4 changed files with 24 additions and 12 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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;

View File

@ -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) {