Skip to content

Commit

Permalink
Merge pull request #10 from aglab2/master
Browse files Browse the repository at this point in the history
Various improvements
  • Loading branch information
DavidSM64 authored Mar 3, 2018
2 parents c380a35 + 65618eb commit 6f74e45
Show file tree
Hide file tree
Showing 3 changed files with 268 additions and 99 deletions.
213 changes: 151 additions & 62 deletions data/ObjectCombos_NA.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"ModelAddress": "0x00000000",
"Behavior": "0x13000494"
},
{
"Name": "Aquarium Bubble",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x13000494"
},
{
"Name": "Arrow Lift",
"ModelID": "0x37",
Expand All @@ -70,12 +64,6 @@
"ModelAddress": "0x0C000104",
"Behavior": "0x130020E8"
},
{
"Name": "Baby Penguin",
"ModelID": "0x57",
"ModelAddress": "0x0C000104",
"Behavior": "0x130020E8"
},
{
"Name": "Bascule Bridge",
"ModelID": "0x38",
Expand Down Expand Up @@ -118,30 +106,12 @@
"ModelAddress": "0x0E0003A0",
"Behavior": "0x13004D64"
},
{
"Name": "Big Rotating Gear",
"ModelID": "0x44",
"ModelAddress": "0x0E0003A0",
"Behavior": "0x13004D64"
},
{
"Name": "Big Staircase Level Part",
"ModelID": "0x04",
"ModelAddress": "0x0E000820",
"Behavior": "0x13002A48"
},
{
"Name": "Big Staircase Level Part",
"ModelID": "0x04",
"ModelAddress": "0x0E000820",
"Behavior": "0x13002A48"
},
{
"Name": "Bird ambient sounds",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x13003C7C"
},
{
"Name": "Bird ambient sounds",
"ModelID": "0x00",
Expand All @@ -160,30 +130,12 @@
"ModelAddress": "0x16000200",
"Behavior": "0x13002588"
},
{
"Name": "Blue Coin",
"ModelID": "0x76",
"ModelAddress": "0x16000200",
"Behavior": "0x13002588"
},
{
"Name": "Blue Coins Switch",
"ModelID": "0x8C",
"ModelAddress": "0x0F000000",
"Behavior": "0x13002568"
},
{
"Name": "Blue Coins Switch",
"ModelID": "0x8C",
"ModelAddress": "0x0F000000",
"Behavior": "0x13002568"
},
{
"Name": "Blue Elevator Platform",
"ModelID": "0x40",
"ModelAddress": "0x0E0008F0",
"Behavior": "0x13000CFC"
},
{
"Name": "Blue Elevator Platform",
"ModelID": "0x40",
Expand All @@ -196,12 +148,6 @@
"ModelAddress": "0x16000B8C",
"Behavior": "0x13000C84"
},
{
"Name": "Blue Flame",
"ModelID": "0x91",
"ModelAddress": "0x16000B8C",
"Behavior": "0x13000C84"
},
{
"Name": "Blue Smiley",
"ModelID": "0x37",
Expand Down Expand Up @@ -232,12 +178,6 @@
"ModelAddress": "0x0C000224",
"Behavior": "0x13002790"
},
{
"Name": "Boo Buddy",
"ModelID": "0x54",
"ModelAddress": "0x0C000224",
"Behavior": "0x130027D0"
},
{
"Name": "Boo Buddy 2",
"ModelID": "0x54",
Expand Down Expand Up @@ -686,7 +626,10 @@
"Name": "Coin Formation",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x130008EC"
"Behavior": "0x130008EC",
"BP2_NAME": "Content",
"BP2_DESCRIPTION": "0: Five coins horizontal\n2: Coin ring horizontal\n4: Coin arrow\n16: Five coins horizontal flying\n17: Five coins vertical\n18: Coin ring horizontal flying\n19: Coin ring vertical"

},
{
"Name": "Coins",
Expand Down Expand Up @@ -2639,7 +2582,7 @@
"Behavior": "0x13002F60"
},
{
"Name": "Warp",
"Name": "Warp (for level exit)",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x13002F84"
Expand Down Expand Up @@ -2925,6 +2868,152 @@
"ModelID": "0x55",
"ModelAddress": "0x0C000468",
"Behavior": "0x13004538"
},
{
"Name": "Beta Blarrg [MOP1]",
"ModelID": "0x54",
"ModelAddress": "0x0C000224",
"Behavior": "0x130023D0"
},
{
"Name": "Trampoline [MOP1]",
"ModelID": "0xB5",
"ModelAddress": "0x0C000000",
"Behavior": "0x13001608"
},
{
"Name": "Noteblock [MOP1]",
"ModelID": "0x7B",
"ModelAddress": "0x0301dbf8",
"Behavior": "0x13000174"
},
{
"Name": "Sandblock [MOP1]",
"ModelID": "0x99",
"ModelAddress": "0x030225e4",
"Behavior": "0x1300064C"
},
{
"Name": "Shrinkplatform [MOP1]",
"ModelID": "0x98",
"ModelAddress": "0x030212f4",
"Behavior": "0x13000624"
},
{
"Name": "Spring [MOP1]",
"ModelID": "0x92",
"ModelAddress": "0x0301fc98",
"Behavior": "0x130005B4"
},
{
"Name": "Shell 1 [MOP1]",
"ModelID": "0x9B",
"ModelAddress": "0x0f000adc",
"Behavior": "0x13004218"
},
{
"Name": "Shell 2 [MOP1]",
"ModelID": "0x9D",
"ModelAddress": "0x0f000b08",
"Behavior": "0x13004218"
},
{
"Name": "Emitter [MOP2]",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x130050B4",
"BP1_NAME": "Param 1",
"BP2_NAME": "Param 2",
"BP1_DESCRIPTION": "Spawn radius, Red - value",
"BP2_DESCRIPTION": "Green - value, Blue - value"
},
{
"Name": "Flipclock [MOP2]",
"ModelID": "0xF0",
"ModelAddress": "0x0302272c",
"Behavior": "0x130050D0"
},
{
"Name": "Jukebox [MOP2]",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x13005104",
"BP1_NAME": "First",
"BP2_NAME": "Last",
"BP1_DESCRIPTION": "First song in list",
"BP2_DESCRIPTION": "Last song in list"
},
{
"Name": "PSwitch [MOP2]",
"ModelID": "0xCF",
"ModelAddress": "0x0f0004cc",
"Behavior": "0x1300512C"
},
{
"Name": "Switch for Switchblocks [MOP2]",
"ModelID": "0xF2",
"ModelAddress": "0x03022708",
"Behavior": "0x13003AE0",
"BP2_NAME": "Color",
"BP2_DESCRIPTION": "0 for red\n1 for blue"
},
{
"Name": "Switchblock [MOP2]",
"ModelID": "0xF1",
"ModelAddress": "0x030226d4",
"Behavior": "0x13004EA0",
"BP2_NAME": "Color",
"BP2_DESCRIPTION": "0 for red\n2 for blue",
"BP1_NAME": "Start Color",
"BP1_DESCRIPTION": "0 to start red\n2 to start blue"
},
{
"Name": "Checkpoint Flag [MOP3]",
"ModelID": "0x2E",
"ModelAddress": "0x00606660",
"Behavior": "0x13000D50",
"BP2_NAME": "Flag",
"BP2_DESCRIPTION": "0 for regular flag\n1 for reset flag"
},
{
"Name": "Moving & Rotating Block [MOP3]",
"ModelID": "0x2D",
"ModelAddress": "0x00603670",
"Behavior": "0x13000D24",
"BP1_NAME": "Color",
"BP1_DESCRIPTION": "0 for blue\n1 for red",
"BP2_NAME": "PathID",
"BP2_DESCRIPTION": "Path ID (0, 1 and 2 are predefined)"
},
{
"Name": "Flipswitch Panel [MOP3]",
"ModelID": "0x2A",
"ModelAddress": "0x005f9fe0",
"Behavior": "0x130005D8"
},
{
"Name": "Flipswitch Panel Starspawner [MOP3]",
"ModelID": "0x00",
"ModelAddress": "0x00000000",
"Behavior": "0x130002A0",
"BP1_NAME": "Star #",
"BP1_DESCRIPTION": "Star number"
},
{
"Name": "Green Switchboard [MOP3]",
"ModelID": "0x2B",
"ModelAddress": "0x005fd8b0",
"Behavior": "0x13000CFC",
"BP1_NAME": "Direct 1",
"BP1_DESCRIPTION": "Maximum distance into direction1",
"BP2_NAME": "Direct 2",
"BP2_DESCRIPTION": "Maximum distance into direction2"
},
{
"Name": "Flipswap Platform [MOP3]",
"ModelID": "0x2F",
"ModelAddress": "0x005f9ac0",
"Behavior": "0x13000278"
}
]
}
45 changes: 42 additions & 3 deletions src/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ private void saveROMAsToolStripMenuItem_Click(object sender, EventArgs e)

private void saveROMToolStripMenuItem_Click(object sender, EventArgs e)
{
ROM.Instance.saveFileAs(ROM.Instance.Filepath, ROM.Instance.Endian);
ROM.Instance.saveFile();
}

private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
Expand All @@ -534,6 +534,14 @@ private void replaceObject(int index, ref SelectComboPreset comboWindow)
area.Objects[index].setBehaviorFromAddress(comboWindow.ReturnObjectCombo.Behavior);
treeView1.Nodes[0].Nodes[index].Text = area.Objects[index].getObjectComboName();
area.Objects[index].SetBehaviorParametersToZero();
area.Objects[index].Act1 = true;
area.Objects[index].Act2 = true;
area.Objects[index].Act3 = true;
area.Objects[index].Act4 = true;
area.Objects[index].Act5 = true;
area.Objects[index].Act6 = false;
area.Objects[index].AllActs = true;
area.Objects[index].ShowHideActs(true);
area.Objects[index].UpdateProperties();
}

Expand Down Expand Up @@ -680,6 +688,8 @@ private void objectComboPresetToolStripMenuItem_Click(object sender, EventArgs e
glControl1.Invalidate();
propertyGrid1.Refresh();
glControl1.Update(); // Needed after calling propertyGrid1.Refresh();
updateSelectedObjectsInROM();
Globals.needToSave = true;
}

private void Form1_Shown(object sender, EventArgs e)
Expand Down Expand Up @@ -1069,7 +1079,19 @@ private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEv
if (obj == null) return;
if (label.Equals("All Acts"))
{
obj.ShowHideActs((bool)e.ChangedItem.Value);
bool isAllActs = (bool)e.ChangedItem.Value;
obj.ShowHideActs(isAllActs);

if (isAllActs)
{
obj.Act1 = true;
obj.Act2 = true;
obj.Act3 = true;
obj.Act4 = true;
obj.Act5 = true;
obj.Act6 = false;
}

propertyGrid1.Refresh();
}
else if (label.Equals("Behavior") || label.Equals("Model ID"))
Expand Down Expand Up @@ -1111,7 +1133,24 @@ private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEv
if (e.ChangedItem.Label.Equals("Behavior"))
if (!obj.canEditBehavior)
continue;


if (e.ChangedItem.Label.Equals("All Acts"))
{
bool isAllActs = (bool)e.ChangedItem.Value;
obj.ShowHideActs(isAllActs);

if (isAllActs)
{
obj.Act1 = true;
obj.Act2 = true;
obj.Act3 = true;
obj.Act4 = true;
obj.Act5 = true;
obj.Act6 = false;
}

propertyGrid1.Refresh();
}
obj.updateROMData();
}
}
Expand Down
Loading

0 comments on commit 6f74e45

Please sign in to comment.