Skip to content

Commit

Permalink
Add regenerate button for blips (#236)
Browse files Browse the repository at this point in the history
* Regenerate blips without creating a new one
* Regenerating a blip does not modify its name
  • Loading branch information
nashalexander authored Apr 27, 2024
1 parent a47e6b0 commit 0085952
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion editor/script/tools/blip.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function makeBlipTool() {

function generate() {
var curBlip = blip[selectedId];
curBlip.name = CreateDefaultName(blipNames[curGenerator], blip);

switch (curGenerator) {
case BlipGenerator.PICKUP:
Expand Down Expand Up @@ -518,6 +517,15 @@ function makeBlipTool() {
}
});

tool.menu.push({
control: "button",
icon: "loop",
description: "Regenerate blip",
onclick : function(e) {
generate()
},
});

tool.menu.pop({ control: "group" });
};

Expand All @@ -543,6 +551,7 @@ function makeBlipTool() {
}

selectedId = nextId;
blip[selectedId].name = CreateDefaultName(blipNames[curGenerator], blip);
generate();
};

Expand Down

0 comments on commit 0085952

Please sign in to comment.