fix: Removes BodyValue and fixes modifying Body and BodyMod in props gump. (#743)

* Removes BodyValue
* Removes BodyPicker gump
* Fixes setting Body and BodyMod in props gump
* Props will now look for an `implicit cast` in order to find a way to allow you to modify values with the props gump.
* Fixed `[self set body 0x190` so it works too.
This commit is contained in:
Kamron Batman 2021-08-28 22:56:00 -07:00 • committed by GitHub
parent 244fc6a136
commit bf20800382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 175 additions and 1477 deletions

View file

@ -19,7 +19,7 @@ namespace Server.Gumps
private readonly Mobile m_Mobile;
private readonly object m_Object;
private readonly PropertyInfo m_Property;
private PropertiesGump m_PropertiesGump;
private readonly PropertiesGump m_PropertiesGump;
public SetGump(PropertyInfo prop, Mobile from, object o, PropertiesGump propertiesGump) : base(GumpOffsetX, GumpOffsetY)
{
@ -30,7 +30,6 @@ namespace Server.Gumps
var canNull = !prop.PropertyType.IsValueType;
var canDye = prop.IsDefined(typeof(HueAttribute), false);
var isBody = prop.IsDefined(typeof(BodyAttribute), false);
var val = prop.GetValue(m_Object, null);
var initialText = val switch
@ -46,16 +45,14 @@ namespace Server.Gumps
0,
0,
BackWidth,
BackHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0) +
(isBody ? EntryHeight + OffsetSize : 0),
BackHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
BackGumpID
);
AddImageTiled(
BorderSize,
BorderSize,
TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0),
TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0) +
(isBody ? EntryHeight + OffsetSize : 0),
TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
OffsetGumpID
);
@ -118,23 +115,6 @@ namespace Server.Gumps
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
}
if (isBody)
{
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, "Body Picker");
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4);
}
}
@ -186,16 +166,6 @@ namespace Server.Gumps
m_Mobile.SendHuePicker(new InternalPicker(m_Property, m_Mobile, m_Object, m_PropertiesGump));
break;
}
case 4: // Body Picker
{
toSet = null;
shouldSet = false;
shouldSend = false;
m_Mobile.SendGump(new SetBodyGump(m_Property, m_Mobile, m_Object, m_PropertiesGump));
break;
}
default: