Lua forms.setproperty: Convert the passed value to an enum if applicable
This commit is contained in:
parent
f8a3dca089
commit
d54e53d329
|
@ -482,6 +482,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (form.Handle == ptr)
|
if (form.Handle == ptr)
|
||||||
{
|
{
|
||||||
|
if (form.GetType().GetProperty(property).PropertyType.IsEnum)
|
||||||
|
{
|
||||||
|
value = Enum.Parse(form.GetType().GetProperty(property).PropertyType, value.ToString(), true);
|
||||||
|
}
|
||||||
form
|
form
|
||||||
.GetType()
|
.GetType()
|
||||||
.GetProperty(property)
|
.GetProperty(property)
|
||||||
|
@ -493,6 +497,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (control.Handle == ptr)
|
if (control.Handle == ptr)
|
||||||
{
|
{
|
||||||
|
if (control.GetType().GetProperty(property).PropertyType.IsEnum)
|
||||||
|
{
|
||||||
|
value = Enum.Parse(control.GetType().GetProperty(property).PropertyType, value.ToString(), true);
|
||||||
|
}
|
||||||
control
|
control
|
||||||
.GetType()
|
.GetType()
|
||||||
.GetProperty(property)
|
.GetProperty(property)
|
||||||
|
|
Loading…
Reference in New Issue