Use exact same colours as original classic for menu background overlay

This commit is contained in:
UnknownShadow200 2017-11-03 20:46:17 +11:00
parent b365a3b796
commit f9fefd6ce8
6 changed files with 18 additions and 15 deletions

View File

@ -12,7 +12,12 @@ namespace ClassicalSharp.Gui.Screens {
}
protected Widget[] widgets;
protected Font titleFont, regularFont;
protected FastColour backCol = new FastColour(60, 60, 60, 160);
// 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++) {
@ -22,7 +27,7 @@ namespace ClassicalSharp.Gui.Screens {
}
protected void RenderMenuBounds() {
gfx.Draw2DQuad(0, 0, game.Width, game.Height, backCol);
gfx.Draw2DQuad(0, 0, game.Width, game.Height, topBackCol, bottomBackCol);
}
public override void Render(double delta) {

View File

@ -19,7 +19,6 @@ namespace ClassicalSharp.Gui.Screens {
base.Init();
titleFont = new Font(game.FontName, 16, FontStyle.Bold);
regularFont = new Font(game.FontName, 16);
backCol.A = 210;
if (game.Graphics.LostContext) return;
MakeButtons();

View File

@ -50,8 +50,8 @@ namespace ClassicalSharp.Gui.Widgets {
public override void EnterInput() {
if (!Text.Empty) {
// Don't want trailing spaces in output message
string allText = new String(Text.value, 0, Text.TextLength);
game.Chat.Send(allText);
string text = new String(Text.value, 0, Text.TextLength);
game.Chat.Send(text);
}
originalText = null;

View File

@ -37,15 +37,15 @@ namespace ClassicalSharp.Gui.Widgets {
// 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 topCol = new FastColour(34, 34, 34, 168);
static FastColour bottomCol = new FastColour(57, 57, 104, 202);
static FastColour topBackCol = new FastColour(34, 34, 34, 168);
static FastColour bottomBackCol = new FastColour(57, 57, 104, 202);
static FastColour topSelCol = new FastColour(255, 255, 255, 142);
static FastColour bottomSelCol = new FastColour(255, 255, 255, 192);
static VertexP3fT2fC4b[] vertices = new VertexP3fT2fC4b[8 * 10 * (4 * 4)];
int vb;
public override void Render(double delta) {
gfx.Draw2DQuad(TableX, TableY, TableWidth, TableHeight, topCol, bottomCol);
gfx.Draw2DQuad(TableX, TableY, TableWidth, TableHeight, topBackCol, bottomBackCol);
if (totalRows > MaxRowsDisplayed) scroll.Render(delta);
if (SelectedIndex != -1 && game.ClassicMode) {

View File

@ -492,12 +492,12 @@ Int32 Table_Height(TableWidget* widget) {
}
/* These were sourced by taking a screenshot of vanilla
Then using paInt32 to extract the colour components
Then using paint to extract the colour components
Then using wolfram alpha to solve the glblendfunc equation */
PackedCol Table_TopCol = PACKEDCOL_CONST( 34, 34, 34, 168);
PackedCol Table_BottomCol = PACKEDCOL_CONST( 57, 57, 104, 202);
PackedCol Table_TopSelCol = PACKEDCOL_CONST(255, 255, 255, 142);
PackedCol Table_BottomSelCol = PACKEDCOL_CONST(255, 255, 255, 192);
PackedCol Table_TopBackCol = PACKEDCOL_CONST( 34, 34, 34, 168);
PackedCol Table_BottomBackCol = PACKEDCOL_CONST( 57, 57, 104, 202);
PackedCol Table_TopSelCol = PACKEDCOL_CONST(255, 255, 255, 142);
PackedCol Table_BottomSelCol = PACKEDCOL_CONST(255, 255, 255, 192);
#define TABLE_MAX_VERTICES (8 * 10 * ISOMETRICDRAWER_MAXVERTICES)
bool TableWidget_GetCoords(TableWidget* widget, Int32 i, Int32* winX, Int32* winY) {
@ -623,7 +623,7 @@ void TableWidget_Init(GuiElement* elem) {
void TableWidget_Render(GuiElement* elem, Real64 delta) {
TableWidget* widget = (TableWidget*)elem;
GfxCommon_Draw2DGradient(Table_X(widget), Table_Y(widget),
Table_Width(widget), Table_Height(widget), Table_TopCol, Table_BottomCol);
Table_Width(widget), Table_Height(widget), Table_TopBackCol, Table_BottomBackCol);
if (widget->RowsCount > TABLE_MAX_ROWS_DISPLAYED) {
GuiElement* scroll = &widget->Scroll.Base.Base;
scroll->Render(scroll, delta);

View File

@ -120,7 +120,6 @@ void SpecialInputWidget_SetActive(SpecialInputWidget* widget, bool active);
#define INPUTWIDGET_MAX_LINES 3
struct InputWidget_;
/* Remakes the raw texture containing all the chat lines. Also updates the dimensions of the widget. */
typedef struct InputWidget_ {
Widget Base;
FontDesc Font;