Computer Craft Text User Interface API (tui)

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

CaptiveCreeper

New Member
Jul 29, 2019
8
0
0
I have been working a API that makes a user interface when called simular to buttions in other programs. Please post any bugs so i can help you. To install place int the folder FTBFOLDER/MODPACK/minecraft/mods/computercraft/lua/rom/apis/. I have made a Yes No and Customizable version No title, Title on Top, Title on Bottom, Title on Top and Bottom. They can be called by
Code:
local options = { "option1","option2","option3"}
local title1 = {"Title One"}
local title2 = {"Title Two")
 
 
-- for a simple Yes No with no title just type
--Use left and right to switch between options and space to choose the selected option
local YN = tui.yn()
if YN == true then
--place code for yes here
else
--Place code for false here
end
 
--for a Yes No with a Tittle on the top
local YNTITLETOP = tui.ynTittleTop(title1)
if TNTITLETOP == true then
--code for Yes here
else
--code for No here
end
 
 
local YNTITLEBOTTOM = tui.ynTittleBottom(title2)
if YNTITLEBOTTOM == true then
--code for Yes here
else
--code for No here
end
 
 
local YNTITLEBOTH = tui.ynTittleBoth(title1,title2)
if YNTITLEBOTH == true then
--code for Yes here
else
--code for No here
end
 
--for a interface with as many options as you want use this
--Custom uses up /down to move selected item
 
CUSTOM = tui.custom(options)
if CUSTOM == 1 then
--code for option 1
end
if CUSTOM == 2 then
--code for option 2
end
if CUSTOM == 3 then
--code for option 3
end
-- This will go on for as long as you have options
--For the titles you just add them after the options when you call the function
If you have any ideas please send them to me
Here is the paste bin http://pastebin.com/dfbD2dHb