Skip to content

Commonly Edited Classes require User-Friendly Editor String Representations #1

@audinowho

Description

@audinowho

By default, all classes shown in the editor are represented by their .ToString return value:
image

These are less than ideal for a user trying to tell list entries apart. They need to have their string representations changed to something easier to understand.

Some classes have overridden ToString values that make them more readable. However, we should not override ToString in this case, as we are specifically trying to get an editor-relevant string that may differ from ToString's use case.

Instead, we should use the editor-specific way of retrieving a string representation:

  1. Create a class that inherits from Editor in RogueEssence.Editor.Avalonia, where T is the type you wish to change the string representation to.
  2. Override GetString(MapItem obj, Type type, object[] attributes).
  3. Add this new class to DataEditor's editors, by calling the AddEditor function in Program.cs

An example of this can be found in MapItemEditor.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions