mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
fix layout of some more menus, and put crosshair back on top screen
This commit is contained in:
parent
d46428592b
commit
96c098bd43
12
src/Menus.c
12
src/Menus.c
@ -261,6 +261,8 @@ static struct Widget* list_widgets[] = {
|
|||||||
#define LISTSCREEN_EMPTY "-"
|
#define LISTSCREEN_EMPTY "-"
|
||||||
|
|
||||||
static void ListScreen_Layout(void* screen) {
|
static void ListScreen_Layout(void* screen) {
|
||||||
|
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
||||||
|
|
||||||
struct ListScreen* s = (struct ListScreen*)screen;
|
struct ListScreen* s = (struct ListScreen*)screen;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -280,6 +282,8 @@ static void ListScreen_Layout(void* screen) {
|
|||||||
Widget_SetLocation(&s->left, ANCHOR_CENTRE, ANCHOR_CENTRE, -220, 0);
|
Widget_SetLocation(&s->left, ANCHOR_CENTRE, ANCHOR_CENTRE, -220, 0);
|
||||||
Widget_SetLocation(&s->right, ANCHOR_CENTRE, ANCHOR_CENTRE, 220, 0);
|
Widget_SetLocation(&s->right, ANCHOR_CENTRE, ANCHOR_CENTRE, 220, 0);
|
||||||
Widget_SetLocation(&s->title, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -155);
|
Widget_SetLocation(&s->title, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -155);
|
||||||
|
|
||||||
|
Window_3DS_SetRenderScreen(scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static STRING_REF cc_string ListScreen_UNSAFE_Get(struct ListScreen* s, int index) {
|
static STRING_REF cc_string ListScreen_UNSAFE_Get(struct ListScreen* s, int index) {
|
||||||
@ -4145,11 +4149,15 @@ static void TouchOnscreenScreen_ContextRecreated(void* screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void TouchOnscreenScreen_Layout(void* screen) {
|
static void TouchOnscreenScreen_Layout(void* screen) {
|
||||||
|
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
||||||
|
|
||||||
struct TouchOnscreenScreen* s = (struct TouchOnscreenScreen*)screen;
|
struct TouchOnscreenScreen* s = (struct TouchOnscreenScreen*)screen;
|
||||||
Menu_LayoutButtons(s->btns, s->btnDescs, ONSCREEN_PAGE_BTNS);
|
Menu_LayoutButtons(s->btns, s->btnDescs, ONSCREEN_PAGE_BTNS);
|
||||||
Menu_LayoutBack(&s->back);
|
Menu_LayoutBack(&s->back);
|
||||||
Widget_SetLocation(&s->left, ANCHOR_CENTRE, ANCHOR_CENTRE, -260, 0);
|
Widget_SetLocation(&s->left, ANCHOR_CENTRE, ANCHOR_CENTRE, -260, 0);
|
||||||
Widget_SetLocation(&s->right, ANCHOR_CENTRE, ANCHOR_CENTRE, 260, 0);
|
Widget_SetLocation(&s->right, ANCHOR_CENTRE, ANCHOR_CENTRE, 260, 0);
|
||||||
|
|
||||||
|
Window_3DS_SetRenderScreen(scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TouchOnscreenScreen_Init(void* screen) {
|
static void TouchOnscreenScreen_Init(void* screen) {
|
||||||
@ -4322,9 +4330,13 @@ static void TouchCtrlsScreen_ContextRecreated(void* screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void TouchCtrlsScreen_Layout(void* screen) {
|
static void TouchCtrlsScreen_Layout(void* screen) {
|
||||||
|
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
||||||
|
|
||||||
struct TouchCtrlsScreen* s = (struct TouchCtrlsScreen*)screen;
|
struct TouchCtrlsScreen* s = (struct TouchCtrlsScreen*)screen;
|
||||||
Menu_LayoutButtons(s->btns, touchCtrls_btns, TOUCHCTRLS_BTNS);
|
Menu_LayoutButtons(s->btns, touchCtrls_btns, TOUCHCTRLS_BTNS);
|
||||||
Menu_LayoutBack(&s->back);
|
Menu_LayoutBack(&s->back);
|
||||||
|
|
||||||
|
Window_3DS_SetRenderScreen(scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TouchCtrlsScreen_Init(void* screen) {
|
static void TouchCtrlsScreen_Init(void* screen) {
|
||||||
|
@ -389,8 +389,6 @@ static void HUDScreen_Render(void* screen, double delta) {
|
|||||||
|
|
||||||
if (Gui_GetBlocksWorld()) return;
|
if (Gui_GetBlocksWorld()) return;
|
||||||
|
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
|
||||||
|
|
||||||
Gfx_BindDynamicVb(s->vb);
|
Gfx_BindDynamicVb(s->vb);
|
||||||
Widget_Render2(&s->hotbar, 12);
|
Widget_Render2(&s->hotbar, 12);
|
||||||
|
|
||||||
@ -399,8 +397,6 @@ static void HUDScreen_Render(void* screen, double delta) {
|
|||||||
Gfx_BindDynamicVb(s->vb); /* Have to rebind for mobile right now... */
|
Gfx_BindDynamicVb(s->vb); /* Have to rebind for mobile right now... */
|
||||||
Gfx_DrawVb_IndexedTris(4);
|
Gfx_DrawVb_IndexedTris(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ScreenVTABLE HUDScreen_VTABLE = {
|
static const struct ScreenVTABLE HUDScreen_VTABLE = {
|
||||||
|
@ -447,16 +447,21 @@ static void HotbarWidget_RenderEntries(struct HotbarWidget* w, int offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int HotbarWidget_Render2(void* widget, int offset) {
|
static int HotbarWidget_Render2(void* widget, int offset) {
|
||||||
|
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
||||||
|
|
||||||
struct HotbarWidget* w = (struct HotbarWidget*)widget;
|
struct HotbarWidget* w = (struct HotbarWidget*)widget;
|
||||||
HotbarWidget_RenderOutline(w, offset );
|
HotbarWidget_RenderOutline(w, offset );
|
||||||
HotbarWidget_RenderEntries(w, offset + 8);
|
HotbarWidget_RenderEntries(w, offset + 8);
|
||||||
|
|
||||||
#ifdef CC_BUILD_TOUCH
|
#ifdef CC_BUILD_TOUCH
|
||||||
if (!Input_TouchMode) return HOTBAR_MAX_VERTICES;
|
if (Input_TouchMode) {
|
||||||
w->ellipsisTex.x = HotbarWidget_TileX(w, HOTBAR_MAX_INDEX) - w->ellipsisTex.Width / 2;
|
w->ellipsisTex.x = HotbarWidget_TileX(w, HOTBAR_MAX_INDEX) - w->ellipsisTex.Width / 2;
|
||||||
w->ellipsisTex.y = w->y + (w->height / 2) - w->ellipsisTex.Height / 2;
|
w->ellipsisTex.y = w->y + (w->height / 2) - w->ellipsisTex.Height / 2;
|
||||||
Texture_Render(&w->ellipsisTex);
|
Texture_Render(&w->ellipsisTex);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Window_3DS_SetRenderScreen(scr);
|
||||||
return HOTBAR_MAX_VERTICES;
|
return HOTBAR_MAX_VERTICES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user