-
Notifications
You must be signed in to change notification settings - Fork 3
/
NEW_FEATURES.txt
118 lines (93 loc) · 3.8 KB
/
NEW_FEATURES.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
NEW IN RECRAFTED
The following is a non-exhaustive list of new
and/or changed features in Recrafted compared to
CraftOS.
!!!! THIS FILE IS OUTDATED !!!!
See https://ocaweso.me/recrafted for more
up-to-date documentation.
Major Changes
=============
- `os.loadAPI` has been completely omitted.
- * All APIs except the standard Lua ones must be
loaded using `require` before they can be used.
- * Lua 5.1 builtins have been removed from `_G`,
but can be accessed through `require("lua51")`.
- Startup scripts from /startup are run in
parallel as separate threads.
- Recrafted has full native support for
multithreading -- custom schedulers are no
longer necessary!
- Multishell can be used even on standard (non-
advanced) computers, using Alt+Left and
Alt+Right to switch tabs. There is no
dedicated Multishell program - only the API. A
Multishell instance may be started at any time
using multishell.launch.
* These do not apply when compatibility mode is
enabled - see "Compatibility Mode" below.
New API Methods
===============
Recrafted features a few extensions to the CraftOS
APIs:
- textutils.coloredWrite(...):
Similar to textutils.tabulate(), but takes
strings instead of tables and doesn't tabulate
its arguments. Useful for easy printing of
colorized text. Returns the number of lines
written.
- textutils.coloredPrint(...):
Like textutils.coloredWrite(), but prints an
extra newline at the end of the text, similar
to print().
- Tables given to textutils.tabulate() may
contain tables, along with strings and numbers;
if a table is present, it must contain a set of
arguments suitable for passing to
textutils.coloredWrite().
- Recrafted's paintutils API uses the BIMG (Blit
Image) format for its images. This format
supports animations and lots of other useful
metadata, plus combining text and images.
See https://github.com/SkyTheCodeMaster/bimg
for details on the format.
The Multishell foreground thread management
functions should only be used when absolutely
necessary. If they ARE necessary, these should be
used instead of the corresponding thread API
functions regardless of whether multishell is
actually enabled, to ensure proper behavior when it
is enabled.
The foreground thread is the only thread that will
respond to terminate events. Ensuring that it is
set correctly is therefore quite important. Under
most circumstances you should not need to use these
functions, since shell.run() uses them behind the
scenes.
These should not be confused with Multishell's
getFocus() and setFocus() functions, which manage
the focused tab.
- multishell.getForeground():
Returns the foreground thread ID of the current
tab.
- multishell.pushForeground(pid):
Adds a thread to the current tab's foreground
stack; the given thread will be removed when
it exits.
- multishell.switchForeground(pid):
Changes the top entry of the current tab's
foreground stack; removes the old entry.
- multishell.launch()'s first argument, the
environment, is optional and may be completely
omitted.
Compatibility Mode
==================
When the bios.compat_mode setting is set, Recrafted
will enter CraftOS compatibility mode. This
disables strict global checking and places all
relevant functions and APIs into _G. In
compatibility mode, os.version() returns
"CraftOS 1.8" rather than the current Recrafted
version.
This mode should only be used when necessary. New
programs should use proper Lua coding conventions
and therefore work without it.