Skip to content

Commit

Permalink
Merge pull request #10 from SM64-STROOP/Development
Browse files Browse the repository at this point in the history
Build 0.2.6
  • Loading branch information
danebouchie authored Nov 6, 2016
2 parents bfe06f1 + b5ffa4d commit 28bf804
Show file tree
Hide file tree
Showing 49 changed files with 2,275 additions and 1,607 deletions.
3 changes: 3 additions & 0 deletions Source/SM64 Diagnostic/Config/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<CoordinateOffsetX>0xA0</CoordinateOffsetX>
<CoordinateOffsetY>0xA4</CoordinateOffsetY>
<CoordinateOffsetZ>0xA8</CoordinateOffsetZ>
<HomeOffsetX>0x164</HomeOffsetX>
<HomeOffsetY>0x168</HomeOffsetY>
<HomeOffsetZ>0x16C</HomeOffsetZ>
<RotationOffset>0xC8</RotationOffset>
<MaxObjectSlots>240</MaxObjectSlots>
<MoveToMarioYOffset>300</MoveToMarioYOffset>
Expand Down
7 changes: 0 additions & 7 deletions Source/SM64 Diagnostic/Config/MarioData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
<Data type="ushort" address="0x00c26c22" absoluteAddress="true" isAngle="true">Roll</Data>
<Data type="ushort" address="0x00c26c26" absoluteAddress="true" isAngle="true">Yaw Velocity</Data>
<Data type="ushort" address="0x00c26c20" absoluteAddress="true" isAngle="true">Flying Pull Back</Data>
<Data type="float" address="0x70" marioOffset="true">Floor Height</Data>
<Data type="float" address="0x6C" marioOffset="true">Ceiling Height</Data>
<Data special="true" specialType="DistanceBelowCeiling">Dist Below Ceiling</Data>
<Data special="true" specialType="DistanceAboveFloor">Dist Above Floor</Data>
<Data type="uint" address="0x00C26C58" absoluteAddress="true" useHex="true">Floor Triangle</Data>
<Data type="uint" address="0x00C26C50" absoluteAddress="true" useHex="true">Wall Triangle</Data>
<Data type="uint" address="0x00C26C54" absoluteAddress="true" useHex="true">Ceiling Triangle</Data>
<Data type="uint" address="0xc26c68" absoluteAddress="true" useHex="true">Interaction Object</Data>
<Data type="uint" address="0xc26c70" absoluteAddress="true" useHex="true">Using Object</Data>
<Data type="uint" address="0xc1c8b4" absoluteAddress="true" useHex="true">Stood On Object</Data>
Expand Down
3 changes: 3 additions & 0 deletions Source/SM64 Diagnostic/Config/ObjectAssociations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<Using>
<OverlayImage path="Using.png"/>
</Using>
<Closest>
<OverlayImage path="Closest.png"/>
</Closest>
</Overlays>
<Object behaviorScriptAddress="0x13000000" name="Star Door">
<Image path="Star Door.png"/>
Expand Down
8 changes: 6 additions & 2 deletions Source/SM64 Diagnostic/Config/ObjectData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<Data type="uint" address="0x114" objectOffset="true" isAngle="true">Pitch (Rot Speed)</Data>
<Data type="uint" address="0x11c" objectOffset="true" isAngle="true">Roll (Rot Speed)</Data>
<Data type="float" address="0x015C" objectOffset="true">Dist to Mario</Data>
<Data special="true" specialType="DistanceToMario">Act. Dist to Mario</Data>
<Data special="true" specialType="LateralDistanceToMario">Lat. Dist to Mario</Data>
<Data special="true" specialType="MarioDistanceToObject">Act. Dist to Mario</Data>
<Data special="true" specialType="MarioLateralDistanceToObject">Lat. Dist to Mario</Data>
<Data type="uint" address="0x0160" objectOffset="true" isAngle="true">Angle to Mario</Data>
<Data type="float" address="0x019C" objectOffset="true">Drawing Dist</Data>
<Data special="true" specialType="RngCallsPerFrame">RNG Calls/Frame</Data>
Expand All @@ -37,6 +37,10 @@
<Data type="float" address="0x164" objectOffset="true">Home X</Data>
<Data type="float" address="0x168" objectOffset="true">Home Y</Data>
<Data type="float" address="0x16C" objectOffset="true">Home Z</Data>
<Data special="true" specialType="MarioDistanceToObjectHome">Mario Dist to Home</Data>
<Data special="true" specialType="MarioLateralDistanceToObjectHome">Mario Lat. Dist to Home</Data>
<Data special="true" specialType="ObjectDistanceToHome">Dist to Home</Data>
<Data special="true" specialType="LateralObjectDistanceToHome">Lat. Dist to Home</Data>
<Data type="uint" address="0x1CC" objectOffset="true" useHex="true">Release Status</Data>
<Data type="ushort" address="0x136" objectOffset="true" useHex="true">Interaction Status</Data>
<Data type="int" address="0x144" objectOffset="true">Subtype</Data>
Expand Down
45 changes: 45 additions & 0 deletions Source/SM64 Diagnostic/Config/TrianglesData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<TrianglesData>
<Data special="true" specialType="Classification">Classification</Data>
<Data type="ushort" address="0x00" triangleOffset="true">SurfaceType</Data>
<Data type="byte" address="0x02" triangleOffset="true" useHex="true">Flags</Data>
<Data type="byte" address="0x03" triangleOffset="true">Wind Direction</Data>
<Data type="short" address="0x04" triangleOffset="true">Wall Projection</Data>
<Data type="short" address="0x06" triangleOffset="true">Y Min</Data>
<Data type="short" address="0x08" triangleOffset="true">Y Max</Data>
<Data type="short" address="0x0A" triangleOffset="true">X1</Data>
<Data type="short" address="0x0C" triangleOffset="true">Y1</Data>
<Data type="short" address="0x0E" triangleOffset="true">Z1</Data>
<Data type="short" address="0x10" triangleOffset="true">X2</Data>
<Data type="short" address="0x12" triangleOffset="true">Y2</Data>
<Data type="short" address="0x14" triangleOffset="true">Z2</Data>
<Data type="short" address="0x16" triangleOffset="true">X3</Data>
<Data type="short" address="0x18" triangleOffset="true">Y3</Data>
<Data type="short" address="0x1A" triangleOffset="true">Z3</Data>
<Data type="float" address="0x1C" triangleOffset="true">Normal X</Data>
<Data type="float" address="0x20" triangleOffset="true">Normal Y</Data>
<Data type="float" address="0x24" triangleOffset="true">Normal Z</Data>
<Data type="float" address="0x28" triangleOffset="true">Normal Offset</Data>
<Data type="uint" address="0x2C" triangleOffset="true" useHex="true">Associated Object</Data>
<Data special="true" specialType="UpHillAngle">Uphill Angle</Data>
<Data special="true" specialType="DownHillAngle">Downhill Angle</Data>
<Data special="true" specialType="RightHillAngle">Right Hill Angle</Data>
<Data special="true" specialType="LeftHillAngle">Left Hill Angle</Data>
<Data special="true" specialType="Steepness">Steepness</Data>
<Data type="float" address="0x8033B1AC" color="#ffcccc">Mario X</Data>
<Data type="float" address="0x8033B1B0" color="#ffcccc">Mario Y</Data>
<Data type="float" address="0x8033B1B4" color="#ffcccc">Mario Z</Data>
<Data special="true" specialType="ClosestVertex" color="#ffcccc">Closest Vertex</Data>
<Data type="ushort" address="0x00C26C16" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Intended)</Data>
<Data type="ushort" address="0x00C26C1C" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Facing)</Data>
<Data type="uint" address="0x00C26C58" absoluteAddress="true" useHex="true" color="#ffcccc">Floor Triangle</Data>
<Data type="uint" address="0x00C26C50" absoluteAddress="true" useHex="true" color="#ffcccc">Wall Triangle</Data>
<Data type="uint" address="0x00C26C54" absoluteAddress="true" useHex="true" color="#ffcccc">Ceiling Triangle</Data>
<Data type="float" address="0x8033b1E0" color="#ffcccc">Floor Height</Data>
<Data special="true" specialType="HeightOnSlope" color="#ffcccc">Height On Slope</Data>
<Data type="float" address="0x8033b1DC" color="#ffcccc">Ceiling Height</Data>
<Data special="true" specialType="DistanceBelowCeiling" color="#ffcccc">Dist Below Ceiling</Data>
<Data special="true" specialType="DistanceAboveFloor" color="#ffcccc">Dist Above Floor</Data>
<Data special="true" specialType="NormalDistAway" color="#ffcccc">Normal Dist Away</Data>
<Data special="true" specialType="VerticalDistAway" color="#ffcccc">Vertical Dist Away</Data>
</TrianglesData>
56 changes: 44 additions & 12 deletions Source/SM64 Diagnostic/Controls/DataContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SM64_Diagnostic.ManagerClasses
namespace SM64_Diagnostic.Controls
{
public class DataContainer
public class DataContainer : IDataContainer
{
Label _nameLabel;
TableLayoutPanel _tablePanel;
TextBox TextBoxValue;
TextBox _textBoxValue;
string _specialName;

public DataContainer(string name)
{
_specialName = name;

this._nameLabel = new Label();
this._nameLabel.Width = 210;
this._nameLabel.Text = name;
this._nameLabel.Margin = new Padding(3, 3, 3, 3);

this.TextBoxValue = new TextBox();
this.TextBoxValue.ReadOnly = true;
this.TextBoxValue.BorderStyle = BorderStyle.None;
this.TextBoxValue.TextAlign = HorizontalAlignment.Right;
this.TextBoxValue.Width = 200;
this.TextBoxValue.Margin = new Padding(6, 3, 6, 3);
this._textBoxValue = new TextBox();
this._textBoxValue.ReadOnly = true;
this._textBoxValue.BorderStyle = BorderStyle.None;
this._textBoxValue.TextAlign = HorizontalAlignment.Right;
this._textBoxValue.Width = 200;
this._textBoxValue.Margin = new Padding(6, 3, 6, 3);

this._tablePanel = new TableLayoutPanel();
this._tablePanel.Size = new Size(230, _nameLabel.Height + 2);
Expand All @@ -41,7 +44,7 @@ public DataContainer(string name)
this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120));
this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110));
this._tablePanel.Controls.Add(_nameLabel, 0, 0);
this._tablePanel.Controls.Add(this.TextBoxValue, 1, 0);
this._tablePanel.Controls.Add(this._textBoxValue, 1, 0);
}

public Control Control
Expand All @@ -64,16 +67,45 @@ public string Name
}
}

public string SpecialName
{
get
{
return _specialName;
}
set
{
_specialName = value;
}
}

public string Text
{
get
{
return TextBoxValue.Text;
return _textBoxValue.Text;
}
set
{
_textBoxValue.Text = value;
}
}

public Color Color
{
get
{
return Control.BackColor;
}
set
{
TextBoxValue.Text = value;
Control.BackColor = value;
_textBoxValue.BackColor = Color;
}
}

public void Update()
{
}
}
}
30 changes: 30 additions & 0 deletions Source/SM64 Diagnostic/Controls/IDataContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SM64_Diagnostic.Controls
{
public interface IDataContainer
{
string Name
{
get;
set;
}
string SpecialName
{
get;
}

Control Control
{
get;
}


void Update();
}
}
31 changes: 23 additions & 8 deletions Source/SM64 Diagnostic/Controls/ObjectSlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ObjectSlot : Panel
{
const int BorderSize = 2;

ObjectSlotManager _manager;
ObjectSlotsManager _manager;
ObjectSlotManagerGui _gui;

Color _mainColor, _borderColor, _backColor;
Expand Down Expand Up @@ -106,7 +106,7 @@ public Image ObjectImage
}
}

public ObjectSlotManager Manager
public ObjectSlotsManager Manager
{
get
{
Expand All @@ -127,7 +127,8 @@ public override Color BackColor
}
}

bool _drawSelectedOverlay, _drawStandingOnOverlay, _drawHoldingOverlay, _drawInteractingObject, _drawUsingObject;
bool _drawSelectedOverlay, _drawStandingOnOverlay, _drawHoldingOverlay, _drawInteractingObject, _drawUsingObject,
_drawClosestOverlay;
public bool DrawSelectedOverlay
{
get
Expand Down Expand Up @@ -200,7 +201,22 @@ public bool DrawUsingOverlay
}
}

public ObjectSlot(int index, ObjectSlotManager manager, ObjectSlotManagerGui gui, Size size)
public bool DrawClosestOverlay
{
get
{
return _drawClosestOverlay;
}
set
{
if (_drawClosestOverlay == value)
return;
_drawClosestOverlay = value;
Invalidate();
}
}

public ObjectSlot(int index, ObjectSlotsManager manager, ObjectSlotManagerGui gui, Size size)
{
Index = index;
_manager = manager;
Expand Down Expand Up @@ -310,10 +326,7 @@ private void OnDrag(object sender, MouseEventArgs e)
Refresh();

// Start the drag and drop but setting the object slot index in Drag and Drop data
var obj = _manager.ObjectSlotData.Where((objData) => objData.Index == Index).ToList();
if (obj.Count == 0)
return;
var objectAddress = obj[0].Address;
var objectAddress = Address;
var dropAction = new DropAction(DropAction.ActionType.Object, objectAddress);
DoDragDrop(dropAction, DragDropEffects.All);
}
Expand Down Expand Up @@ -392,6 +405,8 @@ protected override void OnPaint(PaintEventArgs e)
e.Graphics.DrawImage(_gui.StandingOnObjectOverlayImage, new Rectangle(new Point(), Size));
if (_drawUsingObject)
e.Graphics.DrawImage(_gui.UsingObjectOverlayImage, new Rectangle(new Point(), Size));
if (_drawClosestOverlay)
e.Graphics.DrawImage(_gui.ClosestObjectOverlayImage, new Rectangle(new Point(), Size));
}


Expand Down
Loading

0 comments on commit 28bf804

Please sign in to comment.