Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Support Undo&Redo for Multiselection operations
Browse files Browse the repository at this point in the history
  • Loading branch information
secsome committed Apr 30, 2023
1 parent 9178119 commit 9f595d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed the bug that lighting is not reset correctly when loading/creating a map
- Fixed the bug that smudges and basenodes drifting away when resizing the map
- Multiselection now supports copy & paste
- Multiselection operations(raise or lower cells) now supports undo & redo
- New ***ExtConfig*** : `ExtendedValidationNoError` = **BOOLEAN**, defaults to false

## RELEASE 1.5.2 (2023-03-03)
Expand Down
3 changes: 1 addition & 2 deletions DOCUMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
- For now, I cannot ensure the stability of it, so save your maps frequently before heavy loss! XD

The multiple selection function is now available. Press Ctrl key to select tiles and press Ctrl+Shift key to deselect them. Ctrl+D can clear all selected tiles.
Now this feature supports RaiseSingleTile/LowerSingleTile (though they are not "Single" anymore) and calucate selected area ore value.
NOTICE THAT UNDOREDO AND COPYPASTE HASN'T BEEN SUPPORTED YET!
Now this feature supports RaiseSingleTile/LowerSingleTile (though they are not "Single" anymore), copy paste, and calucating selected area ore value.

## BASIC TYPES
- **INTEGER**
Expand Down
2 changes: 1 addition & 1 deletion FA2pp
Submodule FA2pp updated 1 files
+3 −0 CMapData.h
6 changes: 6 additions & 0 deletions FA2sp/Miscs/MultiSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,16 @@ DEFINE_HOOK(433DA0, CFinalSunDlg_Tools_RaiseSingleTile, 5)
{
if (MultiSelection::GetCount())
{
CMapData::Instance->SaveUndoRedoData(true, 0, 0, 0, 0);
MultiSelection::ApplyForEach(
[](CellData& cell) {
if (cell.Height < 14)
++cell.Height;
}
);
pThis->MyViewFrame.pIsoView->RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
CMapData::Instance->SaveUndoRedoData(true, 0, 0, 0, 0);
CMapData::Instance->DoUndo();
}
else
{
Expand Down Expand Up @@ -368,13 +371,16 @@ DEFINE_HOOK(433D30, CFinalSunDlg_Tools_LowerSingleTile, 5)
{
if (MultiSelection::GetCount())
{
CMapData::Instance->SaveUndoRedoData(true, 0, 0, 0, 0);
MultiSelection::ApplyForEach(
[](CellData& cell) {
if (cell.Height > 0)
--cell.Height;
}
);
pThis->MyViewFrame.pIsoView->RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
CMapData::Instance->SaveUndoRedoData(true, 0, 0, 0, 0);
CMapData::Instance->DoUndo();
}
else
{
Expand Down

0 comments on commit 9f595d5

Please sign in to comment.