Skip to content

Complete refactor + lots of new features - #10

Open
rp-an-87 wants to merge 36 commits into
IhanaMies:masterfrom
rp-an-87:master
Open

Complete refactor + lots of new features#10
rp-an-87 wants to merge 36 commits into
IhanaMies:masterfrom
rp-an-87:master

Conversation

@rp-an-87

@rp-an-87 rp-an-87 commented Jun 15, 2024

Copy link
Copy Markdown

Hey, i've been working on this to fit my own needs while I play (I love to min/max loot and play the market). This is the first time I do anything in C# so i have no idea about packages/build/etc, but i moved everything around so it made a little more sense rather than have everything in one big class.

Feel free to reject this, but this is a complete refactor of the code and adds tons of new features:

I changed the entire file structure, my dev environment looks like this:

<SPT base directory>\Dev\LootValue\<repo files>

Server:

  • Flea market price is now the actual flea market price and doesn't use offers (as surges exist and thus leads to items not being sold)

Client:

Most of the logic was re-dne from scratch, fixing a lot of bugs in the way

New features and changes:

  • More information on tooltip

    • Shows price per kg and per slot separately (especially useful in raid)
    • Adds a new tier color (25k)
    • Shows you more information regarding the sale of the item
      • i.e: if the item is banned for flea market, if the item is not empty, key combo to sell
      • Also shows you price per unit if item has multiple stacks
      • Also shows you total sale price if selling more than one item
    • Improved colors and markings
      • Lower price is smaller and more dim
    • Tooltip now shows up when it makes sense (i.e: not on the flea market, insurance, etc.)
  • Better quick sale logic

    • Can no longer sell items that would probably bug the game (from insurance, from traders, flea market, etc.)
    • Can now quick sell non FiR items to flea market (same as live)
    • Added a lot of failsafes to avoid selling items that should not be sold
      • i.e: you can no longer sell non empty items, items that are banned, items that have internal banned items (such as armor with banned plates), etc.
    • Allows you to sell items in bulk to the flea market:
      • Items that have a stack size will be sold together
      • Separate items that are the same will be sold as one offer
        • Only caveat is that FiR items will not be mixed with non FiR items.
        • Can be configured to only be allowed for FiR items (selling non FiR in bulk is quite dangerous)
    • Can configure how you want quick sale to work, and add exceptions
      • Exceptions include min durability, min price (also considers multiple items), non operational weapons
    • Flea market asking offer can be lowered relative to durability of item (to improve selling chance of used items)

Most of the new features are toggleable.

Note I developed mostly for the one button quick sale mode, while I did my best to try to code and support both methods, and make everything as generic as possible, I could've forgotten some tooltip scenarios for the two button sale.


Note as I said before, I made this mainly for myself, but it felt a little selfish to at least not bring this up back to you :)

I will probably work on this even further as I keep finding things I would like the mod to do for me, but most of the things that I really wanted are already there. I won't take any feature request most likely

rp-an-87 added 30 commits June 2, 2024 20:29
- Improve how a tooltip text is generated to be more reusable.

- Decouple tooltip text logic from actual code logic.

- Improve highlighting logic.

- Add arrow to show which seller it will use when using quick sale.

- Tooltip will only show base price of weapons.

- Tooltip will show unit price of items that have multiple stacks.

- Tooltip will show if item can't be sold to either channels.

- Tooltip will tell you if an item won't be able to be sold (i.e: item has items, item contains banned items)

Quick sale:

- Decoupled quick sale logic so the same checks are done everywhere

- Quick sale has improved logic for checking if an item can be sold on the flea market or not.

General:

- Selling something will sell the entire stack.

- If FiR, multiple comparable items will be sold as one offer

Server:

- Server will not check for the current offers, but rather the actual average price to avoid not selling the item (lowest offer could be higher than avg offer causing it to not be sold)

- WIP: Improve building mechanism for csproj (I HAVE NO IDEA WHAT I AM DOING HERE)
fixes armor carriers without plates
added todos
improve boolean logic on tooltips to make it easier to read

price tooltip wont show on flea market, trader and mails
improve indent and logic
Improve UI for price Per slot and per weight
- Extracted flea market listing logic
- Using nativel ogic to check if item is empty / listable in flea market
- Improve logic for price checking
- Improve bad condition tooltip messages
Improve trader price for items that are not empty
Improve algorithm to get trader price
Improve logic to be more readable
Allow non FiR items to be sold in bulk.
Added support for repair kits and fuel durability
Added support to sell items to trader if certain conditions are met
decoupled tooltip utils
multiple item tooltip will be added on two click solution properly
multiple item sale will only be shown if quick sale is enabled
Improves selling threshold to consider the total value of all items that will be sold when clicking
rp-an-87 added 6 commits June 14, 2024 16:45
Fix min durability items that have 0 price to not be considered banned from flea market
@IhanaMies

Copy link
Copy Markdown
Owner

As I've been less and less active I'm very hesitant to merge this as is.
I would release this as a separate mod and you have every right to do so :)

@rp-an-87

rp-an-87 commented Jul 9, 2024

Copy link
Copy Markdown
Author

Hey! no worries, I don't really have the time to maintain it either, maybe I just throw it on the discord and someone might want to use it or take it over, thanks for your work, I learned how to do quite a few things :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants