[Feature Request] Popup attribute.

Issue #846 new
Eive Devheart created an issue

Hi,

Request:
I would like a type attribute which would allow me to have a few objects hidden in inspector, and replace with a small button.
Clicking that icon would open a floating window and allow me to edit the object.
In a way it’s the opposite of the existing [InlineEditor] attribute.

Use case:
Here I am with an simulation game. (imagine Two Point Hospital or any tycoon game). When I edit the scriptable object for this game, I’m tempted to replace simple numbers with a “GameDrivenFormula” object. For instance:
- Player.MoveSpeed: instead of a float I would have my “GameDrivenFormula” object.
- Skill.AttackPower instead of a number… Yes the object is here again.
- Monster.InitialHealth, Task.Duration, Attack.SuccessRate, Chest.GoldAmount, Item.Efficiency …. All “GameDrivenFormula” object.

However that useful object, can make my inspector quite “lengthy” , it’s made of a list full of “abstract GameDrivenFormulaComponent” objects, and a few other members.

So it would be nice, if that lengthy object was replaced with a little pen icon, which opens a popup for me to edit it.

Proof of concept:
You can find a PoC on your Discord and it works amazingly and is super useful to my workflow: https://discord.com/channels/355444042009673728/355817720182341632/968858771344490496

Enhancement from PoC:
1. Parameter: ButtonLabel: A string, a custom expression or a custom method. In my game I replaced KAJed’s “Edit” string with a string preview of my “GameDrivenFormula” object. I also handled Null objects.
2. Contextual menu: We should still be able to copy and paste objects or set it to null.
3. I’m not sure on this one: I don’t know if I like the label by default, or a pen icon. I like that the button takes all the space it has though. (because, clicking area)
4. It’s a must to have it as type attribute, but MAYBE (not sure)… It could be useful to some people to put it on members as well.
5. I don’t know about the name of such attribute.
6. Pitfall, I guess it only work on reference types for now. (which is great)… But that may be a trap to some users.

Best regards

Comments (0)

  1. Log in to comment