sbox-issues icon indicating copy to clipboard operation
sbox-issues copied to clipboard

Reset button for a Component in the Inspector window does nothing

Open collinstevens opened this issue 1 year ago • 4 comments
trafficstars

Describe the bug

reset button for a component in the inspector does nothing

To Reproduce

  1. Create a component with a property initialized to a value
  2. Attach the component to a GameObject and modify the Property's value
  3. Click the ellipsis on the component in the inspector and select "Reset"

Expected behavior

the Reset button should set the properties to their default values

Media/Files

image image

Additional context

No response

collinstevens avatar Apr 29 '24 09:04 collinstevens

Added this now

DevulTj avatar Apr 29 '24 11:04 DevulTj

@DevulTj since your last change

public override void Reset()
{
  base.Reset();
}

is now breaking the Component behavior. I had to remove the base function call in order to restore the previous behavior.

I'm not sure if this is expected.

PolSpock avatar Apr 29 '24 12:04 PolSpock

Yeah, fair enough, I'll fix that properly.

DevulTj avatar Apr 29 '24 12:04 DevulTj

Calling Sandbox.MapInstance.Reset() is now throwing error:

Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Sandbox.MapInstance.LoadMapAsync(String mapName)

This breaks my Reset logic for my project :/ (i will find a temporary fix)

PolSpock avatar May 03 '24 19:05 PolSpock

This isn't happening anymore

DevulTj avatar Jul 08 '24 20:07 DevulTj