Page 5 of 10

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 6:14 pm
by ejwessel
qasur wrote:Can it be setup so items you only have one of in inventory/store don't invoke the slider?
Let me see if I understand your question correctly. I think when you're saying slider you mean just the slider you dont mean the full dialog do you?

If you're talking about just the dialog then,
I currently made it so that when used, any amount of items will invoke the dialog.

As for the slider I may not use it as there seem to be problems correlating the amount to the slider bar; the bar is out out of 100 ticks and seems to not correspond the amount correctly.

Let me know if I misunderstood or didn't answer your question. =)

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 8:48 pm
by qasur
Yeah, I mean the dialogue that invokes the slider. It should be made so that you don't need it if you're selling an item you only have one-of in your inventory.

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 9:34 pm
by taws34
Possibly add something similar to Elder Scrolls Oblivion..

when at a merchant, mass selling does not show up until you have 3 or more of the item to sell.

The slider then sets the points from 1 to the # of items to sell. Each stop in the slider is a whole integer.

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 11:17 pm
by Kim
If done correctly, then even one-of items may be "overkill" but having a consistent buy/sell dialog is more important than discussing whether it should be used from X number of a given item.

The slider should scale with screen and work by percentages, not fixed integers. Of course 25% movement from left to right can coincide with "4 of 16", "2 of 8" or "321 of 1284". Limited screen size make it impossible to have each slider point match an item integer when you get above a certain number which of course will vary with screen size, hence the reason percentages will work.

* Moving the slider should affect the input field and update its value to correspond with an integer item amount.
* Using + and - buttons should update the input field and recalculate the sliders position and move it if needed. A nice feature to the +/- buttons will be increase the number at an increasing speed the longer held.
* Entering a value into the input field is the manual option and should recalculate the sliders position and move it if needed.

A possible preference, or static, option is to require confirmation when performing actions beyond X amount - regardless of its buy or sell.

I would like to see a total transaction gold value - maybe in the spot below "Selling: Meat" and above "-1" button.
When buying, the slider and +X button will be limited by your gold available.

Re: Bulk buy/sell/drop interface collaboration

Posted: Fri Jul 08, 2011 3:07 am
by ejwessel
Kim wrote:If done correctly, then even one-of items may be "overkill" but having a consistent buy/sell dialog is more important than discussing whether it should be used from X number of a given item.

The slider should scale with screen and work by percentages, not fixed integers. Of course 25% movement from left to right can coincide with "4 of 16", "2 of 8" or "321 of 1284". Limited screen size make it impossible to have each slider point match an item integer when you get above a certain number which of course will vary with screen size, hence the reason percentages will work.

* Moving the slider should affect the input field and update its value to correspond with an integer item amount.
* Using + and - buttons should update the input field and recalculate the sliders position and move it if needed. A nice feature to the +/- buttons will be increase the number at an increasing speed the longer held.
* Entering a value into the input field is the manual option and should recalculate the sliders position and move it if needed.

A possible preference, or static, option is to require confirmation when performing actions beyond X amount - regardless of its buy or sell.

I would like to see a total transaction gold value - maybe in the spot below "Selling: Meat" and above "-1" button.
When buying, the slider and +X button will be limited by your gold available.
First off I'd like to thank you for being so descriptive =D

I really like the percentages idea, a lot
As for the 3 starred points you made, I plan to have those =)
For the confirmation when performing actions beyond X amount I wasn't sure but I'm glad somebody suggested it.
For the total transaction I wasn't sure where people would prefer it, but you're the first. Regardless I really like the idea of how much you can buy being limited to the gold available.

As a list of things I'll be working on next:
  • Slider should scale with screen and work by percentages
  • Moving the slider should affect the input field and update its value to correspond with an integer item amount
  • Using + and - buttons recalculate the sliders position and move it if needed. With +/- buttons will be increase the number at an increasing speed the longer held.
  • Entering a value into the input field is the manual option and should recalculate the sliders position and move it if needed.
  • total transaction gold value area that when buying, the slider and +X button will be limited by your gold available.

Re: Bulk buy/sell/drop interface collaboration

Posted: Sat Jul 09, 2011 1:03 am
by ejwessel
Still have:
  • +/- buttons will be increase the number at an increasing speed the longer held.
  • total transaction gold value area that when buying, the slider and +X button will be limited by your gold available.
to do, but otherwise

here is a demo of both different sizes of items and the slider bar acting accordingly

Let me know, in the mean time I'll be working on the above.

Re: Bulk buy/sell/drop interface collaboration

Posted: Sun Jul 10, 2011 6:00 am
by ejwessel
+/- buttons will be increase the number at an increasing speed the longer held.

^I'm not entirely sure how to do this. I keep thinking either onTouch() or onLongClick(), but neither work because it requires additional functionality

Also if anybody else would like to work on this with me please do =D. I keep forgetting this open source and it's no a project thats I'm just doing. If so let me know.

Re: Bulk buy/sell/drop interface collaboration

Posted: Sun Jul 10, 2011 9:25 am
by Kim
onTouch() seems like the best option, but is there no onHeld(), onClick() or onButtonEvent() options ?
I dont think onLongClick() is option since it must already have a predefined length of held-time

Here is a crude example, that I think will work:

Code: Select all

if (key is pressed){
  const baseIncrease 1;
  integer increase;
  float timePress;
  increase = baseIncrease;
  timePress = now();
  while (key is pressed){
    increase = CheckIncreaseSpeed(timePress);
    input_field_value =   input_field_value + increase;
  }
}
function CheckIncreaseSpeed( float start ){
  const baseIncrease 1;
  const baseSpeed 5; // seconds
  float timeNow, timeDiff;
  timeNow = now();
  timeDiff = timeNow - start;
  return (baseIncrease + floor(timeDiff / baseSpeed) * baseIncrease);
}

Re: Bulk buy/sell/drop interface collaboration

Posted: Sun Jul 10, 2011 12:26 pm
by Samuel
Ejwessel, can you provide the current source code please?
Kim, I think a timer is better than another thread being in a while loop all the time.

IMO there should be around 500 ms delay before starting the fast count up/down (around 100 ms) operation. (i think no further acceleration is necessary)

Regarding the code here are some thoughts:
1) AFAIK you should overwrite the function "onTouchEvent(MotionEvent event)". (There is some code example in the r121 of Andors Trail)
2) You should check if "event.getAction() == MotionEvent.ACTION_DOWN" is true then start a 100ms timer.
3) Always when "event.getAction()" is one of "MotionEvent.ACTION_UP", "MotionEvent.ACTION_CANCEL" or "MotionEvent.ACTION_OUTSIDE" you should stop the timer.
4) In the timer you need to skip the first 4 calls
5) For every other call you should increase the value of slider and value field.

I don't know if this work is really needed. I think the slider will pretty much do it.

Re: Bulk buy/sell/drop interface collaboration

Posted: Mon Jul 11, 2011 12:53 am
by ejwessel
Samuel wrote: Ejwessel, can you provide the current source code please?
Yes, heads up though as the code will probably need some refactoring.
I'm more proficient at C++, but I think I did an alright job with this project =) Let me know though, as I would like feedback on how to improve.
Samuel wrote: I don't know if this work is really needed. I think the slider will pretty much do it.
I agree, you're right about this. This could also be something we add later if enough people desire it.