Skip to content

Commit 5ed00ec

Browse files
committed
rename AnimationBase -> AnimationDescriptor without forgetting the editor...
1 parent 48091dd commit 5ed00ec

File tree

17 files changed

+109
-109
lines changed

17 files changed

+109
-109
lines changed

Intersect.Editor/Core/Graphics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ bool alternate
14461446
else if (tmpMap.Attributes[x, y].Type == MapAttributeType.Animation)
14471447
{
14481448
var animation =
1449-
AnimationBase.Get(((MapAnimationAttribute) tmpMap.Attributes[x, y]).AnimationId);
1449+
AnimationDescriptor.Get(((MapAnimationAttribute) tmpMap.Attributes[x, y]).AnimationId);
14501450

14511451
if (animation != null)
14521452
{
@@ -1457,7 +1457,7 @@ bool alternate
14571457
var animInstance = tmpMap.GetAttributeAnimation(tmpMap.Attributes[x, y], animation.Id);
14581458

14591459
//Update if the animation isn't right!
1460-
if (animInstance == null || animInstance.MyBase != animation)
1460+
if (animInstance == null || animInstance.Descriptor != animation)
14611461
{
14621462
tmpMap.SetAttributeAnimation(
14631463
tmpMap.Attributes[x, y], new Animation(animation, true)

Intersect.Editor/Entities/Animation.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,52 +34,52 @@ public partial class Animation
3434

3535
private long mUpperTimer;
3636

37-
public AnimationBase MyBase;
37+
public AnimationDescriptor Descriptor;
3838

39-
public Animation(AnimationBase animBase, bool loopForever)
39+
public Animation(AnimationDescriptor animationDescriptor, bool loopForever)
4040
{
41-
MyBase = animBase;
42-
mLowerLoop = animBase.Lower.LoopCount;
43-
mUpperLoop = animBase.Upper.LoopCount;
44-
mLowerTimer = Timing.Global.MillisecondsUtc + animBase.Lower.FrameSpeed;
45-
mUpperTimer = Timing.Global.MillisecondsUtc + animBase.Upper.FrameSpeed;
41+
Descriptor = animationDescriptor;
42+
mLowerLoop = animationDescriptor.Lower.LoopCount;
43+
mUpperLoop = animationDescriptor.Upper.LoopCount;
44+
mLowerTimer = Timing.Global.MillisecondsUtc + animationDescriptor.Lower.FrameSpeed;
45+
mUpperTimer = Timing.Global.MillisecondsUtc + animationDescriptor.Upper.FrameSpeed;
4646
mInfiniteLoop = loopForever;
4747
}
4848

4949
public void Draw(RenderTarget2D target, bool upper = false, bool alternate = false)
5050
{
51-
if (!upper && alternate != MyBase.Lower.AlternateRenderLayer)
51+
if (!upper && alternate != Descriptor.Lower.AlternateRenderLayer)
5252
{
5353
return;
5454
}
5555

56-
if (upper && alternate != MyBase.Upper.AlternateRenderLayer)
56+
if (upper && alternate != Descriptor.Upper.AlternateRenderLayer)
5757
{
5858
return;
5959
}
6060

6161
if (!upper)
6262
{
6363
//Draw Lower
64-
var tex = GameContentManager.GetTexture(GameContentManager.TextureType.Animation, MyBase.Lower.Sprite);
64+
var tex = GameContentManager.GetTexture(GameContentManager.TextureType.Animation, Descriptor.Lower.Sprite);
6565
if (mShowLower)
6666
{
67-
if (mLowerFrame >= MyBase.Lower.FrameCount)
67+
if (mLowerFrame >= Descriptor.Lower.FrameCount)
6868
{
6969
return;
7070
}
7171

7272
if (tex != null)
7373
{
74-
if (MyBase.Lower.XFrames > 0 && MyBase.Lower.YFrames > 0)
74+
if (Descriptor.Lower.XFrames > 0 && Descriptor.Lower.YFrames > 0)
7575
{
76-
var frameWidth = (int) tex.Width / MyBase.Lower.XFrames;
77-
var frameHeight = (int) tex.Height / MyBase.Lower.YFrames;
76+
var frameWidth = (int) tex.Width / Descriptor.Lower.XFrames;
77+
var frameHeight = (int) tex.Height / Descriptor.Lower.YFrames;
7878
Core.Graphics.DrawTexture(
7979
tex,
8080
new RectangleF(
81-
mLowerFrame % MyBase.Lower.XFrames * frameWidth,
82-
(float) Math.Floor((double) mLowerFrame / MyBase.Lower.XFrames) * frameHeight,
81+
mLowerFrame % Descriptor.Lower.XFrames * frameWidth,
82+
(float) Math.Floor((double) mLowerFrame / Descriptor.Lower.XFrames) * frameHeight,
8383
frameWidth, frameHeight
8484
),
8585
new RectangleF(
@@ -93,36 +93,36 @@ public void Draw(RenderTarget2D target, bool upper = false, bool alternate = fal
9393
Options.Instance.Map.MapWidth * Options.Instance.Map.TileWidth -
9494
Core.Graphics.CurrentView.Left +
9595
(int) mRenderX +
96-
MyBase.Lower.Lights[mLowerFrame].OffsetX,
96+
Descriptor.Lower.Lights[mLowerFrame].OffsetX,
9797
Options.Instance.Map.MapHeight * Options.Instance.Map.TileHeight -
9898
Core.Graphics.CurrentView.Top +
9999
(int) mRenderY +
100-
MyBase.Lower.Lights[mLowerFrame].OffsetY, MyBase.Lower.Lights[mLowerFrame]
100+
Descriptor.Lower.Lights[mLowerFrame].OffsetY, Descriptor.Lower.Lights[mLowerFrame]
101101
);
102102
}
103103
}
104104
else
105105
{
106106
//Draw Upper
107-
var tex = GameContentManager.GetTexture(GameContentManager.TextureType.Animation, MyBase.Upper.Sprite);
107+
var tex = GameContentManager.GetTexture(GameContentManager.TextureType.Animation, Descriptor.Upper.Sprite);
108108
if (mShowUpper)
109109
{
110-
if (mUpperFrame >= MyBase.Upper.FrameCount)
110+
if (mUpperFrame >= Descriptor.Upper.FrameCount)
111111
{
112112
return;
113113
}
114114

115115
if (tex != null)
116116
{
117-
if (MyBase.Upper.XFrames > 0 && MyBase.Upper.YFrames > 0)
117+
if (Descriptor.Upper.XFrames > 0 && Descriptor.Upper.YFrames > 0)
118118
{
119-
var frameWidth = (int) tex.Width / MyBase.Upper.XFrames;
120-
var frameHeight = (int) tex.Height / MyBase.Upper.YFrames;
119+
var frameWidth = (int) tex.Width / Descriptor.Upper.XFrames;
120+
var frameHeight = (int) tex.Height / Descriptor.Upper.YFrames;
121121
Core.Graphics.DrawTexture(
122122
tex,
123123
new RectangleF(
124-
mUpperFrame % MyBase.Upper.XFrames * frameWidth,
125-
(float) Math.Floor((double) mUpperFrame / MyBase.Upper.XFrames) * frameHeight,
124+
mUpperFrame % Descriptor.Upper.XFrames * frameWidth,
125+
(float) Math.Floor((double) mUpperFrame / Descriptor.Upper.XFrames) * frameHeight,
126126
frameWidth, frameHeight
127127
),
128128
new RectangleF(
@@ -136,11 +136,11 @@ public void Draw(RenderTarget2D target, bool upper = false, bool alternate = fal
136136
Options.Instance.Map.MapWidth * Options.Instance.Map.TileWidth -
137137
Core.Graphics.CurrentView.Left +
138138
(int) mRenderX +
139-
MyBase.Upper.Lights[mUpperFrame].OffsetX,
139+
Descriptor.Upper.Lights[mUpperFrame].OffsetX,
140140
Options.Instance.Map.MapHeight * Options.Instance.Map.TileHeight -
141141
Core.Graphics.CurrentView.Top +
142142
(int) mRenderY +
143-
MyBase.Upper.Lights[mUpperFrame].OffsetY, MyBase.Upper.Lights[mUpperFrame]
143+
Descriptor.Upper.Lights[mUpperFrame].OffsetY, Descriptor.Upper.Lights[mUpperFrame]
144144
);
145145
}
146146
}
@@ -158,15 +158,15 @@ public void Update()
158158
if (mLowerTimer < Timing.Global.MillisecondsUtc && mShowLower)
159159
{
160160
mLowerFrame++;
161-
if (mLowerFrame >= MyBase.Lower.FrameCount)
161+
if (mLowerFrame >= Descriptor.Lower.FrameCount)
162162
{
163163
mLowerLoop--;
164164
mLowerFrame = 0;
165165
if (mLowerLoop < 0)
166166
{
167167
if (mInfiniteLoop)
168168
{
169-
mLowerLoop = MyBase.Lower.LoopCount;
169+
mLowerLoop = Descriptor.Lower.LoopCount;
170170
}
171171
else
172172
{
@@ -175,21 +175,21 @@ public void Update()
175175
}
176176
}
177177

178-
mLowerTimer = Timing.Global.MillisecondsUtc + MyBase.Lower.FrameSpeed;
178+
mLowerTimer = Timing.Global.MillisecondsUtc + Descriptor.Lower.FrameSpeed;
179179
}
180180

181181
if (mUpperTimer < Timing.Global.MillisecondsUtc && mShowUpper)
182182
{
183183
mUpperFrame++;
184-
if (mUpperFrame >= MyBase.Upper.FrameCount)
184+
if (mUpperFrame >= Descriptor.Upper.FrameCount)
185185
{
186186
mUpperLoop--;
187187
mUpperFrame = 0;
188188
if (mUpperLoop < 0)
189189
{
190190
if (mInfiniteLoop)
191191
{
192-
mUpperLoop = MyBase.Upper.LoopCount;
192+
mUpperLoop = Descriptor.Upper.LoopCount;
193193
}
194194
else
195195
{
@@ -198,7 +198,7 @@ public void Update()
198198
}
199199
}
200200

201-
mUpperTimer = Timing.Global.MillisecondsUtc + MyBase.Upper.FrameSpeed;
201+
mUpperTimer = Timing.Global.MillisecondsUtc + Descriptor.Upper.FrameSpeed;
202202
}
203203
}
204204

Intersect.Editor/Forms/DockingElements/frmMapLayers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ public GameObjects.Maps.MapAttribute CreateAttribute()
734734

735735
case MapAttributeType.Animation:
736736
var animationAttribute = attribute as MapAnimationAttribute;
737-
animationAttribute.AnimationId = AnimationBase.IdFromList(cmbAnimationAttribute.SelectedIndex);
737+
animationAttribute.AnimationId = AnimationDescriptor.IdFromList(cmbAnimationAttribute.SelectedIndex);
738738
animationAttribute.IsBlock = chkAnimationBlock.Checked;
739739
break;
740740

@@ -746,7 +746,7 @@ public GameObjects.Maps.MapAttribute CreateAttribute()
746746
case MapAttributeType.Critter:
747747
var critterAttribute = attribute as MapCritterAttribute;
748748
critterAttribute.Sprite = cmbCritterSprite.Text;
749-
critterAttribute.AnimationId = AnimationBase.IdFromList(cmbCritterAnimation.SelectedIndex - 1);
749+
critterAttribute.AnimationId = AnimationDescriptor.IdFromList(cmbCritterAnimation.SelectedIndex - 1);
750750
critterAttribute.Movement = (byte)cmbCritterMovement.SelectedIndex;
751751
critterAttribute.Layer = (byte)cmbCritterLayer.SelectedIndex;
752752
critterAttribute.Speed = (int)nudCritterMoveSpeed.Value;
@@ -993,7 +993,7 @@ private void btnVisualMapSelector_Click(object sender, EventArgs e)
993993
private void rbAnimation_CheckedChanged(object sender, EventArgs e)
994994
{
995995
cmbAnimationAttribute.Items.Clear();
996-
cmbAnimationAttribute.Items.AddRange(AnimationBase.Names);
996+
cmbAnimationAttribute.Items.AddRange(AnimationDescriptor.Names);
997997
if (cmbAnimationAttribute.Items.Count > 0)
998998
{
999999
cmbAnimationAttribute.SelectedIndex = 0;
@@ -1012,7 +1012,7 @@ private void rbCritter_CheckedChanged(object sender, EventArgs e)
10121012
{
10131013
cmbCritterAnimation.Items.Clear();
10141014
cmbCritterAnimation.Items.Add(Strings.General.None);
1015-
cmbCritterAnimation.Items.AddRange(AnimationBase.Names);
1015+
cmbCritterAnimation.Items.AddRange(AnimationDescriptor.Names);
10161016
cmbCritterAnimation.SelectedIndex = 0;
10171017

10181018
cmbCritterSprite.Items.Clear();

Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
10961096
if (MapList.OrderedMaps[i].MapId == command.MapId)
10971097
{
10981098
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
1099-
AnimationBase.GetName(command.AnimationId),
1099+
AnimationDescriptor.GetName(command.AnimationId),
11001100
Strings.EventCommandList.animationonmap.ToString(
11011101
MapList.OrderedMaps[i].Name, command.X, command.Y,
11021102
Strings.Direction.dir[(Direction) command.Dir]
@@ -1106,7 +1106,7 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
11061106
}
11071107

11081108
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
1109-
AnimationBase.GetName(command.AnimationId),
1109+
AnimationDescriptor.GetName(command.AnimationId),
11101110
Strings.EventCommandList.animationonmap.ToString(
11111111
Strings.EventCommandList.mapnotfound, command.X, command.Y, Strings.Direction.dir[(Direction)command.Dir]
11121112
)
@@ -1135,7 +1135,7 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
11351135
if (command.EntityId == Guid.Empty)
11361136
{
11371137
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
1138-
AnimationBase.GetName(command.AnimationId),
1138+
AnimationDescriptor.GetName(command.AnimationId),
11391139
Strings.EventCommandList.animationonplayer.ToString(command.X, command.Y, spawnOpt)
11401140
));
11411141
}
@@ -1144,7 +1144,7 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
11441144
if (map.LocalEvents.ContainsKey(command.EntityId))
11451145
{
11461146
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
1147-
AnimationBase.GetName(command.AnimationId),
1147+
AnimationDescriptor.GetName(command.AnimationId),
11481148
Strings.EventCommandList.animationonevent.ToString(
11491149
map.LocalEvents[command.EntityId].Name, command.X, command.Y, spawnOpt
11501150
)
@@ -1153,7 +1153,7 @@ private static string GetCommandText(PlayAnimationCommand command, MapInstance m
11531153
else
11541154
{
11551155
commandTextBuilder.Append(Strings.EventCommandList.playanimation.ToString(
1156-
AnimationBase.GetName(command.AnimationId),
1156+
AnimationDescriptor.GetName(command.AnimationId),
11571157
Strings.EventCommandList.animationonevent.ToString(
11581158
Strings.EventCommandList.deletedevent, command.X, command.Y, spawnOpt
11591159
)

Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_PlayAnimation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ PlayAnimationCommand editingCommand
4141
mCurrentMap = currentMap;
4242
InitLocalization();
4343
cmbAnimation.Items.Clear();
44-
cmbAnimation.Items.AddRange(AnimationBase.Names);
45-
cmbAnimation.SelectedIndex = AnimationBase.ListIndex(mMyCommand.AnimationId);
44+
cmbAnimation.Items.AddRange(AnimationDescriptor.Names);
45+
cmbAnimation.SelectedIndex = AnimationDescriptor.ListIndex(mMyCommand.AnimationId);
4646
if (mMyCommand.MapId != Guid.Empty)
4747
{
4848
cmbConditionType.SelectedIndex = 0;
@@ -211,7 +211,7 @@ private void UpdateSpawnPreview()
211211

212212
private void btnSave_Click(object sender, EventArgs e)
213213
{
214-
mMyCommand.AnimationId = AnimationBase.IdFromList(cmbAnimation.SelectedIndex);
214+
mMyCommand.AnimationId = AnimationDescriptor.IdFromList(cmbAnimation.SelectedIndex);
215215
switch (cmbConditionType.SelectedIndex)
216216
{
217217
case 0: //Tile Spawn

Intersect.Editor/Forms/Editors/Events/Event Commands/Event_MoveRouteAnimationSelector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public EventMoveRouteAnimationSelector(
2323
InitializeComponent();
2424
cmbAnimation.Items.Clear();
2525
cmbAnimation.Items.Add(Strings.General.None);
26-
cmbAnimation.Items.AddRange(AnimationBase.Names);
26+
cmbAnimation.Items.AddRange(AnimationDescriptor.Names);
2727
if (!newAction)
2828
{
29-
cmbAnimation.SelectedIndex = AnimationBase.ListIndex(action.AnimationId) + 1;
29+
cmbAnimation.SelectedIndex = AnimationDescriptor.ListIndex(action.AnimationId) + 1;
3030
}
3131

3232
mNewAction = newAction;
@@ -45,7 +45,7 @@ private void InitLocalization()
4545

4646
private void btnOkay_Click(object sender, EventArgs e)
4747
{
48-
mMyAction.AnimationId = AnimationBase.IdFromList(cmbAnimation.SelectedIndex - 1);
48+
mMyAction.AnimationId = AnimationDescriptor.IdFromList(cmbAnimation.SelectedIndex - 1);
4949
mRouteDesigner.Controls.Remove(this);
5050
}
5151

Intersect.Editor/Forms/Editors/Events/frmEvent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ private void btnPastePage_Click(object sender, EventArgs e)
440440

441441
private void cmbAnimation_SelectedIndexChanged(object sender, EventArgs e)
442442
{
443-
CurrentPage.AnimationId = AnimationBase.IdFromList(cmbAnimation.SelectedIndex - 1);
443+
CurrentPage.AnimationId = AnimationDescriptor.IdFromList(cmbAnimation.SelectedIndex - 1);
444444
}
445445

446446
private void chkIsGlobal_CheckedChanged(object sender, EventArgs e)
@@ -1000,7 +1000,7 @@ public void InitEditor(bool disableNaming, bool disableTriggers, bool questEvent
10001000

10011001
cmbAnimation.Items.Clear();
10021002
cmbAnimation.Items.Add(Strings.General.None);
1003-
cmbAnimation.Items.AddRange(AnimationBase.Names);
1003+
cmbAnimation.Items.AddRange(AnimationDescriptor.Names);
10041004
chkParallelRun.Checked = MyEvent.CanRunInParallel;
10051005
if (MyEvent.CommonEvent || questEvent)
10061006
{
@@ -1092,7 +1092,7 @@ public void LoadPage(int pageNum)
10921092
UpdateFacePreview();
10931093
}
10941094

1095-
cmbAnimation.SelectedIndex = AnimationBase.ListIndex(CurrentPage.AnimationId) + 1;
1095+
cmbAnimation.SelectedIndex = AnimationDescriptor.ListIndex(CurrentPage.AnimationId) + 1;
10961096
chkHideName.Checked = Convert.ToBoolean(CurrentPage.HideName);
10971097
chkDisableInspector.Checked = Convert.ToBoolean(CurrentPage.DisablePreview);
10981098
chkDirectionFix.Checked = Convert.ToBoolean(CurrentPage.DirectionFix);

0 commit comments

Comments
 (0)