cepheid

An Aurora 4X clone
Log | Files | Refs | README

commit 8876d156020f15a77460eaf698b024ae239faf8e
parent d8ca35ed8b3db9d9ea68a84901f03ccf84443b03
Author: hhvn <dev@hhvn.uk>
Date:   Thu, 25 Aug 2022 22:14:49 +0100

Add bodies tab

Diffstat:
Cdata/icons/colonies.png -> data/icons/bodies.png | 0
Cdata/icons/colonies.xcf -> data/icons/bodies.xcf | 0
Mdata/icons/colonies.png | 0
Mdata/icons/colonies.xcf | 0
Msrc/data.c | 7+++++++
Msrc/main.h | 3+++
Msrc/struct.h | 1+
Msrc/ui.c | 15+++++++++++++++
8 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/data/icons/colonies.png b/data/icons/bodies.png Binary files differ. diff --git a/data/icons/colonies.xcf b/data/icons/bodies.xcf Binary files differ. diff --git a/data/icons/colonies.png b/data/icons/colonies.png Binary files differ. diff --git a/data/icons/colonies.xcf b/data/icons/colonies.xcf Binary files differ. diff --git a/src/data.c b/src/data.c @@ -8,6 +8,7 @@ Font font; IMAGE(tactical); IMAGE(colonies); +IMAGE(bodies); IMAGE(fleet); IMAGE(design); IMAGE(sys); @@ -25,6 +26,10 @@ unsigned char colonies_png[] = { #include "../data/icons/colonies.h" }; +unsigned char bodies_png[] = { +#include "../data/icons/bodies.h" +}; + unsigned char fleet_png[] = { #include "../data/icons/fleet.h" }; @@ -53,6 +58,7 @@ data_load(void) { sizeof(DejaVuSansMono_ttf), FONT_SIZE, NULL, 0); IMAGE_LOAD(tactical); IMAGE_LOAD(colonies); + IMAGE_LOAD(bodies); IMAGE_LOAD(fleet); IMAGE_LOAD(design); IMAGE_LOAD(sys); @@ -67,6 +73,7 @@ data_unload(void) { UnloadFont(font); IMAGE_UNLOAD(tactical); IMAGE_UNLOAD(colonies); + IMAGE_UNLOAD(bodies); IMAGE_UNLOAD(fleet); IMAGE_UNLOAD(design); IMAGE_UNLOAD(sys); diff --git a/src/main.h b/src/main.h @@ -61,12 +61,14 @@ int ui_should_draw_body(Body *body, int orbit); void ui_draw_body(Body *body); int ui_handle_view_main(int nowsel); int ui_handle_view_colonies(int nowsel); +int ui_handle_view_bodies(int nowsel); int ui_handle_view_fleets(int nowsel); int ui_handle_view_design(int nowsel); int ui_handle_view_sys(int nowsel); int ui_handle_view_settings(int nowsel); void ui_draw_view_main(void); void ui_draw_view_colonies(void); +void ui_draw_view_bodies(void); void ui_draw_view_fleets(void); void ui_draw_view_design(void); void ui_draw_view_sys(void); @@ -95,6 +97,7 @@ void save_write(void); extern Font font; extern Texture image_tactical; extern Texture image_colonies; +extern Texture image_bodies; extern Texture image_fleet; extern Texture image_design; extern Texture image_sys; diff --git a/src/struct.h b/src/struct.h @@ -132,6 +132,7 @@ typedef struct { enum UiViews { UI_VIEW_MAIN, UI_VIEW_COLONIES, + UI_VIEW_BODIES, UI_VIEW_FLEETS, UI_VIEW_DESIGN, UI_VIEW_SYSTEMS, diff --git a/src/ui.c b/src/ui.c @@ -41,6 +41,7 @@ static Color body_col[] = { int (*view_handlers[UI_VIEW_LAST])(int) = { [UI_VIEW_MAIN] = ui_handle_view_main, [UI_VIEW_COLONIES] = ui_handle_view_colonies, + [UI_VIEW_BODIES] = ui_handle_view_bodies, [UI_VIEW_FLEETS] = ui_handle_view_fleets, [UI_VIEW_DESIGN] = ui_handle_view_design, [UI_VIEW_SYSTEMS] = ui_handle_view_sys, @@ -50,6 +51,7 @@ int (*view_handlers[UI_VIEW_LAST])(int) = { void (*view_drawers[UI_VIEW_LAST])(void) = { [UI_VIEW_MAIN] = ui_draw_view_main, [UI_VIEW_COLONIES] = ui_draw_view_colonies, + [UI_VIEW_BODIES] = ui_draw_view_bodies, [UI_VIEW_FLEETS] = ui_draw_view_fleets, [UI_VIEW_DESIGN] = ui_draw_view_design, [UI_VIEW_SYSTEMS] = ui_draw_view_sys, @@ -63,6 +65,7 @@ Tabs view_tabs = { * in the ui; in the code it's just called 'main' for my fingers' sake */ UI_VIEW_LAST, 0, {{&image_tactical, "Tactical", 0}, {&image_colonies, "Colonies", 0}, + {&image_bodies, "Bodies", 0}, {&image_fleet, "Fleets", 0}, {&image_design, "Design", 0}, {&image_sys, "Systems", 0}, @@ -568,6 +571,13 @@ ui_handle_view_colonies(int nowsel) { } int +ui_handle_view_bodies(int nowsel) { + if (nowsel) + ui_title("Bodies"); + return 1; +} + +int ui_handle_view_fleets(int nowsel) { if (nowsel) ui_title("Fleets"); @@ -765,6 +775,11 @@ ui_draw_view_colonies(void) { } void +ui_draw_view_bodies(void) { + ui_print(10, VIEWS_HEIGHT + 10, COL_FG, "Something like the mineral overview in Aurora"); +} + +void ui_draw_view_fleets(void) { ui_print(10, VIEWS_HEIGHT + 10, COL_FG, "Groups/fleets/subfleets/ships here"); ui_print(GetScreenWidth() / 2, VIEWS_HEIGHT + 10, COL_FG, "Tabs here");