1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-29 00:23:23 +00:00
Commit Graph

248 Commits

Author SHA1 Message Date
Jonathan Coates
88f41314c7
Make io handles opaque to the docs
Yep, this is kinda gross. But also a nice refactor
2021-06-28 22:47:56 +01:00
Jonathan Coates
5ef8d52c13
Merge branch 'mc-1.15.x' into mc-1.16.x 2021-06-28 18:37:24 +01:00
Lupus590
b3f2f14e96
remove extra , 2021-06-23 15:14:01 +01:00
Jonathan Coates
3ace49d27f
Remove config option for debug API
And also remove the "is present" guards within the various APIs. I'm
happy at this point that debug is safe, and think we can guarantee its
presence.
2021-06-22 21:01:05 +01:00
Jonathan Coates
df7a40354e
Merge branch 'mc-1.15.x' into mc-1.16.x 2021-06-19 15:18:12 +01:00
Jonathan Coates
c489d4bc4f
Fix exiting paint typing "e" in the shell
When exiting paint via the keyboard by typing "Ctrl" then "E"
separately, we consume the "key" event within paint, leaving the shell
to consume "read".

To avoid this, we run a sleep(0) to gobble any other left-over events.

Note, it's generally not enough to run a queueEvent/pullEvent here, as
the char event may not have ended up on the queue yet. Alas, as this
solution is pretty ugly.
2021-06-19 15:13:26 +01:00
Jonathan Coates
0bfe960cbd
Merge branch 'mc-1.15.x' into mc-1.16.x 2021-06-19 12:41:30 +01:00
Jonathan Coates
a735f23e1f
Fix a couple of bugs with wget
- Provide a friendly message when writing to a file fails.
 - Correctly write empty files

Fixes #832, closes #833
2021-06-19 11:59:15 +01:00
Jonathan Coates
d71bf225cc
Add very simple markdown support to the help viewer (#819)
- Allow help files to use the ".md" suffix, and move changelog/whatsnew
   to use them.

 - When files end with ".md", the "help" program attempts to highlight
   them. This involves:
   - Colour code blocks with a lightGrey background.
   - Replace lists to use bullet points instead of "-"/"*".
   - Colours headings yellow.
   The implementation of this is a bit janky because a) I wrote this and
   b) we need to run this step before text wrapping, but preserve
   colours and section positions over wrapping (thanks to Jack for
   getting this working).

 - Add section navigation to the help viewer, with left/right to move to
   the next/previous section.

Closes #569
2021-06-12 19:48:41 +01:00
Wojbie
b323db30ee
Add cc.shell.completion programWithArgs completion. (#815)
And expand monitor, shell, fg and bg to use it
2021-06-07 22:02:45 +01:00
JackMacWindows
53efd6b303
Fixed error handling in scale subcommand (#816) 2021-06-07 20:47:15 +01:00
Matthew Wilbern
f8074636bc
Allow craft program to craft unlimited items (#807) 2021-06-06 06:52:01 +01:00
Jonathan Coates
f38a6a9d43
Merge branch 'mc-1.15.x' into mc-1.16.x 2021-06-05 11:36:30 +01:00
Matthew Wilbern
7fc55aa9a0
Add __eq metamethod and equals method to the vector api. (#800) 2021-05-31 13:58:46 +01:00
magiczocker10
38335ca187
Add some options for textutils.serialize (#664) 2021-05-29 17:46:58 +01:00
JackMacWindows
e0e194099c
Add a scale subcommand to monitor.lua (#623) 2021-05-29 16:55:55 +01:00
Jonathan Coates
b129ae627b
Make cc.pretty internals more opaque
I wish I had an actual type system.
2021-05-28 21:28:56 +01:00
Jonathan Coates
8b8692ba53 Merge branch 'mc-1.15.x' into mc-1.16.x 2021-05-20 18:30:10 +01:00
Jonathan Coates
1f385f5b35 Bump version to 1.94.0 2021-05-20 18:29:57 +01:00
JackMacWindows
e0a288bcb9
Add the ability to call cc.expect directly 2021-05-19 20:14:13 -04:00
Lupus590
28165bfcd6
Add cc.expect.range (#790) 2021-05-17 17:49:48 +01:00
Jonathan Coates
b0e30fdce1 Use lightGrey for folders on normal computers
This way we still get some differences between files and folders on
normal computers. I did try with just green, but I think the contrast is
too low.

Closes #656
2021-05-05 22:10:19 +01:00
Jonathan Coates
bc8e090873 Simplify our overrides of load/loadstring
- Remove auto-prefixing of load/loadstring
 - Use Cobalt's normal load implementation, with a simple hook to
   set _ENV on the environment.
2021-05-04 18:30:28 +01:00
Jonathan Coates
cf0f67265f Correctly handle sparse arrays in cc.pretty
This also swaps the order we display mixed array/maps in, so that the
array part comes first. I think this is more sensible.

Closes #777
2021-05-04 18:05:56 +01:00
Jonathan Coates
eb2d617ed8 Add a pre commit hook to lint code
This uses pre-commit [1] to check patches are well formed and run
several linters on them. We currently do some boring things (check files
are syntactically valid) as well as some project-specific ones:
 - Run illuaminate on the Lua files
 - Run checkstyle on Java

[1]: https://pre-commit.com/
2021-04-28 21:24:27 +01:00
Jonathan Coates
f387730b88 Merge branch 'mc-1.15.x' into mc-1.16.x 2021-04-24 11:50:23 +01:00
Jonathan Coates
058d63e77f Add citation to cc.pretty
ust to look extra pretentious.
2021-04-11 18:43:24 +01:00
Jonathan Coates
17b5bca443 Make the peripheral API examples a little clearer 2021-04-07 18:34:55 +01:00
Jonathan Coates
51d3b091da "Finish" documentation for several modules
- Add remaining docs for the turtle API
 - Add documentation for the fluid storage peripheral.
 - Enforce undocumented warning for most modules (only io and window
   remaining).

"Finish" in quotes, because these are clearly a long way from perfect.
I'm bad at writing docs, OK!
2021-04-03 12:45:54 +01:00
lily
9708dd6786
Fixed sortCoords for draw functions (#749) 2021-04-02 15:30:28 +01:00
Jonathan Coates
e48427dbbc Add documentation for io.setvbuf
Fixes #746.

Love how "good first issue" guarantees that nobody will do it. Not
actually true, and thank you for those people who have contributed!
2021-03-28 19:38:25 +01:00
Wojbie
32d956bbe7 Fix missing term.setCursorBlink(true) in edit.lua 2021-03-19 16:07:20 +01:00
Jonathan Coates
8c56b6a7be Merge branch 'mc-1.15.x' into mc-1.16.x 2021-03-12 09:26:15 +00:00
Jonathan Coates
66e42e0817 Bump version to 1.95.3 2021-03-12 09:19:16 +00:00
Wojbie
1f70ed6985
Make edit display errors/results of execution and handle require. (#723) 2021-02-23 20:50:19 +00:00
Jonathan Coates
1316d6a3c9 Migrate all examples to use tweaked.cc
Might as well, I've got the server capacity to spare. Hopefully.
2021-01-23 14:58:08 +00:00
FensieRenaud
763bab80fa Serialise sparse arrays into JSON (#685) 2021-01-18 20:48:33 +00:00
FensieRenaud
417fda3019
Serialise sparse arrays into JSON (#685) 2021-01-18 16:44:39 +00:00
Jonathan Coates
0be030c497 Merge branch 'mc-1.15.x' into mc-1.16.x 2021-01-16 11:38:59 +00:00
Jonathan Coates
ee27d8f081 Bump version to 1.95.2 2021-01-16 11:18:59 +00:00
Wojbie
c83eeb16a8
id.lua now handles more disk types (#677)
Co-authored-by: Lupus590 <lupussolitarius590@gmail.com>
2021-01-15 19:30:21 +00:00
Jonathan Coates
fd262a7995 Clarify the cc.strings.wrap docs a little
Also make the example a bit more "useful". Hopefully this should clarify
that the function returns a table rather than a single string.

Closes #678.
2021-01-14 09:12:37 +00:00
Wojbie
1f84480a80
Make rightAlt only close menu, never open it. (#672)
Fixes #669
2021-01-11 21:59:29 +00:00
Jonathan Coates
7ca261d763 Merge branch 'mc-1.15.x' into mc-1.16.x 2021-01-09 18:32:40 +00:00
Wojbie
b2e5401486
Added Numpad Enter Support in rom lua programs. (#657) 2021-01-07 21:41:04 +00:00
Jonathan Coates
1edb7288b9 Merge branch 'mc-1.15.x' into mc-1.16.x 2021-01-06 22:39:54 +00:00
Jonathan Coates
cc5e972cfc Bump version to 1.95.1
Will actually release tomorrow - it's getting quite late right now.
2021-01-06 22:39:26 +00:00
Jonathan Coates
72340defe4 Update illuaminate
- Fix doc library-path
 - Only style <pre> code blocks as executable. Skip <code> ones.
 - Document the default parameters in gps. Yes, we should do it
   everywhere, but one has to start somewhere!
2021-01-06 17:42:47 +00:00
Jonathan Coates
b8d5a89446 Add explicit @module annotation
This feels like a bug - it should be inferred automatically.
2020-12-25 17:42:53 +00:00
Jonathan Coates
96c577482d Merge branch 'mc-1.15.x' into mc-1.16.x 2020-12-25 16:43:32 +00:00
Jonathan Coates
7f9a707f75 Bump version to 1.95.0
As is tradition.
2020-12-25 16:40:50 +00:00
Jonathan Coates
ed3913c1f4
Manually wrap strings for help (#602)
This saves us writing to a buffer multiple times, and so makes things much,
much faster.
2020-12-23 16:33:58 +00:00
Lupus590
16d74dd2e8 Add functions to wrap text 2020-12-23 16:21:04 +00:00
TheWireLord
b97e950d86 Added Numpad Enter Support - bios.lua
Add the ability to use Numpad Enter and have it act just like normal Enter.
(Just like the web-based emulator on the Tweaked.cc wiki)
2020-12-12 16:45:02 -05:00
JackMacWindows
24d3777722
Added improved help viewer (#595)
- Pagination, with (page) up/down, q(uit) and scrolling support.
 - Render markdown style bullets ('-'/'*') using a '•' instead.
2020-12-02 19:22:12 +00:00
Jonathan Coates
511eea39a1
Remove <!-- -->s in usages
We fixed the bug in illuaminate, so this should be redundant now.
2020-11-28 17:53:07 +00:00
SquidDev
04f9644ae7 Allow strings or numbers in textutils.*tabulate
A little dubious, but apparently CC used to support it. This means we're
consistent with methods like io.write or string.len which accept strings
or numbers.

Fixes #591
2020-11-27 21:29:11 +00:00
JackMacWindows
486f41f082
Fixed length check on function name in expect (#589) 2020-11-26 19:46:03 +00:00
Lupus590
fff8353451
Remove extra space (#586) 2020-11-21 12:25:19 +00:00
Lupus590
9a749642d2
Strict Globals (#583) 2020-11-21 12:11:40 +00:00
SquidDev
c35707725f More examples
Yay!
2020-11-20 21:59:17 +00:00
SquidDev
b0651082f4 Cleanup examples for the various modules 2020-11-20 19:36:28 +00:00
SquidDev
aab0cd34cd Use term.blit on original paint render
This makes it super speedy, meaning an initial refresh doesn't take ages
to load.
2020-11-20 15:06:47 +00:00
Luca
d2a1a00dc4
Clear gets an option to reset the palette (#582)
Fixes #555.
2020-11-17 12:53:20 +00:00
SquidDev
7f90f2f7ca Clean up some examples a little bit
Would be good if they didn't crash and burn on entry :).
2020-11-12 19:40:18 +00:00
SquidDev
83df64e520 Merge branch 'mc-1.15.x' into mc-1.16.x 2020-11-07 12:46:10 +00:00
SquidDev
74ac5bb3d1 Bump to 1.94.0 2020-11-07 12:43:57 +00:00
Lupus590
d13bd2cce8
use arg[0] in all usage printouts (#571) 2020-11-04 14:03:08 +00:00
SquidDev
cc96e41d3e Remove stray copy-paste error from changelog 2020-11-03 14:37:24 +00:00
Drew Lemmy
741adfa7bb
Use blit to draw boxes, add colors.toBlit (#570) 2020-11-01 19:28:18 +00:00
SquidDev
666e83cf4f Fix JSON objects failing to pass
Maybe I should run the whole test suite, not just the things I think
matter? Nah....
2020-11-01 11:48:19 +00:00
SquidDev
c58441b29c Various SNBT parsing improvements
Correctly handle:
 - Typed arrays ([I; 1, 2, 3])
 - All suffixed numbers (1.2d)
 - Single-quoted strings

Fixes #559
2020-11-01 11:36:48 +00:00
SquidDev
c334423d42 Add function to get window visibility
Closes #562

Co-authored-by: devomaa <lmao@distruzione.org>
2020-10-31 09:54:38 +00:00
SquidDev
5bf367af9f Merge branch 'mc-1.15.x' into mc-1.16.x 2020-10-23 17:45:11 +01:00
SquidDev
61fb4caaad Bump to 1.93.1 2020-10-23 17:44:52 +01:00
Drew Lemmy
34a2c835d4
Add color table to docs (#553) 2020-10-11 21:37:56 +01:00
Jonathan Coates
30d35883b8
Fix my docs
Thanks @plt-hokusai. Kinda embarrassing this slipped through - I
evidently need to lint examples too.
2020-10-08 09:48:36 +01:00
SquidDev
0c6e7b5db5 Merge branch 'mc-1.15.x' into mc-1.16.x 2020-10-04 11:24:42 +01:00
SquidDev
334ca65482 Bump to 1.93.0 2020-10-04 11:19:43 +01:00
SquidDev
84036d97d9 Fix io.open documentation
Well, that was silly.
2020-10-02 21:21:53 +01:00
SquidDev
87393e8aef Fix additional - in docs
Why isn't this automatically stripped! Bad squid.
2020-09-13 17:56:12 +01:00
SquidDev
86bf57e3cd My inability to spell will be immortalsied in the changelog 2020-09-12 11:03:18 +01:00
SquidDev
d0a973fa46 Merge branch 'mc-1.15.x' into mc-1.16.x 2020-09-12 09:29:21 +01:00
SquidDev
748ebbe66b Bump to 1.92.0
A tiny release, but there's new features so it's technically a minor
bump.
2020-09-12 09:27:47 +01:00
SquidDev
59de21eae2 Handle tabs when parsing JSON
Fixes #539
2020-09-11 18:02:23 +01:00
JackMacWindows
d5368d0719
Add date-specific MOTDs (like Minecraft) (#533) 2020-09-04 17:35:46 +01:00
SquidDev
26c12ac1a9 Bump version to 1.91.1 2020-09-04 17:29:35 +01:00
SquidDev
7809a2eddd Merge branch 'mc-1.15.x' into mc-1.16.x 2020-08-23 15:46:17 +01:00
SquidDev
183b342071 Bump for 1.91.0 2020-08-23 15:35:58 +01:00
R93950X
d5de39ebd4
Fix time formatting (#527)
Fixes #525.

Co-authored-by: R93950X <R93950X@users.noreply.github.com>
2020-08-22 15:17:12 +01:00
SquidDev
9f72448ecd Properly deprecate colors.rgb8 2020-08-04 19:50:36 +01:00
SquidDev
29646a7f61 Bump version to 1.90.3 2020-07-27 19:07:06 +01:00
Jonathan Coates
cd879b067f
Merge pull request #508 from neumond/mc-1.15.x
Fix JSON serialization of strings
2020-07-25 17:51:46 +01:00
neumond
053cb1b53c Fix JSON serialization of strings
Control characters become escaped as JSON requires
Non-ASCII characters get escaped as well for better interoperability
We assume here that lua strings represent only first 256 code points of unicode
2020-07-25 19:40:06 +03:00
SquidDev
6b102a8142 Merge branch 'mc-1.15.x' into mc-1.16.x 2020-07-25 12:08:33 +01:00
SquidDev
ac7979fb46 Bump for 1.90.2 2020-07-25 11:53:46 +01:00
SquidDev
a1dcd59d95 Update to latest Forge
Fixes #498
2020-07-18 15:11:57 +01:00
SquidDev
2f323f23d7 Update changelog for release 2020-07-18 12:23:36 +01:00
SquidDev
3f277a7a7b Bump version to 1.90.0
Going to let this stew for a couple of days - there's probably something
else which'll break.
2020-07-06 15:38:09 +01:00
SquidDev
8f3a56dd32 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-06-30 11:31:41 +01:00
SquidDev
113d5d982f Merge branch 'master' into mc-1.14.x 2020-06-30 11:28:56 +01:00
JakobDev
b54519d0e6
Add functions for parsing and drawing nft (#458) 2020-06-25 09:08:35 +01:00
Jonathan Coates
9499654757
Add documentation for peripherals
No clue how we're going to do this for the dynamic peripheral system
if/when that ships, but this is a good first stage.

Like the Java APIs, this relies on stub files, so we can't link to the
implementation which is a bit of a shame. However, it's a good first
step.
2020-06-24 12:12:06 +01:00
SquidDev
1efabccd14 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-06-21 12:09:28 +01:00
SquidDev
029374e9aa Merge branch 'master' into mc-1.14.x 2020-06-21 12:08:30 +01:00
SquidDev
2b077554f7 Merge branch 'mc-1.14.x' into mc-1.15.x
# Conflicts:
#	gradle.properties
#	src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java
#	src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java
#	src/main/java/dan200/computercraft/core/apis/handles/HandleGeneric.java
#	src/main/java/dan200/computercraft/shared/Config.java
#	src/main/java/dan200/computercraft/shared/network/NetworkHandler.java
#	src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java
#	src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java
#	src/main/resources/data/computercraft/lua/rom/help/changelog.txt
#	src/main/resources/data/computercraft/lua/rom/help/whatsnew.txt
2020-06-16 09:24:14 +01:00
SquidDev
9134f243c1 Merge branch 'master' into mc-1.14.x 2020-06-15 22:05:02 +01:00
SquidDev
c493d668c8 Bump version 2020-05-17 17:02:17 +01:00
SquidDev
d0deab3519 Update changelog to include some missing things 2020-05-15 10:48:31 +01:00
SquidDev
d5a8df753a Merge branch 'mc-1.14.x' into mc-1.15.x 2020-05-15 10:36:23 +01:00
SquidDev
13de2c4dd0 Fix location of cc.require
Yay for 1.12->1.13 changes!
2020-05-15 10:28:35 +01:00
SquidDev
906280225e Merge branch 'master' into mc-1.14.x 2020-05-15 10:19:57 +01:00
SquidDev
abbc641fd4 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-05-13 14:36:39 +01:00
SquidDev
4be0b15afa Merge branch 'master' into mc-1.14.x 2020-05-13 14:04:28 +01:00
SquidDev
e918f55b58 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-05-04 10:05:32 +01:00
SquidDev
052cf8ee7d Merge branch 'master' into mc-1.14.x 2020-05-04 09:39:54 +01:00
SquidDev
697e9449cf Delete existing treasure disks 2020-04-30 10:59:55 +01:00
SquidDev
76c3e4c155 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-04-29 17:37:53 +01:00
SquidDev
358289b5f9 Merge branch 'master' into mc-1.14.x 2020-04-29 17:37:36 +01:00
SquidDev
a3021c4697 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-04-24 18:44:29 +01:00
SquidDev
b7c61f9c6d Bump version 2020-04-24 18:34:01 +01:00
SquidDev
33260a7747 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-04-23 10:04:37 +01:00
SquidDev
a049502d12 Merge branch 'master' into mc-1.14.x 2020-04-23 10:03:45 +01:00
SquidDev
d7729337ac Merge branch 'mc-1.14.x' into mc-1.15.x 2020-04-22 10:39:00 +01:00
SquidDev
e5cc345f49 Some cleanup to the Lua programs 2020-04-22 10:00:43 +01:00
SquidDev
d847a4d9e0 Merge branch 'master' into mc-1.14.x
This also deletes display list support - MC 1.14 now requires VBOs to be
supported in some capacity.
2020-04-22 09:45:23 +01:00
Jonathan Coates
95fee95006
Fix spelling of Ctrl 2020-02-08 20:26:16 +00:00
SquidDev
fb440b0d2e Update to 1.15
Most of the port is pretty simple. The main problems are regarding
changes to Minecraft's rendering system.

 - Remove several rendering tweaks until Forge's compatibility it
   brought up-to-date
    - Map rendering for pocket computers and printouts
    - Item frame rendering for printouts
    - Custom block outlines for monitors and cables/wired modems
    - Custom breaking progress for cables/wired modems

 - Turtle "Dinnerbone" rendering is currently broken, as normals are not
   correctly transformed.

 - Rewrite FixedWidthFontRenderer to to the buffer in a single sweep.
   In order to do this, the term_font now also bundles a "background"
   section, which is just a blank region of the screen.

 - Render monitors using a VBO instead of a call list. I haven't
   compared performance yet, but it manages to render a 6x5 array of
   _static_ monitors at almost 60fps, which seems pretty reasonable.
2020-01-24 09:12:29 +00:00
SquidDev
bf6d017ad1 Merge branch 'master' into mc-1.14.x 2020-01-14 08:52:59 +00:00
SquidDev
a706300598 Update changelog/version 2020-01-13 15:10:32 +00:00
SquidDev
41a1b99f7d Merge branch 'master' into mc-1.14.x 2020-01-13 15:05:50 +00:00
SquidDev
037cbabb32 Merge branch 'master' into mc-1.14.x
Unfortunately we can't apply the config changes due to backwards
compatibility. This'll be something we may need to PR into Forge.

CraftTweaker support still needs to be added.
2019-12-23 22:34:30 +00:00
SquidDev
92567b4d7e Merge branch 'master' into mc-1.14.x 2019-11-29 20:23:56 +00:00
SquidDev
642351af1a Merge branch 'master' into mc-1.14.x 2019-11-25 09:15:20 +00:00
SquidDev
3ea2d6a0a8 Merge branch 'master' into mc-1.14.x 2019-10-04 19:56:49 +01:00
SquidDev
81f85361d5 Move Lua files to the correct location
I really need to fix this.
2019-10-01 19:43:03 +01:00
SquidDev
d4f6a594b6 Merge branch 'master' into mc-1.14.x 2019-10-01 18:58:40 +01:00
SquidDev
07a56454a0 Bumpity bumpity bump 2019-08-09 09:38:30 +01:00
SquidDev
08d22fd3df Fix changelog being out-of-sync 2019-08-04 11:05:14 +01:00
SquidDev
e6c691a8f8 Fix rom's location
This isn't going to get annoying or anything
2019-08-04 11:02:07 +01:00
SquidDev
4b0e5c445c Merge branch 'master' into mc-1.14.x 2019-08-04 10:57:20 +01:00
SquidDev
57318b022d Merge branch 'master' into mc-1.14.x 2019-06-15 08:00:20 +01:00
SquidDev
0f3c44c926 Merge branch 'master' into mc-1.13.x 2019-06-08 08:21:08 +01:00
SquidDev
b6715bd812 Fix a couple of build failures 2019-06-02 18:36:34 +01:00
SquidDev
c82d8a7c2a Merge branch 'master' into mc-1.13.x 2019-06-02 16:46:45 +01:00
SquidDev
220e4bd660 Merge branch 'master' into mc-1.13.x 2019-04-24 10:15:33 +01:00
SquidDev
810258e9b8 Update and rename all resources
- Languages are converted to JSON
 - Rename most *(_advanced) blocks to *_{advanced,normal}. It's more
   verbose, but means they're sorted together.
 - A couple of changes to the ROM to work with some Java changes.
 - Update recipes and advancements to not use damage values.
2019-04-02 13:18:43 +01:00
SquidDev
5e462adc5c Relocate all resource files
- textures/{block,item}s -> textures/{block,item}
 - assets/*/{advancements,lua,recipes} -> data/*/...
2019-04-02 13:18:43 +01:00