Skip to content

Commit a0dc6bf

Browse files
committed
fix: correct replacements that were improperly changed/were somehow missed
1 parent 2c44561 commit a0dc6bf

File tree

11 files changed

+99
-99
lines changed

11 files changed

+99
-99
lines changed

Intersect.Editor/Core/Graphics.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ RenderTarget2D renderTarget2D
521521
var drawLayers = new List<string>();
522522
if (layer == 0)
523523
{
524-
drawLayers.AddRange(Options.Instance.MapOpts.Layers.LowerLayers);
524+
drawLayers.AddRange(Options.Instance.Map.Layers.LowerLayers);
525525
}
526526
else
527527
{
528-
drawLayers.AddRange(Options.Instance.MapOpts.Layers.MiddleLayers);
529-
drawLayers.AddRange(Options.Instance.MapOpts.Layers.UpperLayers);
528+
drawLayers.AddRange(Options.Instance.Map.Layers.MiddleLayers);
529+
drawLayers.AddRange(Options.Instance.Map.Layers.UpperLayers);
530530
}
531531

532532
x1 = 0;
@@ -619,7 +619,7 @@ RenderTarget2D renderTarget2D
619619
else if (Globals.CurrentLayer == LayerOptions.Events)
620620
{
621621
}
622-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs)
622+
else if (Globals.CurrentLayer == LayerOptions.Npcs)
623623
{
624624
}
625625
else if (Globals.CurrentTileset != null)
@@ -978,7 +978,7 @@ private static void DrawSelectionRect()
978978
}
979979
}
980980
}
981-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs) //NPCS
981+
else if (Globals.CurrentLayer == LayerOptions.Npcs) //NPCS
982982
{
983983
for (var i = 0; i < tmpMap.Spawns.Count; i++)
984984
{

Intersect.Editor/Forms/DockingElements/frmMapEditor.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
242242
Globals.MouseButton = 0;
243243
if (Globals.CurrentTool == EditingTool.Dropper)
244244
{
245-
foreach (var layer in Enumerable.Reverse(Options.Instance.MapOpts.Layers.All))
245+
foreach (var layer in Enumerable.Reverse(Options.Instance.Map.Layers.All))
246246
{
247247
if (tmpMap.Layers[layer][Globals.CurTileX, Globals.CurTileY].TilesetId != Guid.Empty)
248248
{
@@ -322,7 +322,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
322322
{
323323
Globals.MapEditorWindow.SmartFillAttributes(Globals.CurTileX, Globals.CurTileY);
324324
}
325-
else if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
325+
else if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
326326
{
327327
Globals.MapEditorWindow.SmartFillLayer(Globals.CurTileX, Globals.CurTileY);
328328
}
@@ -335,7 +335,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
335335
{
336336
Globals.MapEditorWindow.SmartEraseAttributes(Globals.CurTileX, Globals.CurTileY);
337337
}
338-
else if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
338+
else if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
339339
{
340340
Globals.MapEditorWindow.SmartEraseLayer(Globals.CurTileX, Globals.CurTileY);
341341
}
@@ -358,7 +358,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
358358
else if (Globals.CurrentLayer == LayerOptions.Events) //Events
359359
{
360360
}
361-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs) //NPCS
361+
else if (Globals.CurrentLayer == LayerOptions.Npcs) //NPCS
362362
{
363363
}
364364
else
@@ -420,7 +420,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
420420

421421
if (Globals.CurrentTool == EditingTool.Fill)
422422
{
423-
if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
423+
if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
424424
{
425425
Globals.MapEditorWindow.FillLayer();
426426
}
@@ -429,7 +429,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
429429
}
430430
else if (Globals.CurrentTool == EditingTool.Erase)
431431
{
432-
if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
432+
if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
433433
{
434434
Globals.MapEditorWindow.EraseLayer();
435435
}
@@ -475,7 +475,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
475475
mMapChanged = true;
476476
}
477477
}
478-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs)
478+
else if (Globals.CurrentLayer == LayerOptions.Npcs)
479479
{
480480
}
481481
else
@@ -676,7 +676,7 @@ private void picMap_MouseMove(object sender, MouseEventArgs e)
676676
else if (Globals.CurrentLayer == LayerOptions.Events)
677677
{
678678
}
679-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs)
679+
else if (Globals.CurrentLayer == LayerOptions.Npcs)
680680
{
681681
if (Globals.MapLayersWindow.rbDeclared.Checked == true && Globals.MapLayersWindow.lstMapNpcs.Items.Count > 0)
682682
{
@@ -778,7 +778,7 @@ private void picMap_MouseMove(object sender, MouseEventArgs e)
778778
{
779779
Globals.MapLayersWindow.RemoveAttribute(tmpMap, Globals.CurTileX, Globals.CurTileY);
780780
}
781-
else if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
781+
else if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
782782
{
783783
if (Globals.CurrentTool == EditingTool.Brush)
784784
{
@@ -891,7 +891,7 @@ public void picMap_MouseUp(object sender, MouseEventArgs e)
891891
else if (Globals.CurrentLayer == LayerOptions.Events)
892892
{
893893
}
894-
else if (Globals.CurrentLayer == LayerOptions.Instance.Npcs)
894+
else if (Globals.CurrentLayer == LayerOptions.Npcs)
895895
{
896896
}
897897
else
@@ -1244,7 +1244,7 @@ private void picMap_DoubleClick(object sender, EventArgs e)
12441244
}
12451245

12461246
//NPCS
1247-
case LayerOptions.Instance.Npcs:
1247+
case LayerOptions.Npcs:
12481248
{
12491249
var spawnIndex = Globals.MapLayersWindow.lstMapNpcs.SelectedIndex;
12501250
var spawn = -1 < spawnIndex && spawnIndex < currentMap.Spawns.Count
@@ -1320,7 +1320,7 @@ public void FillLayer()
13201320
Globals.CurrentMap, Globals.CurTileX, Globals.CurTileY
13211321
);
13221322
}
1323-
else if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
1323+
else if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
13241324
{
13251325
if (Globals.Autotilemode == 0)
13261326
{
@@ -1407,7 +1407,7 @@ public void EraseLayer()
14071407
Globals.CurrentMap, Globals.CurTileX, Globals.CurTileY
14081408
);
14091409
}
1410-
else if (Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer))
1410+
else if (Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer))
14111411
{
14121412
tmpMap.Layers[Globals.CurrentLayer][Globals.CurTileX, Globals.CurTileY].TilesetId =
14131413
Guid.Empty;
@@ -1810,10 +1810,10 @@ public void ProcessSelectionMovement(MapInstance tmpMap, bool ignoreMouse = fals
18101810
}
18111811
}
18121812

1813-
var layers = Options.Instance.MapOpts.Layers.All;
1813+
var layers = Options.Instance.Map.Layers.All;
18141814
if (Globals.SelectionType == (int)SelectionTypes.CurrentLayer)
18151815
{
1816-
layers = Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer) ? new List<string>() { Globals.CurrentLayer } : new List<string>();
1816+
layers = Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer) ? new List<string>() { Globals.CurrentLayer } : new List<string>();
18171817
}
18181818

18191819
//Finish by copying the source tiles over
@@ -1861,7 +1861,7 @@ public void ProcessSelectionMovement(MapInstance tmpMap, bool ignoreMouse = fals
18611861
//Spawns
18621862
NpcSpawn spawnCopy;
18631863
if (Globals.SelectionType != (int)SelectionTypes.CurrentLayer ||
1864-
Globals.CurrentLayer == LayerOptions.Instance.Npcs)
1864+
Globals.CurrentLayer == LayerOptions.Npcs)
18651865
{
18661866
if (Globals.SelectionSource.FindSpawnAt(x0 - dragxoffset, y0 - dragyoffset) != null)
18671867
{
@@ -1962,10 +1962,10 @@ private void WipeCurrentSelection(MapBase tmpMap)
19621962
}
19631963
}
19641964

1965-
var layers = Options.Instance.MapOpts.Layers.All;
1965+
var layers = Options.Instance.Map.Layers.All;
19661966
if (Globals.SelectionType == (int)SelectionTypes.CurrentLayer)
19671967
{
1968-
layers = Options.Instance.MapOpts.Layers.All.Contains(Globals.CurrentLayer) ? new List<string>() { Globals.CurrentLayer } : new List<string>();
1968+
layers = Options.Instance.Map.Layers.All.Contains(Globals.CurrentLayer) ? new List<string>() { Globals.CurrentLayer } : new List<string>();
19691969
}
19701970

19711971
//start by deleting the source tiles
@@ -2018,7 +2018,7 @@ private void WipeCurrentSelection(MapBase tmpMap)
20182018

20192019
//Spawns
20202020
if (Globals.SelectionType != (int)SelectionTypes.CurrentLayer ||
2021-
Globals.CurrentLayer == LayerOptions.Instance.Npcs)
2021+
Globals.CurrentLayer == LayerOptions.Npcs)
20222022
{
20232023
for (var w = 0; w < tmpMap.Spawns.Count; w++)
20242024
{
@@ -2107,7 +2107,7 @@ public void FlipVertical()
21072107
{
21082108
for (var y = 0; y <= selH; y++)
21092109
{
2110-
foreach (var layer in Options.Instance.MapOpts.Layers.All)
2110+
foreach (var layer in Options.Instance.Map.Layers.All)
21112111
{
21122112
Globals.CurrentMap.Layers[layer][selX + x, selY + y] = tmpMap.Layers[layer][selX + x, selY + selH - y];
21132113
}
@@ -2181,7 +2181,7 @@ public void FlipHorizontal()
21812181
{
21822182
for (var y = 0; y <= selH; y++)
21832183
{
2184-
foreach (var layer in Options.Instance.MapOpts.Layers.All)
2184+
foreach (var layer in Options.Instance.Map.Layers.All)
21852185
{
21862186
Globals.CurrentMap.Layers[layer][selX + x, selY + y] = tmpMap.Layers[layer][selX + selW - x, selY + y];
21872187
}

Intersect.Editor/Forms/DockingElements/frmMapLayers.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ public void Init()
6969
NpcPulseColor = ColorTranslator.FromHtml(Preferences.LoadPreference("NpcPulseColor"));
7070

7171
//See if we can use the old style icons instead of a combobox
72-
if (Options.Instance.MapOpts.Layers.All.Count <= mMapLayers.Count)
72+
if (Options.Instance.Map.Layers.All.Count <= mMapLayers.Count)
7373
{
7474
//Hide combobox...
7575
cmbMapLayer.Hide();
7676
for (int i = 0; i < mMapLayers.Count; i++)
7777
{
78-
if (i < Options.Instance.MapOpts.Layers.All.Count)
78+
if (i < Options.Instance.Map.Layers.All.Count)
7979
{
80-
Strings.Tiles.maplayers.TryGetValue(Options.Instance.MapOpts.Layers.All[i].ToLower(), out LocalizedString layerName);
81-
if (layerName == null) layerName = Options.Instance.MapOpts.Layers.All[i];
80+
Strings.Tiles.maplayers.TryGetValue(Options.Instance.Map.Layers.All[i].ToLower(), out LocalizedString layerName);
81+
if (layerName == null) layerName = Options.Instance.Map.Layers.All[i];
8282
mMapLayers[i].Text = layerName;
8383
mMapLayers[i].Show();
8484
}
@@ -96,16 +96,16 @@ public void Init()
9696
}
9797
//Show Combobox
9898
cmbMapLayer.Show();
99-
cmbMapLayer.Items.AddRange(Options.Instance.MapOpts.Layers.All.ToArray());
99+
cmbMapLayer.Items.AddRange(Options.Instance.Map.Layers.All.ToArray());
100100
cmbMapLayer.SelectedIndex = 0;
101101
}
102102

103-
foreach (var layer in Options.Instance.MapOpts.Layers.All)
103+
foreach (var layer in Options.Instance.Map.Layers.All)
104104
{
105105
LayerVisibility.Add(layer, true);
106106
}
107107

108-
SetLayer(Options.Instance.MapOpts.Layers.All[0]);
108+
SetLayer(Options.Instance.Map.Layers.All[0]);
109109
if (cmbTilesets.Items.Count > 0)
110110
{
111111
SetTileset(cmbTilesets.Items[0].ToString());
@@ -351,7 +351,7 @@ public void SetLayer(string name)
351351
{
352352
Globals.CurrentLayer = name;
353353

354-
var index = Options.Instance.MapOpts.Layers.All.IndexOf(name);
354+
var index = Options.Instance.Map.Layers.All.IndexOf(name);
355355

356356
if (!cmbMapLayer.Visible)
357357
{
@@ -362,7 +362,7 @@ public void SetLayer(string name)
362362
mMapLayers[i].BackgroundImage.Dispose();
363363
mMapLayers[i].BackgroundImage = null;
364364
}
365-
mMapLayers[i].BackgroundImage = DrawLayerImage(i, i == index, !LayerVisibility[Options.Instance.MapOpts.Layers.All[i]]);
365+
mMapLayers[i].BackgroundImage = DrawLayerImage(i, i == index, !LayerVisibility[Options.Instance.Map.Layers.All[i]]);
366366
}
367367
}
368368
else
@@ -395,7 +395,7 @@ private Bitmap DrawLayerImage(int layerIndex, bool selected, bool hidden)
395395
var drawIndex = 0;
396396

397397
//Draw Lower & Middle Layers
398-
foreach (var l in Options.Instance.MapOpts.Layers.LowerLayers)
398+
foreach (var l in Options.Instance.Map.Layers.LowerLayers)
399399
{
400400
var drawImg = layer;
401401
if (drawIndex == layerIndex)
@@ -408,15 +408,15 @@ private Bitmap DrawLayerImage(int layerIndex, bool selected, bool hidden)
408408

409409

410410
//If this image for is an upper layer, render the face below the next layers
411-
if (!Options.Instance.MapOpts.Layers.LowerLayers.Contains(Options.Instance.MapOpts.Layers.All[layerIndex]))
411+
if (!Options.Instance.Map.Layers.LowerLayers.Contains(Options.Instance.Map.Layers.All[layerIndex]))
412412
{
413413
g.DrawImage(drawFace, new PointF(13, 13));
414414
}
415415

416416

417417
//Draw Upper Layers
418-
var middleUpperLayers = Options.Instance.MapOpts.Layers.LowerLayers.ToList();
419-
middleUpperLayers.AddRange(Options.Instance.MapOpts.Layers.MiddleLayers);
418+
var middleUpperLayers = Options.Instance.Map.Layers.LowerLayers.ToList();
419+
middleUpperLayers.AddRange(Options.Instance.Map.Layers.MiddleLayers);
420420
foreach (var l in middleUpperLayers)
421421
{
422422
var drawImg = layer;
@@ -429,7 +429,7 @@ private Bitmap DrawLayerImage(int layerIndex, bool selected, bool hidden)
429429
}
430430

431431
//If this image for is a lower layer, render the face above everything
432-
if (Options.Instance.MapOpts.Layers.LowerLayers.Contains(Options.Instance.MapOpts.Layers.All[layerIndex]))
432+
if (Options.Instance.Map.Layers.LowerLayers.Contains(Options.Instance.Map.Layers.All[layerIndex]))
433433
{
434434
g.DrawImage(drawFace, new PointF(13, 13));
435435
}
@@ -1303,7 +1303,7 @@ private void btnAttributeHeader_Click(object sender, EventArgs e)
13031303

13041304
public void btnLightsHeader_Click(object sender, EventArgs e)
13051305
{
1306-
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Instance.Npcs)
1306+
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Npcs)
13071307
{
13081308
Globals.SavedTool = Globals.CurrentTool;
13091309
}
@@ -1318,7 +1318,7 @@ public void btnLightsHeader_Click(object sender, EventArgs e)
13181318

13191319
private void btnEventsHeader_Click(object sender, EventArgs e)
13201320
{
1321-
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Instance.Npcs)
1321+
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Npcs)
13221322
{
13231323
Globals.SavedTool = Globals.CurrentTool;
13241324
}
@@ -1333,13 +1333,13 @@ private void btnEventsHeader_Click(object sender, EventArgs e)
13331333

13341334
private void btnNpcsHeader_Click(object sender, EventArgs e)
13351335
{
1336-
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Instance.Npcs)
1336+
if (Globals.CurrentLayer != LayerOptions.Lights && Globals.CurrentLayer != LayerOptions.Events && Globals.CurrentLayer != LayerOptions.Npcs)
13371337
{
13381338
Globals.SavedTool = Globals.CurrentTool;
13391339
}
13401340

13411341
ChangeTab();
1342-
Globals.CurrentLayer = LayerOptions.Instance.Npcs;
1342+
Globals.CurrentLayer = LayerOptions.Npcs;
13431343
Core.Graphics.TilePreviewUpdated = true;
13441344
RefreshNpcList();
13451345
btnNpcsHeader.BackColor = System.Drawing.Color.FromArgb(90, 90, 90);
@@ -1352,9 +1352,9 @@ private void picMapLayer_MouseClick(object sender, MouseEventArgs e)
13521352
if (e.Button == MouseButtons.Left)
13531353
{
13541354
var index = mMapLayers.IndexOf((PictureBox)sender);
1355-
if (index > -1 && index < Options.Instance.MapOpts.Layers.All.Count)
1355+
if (index > -1 && index < Options.Instance.Map.Layers.All.Count)
13561356
{
1357-
SetLayer(Options.Instance.MapOpts.Layers.All[index]);
1357+
SetLayer(Options.Instance.Map.Layers.All[index]);
13581358
}
13591359
}
13601360
else
@@ -1365,9 +1365,9 @@ private void picMapLayer_MouseClick(object sender, MouseEventArgs e)
13651365

13661366
private void ToggleLayerVisibility(int index)
13671367
{
1368-
if (index > -1 && index < Options.Instance.MapOpts.Layers.All.Count)
1368+
if (index > -1 && index < Options.Instance.Map.Layers.All.Count)
13691369
{
1370-
LayerVisibility[Options.Instance.MapOpts.Layers.All[index]] = !LayerVisibility[Options.Instance.MapOpts.Layers.All[index]];
1370+
LayerVisibility[Options.Instance.Map.Layers.All[index]] = !LayerVisibility[Options.Instance.Map.Layers.All[index]];
13711371
SetLayer(Globals.CurrentLayer);
13721372
}
13731373

@@ -1376,7 +1376,7 @@ private void ToggleLayerVisibility(int index)
13761376
private void picMapLayer_MouseHover(object sender, EventArgs e)
13771377
{
13781378
var tt = new ToolTip();
1379-
tt.SetToolTip((PictureBox) sender, Options.Instance.MapOpts.Layers.All[mMapLayers.IndexOf((PictureBox)sender)]);
1379+
tt.SetToolTip((PictureBox) sender, Options.Instance.Map.Layers.All[mMapLayers.IndexOf((PictureBox)sender)]);
13801380
}
13811381

13821382
private void cmbTilesets_MouseDown(object sender, MouseEventArgs e)
@@ -1401,7 +1401,7 @@ private void cmbMapLayer_SelectedIndexChanged(object sender, EventArgs e)
14011401
{
14021402
if (cmbMapLayer.SelectedIndex > -1)
14031403
{
1404-
SetLayer(Options.Instance.MapOpts.Layers.All[cmbMapLayer.SelectedIndex]);
1404+
SetLayer(Options.Instance.Map.Layers.All[cmbMapLayer.SelectedIndex]);
14051405
}
14061406
}
14071407

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public EventCommandChangeLevel(ChangeLevelCommand refCommand, FrmEvent editor)
1616
InitializeComponent();
1717
mMyCommand = refCommand;
1818
mEventEditor = editor;
19-
if (mMyCommand.Level <= 0 || mMyCommand.Level > Options.Instance.PlayerOpts.MaxLevel)
19+
if (mMyCommand.Level <= 0 || mMyCommand.Level > Options.Instance.Player.MaxLevel)
2020
{
2121
mMyCommand.Level = 1;
2222
}
2323

24-
nudLevel.Maximum = Options.Instance.PlayerOpts.MaxLevel;
24+
nudLevel.Maximum = Options.Instance.Player.MaxLevel;
2525
nudLevel.Value = mMyCommand.Level;
2626
InitLocalization();
2727
}

0 commit comments

Comments
 (0)