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

Larger guis #62

Open
rubensworks opened this issue Jan 22, 2017 · 17 comments
Open

Larger guis #62

rubensworks opened this issue Jan 22, 2017 · 17 comments
Labels

Comments

@rubensworks
Copy link
Member

rubensworks commented Jan 22, 2017

Provide some default taller and wider gui's with more columns. (auto-scaling?)

As suggested by: https://minecraft.curseforge.com/projects/colossal-chests?comment=43

@Glockshna
Copy link
Contributor

Glockshna commented Feb 14, 2017

I made the UI wider and taller, 15 columns and 9 rows but I'm having a few problems I want to solve before I go any further.

I can't get the mod to compile. It fails with this log and I can't seem to find a solution:

I'm using Eclipse and when I cloned the project it was complaining about the exact same thing gradlew is complaining about. Switching it to Java 1.8 fixed all those issues. I'm guessing I need to switch it in gradle somewhere but I'm not sure where. I don't have a lot of experience with this so it's probably something dumb I'm missing.

The second thing is the text at the top of the ui for the colossal chest. Where is that coming from? It would be nice if it could be moved, or even removed?

@rubensworks
Copy link
Member Author

@Glockshna This repo uses submodules, so you'll have to execute git submodule init && git submodule update to init those, which will resolve your issue.

Your scrollbar seems to be in a strange place, since it is used to scroll in the chest inventory, not the player inventory.

I don't intend to remove the text, you'll probably have to take that into account when you make your gui texture.

@Glockshna
Copy link
Contributor

@rubensworks I had a feeling the scrollbar was going to come up, I am planning on moving it back to the chest and just getting rid of one column to accommodate it, but I wanted to get the compilation issue resolved first.

@Glockshna
Copy link
Contributor

Glockshna commented Feb 14, 2017

@rubensworks Here's the fixed UI texture. If you approve I'll go ahead and make the code changes to add it.

The way I'm doing it right now flat out changes the interface to this. It's not optional. Are you comfortable with that?

I should add that I undertook this because the players on my server asked if it could be done easily just for us, but since you have an issue up with this exact thing I figured I'd run the change by you in case you're interested.

@rubensworks
Copy link
Member Author

@Glockshna I'd rather have it configurable actually.

To be honest, the thing I had in mind was to automatically make the gui as wide and high as possible, depending on the player's screen. This will of course require some tiling of the texture, instead of a single texture.

@Glockshna
Copy link
Contributor

Alright I'll just keep it a one off for my server then. If I drink too much coffee one night and make it configurable I'll give you a shout. I'd have to take a deeper look at how you're doing your gui before I attempt that though.

Somewhat related before I let you go, I think there's a minor mistake ContainerColossalChest.java
It looks like you declared CHEST_INVENTORY_ROWS but forgot to use it later on.
I fixed it in my fork.
Glockshna@92c9fb0

That tripped me up when I was trying to expand the interface.

@rubensworks
Copy link
Member Author

@Glockshna Oh, you're right. Feel free to send a PR for that single commit.

@Glockshna
Copy link
Contributor

Here's my version of this change. Let me know if you change your mind on a PR for it. Glockshna@02e074e

@rubensworks rubensworks self-assigned this Feb 14, 2017
@Glockshna
Copy link
Contributor

Glockshna commented Feb 14, 2017

My changes seem to break inventory tweaks, it'll start throwing LOTS of errors and crashes the game if you middle click sort the chest. Gonna need to do a bit of investigative work. Inventory Sorter doesn't care though. It works fine.

@rubensworks
Copy link
Member Author

@Glockshna You're probably going to have to update the Inventory Tweaks annotation here as well, to include the new row and column count:

@Glockshna
Copy link
Contributor

@rubensworks I'll look into it. I appreciate the help.

@Glockshna
Copy link
Contributor

Doesn't look like that was the issue. I went ahead and added rowSize = 12 which from what I gather it wants the number of columns. Either way it didn't work. The same issue persists. InvTweaks is complaining of

Failed to trigger shortcut: Index: 756, Size: 756
[08:51:39] [Client thread/INFO]: [invtweaks.InvTweaks:logInGameError:479]: java.lang.IndexOutOfBoundsException: Index: 756, Size: 756

any time I even so much as click with the chest open. If I sort it, CTD.

@rubensworks
Copy link
Member Author

Not sure what it could be then. Perhaps having a look at the Inventory Tweaks source code could help with debugging this.

@Glockshna
Copy link
Contributor

That's where I'm headed now.

@Glockshna
Copy link
Contributor

Glockshna commented Feb 14, 2017

How does your GUI handle displaying slots that aren't available? The way I have this configured is each row has 12 columns. A 3x3x3 chest has 729 slots. 729 is not divisible by 12, but it is divisible by 9.

for a 3x3x3 https://github.com/CyclopsMC/ColossalChests/blob/master-1.10/src/main/java/org/cyclops/colossalchests/inventory/container/ContainerColossalChest.java#L74 is trying to create a chest with 60 rows of 12 slots which totals to 720 slots. What is happening to the missing 9 slots in this case? I think this may be related to the InvTweaks issue.

Also the Index that InvTweaks is complaining about always seems to be a few rows of capacity larger than the chest it's trying to operate on.

A 3x3x3 Chest's capacity is 729.

  • When the row length is 12 the index InvTweaks complains about is 756. Exactly 3 rows in capacity to large.
  • When the row length is 9 the index is 765, exactly 4 rows too large.

A 4x4x4 Chest's capacity is 1728

  • When the row length is 9 the index is 1764, just as before, it's exactly 4 rows too large.

I didn't test beyond this point because I don't know enough about how your mod works behind the scenes to really find the cause of this without potentially breaking other stuff without even knowing so I'm going to leave this info here and call it good.

@rubensworks
Copy link
Member Author

Ah yes, of course, the current codebase assumes divisibility of 9, because of inventory sizes being a multiple of 9.
For a non-multiple of 9, the last row of the chest will be a special case, and this method will have to be adapted a bit to take into account this last row.

@rubensworks rubensworks removed their assignment Feb 16, 2017
@Hexus-One Hexus-One mentioned this issue Mar 16, 2017
@rubensworks rubensworks changed the title Predefined wider guis Larger guis Mar 16, 2017
@set92
Copy link

set92 commented Jun 5, 2021

So I suppose this is open and can't be integrated no? Or there is some risky, experimental way to use it? Like some hidden config or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Options
Development

No branches or pull requests

3 participants