content menu width increased
This commit is contained in:
parent
5c89202f3f
commit
7a18c530c2
@ -250,9 +250,11 @@ void create_main_menu_panel(Engine* engine, PagesControl* menu) {
|
|||||||
|
|
||||||
typedef std::function<void(const ContentPack& pack)> packconsumer;
|
typedef std::function<void(const ContentPack& pack)> packconsumer;
|
||||||
|
|
||||||
|
const int PACKS_PANEL_WIDTH = 550;
|
||||||
|
|
||||||
std::shared_ptr<Panel> create_packs_panel(const std::vector<ContentPack>& packs, Engine* engine, bool backbutton, packconsumer callback) {
|
std::shared_ptr<Panel> create_packs_panel(const std::vector<ContentPack>& packs, Engine* engine, bool backbutton, packconsumer callback) {
|
||||||
auto assets = engine->getAssets();
|
auto assets = engine->getAssets();
|
||||||
auto panel = std::make_shared<Panel>(vec2(400, 200), vec4(5.0f));
|
auto panel = std::make_shared<Panel>(vec2(PACKS_PANEL_WIDTH, 200), vec4(5.0f));
|
||||||
panel->color(vec4(1.0f, 1.0f, 1.0f, 0.07f));
|
panel->color(vec4(1.0f, 1.0f, 1.0f, 0.07f));
|
||||||
panel->maxLength(400);
|
panel->maxLength(400);
|
||||||
panel->scrollable(true);
|
panel->scrollable(true);
|
||||||
@ -266,7 +268,7 @@ std::shared_ptr<Panel> create_packs_panel(const std::vector<ContentPack>& packs,
|
|||||||
}
|
}
|
||||||
auto idlabel = std::make_shared<Label>("["+pack.id+"]");
|
auto idlabel = std::make_shared<Label>("["+pack.id+"]");
|
||||||
idlabel->color(vec4(1, 1, 1, 0.5f));
|
idlabel->color(vec4(1, 1, 1, 0.5f));
|
||||||
packpanel->add(idlabel, vec2(360-idlabel->size().x, 2));
|
packpanel->add(idlabel, vec2(PACKS_PANEL_WIDTH-40-idlabel->size().x, 2));
|
||||||
|
|
||||||
auto titlelabel = std::make_shared<Label>(pack.title);
|
auto titlelabel = std::make_shared<Label>(pack.title);
|
||||||
packpanel->add(titlelabel, vec2(78, 6));
|
packpanel->add(titlelabel, vec2(78, 6));
|
||||||
@ -284,7 +286,7 @@ std::shared_ptr<Panel> create_packs_panel(const std::vector<ContentPack>& packs,
|
|||||||
if (!pack.creator.empty()) {
|
if (!pack.creator.empty()) {
|
||||||
auto creatorlabel = std::make_shared<Label>("@"+pack.creator);
|
auto creatorlabel = std::make_shared<Label>("@"+pack.creator);
|
||||||
creatorlabel->color(vec4(0.8f, 1.0f, 0.9f, 0.7f));
|
creatorlabel->color(vec4(0.8f, 1.0f, 0.9f, 0.7f));
|
||||||
packpanel->add(creatorlabel, vec2(360-creatorlabel->size().x, 60));
|
packpanel->add(creatorlabel, vec2(PACKS_PANEL_WIDTH-40-creatorlabel->size().x, 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto descriptionlabel = std::make_shared<Label>(pack.description);
|
auto descriptionlabel = std::make_shared<Label>(pack.description);
|
||||||
@ -304,7 +306,7 @@ std::shared_ptr<Panel> create_packs_panel(const std::vector<ContentPack>& packs,
|
|||||||
// TODO: refactor
|
// TODO: refactor
|
||||||
void create_content_panel(Engine* engine, PagesControl* menu) {
|
void create_content_panel(Engine* engine, PagesControl* menu) {
|
||||||
auto paths = engine->getPaths();
|
auto paths = engine->getPaths();
|
||||||
auto mainPanel = create_page(engine, "content", 400, 0.0f, 5);
|
auto mainPanel = create_page(engine, "content", PACKS_PANEL_WIDTH, 0.0f, 5);
|
||||||
|
|
||||||
std::vector<ContentPack> scanned;
|
std::vector<ContentPack> scanned;
|
||||||
ContentPack::scan(engine->getPaths(), scanned);
|
ContentPack::scan(engine->getPaths(), scanned);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user