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

Allow copying/pasting values to `[InlineEditor]`

Open Remscar opened this issue 1 month ago • 2 comments

What can't you do?

If i have a property like this

[Property, InlineEditor]
public FoliagePlacementSettings Placement { get; set; } = new();

I cannot right click the label for the inline property "Placement" in the editor and copy / paste values.

However if I don't use an inline editor I can do so.

How would you like it to work?

Similar to how you can right click on the label of a property and it allows you to Copy/Paste the values of that property, i'd like to to do the same when I choose to use an inline editor.

Ideally it would be the same as if I wasn't using an inline editor.

What have you tried?

Not using an inline editor but that's gross.

Additional context

No response

Remscar avatar Nov 07 '25 20:11 Remscar

What is in FoliagePlacementSettings? I can copy paste values in here fine.

Do you literally want to copy/paste the json of that struct?

aylaylay avatar Nov 08 '25 10:11 aylaylay

@aylaylay Sorry for the late reply.

This is the class, though it could be a struct.

public partial class FoliagePainterSettings
{

	public FoliagePainterSettings()
	{
	}

	[Property]
	[Description( "The brush distribution mode. Circle uses uniform circular distribution, Texture samples from the brush texture based on grayscale values." )]
	public BrushMode BrushMode { get; set; } = BrushMode.Circle;

	[Property]
	[Description( "The object that the foliage will be parented to." )]
	public GameObject? ContainerObject { get; set; }

	[Property]
	[Range( 32, 2048 ), Step( 32 )]
	[Description( "The radius of the paint brush." )]
	public int Size { get; set; } = 50;

	[Property( Title = "Paint Speed" )]
	[Range( 1, 100 ), Step( 1 )]
	[Description( "How many objects to paint per second." )]
	public float ObjectsPaintedPerSecond { get; set; } = 5;

	[Property( Title = "Erase Speed" )]
	[Range( 1, 100 ), Step( 1 )]
	[Description( "How many objects to erase per second." )]
	public float EraseSpeed { get; set; } = 5;

	[Property, ResourceType( ".folb" )]
	public FoliagePalette? Palette { get; set; }

	[Property]
	public bool EraseOnlyPalette { get; set; } = true;

	[Property( Title = "Objects Per Stroke" )]
	[Range( 1, 100 ), Step( 0.5f )]
	[Description( @"
	How many of each type of foliage object to paint per stroke.<br /><br />
	<i>Example:</i> If you have a multiplier of 2.0 for a foliage object, and this is set to 5, you will paint 10 of that foliage object per stroke.
	" )]
	public float ObjectsPaintedPerStroke { get; set; } = 5;

	[Property]
	[Description( @"
	If enabled, a new stroke will be started after the current stroke is finished." )]
	public bool KeepStrokingAfterFinish { get; set; } = false;

	[Property]
	[Range( 0f, 1f ), Step( 0.05f )]
	[Description( @"
	How long to wait after the current stroke is finished before starting a new stroke." )]
	public float StrokeDelay { get; set; } = 0.1f;

	[Property]
	[Description( @"
	Whether to include existing foliage objects when calculating spacing.<br /><br />
	If enabled, spacing calculations will consider existing foliage objects with FoliageInfo components, preventing overlap with previously painted foliage." )]
	public bool IncludeExistingFoliageForSpacing { get; set; } = false;

	[Property]
	[Range( 1, 100 ), Step( 1 )]
	[Description( @"
	Radius to search for foliage objects when erasing.<br /><br />
	When erasing, the tool will search for objects within this distance of the randomly chosen erase position." )]
	public float EraseSearchRadius { get; set; } = 50f;

	[Property]
	[Description( @"
	If enabled, the texture brush will be rotated by a random amount each time you paint or erase.<br /><br />
	Only applies when Brush Mode is set to Texture." )]
	public bool RotateBrushOnPaint { get; set; } = false;

I would like to be able to do this:

Image

But when I right click on Placement, nothing happens;

Image

(Settings is a similar class)

Remscar avatar Nov 10 '25 17:11 Remscar

Works now, thank you!

Remscar avatar Nov 26 '25 17:11 Remscar