Skip to content

Commit e20f15a

Browse files
committed
fix: update Editor to refer to renamed types and new signatures
1 parent 8aa5c63 commit e20f15a

File tree

7 files changed

+152
-156
lines changed

7 files changed

+152
-156
lines changed

Intersect.Editor/Core/Graphics.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using Microsoft.Xna.Framework;
1616
using Microsoft.Xna.Framework.Graphics;
17-
using MapAttribute = Intersect.Enums.MapAttribute;
1817

1918
namespace Intersect.Editor.Core;
2019

@@ -916,7 +915,7 @@ private static void DrawSelectionRect()
916915
for (var y = 0; y < Options.MapHeight; y++)
917916
{
918917
var attr = tmpMap.Attributes[x, y];
919-
if ((attr?.Type ?? MapAttribute.Walkable) == MapAttribute.Walkable)
918+
if ((attr?.Type ?? MapAttributeType.Walkable) == MapAttributeType.Walkable)
920919
{
921920
continue;
922921
}
@@ -1374,7 +1373,7 @@ bool alternate
13741373
continue;
13751374
}
13761375

1377-
if (tmpMap.Attributes[x, y].Type == MapAttribute.Resource && !upper && !alternate)
1376+
if (tmpMap.Attributes[x, y].Type == MapAttributeType.Resource && !upper && !alternate)
13781377
{
13791378
var resource = ResourceBase.Get(((MapResourceAttribute) tmpMap.Attributes[x, y]).ResourceId);
13801379
if (resource == null)
@@ -1443,7 +1442,7 @@ bool alternate
14431442
DrawTexture(res, xpos, ypos, 0, 0, res.Width, res.Height, renderTarget);
14441443
}
14451444
}
1446-
else if (tmpMap.Attributes[x, y].Type == MapAttribute.Animation)
1445+
else if (tmpMap.Attributes[x, y].Type == MapAttributeType.Animation)
14471446
{
14481447
var animation =
14491448
AnimationBase.Get(((MapAnimationAttribute) tmpMap.Attributes[x, y]).AnimationId);

Intersect.Editor/Forms/DockingElements/frmMapEditor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using Intersect.Logging;
1717
using Microsoft.Xna.Framework.Graphics;
1818
using WeifenLuo.WinFormsUI.Docking;
19-
using MapAttribute = Intersect.Enums.MapAttribute;
2019
using Timer = System.Windows.Forms.Timer;
2120

2221
namespace Intersect.Editor.Forms.DockingElements;
@@ -1703,9 +1702,9 @@ public void SmartEraseLayer(int x, int y)
17031702
}
17041703
}
17051704

1706-
private void SmartEraseAttribute(int x, int y, MapAttribute attribute)
1705+
private void SmartEraseAttribute(int x, int y, MapAttributeType attribute)
17071706
{
1708-
var a = MapAttribute.Walkable;
1707+
var a = MapAttributeType.Walkable;
17091708

17101709
if (x < 0 || x >= Options.MapWidth || y < 0 || y >= Options.MapHeight)
17111710
{
@@ -1730,7 +1729,7 @@ private void SmartEraseAttribute(int x, int y, MapAttribute attribute)
17301729

17311730
public void SmartEraseAttributes(int x, int y)
17321731
{
1733-
var attribute = MapAttribute.Walkable;
1732+
var attribute = MapAttributeType.Walkable;
17341733

17351734
if (Globals.CurrentMap.Attributes[x, y] != null)
17361735
{

Intersect.Editor/Forms/DockingElements/frmMapLayers.cs

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using WeifenLuo.WinFormsUI.Docking;
1616
using Graphics = System.Drawing.Graphics;
17-
using MapAttribute = Intersect.Enums.MapAttribute;
1817

1918
namespace Intersect.Editor.Forms.DockingElements;
2019

@@ -576,112 +575,112 @@ public int GetAttributeFromEditor()
576575
{
577576
if (rbBlocked.Checked == true)
578577
{
579-
return (int) MapAttribute.Blocked;
578+
return (int) MapAttributeType.Blocked;
580579
}
581580
else if (rbItem.Checked == true)
582581
{
583-
return (int) MapAttribute.Item;
582+
return (int) MapAttributeType.Item;
584583
}
585584
else if (rbZDimension.Checked == true)
586585
{
587-
return (int) MapAttribute.ZDimension;
586+
return (int) MapAttributeType.ZDimension;
588587
}
589588
else if (rbNPCAvoid.Checked == true)
590589
{
591-
return (int) MapAttribute.NpcAvoid;
590+
return (int) MapAttributeType.NpcAvoid;
592591
}
593592
else if (rbWarp.Checked == true)
594593
{
595-
return (int) MapAttribute.Warp;
594+
return (int) MapAttributeType.Warp;
596595
}
597596
else if (rbSound.Checked == true)
598597
{
599-
return (int) MapAttribute.Sound;
598+
return (int) MapAttributeType.Sound;
600599
}
601600
else if (rbResource.Checked == true)
602601
{
603-
return (int) MapAttribute.Resource;
602+
return (int) MapAttributeType.Resource;
604603
}
605604
else if (rbAnimation.Checked == true)
606605
{
607-
return (int) MapAttribute.Animation;
606+
return (int) MapAttributeType.Animation;
608607
}
609608
else if (rbGrappleStone.Checked == true)
610609
{
611-
return (int) MapAttribute.GrappleStone;
610+
return (int) MapAttributeType.GrappleStone;
612611
}
613612
else if (rbSlide.Checked == true)
614613
{
615-
return (int) MapAttribute.Slide;
614+
return (int) MapAttributeType.Slide;
616615
}
617616
else if (rbCritter.Checked == true)
618617
{
619-
return (int) MapAttribute.Critter;
618+
return (int) MapAttributeType.Critter;
620619
}
621620

622-
return (int) MapAttribute.Walkable;
621+
return (int) MapAttributeType.Walkable;
623622
}
624623

625-
private MapAttribute SelectedMapAttributeType
624+
private MapAttributeType SelectedMapAttributeType
626625
{
627626
get
628627
{
629628
if (rbBlocked.Checked)
630629
{
631-
return MapAttribute.Blocked;
630+
return MapAttributeType.Blocked;
632631
}
633632

634633
if (rbItem.Checked)
635634
{
636-
return MapAttribute.Item;
635+
return MapAttributeType.Item;
637636
}
638637

639638
if (rbZDimension.Checked)
640639
{
641-
return MapAttribute.ZDimension;
640+
return MapAttributeType.ZDimension;
642641
}
643642

644643
if (rbNPCAvoid.Checked)
645644
{
646-
return MapAttribute.NpcAvoid;
645+
return MapAttributeType.NpcAvoid;
647646
}
648647

649648
if (rbWarp.Checked)
650649
{
651-
return MapAttribute.Warp;
650+
return MapAttributeType.Warp;
652651
}
653652

654653
if (rbSound.Checked)
655654
{
656-
return MapAttribute.Sound;
655+
return MapAttributeType.Sound;
657656
}
658657

659658
if (rbResource.Checked)
660659
{
661-
return MapAttribute.Resource;
660+
return MapAttributeType.Resource;
662661
}
663662

664663
if (rbAnimation.Checked)
665664
{
666-
return MapAttribute.Animation;
665+
return MapAttributeType.Animation;
667666
}
668667

669668
if (rbGrappleStone.Checked)
670669
{
671-
return MapAttribute.GrappleStone;
670+
return MapAttributeType.GrappleStone;
672671
}
673672

674673
if (rbSlide.Checked)
675674
{
676-
return MapAttribute.Slide;
675+
return MapAttributeType.Slide;
677676
}
678677

679678
if (rbCritter.Checked)
680679
{
681-
return MapAttribute.Critter;
680+
return MapAttributeType.Critter;
682681
}
683682

684-
return (MapAttribute) byte.MaxValue;
683+
return (MapAttributeType) byte.MaxValue;
685684
}
686685
}
687686

@@ -692,26 +691,26 @@ public GameObjects.Maps.MapAttribute CreateAttribute()
692691
var attribute = GameObjects.Maps.MapAttribute.CreateAttribute(attributeType);
693692
switch (SelectedMapAttributeType)
694693
{
695-
case MapAttribute.Walkable:
696-
case MapAttribute.Blocked:
697-
case MapAttribute.GrappleStone:
698-
case MapAttribute.NpcAvoid:
694+
case MapAttributeType.Walkable:
695+
case MapAttributeType.Blocked:
696+
case MapAttributeType.GrappleStone:
697+
case MapAttributeType.NpcAvoid:
699698
break;
700699

701-
case MapAttribute.Item:
700+
case MapAttributeType.Item:
702701
var itemAttribute = attribute as MapItemAttribute;
703702
itemAttribute.ItemId = ItemBase.IdFromList(cmbItemAttribute.SelectedIndex);
704703
itemAttribute.Quantity = (int)nudItemQuantity.Value;
705704
itemAttribute.RespawnTime = (long)nudItemRespawnTime.Value;
706705
break;
707706

708-
case MapAttribute.ZDimension:
707+
case MapAttributeType.ZDimension:
709708
var zDimensionAttribute = attribute as MapZDimensionAttribute;
710709
zDimensionAttribute.GatewayTo = GetEditorDimensionGateway();
711710
zDimensionAttribute.BlockedLevel = GetEditorDimensionBlock();
712711
break;
713712

714-
case MapAttribute.Warp:
713+
case MapAttributeType.Warp:
715714
var warpAttribute = attribute as MapWarpAttribute;
716715
warpAttribute.MapId = MapList.OrderedMaps[cmbWarpMap.SelectedIndex].MapId;
717716
warpAttribute.X = (byte)nudWarpX.Value;
@@ -722,31 +721,31 @@ public GameObjects.Maps.MapAttribute CreateAttribute()
722721
warpAttribute.WarpSound = TextUtils.SanitizeNone(cmbWarpSound.Text);
723722
break;
724723

725-
case MapAttribute.Sound:
724+
case MapAttributeType.Sound:
726725
var soundAttribute = attribute as MapSoundAttribute;
727726
soundAttribute.Distance = (byte)nudSoundDistance.Value;
728727
soundAttribute.File = TextUtils.SanitizeNone(cmbMapAttributeSound.Text);
729728
soundAttribute.LoopInterval = (int)nudSoundLoopInterval.Value;
730729
break;
731730

732-
case MapAttribute.Resource:
731+
case MapAttributeType.Resource:
733732
var resourceAttribute = attribute as MapResourceAttribute;
734733
resourceAttribute.ResourceId = ResourceBase.IdFromList(cmbResourceAttribute.SelectedIndex);
735734
resourceAttribute.SpawnLevel = (byte)(rbLevel1.Checked ? 0 : 1);
736735
break;
737736

738-
case MapAttribute.Animation:
737+
case MapAttributeType.Animation:
739738
var animationAttribute = attribute as MapAnimationAttribute;
740739
animationAttribute.AnimationId = AnimationBase.IdFromList(cmbAnimationAttribute.SelectedIndex);
741740
animationAttribute.IsBlock = chkAnimationBlock.Checked;
742741
break;
743742

744-
case MapAttribute.Slide:
743+
case MapAttributeType.Slide:
745744
var slideAttribute = attribute as MapSlideAttribute;
746745
slideAttribute.Direction = (Direction)cmbSlideDir.SelectedIndex;
747746
break;
748747

749-
case MapAttribute.Critter:
748+
case MapAttributeType.Critter:
750749
var critterAttribute = attribute as MapCritterAttribute;
751750
critterAttribute.Sprite = cmbCritterSprite.Text;
752751
critterAttribute.AnimationId = AnimationBase.IdFromList(cmbCritterAnimation.SelectedIndex - 1);
@@ -780,7 +779,7 @@ public GameObjects.Maps.MapAttribute PlaceAttribute(MapBase mapDescriptor, int x
780779

781780
public bool RemoveAttribute(MapBase tmpMap, int x, int y)
782781
{
783-
if (tmpMap.Attributes[x, y] != null && tmpMap.Attributes[x, y].Type != MapAttribute.Walkable)
782+
if (tmpMap.Attributes[x, y] != null && tmpMap.Attributes[x, y].Type != MapAttributeType.Walkable)
784783
{
785784
tmpMap.Attributes[x, y] = null;
786785

0 commit comments

Comments
 (0)