jellyton255 / ef_shops

A shops system made in React for qbx_core
GNU General Public License v3.0
33 stars 12 forks source link

refactor: use itemId versus name for key #9

Closed solareon closed 2 months ago

solareon commented 3 months ago

By using item Ids generated at runtime we can have multiple slots with the same item. This enables stores to stock multiple items with unique metadata such as scratch cards (my main motivation for this) or weapons with attachments etc.

Change log

jellyton255 commented 2 months ago

Just an update, I'm procrastinating converting my server's shop config file (very long) to test it and ChatGPT does not want doing it for me.

solareon commented 2 months ago

Just an update, I'm procrastinating converting my server's shop config file (very long) to test it and ChatGPT does not want doing it for me.

This one first to remove the ["whater"] find ^ \["(\S+)"\] = \{ replace { name = '$1',

This one second to get the rest. find ^ (\S+) = \{ replace { name = '$1',

edit and here was the regex that should have done both but vscode doesn't do lookaheads right (?|(?=\[")\["(\S+)"]|(\S+)) = \{