diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index a152be51..c2c20951 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -361,6 +361,7 @@ newmenu textures menuitem "Browse official textures" [ showmenu "Official textures" ] menuitem "Browse custom/downloaded textures" [ showmenu "Custom textures" ] menuitem "Edit texture slots of current map" [ showmenu "Edit texture slots" ] +menuitem "Set notexture" [ showmenu "Set notexture" ] newmenu "Official textures" menuinit __rebuildtexturemenus @@ -399,6 +400,31 @@ menuinit [ ] ] +newmenu "Set notexture" +menuinit [ + resetcurmenu + menurenderoffset -20 0 + push m (escape (curmenu)) + push t (concat chmenutexture $m "[]") + if (strlen (getnotexture)) [ + menuitem (concat Current notexture: (getnotexture)) (concat loadnotexture (getnotexture)) (concat chmenutexture $m (getnotexture)) + ] + menuitem "Reset notexture" loadnotexture $t // no preview possible + menuitem "" -1 $t + menuitem "\f1Pick a notexture to highlight the areas" -1 $t + looplist (gettexturelist "map_editor/marker" "" ".png") [tpath tname td] [ + fullname = (concatword $tpath "/" $tname) + menuitem (concat Set notexture to $tname) (concat loadnotexture (escape $fullname)) (concat chmenutexture $m (escape $fullname)) + ] + menuitem "" -1 $t + menuitem "\f1Pick a notexture for actual use" -1 $t + menuitem "\f4(as default texture, if custom texture downloads fail)" -1 $t + looplist (concat makke/rock.jpg makke/concrete.jpg (at (edittextureslot 2) 1) (at (edittextureslot 3) 1) (at (edittextureslot 4) 1) $__lastwatchedtexture) fn [ + menuitem (concat Set notexture to $fn) (concat loadnotexture (escape $fn)) (concat chmenutexture $m (escape $fn)) + ] + pop m t +] + // Browse mapsounds newmenu [Ambient sounds] menuitem "Browse official mapsounds" [ showmenu "Official mapsounds" ] diff --git a/packages/textures/map_editor/marker/black.png b/packages/textures/map_editor/marker/black.png new file mode 100644 index 00000000..cac81152 Binary files /dev/null and b/packages/textures/map_editor/marker/black.png differ diff --git a/packages/textures/map_editor/marker/blue.png b/packages/textures/map_editor/marker/blue.png new file mode 100644 index 00000000..6847f700 Binary files /dev/null and b/packages/textures/map_editor/marker/blue.png differ diff --git a/packages/textures/map_editor/marker/green.png b/packages/textures/map_editor/marker/green.png new file mode 100644 index 00000000..9e14f967 Binary files /dev/null and b/packages/textures/map_editor/marker/green.png differ diff --git a/packages/textures/map_editor/marker/red.png b/packages/textures/map_editor/marker/red.png new file mode 100644 index 00000000..844ceae3 Binary files /dev/null and b/packages/textures/map_editor/marker/red.png differ diff --git a/packages/textures/map_editor/marker/yellow.png b/packages/textures/map_editor/marker/yellow.png new file mode 100644 index 00000000..67209fb3 Binary files /dev/null and b/packages/textures/map_editor/marker/yellow.png differ diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 1ff253c5..cd019fd4 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -113,6 +113,7 @@ void mapmodel(int *rad, int *h, int *zoff, char *scale, char *name) { if(*scale && *name) // ignore "mapmodel" commands with insufficient parameters { + if(!strchr(name, '/') && !strchr(name, '\\')) flagmapconfigerror(LWW_CONFIGERR * 2); // throw errors for unconverted mapmodels (unspecific, because not all get detected) intret(mapmodels.length()); mapmodelinfo &mmi = mapmodels.add(); mmi.rad = *rad; @@ -131,6 +132,7 @@ void mapmodel(int *rad, int *h, int *zoff, char *scale, char *name) mapmodelchanged = 1; flagmapconfigchange(); } + else flagmapconfigerror(LWW_CONFIGERR * 2); } COMMAND(mapmodel, "iiiss"); diff --git a/source/src/texture.cpp b/source/src/texture.cpp index f80554aa..b4e5cbf4 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -496,6 +496,15 @@ void _texture(Slot &s, float *scale, char *name) } } +void checktexturefilename(const char *name) +{ + if(execcontext == IEXC_MAPCFG && strstr(name, "map_editor")) + { + conoutf("\f3bad texture: %s", name); + flagmapconfigerror(LWW_CONFIGERR * 4); + } +} + COMMANDF(texture, "fs", (float *scale, char *name) { intret(slots.length()); @@ -506,6 +515,7 @@ COMMANDF(texture, "fs", (float *scale, char *name) conoutf("\f3texture slot #%d \"%s\" error: scale factor %.7g out of range 0..4", slots.length() - 1, name, *scale); flagmapconfigerror(LWW_CONFIGERR * 4); } + checktexturefilename(name); flagmapconfigchange(); }); @@ -578,6 +588,7 @@ bool loadskymap(bool reload) { int n = strlen(legacyprefix); filtertext(loadsky, loadsky, FTXT__MEDIAFILEPATH); + checktexturefilename(loadsky); if(!strncmp(loadsky, legacyprefix, n)) { // remove the prefix char *t = loadsky; @@ -609,6 +620,7 @@ void loadnotexture(char *c) *mapconfigdata.notexturename = '\0'; if(c[0]) { + checktexturefilename(c); filtertext(mapconfigdata.notexturename, c, FTXT__MEDIAFILEPATH); defformatstring(p)("packages/textures/%s", mapconfigdata.notexturename); noworldtexture = textureload(p);