Don't sell equipped items feature

AvaLanCS

Member
Contributor
Hi everyone!

My first time with Idea and the code of Destination Sol, I really wanted to make a "Don't sell equipped items" option, so I won't accidentally sell some over powered gear I spent some time to acquire!

The code base is really neat, I found my way around it nicely! The pull request is at
https://github.com/MovingBlocks/DestinationSol/pull/118

A few questions:
I found the SolShip:maybeEquip and maybeUnequip functions to be not self-explanatory at first, is adding javadoc to the code part of the coding style here? Or maybe split it into a canEquip and Equip function?

With placing the button I had two issues:
First time I placed it to the second index (menuLayout.buttonRect(-1, 2)), and shifted the index of the other buttons, but then the exit button was under the screen. Then I looked at the MenuLayout class, and increased row0, which fixed the issue, but then all the screens had their buttons up by 1, which looked bad on the main menu. So I went with the -1 index, which put the button in the right place, but feels a bit awkward. Maybe the screen should be indexed in a bottom to top way?

My other problem was that the text was too long, and went off the edges of the button. I increased the button width (menuLayout:btnW variable) from 25% to 30%, but it probably won't be enough for all possible resolutions. I was wondering if word-wrapping was possible with the buttons?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Thanks for the enhancement! Very handy :)

The equipment system overall is in bad need of an overhaul. It is very basic and hard to work with, and yeah kinda confusing as the same code is used to attempt equipping NPCs in a sensible fashion. I think the naming is from something like "See if the NPC should equip anything new" - thus "maybeEquip"

There is some more info in an issue on GitHub if you're curious. More comments definitely can't hurt! Even if we end up redesigning the setup completely.

UI might be in a similar situation, really. Very have a very nice UI framework with Terasology and I'm curious if that would work within DestSol one day. @Rostyslav Zatserkovnyi earlier spent a bit of effort investigating the idea of extracting NUI so we could maybe put it to work. I really have no idea about the current DS UI, its capabilities, shortcomings, and so on. Since we already have one framework it would ideal to use that as well when we can :)
 
Top