Better inventory management

Thoughts on the further development of Haven & Hearth? Feel free to opine!

Re: Better inventory management

Postby Xcom » Fri Oct 12, 2012 1:26 am

ydex wrote:did anyone ever finnsih the ctrl+shift-click planting or was it impossible? because to be able to just hold them in and by that getting highest q crop in hand would really help alot to iirc...


I sifted through the client code for hours yesterday. I found a way to make it possible to semi so be able to walk around holding items on your mouse cursor. Its far from working perfectly but it works. Although it would require some bit of coding to make it work in a proper manner. I didn't look into the code if there was a way to Ctrl Shift Click farm. Maybe its in another part of the code. Will have a look, but I suspect its server side and cant be fixed, meaning only jorb/loftar would be able to fix. If it was possible it would be great in combination with seedbags.

I must note that I'm a total noblet when it comes to programming but this is what I could come up with. I can say though that I still am a aboslut noob when it comes to programing and have no idea what I'm doing. If this causes your pc to explode it will be on your own to add this into your client.

You also need to make gobatpos() funtion in MapView.java public to make it work. This is stuff I got from the latest enderclient sourse. v02.04.12

Changes made in UI.java:

public void mousedown(MouseEvent ev, Coord c, int button) {
setmods(ev);
lcc = mc = c;

if(mousegrab == null){
root.mousedown(c, button);
}else if(modflags() == 2){
Coord newC = new Coord(new Coord((int)(c.x/(mainview.getScale()) ), (int)(c.y/(mainview.getScale()) )));
Coord newMC = new Coord(mainview.s2m(newC.add(mainview.viewoffset(mainview.sz, mainview.mc).inv())));
Gob hit = mainview.gobatpos(newC);

if(hit == null){
mainview.wdgmsg("click", new Coord(0, 0), newMC, button, 0);
}else{
mainview.wdgmsg("click", new Coord(0, 0), newMC, button, 0, hit.id, hit.getc());
}
}else{
mousegrab.mousedown(wdgxlate(c, mousegrab), button);
}
}

Hope this helps to whoever that can program. I can just say that when I tested it it caused issues when flowermenu was beaing opend at the same time as you were holding a mouse item.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Better inventory management

Postby Xcom » Fri Oct 12, 2012 4:26 am

I looked at the code a bit more today.

This line of code seams to plant crops your holding on the mouse cursor.

wdgmsg("itemact", cc0, mc, ui.modflags());

The modflags indicates the type of key command your holding in. Shift is 1 Ctrl 2 and so on. I tried to change it to different numbers and some of them planted the seed, some planted and picked up a new crop. Non of them sorted any of the seeds to pick up the highest or lowest Q. That function seams to send the info to some place that looks like it sends info to the server but I'm not a coding wiz so I think its server side. Its a real shame can only be fixed by Loftar himself.

With a very simple filter that the Ctrl Shift or Alt Shift uses it could be fixed. But I don't think he will ever bother to put this in. So far down the pipeline that it wont ever happen. Simply have to rely on what we have, LC sorting.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Previous

Return to Critique & Ideas

Who is online

Users browsing this forum: No registered users and 47 guests