Jump to content

Digest January-March

We talk about what was done and updated in the past month. We help keep abreast of events.

March February January

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

A statistics bot for Telegram

Convenient analytics right on your phone.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

The Addons Updater

Let us to introduce the addons updating software and to share the details

Read more Download

ConfigWindow


Ciuine

Recommended Posts

http://alloder.pro/files/file/28-configwindow/Нажмите здесь, чтобы скачать файл

Type /cw to access Configwindow.

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.

Demonstration 1 (actual configuration buttons for NamePlateBars minus IconTabled);

2co53ki.jpg

Seen in this image is a large list of true/false buttons, generated with a single loop of code from the owner add-on.

Also seen is a demonstration of the tabled buttons which allow the user to easily switch forward and backward through a predefined table stored in the owner add-on.

Demonstration 2 (not actual configuration buttons for NNRS);

ri83e0.jpg

Seen in this image is a fake IconTable with no icons.

A slider button which sends an event every time the slider is moved to the owner add-on.

A color button, which can be changed based on the color sliders in the right side of the window.

Two EditLine buttons, one numeric and one string, clicking these opens and focuses on an EditLine to which the user can type in information and press enter to send the information to the owner add-on.

A true/false button.

Link to comment
Share on other sites

ConfigWindow

Просмотр файла

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

 

Link to comment
Share on other sites

  • 4 months later...

из всего этого, вижу для себя полезное только - настройку цвета.

слишком он громоздкий

уж точно все мои настройки из TM ни в какой CW не влезут

Link to comment
Share on other sites

  • 3 weeks later...

При запуске /cw отоброжается пустое окно, как добавить туда адоны?

Link to comment
Share on other sites

Only add-ons that support ConfigWindow will show up. ShipHUD, NCT, PlayerHUD, NamePlateBars, DamageMeters, DoTTimer, and WhisperWindow, currently support it; I don't know if there are others.

Link to comment
Share on other sites

Маловато будет)

Да и еще, WhisperWindow too it is not supported...

Link to comment
Share on other sites

  • 2 years later...
  • 2 weeks later...
  • 9 months later...

Хотел использовать для настройки доттаймера, но конфиг показал только название, настроек небыло.

Link to comment
Share on other sites

  • 6 months later...
ВНИМАНИЕ!
Обязательна информация из \Personal\Logs\mods.txt для диагностики ошибки.
Иначе вам не помочь.
В игре включите в Меню → Интерфейс → Общие настройки → Запись ошибок пользовательских дополнений. Затем запустите аддон в игре.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use