add menu to set notexture
Allows to reset notexture, to set a high-contrast color to find and fix the areas and to set to a useful default texture. As useful textures, in addition to rock.jpg and concrete.jpg, the menu lists the default wall, floor and ceiling textures of the current map, and also the last watched texture from the texture menu. Also adds a few checks to detect unconverted map config files and misuse of the new bright highlight textures.
This commit is contained in:
@@ -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" ]
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 82 B |
Binary file not shown.
|
After Width: | Height: | Size: 100 B |
Binary file not shown.
|
After Width: | Height: | Size: 98 B |
Binary file not shown.
|
After Width: | Height: | Size: 98 B |
Binary file not shown.
|
After Width: | Height: | Size: 98 B |
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user