[Add] Here is something you have been waiting for, for a long time! Cargo window in info panel. :P
This commit is contained in:
parent
23733b032f
commit
8cac584d45
40
src/menu.c
40
src/menu.c
@ -27,6 +27,9 @@
|
|||||||
#define OUTFITS_WIDTH 400
|
#define OUTFITS_WIDTH 400
|
||||||
#define OUTFITS_HEIGHT 200
|
#define OUTFITS_HEIGHT 200
|
||||||
|
|
||||||
|
#define CARGO_WIDTH 300
|
||||||
|
#define CARGO_HEIGHT 300
|
||||||
|
|
||||||
#define MISSIONS_WIDTH 600
|
#define MISSIONS_WIDTH 600
|
||||||
#define MISSIONS_HEIGHT 400
|
#define MISSIONS_HEIGHT 400
|
||||||
|
|
||||||
@ -54,6 +57,10 @@ static void exit_game(void);
|
|||||||
static void menu_info_close(char* str);
|
static void menu_info_close(char* str);
|
||||||
/* Outfits submenu. */
|
/* Outfits submenu. */
|
||||||
static void info_outfits_menu(char* str);
|
static void info_outfits_menu(char* str);
|
||||||
|
/* Cargo submenu. */
|
||||||
|
static void info_cargo_menu(char* str);
|
||||||
|
static void cargo_update(char* str);
|
||||||
|
static void cargo_jettison(char* str);
|
||||||
/* Mission submenu. */
|
/* Mission submenu. */
|
||||||
static void info_missions_menu(char* str);
|
static void info_missions_menu(char* str);
|
||||||
static void mission_menu_abort(char* str);
|
static void mission_menu_abort(char* str);
|
||||||
@ -225,7 +232,7 @@ void menu_info(void) {
|
|||||||
"btnOutfits", "Outfits", info_outfits_menu);
|
"btnOutfits", "Outfits", info_outfits_menu);
|
||||||
window_addButton(wid, -20, (20 + BUTTON_HEIGHT)*2 + 20,
|
window_addButton(wid, -20, (20 + BUTTON_HEIGHT)*2 + 20,
|
||||||
BUTTON_WIDTH, BUTTON_HEIGHT,
|
BUTTON_WIDTH, BUTTON_HEIGHT,
|
||||||
"btnCargo", "Cargo", NULL);
|
"btnCargo", "Cargo", info_cargo_menu);
|
||||||
window_addButton(wid, -20, 20 + BUTTON_HEIGHT + 20,
|
window_addButton(wid, -20, 20 + BUTTON_HEIGHT + 20,
|
||||||
BUTTON_WIDTH, BUTTON_HEIGHT,
|
BUTTON_WIDTH, BUTTON_HEIGHT,
|
||||||
"btnMissions", "Missions", info_missions_menu);
|
"btnMissions", "Missions", info_missions_menu);
|
||||||
@ -266,6 +273,37 @@ static void info_outfits_menu(char* str) {
|
|||||||
"closeOutfits", "Close", menu_generic_close);
|
"closeOutfits", "Close", menu_generic_close);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Show the players cargo. */
|
||||||
|
static void info_cargo_menu(char* str) {
|
||||||
|
(void)str;
|
||||||
|
unsigned int wid;
|
||||||
|
|
||||||
|
/* Create the window. */
|
||||||
|
wid = window_create("Cargo", -1, -1, CARGO_WIDTH, CARGO_HEIGHT);
|
||||||
|
|
||||||
|
/* Buttons. */
|
||||||
|
window_addButton(wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
|
||||||
|
"closeCargo", "Back", menu_generic_close);
|
||||||
|
window_addButton(wid, -40 - BUTTON_WIDTH, 20,
|
||||||
|
BUTTON_WIDTH, BUTTON_HEIGHT, "btnJettisonCargo", "Jettison",
|
||||||
|
cargo_jettison);
|
||||||
|
|
||||||
|
cargo_update(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cargo_update(char* str) {
|
||||||
|
(void)str;
|
||||||
|
unsigned int wid;
|
||||||
|
|
||||||
|
wid = window_get("Cargo");
|
||||||
|
|
||||||
|
window_disableButton(wid, "btnJettisonCargo");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cargo_jettison(char* str) {
|
||||||
|
(void)str;
|
||||||
|
}
|
||||||
|
|
||||||
/* Show the player's active missions. */
|
/* Show the player's active missions. */
|
||||||
static void info_missions_menu(char* str) {
|
static void info_missions_menu(char* str) {
|
||||||
(void)str;
|
(void)str;
|
||||||
|
Loading…
Reference in New Issue
Block a user