commit 823c7f97a968467944940768422304d657489b31 Author: Michael Smith Date: Thu Nov 9 21:59:27 2017 +0100 Initial commit diff --git a/shutdown/init.lua b/shutdown/init.lua new file mode 100644 index 0000000..2968239 --- /dev/null +++ b/shutdown/init.lua @@ -0,0 +1,27 @@ +-- license:BSD-3-Clause +-- copyright-holders:Michael Smith +local exports = {} +exports.name = "shutdown" +exports.version = "0.0.1" +exports.description = "Allows you to shut down a Windows system from within the MAME menu." +exports.license = "The BSD 3-Clause License" +exports.author = { name = "Michael Smith" } + +local shutdown = exports + +function shutdown.startplugin() + local function menu_populate() + return {{ "Really shut down system?", "", "off" }, { "No", "", "" }, { "Yes", "", "" }} + end + + local function menu_callback(index, event) + if event == "select" and index == 3 then + os.execute("shutdown /s /t 0") + end + return false + end + + emu.register_menu(menu_callback, menu_populate, "System shutdown...") +end + +return exports diff --git a/shutdown/plugin.json b/shutdown/plugin.json new file mode 100644 index 0000000..a87fadd --- /dev/null +++ b/shutdown/plugin.json @@ -0,0 +1,10 @@ +{ + "plugin": { + "name": "shutdown", + "description": "Allows you to shut down a Windows system from within the MAME menu.", + "version": "0.0.1", + "author": "Michael Smith", + "type": "plugin", + "start": "true" + } +}