Перейти к содержанию

Дайджесты за январь-февраль

Обновления гайдов и аддонов

Январь Февраль

Мониторинг серверов и редактор аддонов

Представляем вам две легенды. То, о чем можно было только мечтать, стало реальностью.

Мониторинг серверов Редактор аддонов

Подсказки из игры на вашем сайте

Теперь вы можете отображать сведения о внутриигровых элементах простым наведением курсора мыши.

Подробнее

Апдейтер аддонов

Представляем вам программу для автообновления аддонов и делимся подробностями.

Подробнее Скачать

ConfigWindow 7


1 изображение

Информация о файле

This "super" add-on is an assistant to add-on function. Similar to AddonManager. However, instead of being able to turn on/off or hide add-ons; it is capable of allowing add-on developers to quickly and simply create buttons or user input abilities for their add-ons. This allows the user and the developer to reduce the amount of memory their add-on uses if they want to allow people to customize certain aspects of the add-on.

 

Этот "супер" аддон - помощник для для других аддонов. Наподобие AddonManager. Однако, вместо того, чтобы включить/выключить или скрывать аддоны, этот аддон позволяет разработчикам, быстро и просто создавать окно с настройками, или пользовательский ввод для своего аддона. Это позволяет уменьшить объем памяти, используемый аддоном, когда хочется сделать, чтобы люди могли настраивать некоторые аспекты аддона.

--Developer Advice--
Response to "CONFIG_INIT_EVENT" -


Code:
userMods.SendEvent("CONFIG_INIT_EVENT_RESPONSE", { sender = common.GetAddonName() })

Response to "CONFIG_EVENT_"..common.GetAddonName() -

  • Required -
    • NoB - This is the number of the button to be created.
      name - This is for the name of the button.
      btnType - This is the type of button;
      • "Simple" - For simple buttons.
        "T/F" - For true and false buttons.
        "EditLine" - For user input lines.
        "Color" - For a customizable color button.
        "Slider" - For a sliding button.
        "Tabled" - For a forward/backward table button.

  • Optional -
    • state - This is for the "T/F" button, true or false.
      value - This is mainly for the button types "Tabled" and "EditLine" to update the value.
      steps - This is for the number of steps for the "Slider" button.
      pos - This is for the position the "Slider" button should start at.
      color - This is the RGBA current value of the color button.
      texture - This is the textureId of a texture.
      sizeX - Size for X value of "Tabled" texture.
      sizeY - Size for Y value of "Tabled" texture.
      text - Text for "Tabled" text.
      scale - Scale for "Tabled" text.

  • Example -
    Code:
    userMods.SendEvent("CONFIG_EVENT_RESPONSE", {NoB = 0, name = "Dance", btnType = "T/F", state = true})

Response to "CONFIG_CHANGE_BUTTON_RESPONSE" -

  • Required -
    • NoB - Number of the button to change text.

    Optional -
    • name - Name of the button. "EditLine" or "Tabled" buttons.
      value - The new value for the button. "EditLine" or "Tabled" buttons.
      texture - The new texture. "Tabled" buttons only.
      sizeX - Size for X value of "Tabled" texture.
      text - Text for "Tabled" text.
      scale - Scale for "Tabled" text.

    Example -
    Code:
    userMods.SendEvent("CONFIG_CHANGE_BUTTON_RESPONSE", {NoB = 0, name = "Dance2", value = "Tango"})

Response from "CONFIG_SIMPLE_"..common.GetAddonName() -

  • Values Sent - {name}

Response from "CONFIG_BUTTON_"..common.GetAddonName() -

  • Values Sent - {name, state}

Response from "CONFIG_EDIT_LINE_"..common.GetAddonName() -

  • Values Sent - {name, text}

Response from "CONFIG_COLOR_"..common.GetAddonName() -

  • Values Sent - {name, color}

Response from "CONFIG_SLIDER_"..common.GetAddonName() -

  • Values Sent - {name, pos}

Response from "CONFIG_TABLED_"..common.GetAddonName() -

  • Values Sent - {name, dir} (dir is "+" or "-")


Example code for True/False buttons:

Code:
--CONFIG WINDOW COOPERATION
function ConfigInitEvent()
userMods.SendEvent("CONFIG_INIT_EVENT_RESPONSE", { sender = common.GetAddonName() })
end

function ConfigEvent()
local num = 0
for i, v in NPB do
userMods.SendEvent("CONFIG_EVENT_RESPONSE", {NoB = num, name = L [GetGameLocalization()]  , btnType = "T/F", state = v})
num = num + 1
end
end

function ConfigButtonResponse(p)
local s
for i, v in L [GetGameLocalization()]  do
if v == p.name then
s = i
end
end
if NPB   ~= nil then
NPB   = not NPB  
end
userMods.SetGlobalConfigSection("NPB", NPB)
common.StateUnloadManagedAddon( "UserAddon/"..common.GetAddonName() )
common.StateLoadManagedAddon( "UserAddon/"..common.GetAddonName() )
end

Code:
function Init()
-- CONFIG WINDOW EVENTS (INIT, RESPONSE, BUTTON)
common.RegisterEventHandler( ConfigInitEvent, "CONFIG_INIT_EVENT" )
common.RegisterEventHandler( ConfigEvent, "CONFIG_EVENT_"..common.GetAddonName())
common.RegisterEventHandler( ConfigButtonResponse, "CONFIG_BUTTON_"..common.GetAddonName())
end

Что нового в версии 7   Просмотр изменений

Размещено

  • фикс под обновление 7.0 (от LEM)

×
×
  • Создать...

Важная информация

Пользуясь сайтом, вы принимаете Условия использования