summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/dummy/init.lua
blob: 54d4f3d7fefce6ce98697fbd50741a49e967d3b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- license:BSD-3-Clause
-- copyright-holders:Miodrag Milanovic
local exports = {
	name = "dummy",
	version = "0.0.1",
	description = "A dummy example",
	license = "BSD-3-Clause",
	author = { name = "Miodrag Milanovic" }}

local dummy = exports

local reset_subscription, stop_subscription

function dummy.startplugin()
	reset_subscription = emu.add_machine_reset_notifier(
			function ()
				emu.print_info("Starting " .. emu.gamename())
			end)

	stop_subscription = emu.add_machine_stop_notifier(
			function ()
				emu.print_info("Exiting " .. emu.gamename())
			end)

	local function menu_populate()
		return {{ "This is a", "test", "off" }, { "Also a", "test", "" }}
	end

	local function menu_callback(index, event)
		emu.print_info("index: " .. index .. " event: " .. event)
		return false
	end

	emu.register_menu(menu_callback, menu_populate, "Dummy")
end

return exports