mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-09 12:42:39 +01:00
aefaf
This commit is contained in:
parent
6fe20212da
commit
e376997bc9
@ -616,7 +616,7 @@
|
||||
type="Application",
|
||||
icon="IgorTimofeev/OpenComputers/master/Applications/Control2/Icon.pic",
|
||||
createShortcut="desktop",
|
||||
version=1.02,
|
||||
version=1.03,
|
||||
resources={
|
||||
{
|
||||
name="LuaLogo.pic",
|
||||
|
||||
BIN
Applications/.DS_Store
vendored
BIN
Applications/.DS_Store
vendored
Binary file not shown.
@ -14,24 +14,24 @@ local window = {}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local function loadModule(moduleID)
|
||||
if fs.exists(window.modules[moduleID].path) then
|
||||
local success, reason = dofile(window.modules[moduleID].path)
|
||||
if success then
|
||||
window.modules[moduleID].module = success
|
||||
window.modules[moduleID].module.execute(window)
|
||||
else
|
||||
error("Error due module execution: " .. reason)
|
||||
end
|
||||
else
|
||||
error("Mudule file \"" .. window.modules[moduleID].path "\" doesn't exists")
|
||||
end
|
||||
end
|
||||
|
||||
local function createWindow()
|
||||
window = windows.empty("auto", "auto", math.floor(buffer.screen.width * 0.8), math.floor(buffer.screen.height * 0.7), 78, 24)
|
||||
window:addPanel(1, 1, window.width, window.height, 0xEEEEEE).disabled = true
|
||||
window.tabBar = window:addTabBar(1, 1, window.width, 3, 1, 0xDDDDDD, 0x262626, 0xCCCCCC, 0x262626, "Интерпретатор Lua", "События", "Память", "Диски", "BIOS")
|
||||
|
||||
window.resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
window.modules = {}
|
||||
local moduleNames = {}
|
||||
for file in fs.list(window.resourcesPath .. "Modules/") do
|
||||
local module, reason = dofile(window.resourcesPath .. "Modules/" .. file)
|
||||
if module then
|
||||
table.insert(window.modules, module)
|
||||
table.insert(moduleNames, module.name)
|
||||
else
|
||||
error("Error due module execution: " .. reason)
|
||||
end
|
||||
end
|
||||
|
||||
window.tabBar = window:addTabBar(1, 1, window.width, 3, 1, 0xDDDDDD, 0x262626, 0xCCCCCC, 0x262626, table.unpack(moduleNames))
|
||||
window.tabBar.onTabSwitched = function(object, eventData)
|
||||
|
||||
end
|
||||
@ -39,20 +39,13 @@ local function createWindow()
|
||||
window:close()
|
||||
end
|
||||
window.drawingArea = window:addContainer(1, 4, window.width, window.height - 3, 0xEEEEEE)
|
||||
|
||||
window.resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
window.modules = {}
|
||||
for file in fs.list(window.resourcesPath .. "Modules/") do
|
||||
table.insert(window.modules, {
|
||||
path = window.resourcesPath .. "Modules/" .. file
|
||||
})
|
||||
end
|
||||
|
||||
window.modules[1].execute(window)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
createWindow()
|
||||
loadModule(1)
|
||||
window.drawShadow = true
|
||||
window:draw()
|
||||
buffer.draw()
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
|
||||
local args = {...}
|
||||
local buffer = require("doubleBuffering")
|
||||
local GUI = require("GUI")
|
||||
local image = require("image")
|
||||
local unicode = require("unicode")
|
||||
|
||||
local module = {
|
||||
name = "Интерпретатор Lua2"
|
||||
name = "Интерпретатор Lua"
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user