Quantcast
Channel: Modding — Beamdog Forums
Viewing all articles
Browse latest Browse all 11774

[MOD] Smooth Selling v1.3

$
0
0
Current version: 1.3 This mod aims to make it easier and less time-consuming to perform common tasks in stores and item bags, such as selling or moving whole stacks of items. Features:
  • [Store UI] Single-clicking a stack of items in the Sell pane selects the whole stack (this includes selling items from bags)
  • [Item Bag UI] Single-clicking a stack of items (in either pane) selects the whole stack
  • [Choose Amount UI] The default split stack item amount is set to 1 consistently
  • [Choose Amount UI] Pressing Enter closes the window and selects the specified amount
  • [Choose Amount UI] Closing the window with Escape or Cancel deselects the item
You can add these changes by making the following edits to the UI.menu file (which you can export from NearInfinity):
1. Find this code segment:
		action
		"
			local cnt = tonumber(itemRequestAmt)
			Infinity_PopMenu()
			if(cnt and cnt > 0 and cnt <= requester.requesterMax) then
				requester.requesterFunc(cnt)
			end
		"</code>
Insert before the above code segment:
		on return
2. Find this code segment:
		action
		"
			if store.storeItems[storeItemsVar].clickable == 1 then
				if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
					local highlight = true
					if(store.storeItems[storeItemsVar].highlight == 1) then highlight = false end
					storeScreen:SelectStoreItem( storeItemsVar - 1,  highlight)
				end
			end
		"
		actionalt
		"
			showItemDescription(store.storeItems[storeItemsVar].item, 1)
		"
		actionDbl
		"
			if store.storeItems[storeItemsVar].clickable == 1 then
				if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
					local maxCount = store.storeItems[storeItemsVar].maxCount
					if(maxCount > 1) then
						popupRequester(maxCount, storeSplitStack, false)
					end
				end
			end
		"
Replace the above code segment with:
		action
		"
			if store.storeItems[storeItemsVar].clickable == 1 then
				if not storeScreen:IsContainer() then
					if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
						local highlight = true
						if(store.storeItems[storeItemsVar].highlight == 1) then highlight = false end
						storeScreen:SelectStoreItem(storeItemsVar - 1,  highlight)
					end
				elseif (store.storeItems[storeItemsVar].highlight == 1) then
					storeScreen:SelectStoreItem(storeItemsVar - 1,  false)
				else
					storeScreen:SelectStoreItem(storeItemsVar - 1,  true)
					local count = store.storeItems[storeItemsVar].item.count
					local stock = store.storeItems[storeItemsVar].numInStock
					if (count > 1) then
						storeScreen:SetStoreItemCount(storeItemsVar - 1, count)
					elseif (stock > 1) then
						storeScreen:SetStoreItemCount(storeItemsVar - 1, stock)
					end	
				end
			end
		"
		actionalt
		"
			showItemDescription(store.storeItems[storeItemsVar].item, 1)
		"
		actionDbl
		"
			if store.storeItems[storeItemsVar].clickable == 1 then
				if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
					local maxCount = store.storeItems[storeItemsVar].maxCount
					if(maxCount > 1) then
						popupRequester(maxCount, storeSplitStack, false)
						storeScreen:SelectStoreItem(storeItemsVar - 1, false)
					end
				end
			end
		"
3. Find this code segment:
		action
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				local selected = true
				if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end
				storeScreen:SelectGroupItem( storeGroupItemsVar - 1,  selected)
			end
		"
		actionalt
		"
			showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
		"
		actionDbl
		"
		if(store.groupItems[storeGroupItemsVar].item.isBag == 1) then
			showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
			itemDescLeftButtonAction()
		else
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				local count = store.groupItems[storeGroupItemsVar].item.count
				local stock = store.groupItems[storeGroupItemsVar].numInStock
				if(count > 1) then
					popupRequester(count, groupSplitStack, true)
				elseif stock > 1 then
					popupRequester(stock, groupSplitStack, true)
				end	
			end
		end
		"
Replace the above code segment with:
		action
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				if (store.groupItems[storeGroupItemsVar].highlight == 1) then
					storeScreen:SelectGroupItem(storeGroupItemsVar - 1,  false)
				else
					storeScreen:SelectGroupItem(storeGroupItemsVar - 1,  true)
					local count = store.groupItems[storeGroupItemsVar].item.count
					local stock = store.groupItems[storeGroupItemsVar].numInStock
					if (count > 1) then
						storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, count)
					elseif (stock > 1) then
						storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, stock)
					end
				end
			end
		"
		actionalt
		"
			showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
		"
		actionDbl
		"
			if(store.groupItems[storeGroupItemsVar].item.isBag == 1) then
				showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
				itemDescLeftButtonAction()
			else
				if store.groupItems[storeGroupItemsVar].valid ~= 0 then
					local count = store.groupItems[storeGroupItemsVar].item.count
					local stock = store.groupItems[storeGroupItemsVar].numInStock
					if(count > 1) then
						popupRequester(count, groupSplitStack, false)
					elseif stock > 1 then
						popupRequester(stock, groupSplitStack, false)
					end
					storeScreen:SelectGroupItem(storeGroupItemsVar - 1, false)
				end
			end
		"
4. Find this code segment:
		action
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				local selected = true
				if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end
				storeScreen:SelectGroupItem( storeGroupItemsVar - 1,  selected)
			end
		"
		actionalt
		"
			showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
		"
		actionDbl
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				local count = store.groupItems[storeGroupItemsVar].item.count
				local stock = store.groupItems[storeGroupItemsVar].numInStock
				if(count > 1) then
					popupRequester(count, groupSplitStack, true)
				elseif stock > 1 then
					popupRequester(stock, groupSplitStack, true)
				end	
			end
		"
Replace the above code segment with:
		action
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				if (store.groupItems[storeGroupItemsVar].highlight == 1) then
					storeScreen:SelectGroupItem(storeGroupItemsVar - 1,  false)
				else
					storeScreen:SelectGroupItem(storeGroupItemsVar - 1,  true)
					local count = store.groupItems[storeGroupItemsVar].item.count
					local stock = store.groupItems[storeGroupItemsVar].numInStock
					if (count > 1) then
						storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, count)
					elseif (stock > 1) then
						storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, stock)
					end
				end
			end
		"
		actionalt
		"
			showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
		"
		actionDbl
		"
			if store.groupItems[storeGroupItemsVar].valid ~= 0 then
				local count = store.groupItems[storeGroupItemsVar].item.count
				local stock = store.groupItems[storeGroupItemsVar].numInStock
				if(count > 1) then
					popupRequester(count, groupSplitStack, false)
				elseif stock > 1 then
					popupRequester(stock, groupSplitStack, false)
				end
				storeScreen:SelectGroupItem(storeGroupItemsVar - 1, false)
			end
		"
And... you're done. Enjoy!

Viewing all articles
Browse latest Browse all 11774

Latest Images

Trending Articles



Latest Images