Make newmenu::tiny_mode_flag, tabs_flag, max_on_menu const
This commit is contained in:
parent
200952c3d9
commit
530f396b2e
|
@ -199,17 +199,19 @@ struct newmenu_layout
|
||||||
const menu_title title;
|
const menu_title title;
|
||||||
const menu_subtitle subtitle;
|
const menu_subtitle subtitle;
|
||||||
const menu_filename filename;
|
const menu_filename filename;
|
||||||
tiny_mode_flag tiny_mode;
|
const tiny_mode_flag tiny_mode;
|
||||||
tab_processing_flag tabs_flag;
|
const tab_processing_flag tabs_flag;
|
||||||
|
const uint8_t max_on_menu;
|
||||||
uint8_t all_text = 0; //set true if all text items
|
uint8_t all_text = 0; //set true if all text items
|
||||||
uint8_t is_scroll_box = 0; // Is this a scrolling box? Set to false at init
|
uint8_t is_scroll_box = 0; // Is this a scrolling box? Set to false at init
|
||||||
uint8_t mouse_state;
|
uint8_t mouse_state;
|
||||||
int max_on_menu;
|
|
||||||
const partial_range_t<newmenu_item *> items;
|
const partial_range_t<newmenu_item *> items;
|
||||||
int scroll_offset = 0;
|
int scroll_offset = 0;
|
||||||
int max_displayable;
|
int max_displayable;
|
||||||
newmenu_layout(menu_title title, menu_subtitle subtitle, menu_filename filename, partial_range_t<newmenu_item *> items) :
|
newmenu_layout(menu_title title, menu_subtitle subtitle, menu_filename filename, tiny_mode_flag tiny_mode, tab_processing_flag tabs_flag, partial_range_t<newmenu_item *> items) :
|
||||||
title(title), subtitle(subtitle), filename(filename),
|
title(title), subtitle(subtitle), filename(filename),
|
||||||
|
tiny_mode(tiny_mode), tabs_flag(tabs_flag),
|
||||||
|
max_on_menu(std::min<uint8_t>(items.size(), tiny_mode != tiny_mode_flag::normal ? 21u : 14u)),
|
||||||
items(items)
|
items(items)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include "d_zip.h"
|
#include "d_zip.h"
|
||||||
#include "partial_range.h"
|
#include "partial_range.h"
|
||||||
|
|
||||||
#define MAXDISPLAYABLEITEMS 14
|
|
||||||
#define MAXDISPLAYABLEITEMSTINY 21
|
|
||||||
#define MESSAGEBOX_TEXT_SIZE 2176 // How many characters in messagebox
|
#define MESSAGEBOX_TEXT_SIZE 2176 // How many characters in messagebox
|
||||||
#define MAX_TEXT_WIDTH FSPACX(120) // How many pixels wide a input box can be
|
#define MAX_TEXT_WIDTH FSPACX(120) // How many pixels wide a input box can be
|
||||||
|
|
||||||
|
@ -1422,7 +1420,6 @@ static void newmenu_create_structure(newmenu_layout &menu, const grs_font &cv_fo
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menu.is_scroll_box = 0;
|
menu.is_scroll_box = 0;
|
||||||
menu.max_on_menu = menu.items.size();
|
|
||||||
}
|
}
|
||||||
menu.h = iterative_layout_max_height;
|
menu.h = iterative_layout_max_height;
|
||||||
|
|
||||||
|
@ -1681,11 +1678,8 @@ newmenu *newmenu_do4(const menu_title title, const menu_subtitle subtitle, const
|
||||||
{
|
{
|
||||||
if (items.size() < 1)
|
if (items.size() < 1)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
newmenu_layout nl(title, subtitle, filename, items);
|
newmenu_layout nl(title, subtitle, filename, TinyMode, TabsFlag, items);
|
||||||
nl.citem = citem;
|
nl.citem = citem;
|
||||||
nl.max_on_menu = TinyMode != tiny_mode_flag::normal ? MAXDISPLAYABLEITEMSTINY : MAXDISPLAYABLEITEMS;
|
|
||||||
nl.tiny_mode = TinyMode;
|
|
||||||
nl.tabs_flag = TabsFlag;
|
|
||||||
nl.max_displayable = items.size();
|
nl.max_displayable = items.size();
|
||||||
newmenu_create_structure(nl, *(TinyMode != tiny_mode_flag::normal ? GAME_FONT : MEDIUM1_FONT));
|
newmenu_create_structure(nl, *(TinyMode != tiny_mode_flag::normal ? GAME_FONT : MEDIUM1_FONT));
|
||||||
auto menu = std::make_unique<newmenu>(grd_curscreen->sc_canvas, std::move(nl));
|
auto menu = std::make_unique<newmenu>(grd_curscreen->sc_canvas, std::move(nl));
|
||||||
|
|
Loading…
Reference in a new issue