Merge branch 'Terrain-Selection-Issues' into 'master'
Various fixes for the editor's "Terrain land editing" mode (fixes #5473, #6022, #6023, #6024, #6035, #6036) Closes #6036, #6035, #6024, #6023, #6022, and #5473 See merge request OpenMW/openmw!840pull/593/head
commit
e596f62107
@ -0,0 +1,19 @@
|
||||
#include "commands.hpp"
|
||||
|
||||
#include <components/esm/loadland.hpp>
|
||||
|
||||
#include "terrainselection.hpp"
|
||||
|
||||
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(TerrainSelection& terrainSelection, QUndoCommand* parent)
|
||||
: mTerrainSelection(terrainSelection)
|
||||
{ }
|
||||
|
||||
void CSVRender::DrawTerrainSelectionCommand::redo()
|
||||
{
|
||||
mTerrainSelection.update();
|
||||
}
|
||||
|
||||
void CSVRender::DrawTerrainSelectionCommand::undo()
|
||||
{
|
||||
mTerrainSelection.update();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
#ifndef CSV_RENDER_COMMANDS_HPP
|
||||
#define CSV_RENDER_COMMANDS_HPP
|
||||
|
||||
#include <QUndoCommand>
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
class TerrainSelection;
|
||||
|
||||
/*
|
||||
Current solution to force a redrawing of the terrain-selection grid
|
||||
when undoing/redoing changes in the editor.
|
||||
This only triggers a simple redraw of the grid, so only use it in
|
||||
conjunction with actual data changes which deform the grid.
|
||||
|
||||
Please note that this command needs to be put onto the QUndoStack twice:
|
||||
at the start and at the end of the related terrain manipulation.
|
||||
This makes sure that the grid is always updated after all changes have
|
||||
been undone or redone -- but it also means that the selection is redrawn
|
||||
once at the beginning of either action. Future refinement may solve that.
|
||||
*/
|
||||
class DrawTerrainSelectionCommand : public QUndoCommand
|
||||
{
|
||||
private:
|
||||
TerrainSelection& mTerrainSelection;
|
||||
|
||||
public:
|
||||
DrawTerrainSelectionCommand(TerrainSelection& terrainSelection, QUndoCommand* parent = nullptr);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue