summaryrefslogtreecommitdiff
path: root/plugins/MirLua/docs/examples/popup.lua
blob: 395f650267ec885733f70c350c7ed206f120a04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- include m_popup module
local popup = require('m_popup')
--- include m_genmenu module
local genmenu = require('m_genmenu')

m.CreateServiceFunction('MirLua/ShowPopup', function()
    local popupData =
    {
      Title = 'Title',
      Text = 'Popup content',
      hContact = 0,
      Flags = 1
    }
    popup.AddPopup(popupData)
  end)

m.OnModulesLoaded(function()
  genmenu.AddMainMenuItem({ Name = "Show lua popup", Service = 'MirLua/ShowPopup' })
end)