-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
-- digiterm/os.lua | ||
digiterm.os = {} -- init os table | ||
local modpath = digiterm.modpath -- modpath pointer | ||
local path = digiterm.datapath -- datapath pointer | ||
-- digicompute/os.lua | ||
digicompute.os = {} -- init os table | ||
local modpath = digicompute.modpath -- modpath pointer | ||
local path = digicompute.datapath -- datapath pointer | ||
|
||
-- [function] load os | ||
function digiterm.os.load(os_name) | ||
function digicompute.os.load(os_name) | ||
if datalib.dofile(modpath.."/os/"..os_name..".lua") ~= true then | ||
if datalib.dofile(path.."/os/"..os_name.."/.lua") ~= true then | ||
-- print error | ||
digiterm.log(os_name.." os could not be found. Please place the OS file in "..modpath.."/os/ or "..path.."/os/ with extension '.lua'.", "error") | ||
digicompute.log(os_name.." os could not be found. Please place the OS file in "..modpath.."/os/ or "..path.."/os/ with extension '.lua'.", "error") | ||
end | ||
end | ||
end | ||
|
||
-- [function] set meta value | ||
function digiterm.os.set(pos, key, value) | ||
function digicompute.os.set(pos, key, value) | ||
local meta = minetest.get_meta({x = pos.x, y = pos.y, z = pos.z}) -- get meta | ||
meta:set_string(key, value) -- set value | ||
return true -- return true, successful | ||
end | ||
|
||
-- [function] get meta value | ||
function digiterm.os.get(pos, key) | ||
function digicompute.os.get(pos, key) | ||
local meta = minetest.get_meta({x = pos.x, y = pos.y, z = pos.z}) -- get meta | ||
local value = meta:get_string(key) -- get value | ||
return value -- return retrieved value | ||
end | ||
|
||
-- [function] refresh formspec | ||
function digiterm.os.refresh(pos) | ||
function digicompute.os.refresh(pos) | ||
local meta = minetest.get_meta(pos) -- get meta | ||
meta:set_string("formspec", digiterm.formspec_normal(meta:get_string("input"), meta:get_string("output"))) | ||
meta:set_string("formspec", digicompute.formspec_normal(meta:get_string("input"), meta:get_string("output"))) | ||
end |