4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.83k stars 850 forks source link

Private tag included in functions name when renaming #2494

Closed arthuro555 closed 2 years ago

arthuro555 commented 3 years ago

Describe the bug

When renaming a private extension function, the (private) tag is included in the text to rename

To Reproduce

Steps to reproduce the behavior:

  1. Go to an extension function
  2. Make it private
  3. Try renaming it
  4. See issue: image image

Other details

Bouh commented 3 years ago

An lock icon or an eye icon could be better to display.

4ian commented 3 years ago

Yeah the "abuse" of the label is not great, would be cool to extend the list item to allow to display an icon :)

Bouh commented 3 years ago

There is a thumbnail possible on virtualized item in list. image Maybe the icon have to be moved on right, and the icon are not great it was for example. Idk if we can pass an icon component, but we can use image easily!

<SortableVirtualizedItemList
  key={listKey}
  ref={sortableList => (this.sortableList = sortableList)}
  fullList={list}
  width={width}
  height={height}
  onAddNewItem={this._addNewEventsFunction}
  addNewItemLabel={<Trans>Add a new function</Trans>}
  getItemName={getEventsFunctionName}
  getItemThumbnail={(eventsFunction: gdEventsFunction) =>
    eventsFunction.isPrivate()
      ? 'res/button_ok.png'
      : 'res/button_cancel.png'
  }
  selectedItems={
    selectedEventsFunction ? [selectedEventsFunction] : []
  }
  onItemSelected={onSelectEventsFunction}
  renamedItem={this.state.renamedEventsFunction}
  onRename={this._rename}
  onMoveSelectionToItem={this._moveSelectionTo}
  buildMenuTemplate={this._renderEventsFunctionMenuTemplate(
    i18n
  )}
  reactDndType="GD_EVENTS_FUNCTION"
/>
tristanbob commented 2 years ago

I just came here to report this, but @arthuro555 did a great job finding this in March. :)

I like the idea of using an icon (with a mouse-over description) to indicate a private function. Perhaps we can use an icon that represents visibility (since it is hidden from the end-users), like this one:

https://bit.dev/mui-org/material-ui-icons/visibility-off

Bouh commented 2 years ago

An easy quick win for you @ClementPasteau !

ClementPasteau commented 2 years ago

I believe this if now fixed with #3501