From 213acd054adbc4a657ac916442ca6f62e1487d8e Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Mon, 26 Mar 2012 14:59:18 +0200 Subject: [PATCH 1/3] minor: fixed typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f6046e344..988a6dd6a 100644 --- a/README.rst +++ b/README.rst @@ -112,7 +112,7 @@ Options ------- :all_biomes: Change layer for all biomes on your map. Result may be undesirable since the same layer can AND WILL be on different z-levels for different biomes. Use the tool 'probe' to get an idea how layers and biomes are distributed on your map. -:all-layers: Change all layers on your map. Candy mountain, anyone? Will make your map quite boring, but tidy. +:all_layers: Change all layers on your map. Candy mountain, anyone? Will make your map quite boring, but tidy. :force: Allow changing stone to soil and vice versa. !!THIS CAN HAVE WEIRD EFFECTS, USE WITH CARE!! Note that soil will not be magically replaced with stone. You will, however, get a stone floor after digging so it will allow the floor to be engraved. Note that stone will not be magically replaced with soil. You will, however, get a soil floor after digging so it could be helpful for creating farm plots on maps with no soil. From e41e9c24f17ebc63668a15a36aa892d57ffdcb35 Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Tue, 27 Mar 2012 11:28:10 +0200 Subject: [PATCH 2/3] minor updates in readme.rst; moved changelayer plugin to main plugin folder --- README.rst | 37 ++++++++++++----------- plugins/CMakeLists.txt | 8 +---- plugins/{changelayer => }/changelayer.cpp | 16 +++++++--- plugins/changelayer/CMakeLists.txt | 32 -------------------- 4 files changed, 31 insertions(+), 62 deletions(-) rename plugins/{changelayer => }/changelayer.cpp (96%) delete mode 100644 plugins/changelayer/CMakeLists.txt diff --git a/README.rst b/README.rst index 988a6dd6a..a1f8445ce 100644 --- a/README.rst +++ b/README.rst @@ -110,9 +110,10 @@ tl;dr: You will end up with changing quite big areas in one go, especially if yo Options ------- -:all_biomes: Change layer for all biomes on your map. +:all_biomes: Change selected layer for all biomes on your map. Result may be undesirable since the same layer can AND WILL be on different z-levels for different biomes. Use the tool 'probe' to get an idea how layers and biomes are distributed on your map. -:all_layers: Change all layers on your map. Candy mountain, anyone? Will make your map quite boring, but tidy. +:all_layers: Change all layers on your map (only for the selected biome unless 'all_biomes' is added). + Candy mountain, anyone? Will make your map quite boring, but tidy. :force: Allow changing stone to soil and vice versa. !!THIS CAN HAVE WEIRD EFFECTS, USE WITH CARE!! Note that soil will not be magically replaced with stone. You will, however, get a stone floor after digging so it will allow the floor to be engraved. Note that stone will not be magically replaced with soil. You will, however, get a soil floor after digging so it could be helpful for creating farm plots on maps with no soil. @@ -121,23 +122,27 @@ Options Examples: --------- -``changelayer GRANITE`` : Convert layer at cursor position into granite. -``changelayer SILTY_CLAY force`` : Convert layer at cursor position into clay even if it's stone. -``changelayer MARBLE all_biomes all_layers`` : Convert all layers of all biomes which are not soil into marble. +``changelayer GRANITE`` + Convert layer at cursor position into granite. +``changelayer SILTY_CLAY force`` + Convert layer at cursor position into clay even if it's stone. +``changelayer MARBLE all_biomes all_layers`` + Convert all layers of all biomes which are not soil into marble. -.. note:: +.. Notes:: - * If you use changelayer and nothing happens, try to pause/unpause the game for a while and try to move the cursor to another tile. + * If you use changelayer and nothing happens, try to pause/unpause the game for a while and try to move the cursor to another tile. Then try again. If that doesn't help try temporarily changing some other layer, undo your changes and try again for the layer you want to change. Saving and reloading your map might also help. * You should be fine if you only change single layers without the use of 'force'. Still it's advisable to save your game before messing with the map. - * When you force changelayer to convert soil to stone you might experience weird stuff (flashing tiles, tiles changed all over the map, ...). Try reverting the changes manually or even better use an older savegame. You did save your game, right? + * When you force changelayer to convert soil to stone you might experience weird stuff (flashing tiles, tiles changed all over place etc). Try reverting the changes manually or even better use an older savegame. You did save your game, right? changevein ========== Changes material of the vein under cursor to the specified inorganic RAW material. Example: ---------- -``changevein NATIVE_PLATINUM`` : Convert vein at cursor position into platinum ore. +-------- +``changevein NATIVE_PLATINUM`` + Convert vein at cursor position into platinum ore. cursecheck ========== @@ -157,14 +162,10 @@ Options Examples: --------- -Check one single map tile if one of the creatures on it is cursed (in-game cursor required): - * cursecheck -Count all active cursed creatures who roam around on your map (no in-game cursor) without giving more details: - * cursecheck -Give detailed info about all cursed creatures including deceased ones (no in-game cursor): - * cursecheck detail all -Give a nickname all living/active cursed creatures on the map(no in-game cursor): - * cursecheck nick +``cursecheck detail all`` + Give detailed info about all cursed creatures including deceased ones (no in-game cursor). +``cursecheck nick`` + Give a nickname all living/active cursed creatures on the map(no in-game cursor). .. note:: diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b2f700e41..84bdf8239 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -90,6 +90,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(fixpositions fixpositions.cpp) DFHACK_PLUGIN(follow follow.cpp) DFHACK_PLUGIN(changevein changevein.cpp) + DFHACK_PLUGIN(changelayer changelayer.cpp) DFHACK_PLUGIN(advtools advtools.cpp) DFHACK_PLUGIN(tweak tweak.cpp) DFHACK_PLUGIN(feature feature.cpp) @@ -104,10 +105,3 @@ OPTION(BUILD_SKELETON "Build the skeleton plugin." OFF) if(BUILD_SKELETON) add_subdirectory(skeleton) endif() - -# this is the changelayer plugin. -OPTION(BUILD_CHANGELAYER "Build the changelayer plugin." ON) -if(BUILD_CHANGELAYER) - add_subdirectory(changelayer) -endif() - diff --git a/plugins/changelayer/changelayer.cpp b/plugins/changelayer.cpp similarity index 96% rename from plugins/changelayer/changelayer.cpp rename to plugins/changelayer.cpp index ebe249afe..5f7d5cf0e 100644 --- a/plugins/changelayer/changelayer.cpp +++ b/plugins/changelayer.cpp @@ -71,7 +71,9 @@ const string changelayer_help = const string changelayer_trouble = "Known problems with changelayer:\n\n" " Nothing happens, the material stays the old.\n" - " Try pausing/unpausing the game or moving the cursor a bit.\n\n" + " Pause/unpause the game and/or move the cursor a bit. Then retry.\n" + " Try changing another layer, undo the changes and try again.\n" + " Try saving and loading the game.\n\n" " Weird stuff happening after using the 'force' option.\n" " Change former stone layers back to stone, soil back to soil.\n" " If in doubt, use the 'probe' tool to find tiles with soil walls\n" @@ -221,7 +223,7 @@ command_result changelayer (color_ostream &out, std::vector & para // 2) call ReadGeology here, modify the data in the vectors without having to do all that map stuff // 3) write Maps::WriteGeology, pass the vectors, let it do it's work // Step 1) is optional, but it would make implementing 3) easier. - // Otherwise that "check which geolayer is used by biome X" loop would need to be done again. + // Otherwise that "check which geo_index is used by biome X" loop would need to be done again. // no need to touch the same geology more than once // though it wouldn't matter much since there is not much data to be processed @@ -291,7 +293,7 @@ command_result changelayer (color_ostream &out, std::vector & para vector &geolayers = geo_biome->layers; // complain if layer is out of range - // geology has up to 16 layers currently, but size can be < 15 sometimes! + // geology has up to 16 layers currently, but can have less! if(layer >= geolayers.size() || layer < 0) { if(verbose) @@ -379,7 +381,10 @@ bool conversionAllowed(color_ostream &out, MaterialInfo mat_new, MaterialInfo ma { if(force) { - out << "You've been warned, good luck." << endl; + if(!warned) + { + out << "You've been warned, good luck." << endl; + } allowed = true; } else @@ -389,10 +394,11 @@ bool conversionAllowed(color_ostream &out, MaterialInfo mat_new, MaterialInfo ma out << "Use the option 'force' if you REALLY want to do that." << endl << "Weird things can happen with your map, so save your game before trying!" << endl << "Example: 'changelayer GRANITE force'" << endl; - warned = true; } allowed = false; } + // avoid multiple warnings for the same stuff + warned = true; } return allowed; } \ No newline at end of file diff --git a/plugins/changelayer/CMakeLists.txt b/plugins/changelayer/CMakeLists.txt deleted file mode 100644 index 147f8986b..000000000 --- a/plugins/changelayer/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -PROJECT (changelayer) -# A list of source files -SET(PROJECT_SRCS - changelayer.cpp -) -# A list of headers -SET(PROJECT_HDRS -) -SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE) - -# mash them together (headers are marked as headers and nothing will try to compile them) -LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS}) - -# option to use a thread for no particular reason -OPTION(CHANGELAYER_THREAD "Use threads in the changelayer plugin." ON) -#linux -IF(UNIX) - add_definitions(-DLINUX_BUILD) - SET(PROJECT_LIBS - # add any extra linux libs here - ${PROJECT_LIBS} - ) -# windows -ELSE(UNIX) - SET(PROJECT_LIBS - # add any extra linux libs here - ${PROJECT_LIBS} - $(NOINHERIT) - ) -ENDIF(UNIX) -# this makes sure all the stuff is put in proper places and linked to dfhack -DFHACK_PLUGIN(changelayer ${PROJECT_SRCS} LINK_LIBRARIES ${PROJECT_LIBS}) From 13effd5ac56ec0eeebec2cd1c0b5053600e319e2 Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Tue, 27 Mar 2012 12:06:46 +0200 Subject: [PATCH 3/3] minor fix in readme.rst --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a1f8445ce..1e5f84ca7 100644 --- a/README.rst +++ b/README.rst @@ -435,7 +435,7 @@ When multiple commands are bound to the same key combination, DFHack selects the liquids ======= -Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey. Settings will be remembered as long as dfhack runs. Intended for use in combination with the command liquidsgo-here (which can be bound to a hotkey). +Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey. Settings will be remembered as long as dfhack runs. Intended for use in combination with the command liquids-here (which can be bound to a hotkey). For more information, refer to the command's internal help. .. note:: @@ -445,7 +445,7 @@ For more information, refer to the command's internal help. liquids-here ============ -Run the liquid spawner with the current/last settings made in liquidsgo (if no settings in liquidsgo were made it paints a point of 7/7 magma by default). +Run the liquid spawner with the current/last settings made in liquids (if no settings in liquids were made it paints a point of 7/7 magma by default). Intended to be used as keybinding. Requires an active in-game cursor. mode