include the hotbar index in the label displayed for a hotbar (#2770)

* include the hotbar index in the label displayed for a hotbar

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>

* address review comments for hotbarDisplayLabel()

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>

* tweaks to hotbarDisplayLabel()

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann authored and GitHub committed 2021-05-17 07:40:32 +03:00
1 parent 623973add0
commit c594844b9b
5 files changed
+47 -5

No files matched your search

@@ -27,6 +27,7 @@ import { HotbarStore } from "../../../common/hotbar-store";
import { CommandOverlay } from "../command-palette";
import { HotbarAddCommand } from "./hotbar-add-command";
import { HotbarRemoveCommand } from "./hotbar-remove-command";
import { hotbarDisplayLabel } from "./hotbar-display-label";
@observer
export class HotbarSwitchCommand extends React.Component {
@@ -36,7 +37,7 @@ export class HotbarSwitchCommand extends React.Component {
@computed get options() {
const hotbarStore = HotbarStore.getInstance();
const options = hotbarStore.hotbars.map((hotbar) => {
return { value: hotbar.id, label: hotbar.name };
return { value: hotbar.id, label: hotbarDisplayLabel(hotbar.id) };
});
options.push({ value: HotbarSwitchCommand.addActionId, label: "Add hotbar ..." });