ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Force COD (https://www.esoui.com/forums/showthread.php?t=8009)

ESOARMY 08/20/18 03:15 AM

Force COD
 
hey there lua masters, if i put this

QueueCOD(20)

above this
SendMail(currConfig.To,currConfig.Subject,"Thank you!")
d("|c99FF99AAL:|cFFFFFF Sending 1 mail to "..currConfig.To..", containing 6 CLOTH items")
numSlot = 1
zo_callLater(function() BG_OIK:SendMails() end, self.db.delay)

if it will add a 20g cod to the in game mail being sent?
or am I using this the wrong way?

Baertram 08/20/18 04:50 AM

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!


All times are GMT -6. The time now is 11:50 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI