Thread: Force COD
View Single Post
08/20/18, 04:50 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,971
According to this filename here:
https://github.com/esoui/esoui/blob/...d_keyboard.lua

You need to set the sendMoneyMode to false (true = send money / false = COD)
-> See function ZO_MailSend_SetCoDMode at the bottom of this post.
and then you could use the function MailSend:AttachMoney to specify which amount of COD to use.

See functions below which should help:

Lua Code:
  1. function MailSend:SetSendMoneyMode(sendMoneyMode)
  2.     if self.sendMoneyMode ~= sendMoneyMode then
  3.         self.sendMoneyMode = sendMoneyMode
  4.         ZO_DefaultCurrencyInputField_SetCurrencyAmount(self.sendCurrency, 0)
  5.         ZO_DefaultCurrencyInputField_SetUsePlayerCurrencyAsMax(self.sendCurrency, sendMoneyMode)
  6.         if(sendMoneyMode) then
  7.             QueueMoneyAttachment(ZO_DefaultCurrencyInputField_GetCurrency(self.sendCurrency))
  8.         else
  9.             QueueCOD(ZO_DefaultCurrencyInputField_GetCurrency(self.sendCurrency))
  10.         end
  11.         self:UpdatePostageMoney()
  12.     end
  13. end
  14.  
  15. function MailSend:AttachMoney(moneyInput, money)
  16.     if self.sendMoneyMode then
  17.         QueueMoneyAttachment(money)
  18.     else
  19.         QueueCOD(money)
  20.     end
  21. end

But "MailSend" ist not the global variable used ingame so you are not able to use this. It's the "class" and you need to use the created "object" of that class to use the functions.
If you check the code where MailSend gets created via :New or :Initialize you'll get the object name.
It should be:
MAIL_SEND

And these functions may be helping as well:

Lua Code:
  1. function ZO_MailSend_SetCoDMode()
  2.     MAIL_SEND:SetCoDMode()
  3. end


BUT: As there were addons messing around with the send gold feature it might be not possible for addons to specify to send gold or set the COD from addon code. You need to check it. Sending gold will not be possible for sure!
  Reply With Quote