From 26c3b820372cca1f7b0b205d798db34aa8ecb314 Mon Sep 17 00:00:00 2001 From: Torwent Date: Mon, 9 Oct 2023 15:42:25 +0200 Subject: [PATCH] fix: added a new button to mapmaker.simba to "grow" regions easily --- tools/mapmaker.simba | 92 +++++++++++++++++++++------------ utils/rsregions/rsregions.simba | 8 ++- 2 files changed, 66 insertions(+), 34 deletions(-) diff --git a/tools/mapmaker.simba b/tools/mapmaker.simba index 7ee89dec..b6c15465 100644 --- a/tools/mapmaker.simba +++ b/tools/mapmaker.simba @@ -16,7 +16,7 @@ type TRSMapMaker = record Form: TForm; Panel: TPanel; - ButtonNewRegion, ButtonDeleteRegion, ButtonReset, ButtonPrintSelected, ButtonPrintType, ButtonPrintBoxes, ButtonPrintNamed, ButtonRewriteFile: TButton; + ButtonNewRegion, ButtonDeleteRegion, ButtonReset, ButtonGrowRegion, ButtonPrintSelected, ButtonPrintType, ButtonPrintBoxes, ButtonPrintNamed, ButtonRewriteFile: TButton; RenameLabel: TLabel; RenameEdit: TEdit; ListBoxRegions: TListBox; @@ -347,6 +347,15 @@ begin Self.ImageBox.Update(); end; +procedure TRSMapMaker.OnGrowRegion(sender: TObject); +begin + if Self.Index < 0 then + Exit; + + Self.RegionArray[Self.Index].Bounds := Self.RegionArray[Self.Index].Bounds.Expand(80); + Self.ImageBox.Update(); +end; + function TRSMapMaker.GetDirectivesString(): String; begin @@ -604,38 +613,6 @@ begin setAlign(alTop); end; - - //Top buttons - with Self.ButtonReset do - begin - Init(Self.Panel); - SetParent(Self.Panel); - SetAutoSize(True); - SetCaption('Reset'); - SetOnClick(@Self.OnReset); - setAlign(alTop); - end; - - with Self.ButtonDeleteRegion do - begin - Init(Self.Panel); - SetParent(Self.Panel); - SetAutoSize(True); - SetCaption('Delete Region'); - SetOnClick(@Self.OnDelete); - setAlign(alTop); - end; - - with Self.ButtonNewRegion do - begin - Init(Self.Panel); - SetParent(Self.Panel); - SetAutoSize(True); - SetCaption('New Region'); - SetOnClick(@Self.OnNewRegion); - setAlign(alTop); - end; - //Listbox with Self.ListBoxRegions do begin @@ -698,6 +675,55 @@ begin end; + with Self.Panel do + begin + Init(Self.Form); + SetParent(Self.Form); + SetAutoSize(False); + SetAlign(alTop); + end; + + //Top buttons + with Self.ButtonGrowRegion do + begin + Init(Self.Panel); + SetParent(Self.Panel); + SetAutoSize(True); + SetCaption('Grow Region by 80px'); + SetOnClick(@Self.OnGrowRegion); + setAlign(alLeft); + end; + + with Self.ButtonReset do + begin + Init(Self.Panel); + SetParent(Self.Panel); + SetAutoSize(True); + SetCaption('Reset'); + SetOnClick(@Self.OnReset); + setAlign(alLeft); + end; + + with Self.ButtonDeleteRegion do + begin + Init(Self.Panel); + SetParent(Self.Panel); + SetAutoSize(True); + SetCaption('Delete Region'); + SetOnClick(@Self.OnDelete); + setAlign(alLeft); + end; + + with Self.ButtonNewRegion do + begin + Init(Self.Panel); + SetParent(Self.Panel); + SetAutoSize(True); + SetCaption('New Region'); + SetOnClick(@Self.OnNewRegion); + setAlign(alLeft); + end; + mapImg := TRSWalkerMap.InternalLoadMap(MAP_NAME); with Self.ImageBox do begin diff --git a/utils/rsregions/rsregions.simba b/utils/rsregions/rsregions.simba index f5f7bfc9..1e937066 100644 --- a/utils/rsregions/rsregions.simba +++ b/utils/rsregions/rsregions.simba @@ -99,6 +99,8 @@ type RSRegions = record(TSRLBaseRecord) class var GEM_ROCKS_MINE: TBox; ISLE_OF_SOULS: TBox; TAVERLY_DUNGEON: TBox; + PYRAMID_PLUNDER: TBox; + SOPHANEM: TBox; end; begin @@ -197,6 +199,8 @@ begin RSRegions.GEM_ROCKS_MINE := [3912, 627, 4238, 889]; RSRegions.ISLE_OF_SOULS := [4020, 4332, 5202, 5426]; RSRegions.TAVERLY_DUNGEON := [5522, 0, 6301, 895]; + RSRegions.PYRAMID_PLUNDER := [1353, 0, 1751, 397]; + RSRegions.SOPHANEM := [8397, 5131, 8762, 5536]; RSNamedRegionsArray := [ ['Abyss', RSRegions.ABYSS], @@ -293,7 +297,9 @@ begin ['Sophanem Bank', RSRegions.SOPHANEM_BANK], ['Gem Rocks Mine', RSRegions.GEM_ROCKS_MINE], ['Isle of Souls', RSRegions.ISLE_OF_SOULS], - ['Taverly Dungeon', RSRegions.TAVERLY_DUNGEON] + ['Taverly Dungeon', RSRegions.TAVERLY_DUNGEON], + ['Pyramid Plunder', RSRegions.PYRAMID_PLUNDER], + ['Sophanem', RSRegions.SOPHANEM] ]; RSBankRegions.Setup();