Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Stash #10

Open
m4ke72 opened this issue Sep 27, 2021 · 9 comments
Open

Shared Stash #10

m4ke72 opened this issue Sep 27, 2021 · 9 comments

Comments

@m4ke72
Copy link
Collaborator

m4ke72 commented Sep 27, 2021

Hi,

Glad to see that you are working with the shared stash. However it seems to me that you are building a common ATMA-style stash from it, or have I missed something?

Shared stash is however a 3x 10x10 "personal" stash where items have their x and y coordinates. I'd do it with a normal stash and some UI to toggle between personal and shared1-3.

I'm sorry if I have misunderstood all and you are on the right way.

Yours,

m4ke

Edit: And all 3 shared stashes can also have gold.

@pairofdocs
Copy link
Owner

Hey, thanks!

My first try was to use as much of the code from gomule as possible. I didnt want to add new functions and classes to deal with the new shared stash format (D2R Alpha's format was really similar to ATMA d2x but D2R-release doesn't follow that structure)

I was thinking of having Gomule display all the shared stash items visually like a character stash like you mentioned.

The issue the current D2R stash format has is that it contains 3 atma style stashes in one file. Gomule is set up so that an item list is populated with a for-loop by reading a single file. That's what the current code I added does-- just loops through all the items present in SharedStash*.d2i.

I have to look at the code much more to see what needs to be changed and added for a pane to show up and with separate stashes with all items visually seen. Then keeping track of three separate item-lists for each stash is needed and keeping track of cursor position relative to the background stash image for when users click on an item. The gomule original authors would do a better job than I can, I'm not familiar with a big chunk of gomule.

Are you into programming? I'm up for collaborators on this project

@m4ke72
Copy link
Collaborator Author

m4ke72 commented Sep 27, 2021

I've coded Java for living for over 10 years =) I can't commit my time to any projects right now, sorry.

If I were you, I'd add something like SharedStashPage.java which contains arraylist of one page D2Items and Gold.
Array of those into D2Character and create new pages on the load time.

Some buttons? to navigate between personal and shared1-3 and fill the stashgrid with correct items.

Sync MUST be handled somehow. If we have 5 chars open all shared page 1 open and you remove item from there. It must be told to all other childwindows to reload the shared stash and repaint. That of coz requires a save after any modify of shared page..

Other way could be that on window gain focus event shared stash is reloaded automatically.

Just ideas.

m4ke

Edit: D2Character.java has many methods ready to use. You can use same ones that modify the current stash.

@m4ke72
Copy link
Collaborator Author

m4ke72 commented Sep 27, 2021

I implemented anyways some shared stash code, had some time =) It doesn't handle shared saving, shared gold management or keeping child windows in sync.

I marked spots I modified with // m4ke and // /m4ke comments.

The attached code is NOT production code. It might explode your computer and house !!

m4ke

Edit: I forgot the graphics from the zip. Attaching new zip.
Edit2: Maybe better place for that SharedStashPage would be gomule.d2x..

sharedstash-resend.zip

@pairofdocs
Copy link
Owner

pairofdocs commented Sep 28, 2021

Hey, thanks!
Downloading the zip now

My original thought about the stash view was to have one pane and display all three pages
image

So it would map from 1file --> 1pane and everything is visible (although it's a wide pane/window)
and I would keep track of row/column position of the items with some logic (_ < x < pixelPosition --> stash1 or 2 or 3) and using a stash_width_pixel variable like is done for the character files

@pairofdocs
Copy link
Owner

pairofdocs commented Sep 28, 2021

I made a branch with your code to compare to the current master main

https://github.com/pairofdocs/gomule-d2r/tree/shared-stash-colab
and a draft PR for diffing
https://github.com/pairofdocs/gomule-d2r/pull/11/files

Edit: added you as a collaborator so you can push/pull from the branches

@m4ke72
Copy link
Collaborator Author

m4ke72 commented Sep 28, 2021

Hi,

I accepted the invitation. I'm total n00b with this GitHub, I created this account yesterday.. So what I'm supposed to do now? I still can't promise my time to any coding projects..

m4ke

@pairofdocs
Copy link
Owner

pairofdocs commented Sep 28, 2021

Hey,

👍 Gotcha.
I won't have a lot of time either, I understand.

You could do git clone [email protected]:pairofdocs/gomule-d2r.git on your computer and then git checkout shared-stash-colab (edit: maybe an https clone is needed git clone https://github.com/pairofdocs/gomule-d2r.git)

and your code will be right there in the git repo folder, then if you make any changes, and do git push your code will show up on github.com and everyone can see a nice diff on the page https://github.com/pairofdocs/gomule-d2r/pull/11/files

I made another branch for testing out adding a d2SharedStash class + d2SharedStashviewer class, copying the D2Char + Viewer classes and (in-progress) deleting all the parts that won't be needed for shared stashes (like quests, stats, merc tabs) https://github.com/pairofdocs/gomule-d2r/tree/shared-stash-1file-wide (and diff compare)

@whipowill
Copy link

whipowill commented Sep 28, 2021

Just dropping in to say I appreciate you guys getting this up and running. Hats off to you dudes building on 20 years of legacy code.

@pairofdocs
Copy link
Owner

@whipowill Cheers!

After a couple of days I'm convinced that for me legacy D2 is preferred to new D2R 😅 Something about the color/ light angle and shadow contrast doesn't feel right and I can't get into the game. My boomer ways are pulling me back to LoD

The inventory graphics of LoD are so nice and Gomule has those still <3

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

No branches or pull requests

3 participants