HarbourMasters / Shipwright

3.29k stars 492 forks source link

Built-in Plandomizer Editor #4532

Closed Caladius closed 1 week ago

Caladius commented 2 weeks ago

This implements a built-in Plandomizer Editor.

Feature Details
Seed Selection Drop Down This pulls the Spoiler Logs from your Randomizer folder and populates a drop down list to select from. Select the Seed you want to Edit and click Load, when you are finished editing it, click Save.
Current Seed Hash Displays the Spoiler Logs Seed Hash Icons, click the arrows above or below the Icon to change it.
Options The available options changes based on which tab you are on (Hints or Locations). Hints will allow you to Clear or Randomize All Hints, the Hints it will Randomize from are a small selection from a crew of mine and are semi specific. Locations will allow you to Filter by Area and Empty All Rewards into a bucket to select from.
Hints Tab Click on the Input Box (blue background Text) and change the Hint to what you want to be displayed. this box accepts color codes as well, so typing "They say %gGanondorf's Mom%w is going out with %ySqueak%w!" will display Ganondorf's Mom in Green Text and Squeak in Yellow Text, %w sets the text back to White.
Locations Tab Here you can click on the Image Buttons to bring up a list of available Items, the items listed are ones from the current Spoiler Log. In order to populate the list you need to Set other Check Rewards to Sold Out which will swap 1 Sold Out entry for the entry it replaced in the Spoiler Log.
Setting Ice Traps If your seed has Ice Traps in it, you can set an Ice Trap item in the Reward Box and more options will appear in the Additional Options column. The new Image Button that appears will open a list of items when clicked, select the Model you want to appear as the Ice Trap, then click the Input Box and type in what you want the Ice Trap Text to say.
Setting Shop Prices Anything in the Seed that had a value set for Purchase Price will be prepopulated upon Load, drag the Slider to set the prices anywhere from 0-999 Rupees. Hold CTRL and click on the Slider Bar to be able to type the Price instead.

Screenshots below for reference

image image image image image

Build Artifacts

Caladius commented 2 weeks ago

Updates:

Pepper0ni commented 1 week ago

Posting here so it doesn't get lost, Linux is still getting the issue where the item selection menu graphics loop rapidly when there are more than 3 lines.

Caladius commented 1 week ago

What happens when you comment out the std::sort block in the item popup function?

I'm almost positive it's related to that but I don't have Linux to test on to know for certain.

Pepper0ni commented 1 week ago

What happens when you comment out the std::sort block in the item popup function?

This does indeed fix the issue

EDIT: Pushed a fix to your fork in PR.

Also I still has 3 missing icons on my end: Milk from cows, Buy Bombs 30, and Buying hearts. Is there an OTR issue I have to sort out?

Caladius commented 1 week ago

Ok perfect, I think I know how to address it properly. Will look at it tonight or tomorrow

On Thu, Nov 14, 2024, 5:03 PM Pepper0ni @.***> wrote:

What happens when you comment out the std::sort block in the item popup function?

This does indeed fix the issue

— Reply to this email directly, view it on GitHub https://github.com/HarbourMasters/Shipwright/pull/4532#issuecomment-2477496131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB75K5IO7MNUIKGXHZTASL32AUM2JAVCNFSM6AAAAABRMQW3BCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZXGQ4TMMJTGE . You are receiving this because you authored the thread.Message ID: @.***>

Malkierian commented 1 week ago

If I'm reading it correctly, it looks like you're sorting on each draw call. I'd like to suggest moving all the sorting to a function that can be called on a change or selection instead. Not only would that be better for performance, but I think would also resolve the issue Pepper0ni brought up.

Caladius commented 1 week ago

If I'm reading it correctly, it looks like you're sorting on each draw call. I'd like to suggest moving all the sorting to a function that can be called on a change or selection instead. Not only would that be better for performance, but I think would also resolve the issue Pepper0ni brought up.

Moving it to its own function was my plan, Commit pushed up for that.

@Pepper0ni should be fixed now.

Pepper0ni commented 1 week ago

This patch fixes the sorting, but I found several other issues with the icons:

Caladius commented 1 week ago
  • I would still like the sort function change, even with malk's improvement, in order to make the sort deterministic and avoid any other UB issues in future.

The first 3 points I can take care of, however the last point I would like to request that you make a code suggestion here to visualize what you truly would want from that aspect. Rather than me roll the dice and hope it works haha!

Malkierian commented 1 week ago

One more important thing, triforce pieces don't show an icon. An optional thing, being able to select the contents of the bottles in the pool. One other optional thing, if you can figure it out, now that the notes are the right size, they're not centered anymore, so if you can figure out how to pad them so they're centered in their columns, that'd be great. But, like I said, optional in this instance.

Caladius commented 1 week ago

One more important thing, triforce pieces don't show an icon. An optional thing, being able to select the contents of the bottles in the pool. One other optional thing, if you can figure it out, now that the notes are the right size, they're not centered anymore, so if you can figure out how to pad them so they're centered in their columns, that'd be great. But, like I said, optional in this instance.

The optional stuff maybe in a later revision, I was more gearing this to be a Plando that you built using what the seed provided, maybe a checkbox to load the Resources Pool with all of the items.

Malkierian commented 1 week ago

Right, but tbf, what's in a bottle isn't critical to the playthrough, but the planner might still want to change that for funny reasons. It's a small thing, and most probably won't realize they're missing it.

Malkierian commented 1 week ago

I'm OK with leaving that for later, though, it does do what the goal was. @Pepper0ni You probably should just do what you were wanting with the sort yourself, as even I'm not quite sure what you're talking about with that one.

Pepper0ni commented 1 week ago

Sorry for the delay.

The sort thing I mentioned was adding a second condition to the sort, so that it is deterministic instead of UB what happens in the case where the item type is the same. I made this change in the PR i sent to Caladius' fork and assumed he would have seen it. I'll make a suggestion as soon as I figure out how to.

Malkierian commented 1 week ago

Ohhhh, ok, that makes sense. @Caladius please add that in, and we can merge this.

Caladius commented 1 week ago

Ohhhh, ok, that makes sense. @Caladius please add that in, and we can merge this.

Done, thank you @Pepper0ni and @Malkierian