• 0
Sign in to follow this  
Followers 0
nikas455

items are not for sale

Question

 

ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged.sqf

ExileClient_gui_wasteDumpDialog_show.sqf

Спойлер

/**
 * ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display","_dropdown","_index","_vehicleObject","_mode","_cargo","_revenue","_revenueControl","_sellButton"];
disableSerialization;
_display = uiNameSpace getVariable ["RscExileWasteDumpDialog", displayNull];
_dropdown = _this select 0;
_index = _this select 1;
_vehicleObject = objectFromNetId (_dropdown lbData _index);
if (isNull _vehicleObject) then
{
	closeDialog 0;
}
else 
{
	_mode = _dropdown lbValue _index;
	_totalRevenue = 0;
	
	if (_mode isEqualTo 1) then
	{
		_cargo = _vehicleObject call ExileClient_util_containerCargo_list;
		_cargoPrice = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
		_totalRevenue = _totalRevenue + _cargoPrice;
	};
	
	
	if (_mode isEqualTo 2) then
	{
		_crateCheck = attachedObjects _vehicleObject;
		_count = count _crateCheck;	
		
		_cargo = _vehicleObject call ExileClient_util_containerCargo_list;
		_cargoPrice = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
		_totalRevenue = _totalRevenue + _cargoPrice;
		
		if !(_count isEqualTo 0) then
		{		
			_crate = _crateCheck select (_count - 1);
			_crateCargo = _crate call ExileClient_util_containerCargo_list;
			_cratePrice = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
			_totalRevenue = _totalRevenue + _cratePrice;
		};
		
		
		_totalRevenue = _totalRevenue + ([(typeOf _vehicleObject)] call ExileClient_util_gear_calculateTotalSellPrice); 
	};
	
	if (_mode isEqualTo 3) then
	{
		_crateCheck = attachedObjects _vehicleObject;
		_count = count _crateCheck;
		if !(_count isEqualTo 0) then
		{		
			_crate = _crateCheck select (_count - 1);
			_crateCargo = _crate call ExileClient_util_containerCargo_list;
			_cratePrice = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
			_totalRevenue = _totalRevenue + _cratePrice;
		}else{_totalRevenue=0;};
	};
	
	_revenueControl = _display displayCtrl 4001;
	_revenueControl ctrlSetStructuredText (parseText (format ["<t size='1.4'>%1<img image='\exile_assets\texture\ui\poptab_notification_ca.paa' size='1' shadow='true' /></t>", _totalRevenue]));
	_sellButton = _display displayCtrl 4000;
	_sellButton ctrlEnable true;
};
true

 

Спойлер

/**
 * ExileClient_gui_wasteDumpDialog_show
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_nearVehicles","_localVehicles","_display","_revenue","_sellButton","_dropdown","_vehicleObject","_vehicleName","_index"];
disableSerialization;
_nearVehicles = nearestObjects [player, ["LandVehicle", "Air", "Ship"], 150];
_localVehicles = [];
{
	if (local _x) then
	{
		if (alive _x) then
		{
			_localVehicles pushBack _x;
		};
	};
}
forEach _nearVehicles;
if (_localVehicles isEqualTo []) exitWith
{
	["ErrorTitleAndText", ["Whoops!", "Park within 50m and get in as driver first."]] call ExileClient_gui_toaster_addTemplateToast;
};
ExileClientCurrentTrader = _this;
createDialog "RscExileWasteDumpDialog";
waitUntil { !isNull findDisplay 24011 };
_display = uiNameSpace getVariable ["RscExileWasteDumpDialog", displayNull];
_revenue = _display displayCtrl 4001;
_revenue ctrlSetStructuredText (parseText "<t size='1.4'>0<img image='\exile_assets\texture\ui\poptab_notification_ca.paa' size='1' shadow='true' /></t>");
_sellButton = _display displayCtrl 4000;
_sellButton ctrlEnable false;
_dropdown = _display displayCtrl 4002;
lbClear _dropdown;
{
	_vehicleObject = _x;
	_vehicleName = getText(configFile >> "CfgVehicles" >> (typeOf _vehicleObject) >> "displayName");
	_index = _dropdown lbAdd (format ["Cargo: %1", _vehicleName]);
	_dropdown lbSetData [_index, netId _vehicleObject];
	_dropdown lbSetValue [_index, 1];
	_index = _dropdown lbAdd (format ["Vehicle + Cargo + Crate: %1", _vehicleName]);
	_dropdown lbSetData [_index, netId _vehicleObject];
	_dropdown lbSetValue [_index, 2];
	_index = _dropdown lbAdd (format ["Crate: %1", _vehicleName]);
	_dropdown lbSetData [_index, netId _vehicleObject];
	_dropdown lbSetValue [_index, 3];
}
forEach _localVehicles;
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
true

 

items are not for sale

 

Edited by nikas455

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.