diff --git a/config/menus.cfg b/config/menus.cfg index 06a2a538..b7c14cd3 100644 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -27,18 +27,19 @@ const __genmapitems [ ] ] -newmenu [all maps] +newmenu [all custom maps] +menurenderoffset -20 0 menudirlist "packages/maps" cgz [map $arg1] newmenu maps __genmapitems $__defaultmaps menuitem [] -1 -menuitem "Show all maps\i\3" [ showmenu [all maps] ] +menuitem "Show all custom maps\i\3" [ showmenu [all custom maps] ] newmenu maps_flags __genmapitems $__ctfmaps menuitem [] -1 -menuitem "Show all maps\i\3" [showmenu [all maps]] +menuitem "Show all custom maps\i\3" [showmenu [all custom maps]] //// Main > Play demo //// diff --git a/config/menus_bot.cfg b/config/menus_bot.cfg index 17a39867..39ccfaa2 100644 --- a/config/menus_bot.cfg +++ b/config/menus_bot.cfg @@ -92,6 +92,7 @@ newmenu [search official map] menudirlist "packages/maps/official" cgz [map $arg1] 0 searchmap newmenu [search custom map] +menurenderoffset -20 0 menudirlist "packages/maps" cgz [map $arg1] 0 searchmap newmenu [search map] diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 6945cc63..a40919e9 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -322,15 +322,15 @@ VARP(browsefiledesc, 0, 1, 1); struct mitemmapload : mitemmanual { - const char *filename, *maptitle; + const char *filename, *mapmessage; Texture *image; - mitemmapload(gmenu *parent, const char *filename, char *text, char *action, char *hoveraction, const char *desc) : mitemmanual(parent, text, action, hoveraction, NULL, desc), filename(filename), maptitle(NULL), image(NULL) {} + mitemmapload(gmenu *parent, const char *filename, char *text, char *action, char *hoveraction, const char *desc) : mitemmanual(parent, text, action, hoveraction, NULL, desc), filename(filename), mapmessage(NULL), image(NULL) {} virtual ~mitemmapload() { delstring(filename); - DELETEA(maptitle); + DELETEA(mapmessage); DELETEA(text); DELETEA(action); DELETEA(hoveraction); @@ -350,28 +350,30 @@ struct mitemmapload : mitemmanual draw_text(text, x, y, c, c, c); if(isselection()) { - if(!image && !maptitle) + if(!image && !mapmessage) { // load map description and preview picture silent_texture_load = true; const char *cgzpath = "packages" PATHDIVS "maps"; if(browsefiledesc) - { // checking maptitles is slow and may be disabled - maptitle = getfiledesc(cgzpath, behindpath(filename), "cgz"); // check for regular map - if(!maptitle) maptitle = getfiledesc((cgzpath = "packages" PATHDIVS "maps" PATHDIVS "official"), behindpath(filename), "cgz"); // check for official map + { // checking map messages is slow and may be disabled + mapmessage = getfiledesc(cgzpath, behindpath(filename), "cgz"); // check for regular map + if(!mapmessage) mapmessage = getfiledesc((cgzpath = "packages" PATHDIVS "maps" PATHDIVS "official"), behindpath(filename), "cgz"); // check for official map } defformatstring(p2p)("%s/preview/%s.jpg", cgzpath, filename); if(!hidebigmenuimages) image = textureload(p2p, 3); if(!image || image == notexture) image = textureload("packages/misc/nopreview.jpg", 3); silent_texture_load = false; } + w += FONTH; + int xs = (2 * VIRTW - w - x) / 2, xp = x + w + xs / 2, ym = VIRTH - FONTH/2; if(image && !hidebigmenuimages && image->ys > FONTH) { - w += FONTH; - int xs = (2 * VIRTW - w - x) / 2, ys = (xs * image->ys) / image->xs, xp = x + w + xs/2, yp = VIRTH - ys / 2; + int ys = (xs * image->ys) / image->xs, yp = VIRTH - ys / 2; + ym = yp + ys + 2 * FONTH; framedquadtexture(image->id, xp, yp, xs, ys, FONTH); draw_text(text, xp + xs/2 - text_width(text)/2, yp + ys); } - if(maptitle && *maptitle) draw_text(maptitle, x / 6, VIRTH - FONTH/2, 0xFF, 0xFF, 0xFF, 0xFF, -1, (x * 3) / 4); + if(mapmessage && *mapmessage) draw_text(mapmessage, xp - FONTH, ym, 0xFF, 0xFF, 0xFF, 0xFF, -1, 2 * VIRTW - (xp - FONTH) - FONTH/2); } } };