Ryex / ic10emu

A Stationeers IC10 code editor and emulator
https://ic10emu.dev/
Apache License 2.0
7 stars 2 forks source link

Let Users Attach devices #18

Closed Ryex closed 5 months ago

Ryex commented 5 months ago

The VM needs better tools to build state from objects in order to be able to attach devices other than the main IC smoothly

Ryex commented 5 months ago

@ComputerDruid @Emilgardis Pinging you in case your not watching this PR

This is nearly ready for merge. still need to let device state be persisted through share links

Preview at: https://attach-devices--ic10emu.netlify.app/

Ryex commented 5 months ago

Made it through the rest of the commits.

I also tried out the demo link in Firefox, and came up with a handful of UI notes:

  • When changing device id or name of a device attached to a pin, the pin UI doesn't update with the new ID or name. It does seem like it stays attached to the pin in the VM, though.

This is the Select updating bug I've reported upstream, I'll need to completely re-implement the whole component to fix it myself

  • When adding devices, clicking "add device" starts with the text box focused but with the previous search still there. So if I click "add device" and then start typing, it mashes the two search terms together, which isn't what I want. Probably just auto-selecting the text is the right way to go there, so that typing overwrites it but the previous search is still there if I want to add a bunch of volume pumps.

changed

  • New devices added via UI should probably start with all cable networks connected to "Network 1". I kept forgetting to do that and then being confused when the device wasn't in the pin drop-down. I think if I wanted to keep cable networks separate, I'd just want to create more networks with unique names and leave "Network 1" as the "default network".

hmm, that probably is the desired default behavior, changed

  • When using the search UI, it lagged a bunch on the first letter while I was typing "analyzer". Presumably it was matching a lot of things and populating the UI, but I dunno because as soon as it stopped lagging the rest of my typing filled in and it filtered down to just the 3 I expected. Maybe just a limit on the number of search results would help?

This is mostly a factor of rendering all the search results. the actual search is extremely fast. I bumped the search delay to 500 (half a second) form 200 (1/5 second) after the filter change so hopefully there will be enough time to type more than 2 characters.

  • I wasn't able to test the script I pasted much because I didn't see a way to control the value of readonly logic fields in the UI. So the liquid pipe analyzer I added has a Temperature field but I couldn't set it to 273.15 to see if my script would open the radiator.

a good point, changed.

This is super exciting though, I really like the devices UI in general. It's going to be soooo nice to use once everything's wired up together.

Ryex commented 5 months ago

It looks good! Some pointers:

  • Adding a device with power only from network 1 seems to make it accessible from the active ic.

networks should now respect if a connection is data or power only

  • Would be nice to present in-game name and have that also be searchable.

not sure what you mean by pre4sent the in game name, but I added a fuzzy filter that will filter the device list based on device name ore prefab name

  • The field display would benefit from being expandable, or a way to reorder and hide fields.

I improved visibility there, hopefuly that helps

  • id of chip is unchangable

as in the chip in the slot? yeah slots need a UI upgrade, it's next on the list

Emilgardis commented 5 months ago

not sure what you mean by pre4sent the in game name, but I added a fuzzy filter that will filter the device list based on device name ore prefab name

I mean the title, something like

image

maybe

made hash and name italics and smaller size