Commit Graph

52 Commits

Author SHA1 Message Date
ebaydayz
fd2eb14c5e Give inTraderCity a default value
There is no point in setting inTraderCity = "Any"; since you can use the
isInTraderCity variable to check if a player is in any trader city. Also
"Any" will return false for isNil, so the only time "Unknown Trader
City" was being used was when the player had not entered any city yet.
If they left a known trader and went to an unknown one the RPT message
would say "bought x at Any". Now it will correctly say "Unknown Trader"
anytime a purchase is made without inTraderCity being set.
2016-07-29 15:48:51 -04:00
ebaydayz
b1ae6c4a60 Fix unknown entity RPT error for Padlock and Frank&Beans
Vanilla development commit:

955c7a263c
2016-07-29 14:34:45 -04:00
ebaydayz
c9efb9e9df Fix some undefined variables in Adv Trade systemChat messages
Fixes "Cannot sell any, tires are too damaged." and empty string in
success message.
2016-07-29 11:41:44 -04:00
ebaydayz
b408e76c55 Fix extra spaces in Advanced Trading RPT log
Also fixed missing space in systemChat message.
2016-07-29 11:09:42 -04:00
ebaydayz
ba3677f13d Remove redundant "Gear" text next to portrait in Adv Trade
The menu already says "Buying in" or "Selling from" Gear in the top left
so having it again in the top right is redundant. It was my mistake
adding it there originally.
2016-07-29 10:22:13 -04:00
icomrade
bdf0870f3e Fix keys not deleting
Should work fine, but more validation is always good, I tested selling
from all inventories with DZE_SaleRequiresKey true and false.
2016-07-29 00:55:20 -04:00
oiad
12a9e9f83e Advanced trading tidyness
Optimizes the code for the buyitems item listing (What was I thinking!)
Adds item count to buy/sell list (Useful for checking against
backpack/vehicle storage space constraints when buying multiple items)
Small logging fix.
2016-07-28 23:08:11 +12:00
ebaydayz
f84140c555 Don't clear buying list on category switch + AdvTrade fixes
The buying list now acts like a shopping cart. It is no longer cleared
when switching between categories or containers. Closing the dialog or
switching to sell mode still clears it.

Also fixed:
- Filter button in sell mode
- Bug where filtering sellable list readded items already moved to
selling list
- Visual price display not clearing when remove all button is used on
buying list
- Gear container picture showing rank instead of portrait in buy mode
- Dialog is no longer closed when trying to sell zero items
- LbCurSel is now reset when the buyable list is cleared
- Category is no longer opened onLbSelChanged. Instead you need to
double click or use the "View" button, so the arrow keys can be used for
selecting too.
2016-07-27 18:40:03 -04:00
ebaydayz
f76b8493fd Fix category list alignment in advanced trade
Since we changed the alignment back to default the ctrlSetPosition I
added is no longer needed. #1709. With the alignment changed it would
actually run off the background if the category list was too long.
Thanks @oiad
2016-07-23 14:24:54 -04:00
oiad
9efc671abb Advanced trading changes
This changes a few things in Advanced trading, mainly cosmetically.

> Removes all the commented out lines that were the same in defines.sqf,
let me know if these are there for a reason?
> fixes the buying list to have localization support and has a total
item count that works properly.
> cosmetic change displaying backpack info on trader to bring it in line
with the other menus
> adds total item count to the selling list and added localization for
that
2016-07-23 23:30:05 +12:00
icomrade
9c4e30ea08 Fix Advanced Trading Selling + new Var
New variable to configure whether or not the player will need to key to
sell a vehicle. DZE_SaleRequiresKey = false;
2016-07-23 01:16:37 -04:00
icomrade
0414c67284 No longer require key to sell a vehicle
Still requires the vehicle to be local, meaning you were the last person
to be in the driver seat.
2016-07-21 17:42:25 -04:00
oiad
801145d664 Advanced trading fixes/modifications (#1698)
* Advanced trading fixes/modifcations

This adds combine currency option to the Advanced trading screen since
@Airwaves man noticed it didn't have a way of doing it.

Updated stringtables with correct "paid" spelling and differing text for
buying/selling.

This also addds proper currency checking/reporting for the log system
that has been introduced, it's untidy but it works, instead of getting
"user bought x for 1000 currency" in a non coins server, it will convert
it to the proper 1 brief 5 10oz gold etc system (uses a new function
z_calcDefaultCurrencyNoImg)

This also adds a check to see if the buy list is empty (as per the
selling list) and returns text to the user informing them.

Re-arranged buy and sell so buy is on top of sell, it's a bit easier to
read then.

* Advanced trading logging change

This was missing from my previous commit, this changes the
server_tradeobject to check if it's being passed a number (single
currency) or text (my logging currency changes)

* Advanced trading rework

Fixes all problems @ebaydayz
2016-06-21 20:18:41 -04:00
ebaydayz
bd85693af7 Add categories view to Advanced Trading buy mode 2016-05-12 14:09:05 -04:00
ebaydayz
e60175b30c Fix wrong price when adding multiples of same item to buy list
Modifying _temp was also modifying Z_BuyableArray. An independent copy
of the array was needed.
2016-05-11 15:07:58 -04:00
ebaydayz
6ef59a0237 Add server RPT logging to Advanced Trading 2016-05-11 12:41:59 -04:00
ebaydayz
5ca182dffe Fix can't sell satchels with Adv. Trade
Some items (like PipeBomb) are a class in both CfgMagazines and
CfgWeapons. BIS_fnc_invRemove uses weapon first, so that is why the
magazine was not being removed. Using config instead of string avoids
this problem.
2016-05-09 14:10:20 -04:00
ebaydayz
c0cb702534 Add swap for classicBloodBagSystem in Adv. Trade 2016-05-08 17:31:23 -04:00
ebaydayz
5120d8a488 Fix incorrect backpack space calculation
Fixes not being able to purchase into a half full backpack and free slot
counts text incorrect when buying into backpack.
2016-05-08 16:21:24 -04:00
ebaydayz
84e64be47e Don't show debug message when paying with exact amount 2016-05-08 13:30:26 -04:00
ebaydayz
c477304571 Forbid buying duplicate tools into gear 2016-05-08 11:59:25 -04:00
ebaydayz
41e653136f Add attachments compatibility list to trader
Also reduced item info size a bit to better fit normal and large
interface sizes.
2016-05-07 19:29:00 -04:00
ebaydayz
03e3293795 Add extra vehicle info in Adv. Trading
Translations are from Arma2OA languagecore.pbo
2016-05-06 18:57:53 -04:00
ebaydayz
00cb76a496 Fix Adv. Trading pistol detection
The secondaryWeapon command does not detect pistols. It returns the
unit's launcher.
https://community.bistudio.com/wiki/secondaryWeapon

This fixes the menu always showing your pistol slot as open, even when
you already have one.
2016-05-05 17:25:47 -04:00
ebaydayz
7bc5d7f7f5 Fix full toolbelt showing -2 tool slots in Adv. Trade
Correctly shows zero available tool slots when toolbelt, binocular and
NVG slots are full now.
2016-05-05 16:50:09 -04:00
ebaydayz
fe54b78bdb Add backpack selling to Advanced Trading
It was not possible to sell a backpack from your gear or vehicle.

Added option to sell from gear. Sell backpack from vehicle is still not
possible currently due to Arma limitations.
2016-05-05 14:55:50 -04:00
ebaydayz
2c6ef2ced3 Don't show selected vehicleX message on Adv Trade startup
Only show Selected vehicleX systemChat message when clicking the buy
in/sell from vehicle button. Previously it was showing every time the
menu opened.

Also added better logging to RPT. Shows "Trader Menu: %1 x %2 added" and
"Trader Menu: %1 added"
2016-05-05 12:37:10 -04:00
ebaydayz
ef2c910bfc Fix open gear backpack slots always showing zero
IsNil returns true as long as the variable is defined. In this case it
is defined as objNull when you have no backpack.
2016-05-04 19:09:10 -04:00
ebaydayz
cb381c5ce3 Fix another transportMaxBackpacks typo
This was responsible for vehicles showing zero and negative numbers of
available backpack slots.
2016-05-04 18:42:20 -04:00
ebaydayz
349e0a103d Fix trade title showing "Buying in vehicleX" when in sell mode
Tested and confirmed working as intended now.
2016-05-04 16:46:35 -04:00
ebaydayz
85869b32f1 Fix Adv. Trade secondary vehicle check
Forgot this one. See:

f503e53097
2016-05-04 15:53:25 -04:00
ebaydayz
f503e53097 Fix Adv. Trade nearby vehicle check detecting animals
Was getting "Buying in Rabbit" when one was nearby.

No need to check "AllVehicles", this is faster and will get all drivable
vehicle types.
2016-05-04 15:47:47 -04:00
ebaydayz
e6c5930415 Fix unit icon in Advanced Trading selling from gear box
Adds a nice icon of the unit in the top right below "Gear" text.
2016-05-04 14:39:40 -04:00
ebaydayz
800182f7e2 Fix can't buy backpack into vehicle with Advanced Trading
The typo here was causing all vehicles to return 0 for
transportMaxBackpacks.
2016-05-04 14:20:23 -04:00
ebaydayz
5043fafae4 Fix default currency display in Adv. Trading bag item info
Fixes currency display name and picture not showing when looking at
backpack item info.

Also fixed localized string for weps and mags order reversed in item
info for backpacks and vehicles.
2016-05-04 12:54:36 -04:00
Anton
75ae8ad3c0 a couple localization updates (#1690)
* a couple localization updates

* fix merge conflicts

* fix

* fixes
2016-05-03 15:15:44 -04:00
ebaydayz
1eeaa3e792 Add epoch_generateKey function 2016-05-03 13:35:50 -04:00
ebaydayz
2f98fc0451 Prevent MeleeMagazines being counted by BIS_fnc_inv 2016-05-03 13:35:50 -04:00
ebaydayz
d361abaec3 Fix Adv Trade localized string spacing 2016-05-02 19:51:48 -04:00
ebaydayz
8d82693c1b More Advanced Trading localization
Russian translations provided by Epoch forums user koms:
http://epochmod.com/forum/profile/33066-koms/
2016-05-02 17:32:27 -04:00
ebaydayz
f848305b50 Update Advanced Trading with category reuse support
Tested and working ok.
Updating with change from:

03b8c38c6a
2016-05-01 19:02:29 -04:00
icomrade
d6236dcb91 Fix improper total price in advanced trading
Also sort gems by value when giving total price.
2016-05-01 16:24:38 -04:00
ebaydayz
2806d6a00d Localize some Advanced Trading strings 2016-05-01 15:45:07 -04:00
ebaydayz
b4cd47f5b5 Update PVDZ_plr_save in advanced trading 2016-05-01 13:21:17 -04:00
ebaydayz
6187006ece Remove duplicate fnc_inString 2016-05-01 11:01:26 -04:00
icomrade
83694a452e Gem Trading mostly finished
Sometimes displays incorrect total price in advanced trading menu.
2016-04-30 11:17:41 -04:00
icomrade
a86b28b0a7 Fix spawn height for boats, and buying bikes 2016-04-29 00:19:22 -04:00
icomrade
bc0d5027f5 Adv. Trading handle other and free vehicle types
Allow players to sell vehicles without keys and add boat and bike
trading classes to buy/sell
2016-04-28 23:40:28 -04:00
icomrade
55f3a9dc79 Vehicle selling for advanced trading
This should work fairly okay but I expect there may be a couple exploits
and glitches
2016-04-28 18:35:03 -04:00
icomrade
b5af74b72b Add Vehicle Purchasing to Advanced Trading
Allows 1 vehicle purchase at a time.
Vehicles will still spawn inside each other if one is already parked on
the pad.
2016-04-27 22:04:47 -04:00