mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 09:00:34 +00:00
drawing tool and shape editor can now be used with texture mode enabled
This commit is contained in:
parent
9065011437
commit
b921a5a81b
@ -2542,7 +2542,7 @@ void celldrawer::draw() {
|
||||
return;
|
||||
}
|
||||
|
||||
if((cmode & sm::DRAW) && texture::config.tstate == texture::tsActive && !mouseout() && c)
|
||||
if((cmode & sm::DRAW) && mapeditor::intexture && !mouseout() && c)
|
||||
mapeditor::draw_texture_ghosts(c, V);
|
||||
#endif
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace hr {
|
||||
EX namespace mapeditor {
|
||||
|
||||
EX bool drawing_tool;
|
||||
EX bool intexture;
|
||||
|
||||
#if HDR
|
||||
enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor, sgWall };
|
||||
@ -1754,19 +1755,21 @@ EX namespace mapeditor {
|
||||
string line1, line2;
|
||||
|
||||
usershape *us = NULL;
|
||||
|
||||
#if CAP_TEXTURE
|
||||
if(texture::config.tstate != texture::tsActive && intexture) {
|
||||
intexture = false; drawing_tool = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool intexture = false;
|
||||
(void) intexture;
|
||||
|
||||
bool freedraw = drawing_tool;
|
||||
bool freedraw = drawing_tool || intexture;
|
||||
|
||||
#if CAP_TEXTURE
|
||||
if(texture::config.tstate == texture::tsActive) {
|
||||
if(intexture) {
|
||||
sg = 16;
|
||||
line1 = "texture";
|
||||
line2 = "";
|
||||
texture::config.data.update();
|
||||
intexture = true;
|
||||
freedraw = true;
|
||||
drawing_tool = false;
|
||||
}
|
||||
@ -2430,11 +2433,7 @@ EX namespace mapeditor {
|
||||
(void)clickused;
|
||||
|
||||
|
||||
bool freedraw = drawing_tool;
|
||||
#if CAP_TEXTURE
|
||||
bool intexture = texture::config.tstate == texture::tsActive;
|
||||
freedraw |= intexture;
|
||||
#endif
|
||||
bool freedraw = drawing_tool || intexture;
|
||||
|
||||
if(freedraw) {
|
||||
if(lstartcell) lstart = ggmatrix(lstartcell) * lstart_rel;
|
||||
|
@ -423,6 +423,7 @@ EX void showCreative() {
|
||||
dialog::addItem(XLAT("shape editor"), 'g');
|
||||
dialog::add_action([] {
|
||||
mapeditor::drawing_tool = false;
|
||||
mapeditor::intexture = false;
|
||||
pushScreen(mapeditor::showDrawEditor);
|
||||
mapeditor::initdraw(cwt.at);
|
||||
});
|
||||
@ -433,6 +434,7 @@ EX void showCreative() {
|
||||
dialog::add_action([] {
|
||||
dialog::cheat_if_confirmed([] {
|
||||
mapeditor::drawing_tool = true;
|
||||
mapeditor::intexture = false;
|
||||
pushScreen(mapeditor::showDrawEditor);
|
||||
mapeditor::initdraw(cwt.at);
|
||||
});
|
||||
|
@ -1243,12 +1243,13 @@ string texturehelp =
|
||||
|
||||
#if CAP_EDIT
|
||||
EX void start_editor() {
|
||||
addMessage("white");
|
||||
if(config.data.whitetexture() && config.data.loadTextureGL()) {
|
||||
config.tstate = config.tstate_max = tsActive;
|
||||
config.perform_mapping();
|
||||
config.finish_mapping();
|
||||
mapeditor::initdraw(cwt.at);
|
||||
mapeditor::intexture = true;
|
||||
mapeditor::drawing_tool = false;
|
||||
pushScreen(mapeditor::showDrawEditor);
|
||||
}
|
||||
}
|
||||
@ -1393,6 +1394,8 @@ EX void showMenu() {
|
||||
if(GDIM == 2) {
|
||||
dialog::addItem(XLAT("edit the texture"), 'e');
|
||||
dialog::add_action([] {
|
||||
mapeditor::intexture = true;
|
||||
mapeditor::drawing_tool = false;
|
||||
mapeditor::initdraw(cwt.at);
|
||||
pushScreen(mapeditor::showDrawEditor);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user