Scale up resources menu background box with DPI

This commit is contained in:
UnknownShadow200 2019-07-30 22:53:14 +10:00
parent f833db6ba8
commit abd3e2853b
3 changed files with 11 additions and 13 deletions

View File

@ -84,14 +84,9 @@ CC_API void Drawer2D_MakeTextTexture(struct Texture* tex, struct DrawTextArgs* a
/* used specifies what region of the texture actually should be drawn. */
CC_API void Drawer2D_Make2DTexture(struct Texture* tex, Bitmap* bmp, Size2D used, int X, int Y);
/* Returns whether the given colour code is used/valid. */
bool Drawer2D_ValidColCodeAt(const String* text, int i);
/* Returns whether the given colour code is used/valid. */
/* NOTE: This can change if the server defines custom colour codes. */
static CC_INLINE bool Drawer2D_ValidColCode(char c) {
return Drawer2D_GetCol(c).A > 0;
}
bool Drawer2D_ValidColCodeAt(const String* text, int i);
/* Whether text is empty or consists purely of valid colour codes. */
bool Drawer2D_IsEmptyText(const String* text);
/* Returns the last valid colour code in the given input, or \0 if not found. */

View File

@ -998,16 +998,19 @@ CC_NOINLINE static void ResourcesScreen_ResetArea(int x, int y, int width, int h
Launcher_MarkDirty(x, y, width, height);
}
#define RESOURCES_XSIZE 190
#define RESOURCES_YSIZE 70
static void ResourcesScreen_Draw(struct LScreen* s) {
BitmapCol backCol = BITMAPCOL_CONST( 12, 12, 12, 255);
BitmapCol backCol = BITMAPCOL_CONST(12, 12, 12, 255);
int x, y, width, height;
Drawer2D_Clear(&Launcher_Framebuffer, backCol,
0, 0, Window_Width, Window_Height);
ResourcesScreen_ResetArea(
Window_Width / 2 - RESOURCES_XSIZE, Window_Height / 2 - RESOURCES_YSIZE,
RESOURCES_XSIZE * 2, RESOURCES_YSIZE * 2);
width = Display_ScaleX(380);
height = Display_ScaleY(140);
x = Gui_CalcPos(ANCHOR_CENTRE, 0, width, Window_Width);
y = Gui_CalcPos(ANCHOR_CENTRE, 0, height, Window_Height);
ResourcesScreen_ResetArea(x, y, width, height);
LScreen_Draw(s);
}

View File

@ -1052,7 +1052,7 @@ static bool InputWidget_CheckCol(struct InputWidget* w, int index) {
code = w->text.buffer[index];
col = w->text.buffer[index + 1];
return (code == '%' || code == '&') && Drawer2D_ValidColCode(col);
return (code == '%' || code == '&') && Drawer2D_GetCol(col).A;
}
static void InputWidget_BackspaceKey(struct InputWidget* w) {