editor2: clean up editor data/core files...
...by moving them to a separate subdirectory, renamed editor2_tool_hint tag (dropped the "2"), added background music playlist tag for the editor (FR / bug #11407)
This commit is contained in:
parent
2a72d8193f
commit
bacd286c66
11 changed files with 62 additions and 24 deletions
|
@ -11,13 +11,4 @@
|
|||
{core/terrain.cfg}
|
||||
{core/terrain-graphics/}
|
||||
{core/units.cfg}
|
||||
#ifdef EDITOR2
|
||||
#ifndef MULTIPLAYER
|
||||
{multiplayer/}
|
||||
#endif
|
||||
{core/editor-groups.cfg}
|
||||
{core/editor2-brushes.cfg}
|
||||
{core/editor2-hotkeys.cfg}
|
||||
{core/editor2-tods.cfg}
|
||||
{core/editor2-tool-hints.cfg}
|
||||
#endif
|
||||
{core/editor/}
|
||||
|
|
18
data/core/editor/_main.cfg
Normal file
18
data/core/editor/_main.cfg
Normal file
|
@ -0,0 +1,18 @@
|
|||
#textdomain wesnoth-editor
|
||||
# Main purpose of this file is to ensure that macros get read in first.
|
||||
|
||||
# wmlscope: set export=yes
|
||||
|
||||
#ifdef EDITOR2
|
||||
#ifndef MULTIPLAYER
|
||||
{multiplayer/}
|
||||
#endif
|
||||
{core/editor/brushes.cfg}
|
||||
{core/editor/hotkeys.cfg}
|
||||
{core/editor/music.cfg}
|
||||
{core/editor/terrain-groups.cfg}
|
||||
{core/editor/time-of-day.cfg}
|
||||
{core/editor/tool-hints.cfg}
|
||||
|
||||
|
||||
#endif
|
|
@ -1,4 +1,5 @@
|
|||
#textdomain wesnoth-editor
|
||||
# Editor brush definitions
|
||||
|
||||
[brush]
|
||||
name= _ "Single Hex"
|
6
data/core/editor/music.cfg
Normal file
6
data/core/editor/music.cfg
Normal file
|
@ -0,0 +1,6 @@
|
|||
#textdomain wesnoth-editor
|
||||
# Defines the music playlist for the editor
|
||||
|
||||
[editor_music]
|
||||
{DEFAULT_MUSIC_PLAYLIST}
|
||||
[/editor_music]
|
|
@ -3,7 +3,6 @@
|
|||
# All editor_group entries in terrain.cfg should have a corresponding id here.
|
||||
# Name is shown in the tooltip in the editor.
|
||||
# Icon is the button icon name.
|
||||
# Note: Used by editor2. Do not remove.
|
||||
|
||||
#The all entry shows all terrains and must be available
|
||||
[editor_group]
|
|
@ -1,4 +1,5 @@
|
|||
#textdomain wesnoth-editor
|
||||
# Editor time-of-day (lighting settings) presets
|
||||
|
||||
[editor_times]
|
||||
{DAWN}
|
|
@ -1,31 +1,31 @@
|
|||
#textdomain wesnoth-editor
|
||||
# Tool information / help
|
||||
# Editor tool information / help
|
||||
|
||||
[editor2_tool_hint]
|
||||
[editor_tool_hint]
|
||||
# wmllint: local spelling left/right
|
||||
id="editor-tool-paint"
|
||||
text= _ "Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only."
|
||||
[/editor2_tool_hint]
|
||||
[/editor_tool_hint]
|
||||
|
||||
[editor2_tool_hint]
|
||||
[editor_tool_hint]
|
||||
# wmllint: local spelling fore-/background
|
||||
id="editor-tool-fill"
|
||||
text= _ "Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only."
|
||||
[/editor2_tool_hint]
|
||||
[/editor_tool_hint]
|
||||
|
||||
[editor2_tool_hint]
|
||||
[editor_tool_hint]
|
||||
# wmllint: local spelling deselects
|
||||
id="editor-tool-select"
|
||||
text= _ "Left mouse button selects, right deselects. Hold Shift for magic-wand selection of tiles with same terrain."
|
||||
[/editor2_tool_hint]
|
||||
[/editor_tool_hint]
|
||||
|
||||
[editor2_tool_hint]
|
||||
[editor_tool_hint]
|
||||
# wmllint: local spelling alt+number
|
||||
id="editor-tool-starting-position"
|
||||
text= _ "Left mouse button displays player selection, right clears. Number keys scroll to the starting position, alt+number sets respective starting position under cursor, delete clears."
|
||||
[/editor2_tool_hint]
|
||||
[/editor_tool_hint]
|
||||
|
||||
[editor2_tool_hint]
|
||||
[editor_tool_hint]
|
||||
id="editor-paste"
|
||||
text= _ "Click to paste. Use the edit menu to transform the clipboard (rotate, mirror)."
|
||||
[/editor2_tool_hint]
|
||||
text= _ "Click to paste, zoom out for more accuracy when pasting large areas. Use the edit menu to transform the clipboard (rotate, mirror)."
|
||||
[/editor_tool_hint]
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "brush.hpp"
|
||||
#include "editor_common.hpp"
|
||||
|
||||
#include "../foreach.hpp"
|
||||
#include "../pathutils.hpp"
|
||||
|
@ -48,6 +49,9 @@ brush::brush(const config& cfg)
|
|||
add_relative_location(x, y);
|
||||
++cfg_range.first;
|
||||
}
|
||||
if (relative_tiles_.empty()) {
|
||||
WRN_ED << "Empty brush definition, name=" << name_ << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void brush::add_relative_location(int relative_x, int relative_y)
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../map_create.hpp"
|
||||
#include "../mapgen.hpp"
|
||||
#include "../random.hpp"
|
||||
#include "../sound.hpp"
|
||||
|
||||
#include "formula_string_utils.hpp"
|
||||
|
||||
|
@ -115,6 +116,7 @@ editor_controller::editor_controller(const config &game_config, CVideo& video, m
|
|||
init_map_generators(game_config);
|
||||
init_tods(game_config);
|
||||
init_sidebar(game_config);
|
||||
init_music(game_config);
|
||||
hotkey_set_mouse_action(hotkey::HOTKEY_EDITOR_TOOL_PAINT);
|
||||
rng_.reset(new rand_rng::rng());
|
||||
rng_setter_.reset(new rand_rng::set_random_generator(rng_.get()));
|
||||
|
@ -180,7 +182,7 @@ void editor_controller::init_mouse_actions(const config& game_config)
|
|||
}
|
||||
}
|
||||
}
|
||||
foreach (const config* c, game_config.get_children("editor2_tool_hint")) {
|
||||
foreach (const config* c, game_config.get_children("editor_tool_hint")) {
|
||||
mouse_action_map::iterator i = mouse_actions_.find(hotkey::get_hotkey((*c)["id"]).get_id());
|
||||
if (i != mouse_actions_.end()) {
|
||||
mouse_action_hints_.insert(std::make_pair(i->first, (*c)["text"]));
|
||||
|
@ -215,6 +217,19 @@ void editor_controller::init_tods(const config& game_config)
|
|||
}
|
||||
}
|
||||
|
||||
void editor_controller::init_music(const config& game_config)
|
||||
{
|
||||
const config* cfg = game_config.child("editor_music");
|
||||
if (cfg == NULL) {
|
||||
ERR_ED << "No editor music defined\n";
|
||||
return;
|
||||
}
|
||||
foreach (const config* i, cfg->get_children("music")) {
|
||||
sound::play_music_config(*i);
|
||||
}
|
||||
sound::commit_music_changes();
|
||||
}
|
||||
|
||||
|
||||
void editor_controller::load_tooltips()
|
||||
{
|
||||
|
|
|
@ -296,6 +296,9 @@ class editor_controller : public controller_base,
|
|||
|
||||
/** init the available time-of-day settings */
|
||||
void init_tods(const config& game_config);
|
||||
|
||||
/** init background music for the editor */
|
||||
void init_music(const config& game_config);
|
||||
|
||||
/** Load editor-specific tooltips */
|
||||
void load_tooltips();
|
||||
|
|
Loading…
Add table
Reference in a new issue