Skip to content

Commit

Permalink
Added regenerate button for blips
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 committed Nov 7, 2023
1 parent 772bbfb commit 512019f
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 @@ -83,7 +83,6 @@ function makeBlipTool() {

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

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

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

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

Expand All @@ -538,6 +546,7 @@ function makeBlipTool() {
}

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

Expand Down

0 comments on commit 512019f

Please sign in to comment.