WIP: Survival inventory and mcl_chest formspec overhaul. #1

Closed
Ghost wants to merge 20 commits from formspec_list into formspec-v4
First-time contributor

Scope

i won't deal with anything outside of itemslot and inventory formspec. one of us could deal with the other stuff later.

EDIT: i will also not touch anything outside of survival mcl_inventory and mcl_chest

Current To-Dos

  • refactor the measurements to get something calculated than simply eyeballed
  • find out if we can completely get rid of eyeballed values or use a factor of any of the units. yup, almost nothing look like magic numbers where modders (or MCL2 itself) are unable to use.
  • resize other mcl_chests formspec dialogs to match the new itemslot interface.
  • investigate a better method of doing borders for itemslots, player preview background, etc. modders should be able to replicate this effect without too much difficulty.
  • what to do with all the other buttons in inventory? currently i had them disabled.
  • Expose more/less things for modding. requesting review for exposed API.
  • Documentation.
  • other issues i have not documented/realized.
  • codestyle issues. lets discuss this only after all other issues are finished. while its nice that we could get codestyle done early, it usually clutters with other issues that's more important :). plus, i like atomized codestyle commit than spread out fragments.
  • rebase the PR to get a nice commit history and then request for merge.

Misc.

i'll request a review once this is ready for review. right now, it's kinda messy.

Relevant links: MCL2#1869, MCL2#1720

### Scope i won't deal with anything outside of itemslot and inventory formspec. one of us could deal with the other stuff later. EDIT: i will also not touch anything outside of survival `mcl_inventory` and `mcl_chest` ### Current To-Dos - [x] refactor the measurements to get something calculated than simply eyeballed - [x] _find out if we can completely get rid of eyeballed values or use a factor of any of the units._ yup, almost nothing look like magic numbers where modders (or MCL2 itself) are unable to use. - [x] resize ~~other~~ `mcl_chests` formspec dialogs to match the new itemslot interface. - [ ] investigate a better method of doing borders for itemslots, player preview background, etc. modders should be able to replicate this effect without too much difficulty. - [ ] what to do with all the other buttons in inventory? currently i had them disabled. - [ ] _Expose more/less things for modding._ **requesting review** for exposed API. - [ ] Documentation. - [ ] other issues i have not documented/realized. - [ ] codestyle issues. lets discuss this _only_ after all other issues are finished. while its nice that we could get codestyle done early, it usually clutters with other issues that's more important :). plus, i like atomized codestyle commit than spread out fragments. - [ ] rebase the PR to get a nice commit history and then request for merge. ### Misc. i'll request a review once this is ready for review. right now, it's kinda messy. **Relevant links**: [MCL2#1869](https://git.minetest.land/MineClone2/MineClone2/issues/1869), [MCL2#1720](https://git.minetest.land/MineClone2/MineClone2/issues/1720)
Ghost added 1 commit 2021-09-27 16:28:59 +02:00
Author
First-time contributor

@AFCMS from blame, i noticed that you added form2 into mcl_inventory/init.lua. what's the purpose of this completely unused formspec?

@AFCMS from blame, i noticed that you added `form2` into `mcl_inventory/init.lua`. what's the purpose of this completely unused formspec?
Owner

@AFCMS from blame, i noticed that you added form2 into mcl_inventory/init.lua. what's the purpose of this completely unused formspec?

oops, my mistake
will remove it ofc

> @AFCMS from blame, i noticed that you added `form2` into `mcl_inventory/init.lua`. what's the purpose of this completely unused formspec? oops, my mistake will remove it ofc
Owner

Will test soon, but no time rn 😢

Will test soon, but no time rn :cry:
Author
First-time contributor

@AFCMS from blame, i noticed that you added form2 into mcl_inventory/init.lua. what's the purpose of this completely unused formspec?

oops, my mistake
will remove it ofc

i think i'll just include the commit to remove it in this PR. also current PR branch is pretty outdated with my local branch, i'll update once i'm done with exposing the formspecs for modders and refactored mcl_chest formspecs (because it's ugly that i have to copy the same thing more than once in the 62K lines of lua... someone needs to refactor mcl_chest in a different PR/commits)

> > @AFCMS from blame, i noticed that you added `form2` into `mcl_inventory/init.lua`. what's the purpose of this completely unused formspec? > > oops, my mistake > will remove it ofc i think i'll just include the commit to remove it in this PR. also current PR branch is pretty outdated with my local branch, i'll update once i'm done with exposing the formspecs for modders and refactored `mcl_chest` formspecs (because it's ugly that i have to copy the same thing more than once in the 62K lines of lua... someone needs to refactor `mcl_chest` in a different PR/commits)
Ghost added 19 commits 2021-10-02 22:33:42 +02:00
Ghost requested review from AFCMS 2021-10-02 22:37:59 +02:00
Author
First-time contributor

Could you review the exposed API i have set up? you can ignore the commit history, i'll change the history later. maybe there's something you want to change, like naming etc. reminder that codestyle is low priority rn :p

i would also like to clarify that this PR sets the foundation for all the other formspec-v4 stuff. i won't be working on formspec after this PR, leaving the rest to you. i hope that's alright :)

Could you review the exposed API i have set up? you can ignore the commit history, i'll change the history later. maybe there's something you want to change, like naming etc. reminder that codestyle is low priority rn \:p i would also like to clarify that this PR sets the foundation for all the other formspec-v4 stuff. i won't be working on formspec after this PR, leaving the rest to you. i hope that's alright :)
Ghost changed title from WIP: Itemslot and inventory formspec overhaul. to WIP: Survival inventory and mcl_chest formspec overhaul. 2021-10-02 22:54:59 +02:00
Owner

It looks just insane!!!
btw, the itemslot border should be sightly smaller IMO
image

It looks just insane!!! btw, the itemslot border should be sightly smaller IMO ![image](/attachments/45078203-d579-4788-9b55-4b2cd4d205da)
359 KiB
Author
First-time contributor

Interesting, on your (larger) screen, the text is much smaller than mine (see attached). This confirms my suspicion: text does not scale to screen size, and boy that goes agaisnt how formspec is meant to be used (common measurements scalable to any screen size, i think).

Another thing i noticed, on your screen, the player model background's border is also much smaller than mine (see attached). This also confirms my suspicion, background9 slices are not quite as reliable as plain images. perhaps i need to rethink this...

img

you should also compare chest UI too.

anyways, when you're reviewing the API, could you also attempt to create a formspec with the storage size of 5 x 5 itemslots? i want to see how difficult/simple this API will be for modders. consider this a bit of a simulation of how a modder would go about making their own formspec.

Interesting, on your (larger) screen, the text is much smaller than mine (see attached). This confirms my suspicion: text does not scale to screen size, and boy that goes agaisnt how formspec is meant to be used (common measurements scalable to any screen size, i think). Another thing i noticed, on your screen, the player model background's border is also much smaller than mine (see attached). This also confirms my suspicion, `background9` slices are not quite as reliable as plain images. perhaps i need to rethink this... ![img](https://git.minetest.land/attachments/d6d2567a-2c09-42b9-91e1-06070cbae4b3) you should also compare chest UI too. anyways, when you're reviewing the API, could you also attempt to create a formspec with the storage size of 5 x 5 itemslots? i want to see how difficult/simple this API will be for modders. consider this a bit of a simulation of how a modder would go about making their own formspec.
Author
First-time contributor

i also noticed the armor bug. will fix.

i also noticed the armor bug. will fix.
Owner

Which is your screen size?
Mine is 1920x1080

Which is your screen size? Mine is 1920x1080
Author
First-time contributor

mine's 1366x768, but simulating other screen sizes is as easy as changing your window size. thankfully, on linux+KDE i can change window sizes precisely to your screen size.

i'm kinda tilted handling borders rn

mine's 1366x768, but simulating other screen sizes is as easy as changing your window size. thankfully, on linux+KDE i can change window sizes precisely to your screen size. i'm kinda tilted handling borders rn
Ghost closed this pull request 2021-10-29 16:21:42 +02:00
Author
First-time contributor

i've decided that i would use a new branch in MCL2 to develop a formspec overhaul. i'll try to cherry pick your commits, but if i failed, i hope you don't mind having me as the author of your initial formspec work.

EDIT: yeah, i think i'll have to start from scratch now that i've thought about it ¯\_(ツ)_/¯.

i've decided that i would use a new branch in MCL2 to develop a formspec overhaul. ~~i'll try to cherry pick your commits, but if i failed,~~ i hope you don't mind having _me_ as the _author_ of _your_ initial formspec work. EDIT: yeah, i think i'll have to start from scratch now that i've thought about it ¯\\\_(ツ)\_/¯.

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AFCMS/MineClone2#1
No description provided.