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

646 Commits

Author SHA1 Message Date
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
Weblate
45297665c6 Translations for Russian
Translations for French

Co-authored-by: neumond <alice.johnson@yandex.ru>
Co-authored-by: Naheulf <newheulf@gmail.com>
2020-07-05 03:41:59 +00:00
Weblate
da82b89676 Added translation for Russian
Co-authored-by: neumond <alice.johnson@yandex.ru>
2020-07-04 20:41:15 +00: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
SquidDev
37a447e745 Bump version to 1.89.2
Somewhat reluctant to do this, but it's a pretty major bug.
2020-06-30 11:10:26 +01:00
Weblate
e4c422d6f9 Translations for German
Co-authored-by: Jummit <jummit@web.de>
2020-06-27 01:59:35 +00:00
Weblate
478f992dea Translations for German
Co-authored-by: Jummit <jummit@web.de>
2020-06-25 16:49:08 +00: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
Weblate
ab0310e27c Translations for Italian
Translations for French

Translations for French

Co-authored-by: hds <hds536jhmk@gmail.com>
Co-authored-by: Anavrins <xanavrins@gmail.com>
Co-authored-by: AxelFontarive <afontarive@gmail.com>
2020-06-21 16:42:35 +00: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
2a8efb3fd5 Fix crashes when rendering monitors of varying sizes
When calling .flip(), we limit the size of the buffer. However, this
limit is not reset when writing the next time, which means we get
out-of-bounds errors, even if the buffer is /technically/ big enough.

Clearing the buffer before drawing (rather than just resetting the
position) is enough to fix this.

Fixes #476 (and closes #477, which is a duplicate)
2020-06-21 12:03:24 +01:00
Weblate
58a2995bbc Translations for Dutch
Translations for Chinese (Simplified)

Translations for Korean

Translations for German

Co-authored-by: SquidDev <bonzoweb@hotmail.co.uk>
2020-06-18 14:10:23 +00:00
SquidDev
a35dcb28ef Import translations and clean up
- Strip any gui._.config options. These haven't been used since 1.12
   and while they may return, it doesn't seem worth it right now.
 - Fix a couple of typos in the English translations.
 - Import from https://i18n.tweaked.cc. There's definitely some problems
   with the import - empty translations are still included, so we write
   a script to strip them.
2020-06-18 13:10:51 +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
c0f3ca81fb Bump to 1.89.0 2020-06-15 21:37:08 +01:00
Lignum
014bf55cd4 Cherry pick several improvements from #455
- Use texture over texture2D - the latter was deprecated in GLSL 1.30.
 - Cache the tbo buffer - this saves an allocation when monitors update.

Closes #455. While the rest of the PR has some nice changes, it
performs signlificantly worse on my system.
2020-05-31 17:23:49 +01:00
Lignum
085ae2e74a
Use an older version of GLSL (#459)
This ensures that the MVP matrix is available within the monitor
fragment shader, without requiring the ARB_compatibility extension.
2020-05-28 11:06:14 +01:00
Lignum
4ff33f165d
Fetch MVP matrix in monitor shader instead (#454) 2020-05-25 11:19:03 +01:00
SquidDev
d929c02d2a Fix settings loading failing for defined settings
Yes, this was the only piece of code which wasn't tested :/. Fixes #457.
2020-05-24 12:16:51 +01:00
Jonathan Coates
d50a08a549
Rewrite monitor networking (#453)
This moves monitor networking into its own packet, rather than serialising
using NBT. This allows us to be more flexible with how monitors are
serialised.

We now compress terminal data using gzip. This reduces the packet size
of a max-sized-monitor from ~25kb to as little as 100b.

On my test set of images (what I would consider to be the extreme end of
the "reasonable" case), we have packets from 1.4kb bytes up to 12kb,
with a mean of 6kb. Even in the worst case, this is a 2x reduction in
packet size.

While this is a fantastic win for the common case, it is not abuse-proof.
One can create a terminal with high entropy (and so uncompressible). This
will still be close to the original packet size.

In order to prevent any other abuse, we also limit the amount of monitor
data a client can possibly receive to 1MB (configurable).
2020-05-20 08:44:44 +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
161a5b4707 Document and test the redstone library
The tests may be a little agressive, but I wanted some sanity checks for
the 1.15 API rewrite.
2020-05-15 10:03:47 +01:00
SquidDev
c6b6b4479c Update changelog and fix doc typo 2020-05-14 19:23:57 +01:00
SquidDev
96e7b60285 Display function arguments and positions in the REPL
- cc.pretty.pretty now accepts two additional options:
   - function_args: Show function arguments
   - function_source: Show where functions are defined.
 - Expose the two options as lua.* settings (defaulting function_args to
   true, and function_source to false).
   These are then used in the Lua REPL.

Closes #361
2020-05-14 19:11:57 +01:00
SquidDev
086fccd997 Move the package library into a separate module
Hopefully this makes it a little easier for people to use in custom
shells (and anything else where it might be useful).
2020-05-14 17:27:50 +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
a4ae36b6b3 Bump version to 1.88.0
There's probably some other stuff I'll get in before release, but let's
do this just in case.
2020-05-13 13:43:40 +01:00
SquidDev
ac075d9f53 Allow using command computers in survival mode
I'm really not a fan of this change, but it's gated behind a config
option and there's apparently sufficient demand that it's worthwhile.
Closes #442.
2020-05-13 10:26:59 +01:00
Lupus590
05d7be0362
Improvements to the various file system programs (rm, mv, rename) (#440)
This enforces several sanity checks before actually attempting
the move, allowing us to produce friendlier error messages.
2020-05-12 11:32:48 +01:00
SquidDev
9a71dc1a26 Copy across a bunch of 5.1/5.3 io tests
I've been meaning to do this for ages. Woops.
2020-05-11 18:05:40 +01:00
SquidDev
156023b154 Create more work for myself
This ensures no lines start with an empty line, and all files finish
with exactly one "\n".
2020-05-11 16:08:25 +01:00
Jonathan Coates
376d628cf0
Make the local Lua message a little shorter
Co-authored-by: exerro <benedict.allen2514@gmail.com>
2020-05-09 08:30:55 +01:00
Lupus590
44062ebd52
Allow lua REPL to warn about using local variables (#367)
`local varname = value` results in `varname` being inaccessible in
the next REPL input. This is often unintended and can lead to confusing
behaviour. We produce a warning when this occurs.
2020-05-08 16:07:33 +01:00
Jonathan Coates
5739285fc2
Finish off documentation for the commands API 2020-05-05 21:17:52 +01:00
Jonathan Coates
70b457ed18
Add a monitor renderer using TBOs (#443)
This uses the system described in #409, to render monitors in a more
efficient manner.

Each monitor is backed by a texture buffer object (TBO) which contains
a relatively compact encoding of the terminal state. This is then
rendered using a shader, which consumes the TBO and uses it to index
into main font texture.

As we're transmitting significantly less data to the GPU (only 3 bytes
per character), this effectively reduces any update lag to 0. FPS appears
to be up by a small fraction (10-15fps on my machine, to ~110), possibly
as we're now only drawing a single quad (though doing much more work in
the shader).

On my laptop, with its Intel integrated graphics card, I'm able to draw
120 full-sized monitors (with an effective resolution of 3972 x 2330) at
a consistent 60fps. Updates still cause a slight spike, but we always
remain above 30fps - a significant improvement over VBOs, where updates
would go off the chart.

Many thanks to @Lignum and @Lemmmy for devising this scheme, and helping
test and review it! ♥
2020-05-05 13:05:23 +01:00
SquidDev
e918f55b58 Merge branch 'mc-1.14.x' into mc-1.15.x 2020-05-04 10:05:32 +01:00
SquidDev
c28b468844 Update languages and language script 2020-05-04 09:57:38 +01:00
SquidDev
052cf8ee7d Merge branch 'master' into mc-1.14.x 2020-05-04 09:39:54 +01:00
Jonathan Coates
4553e404b2
Merge pull request #437 from SquidDev-CC/feature/keep-ids
Preserve computer ids on unlabelled computers
2020-05-03 06:54:04 +01:00
Drew Lemmy
a565a571f9
Return the peripheral name when wrapping (#436) 2020-05-03 06:53:42 +01:00
SquidDev
fb64b6017b Add shell.execute
This functions the same as shell.run, but does not tokenise the
arguments. This allows us to pass command line arguments through to
another program without having to re-quote them.

Closes #417
2020-05-02 11:05:09 +01:00
SquidDev
3fb906ef6c Show computer/disk ids in the tool tip more often
- Remove the parenthesis around the text (so it's now
   "Computer ID: 12"), rather than "(Computer ID: 12").
 - Show the tooltip if the computer has an ID and no label (as well as
   when in advanced mode).
2020-05-02 10:38:17 +01:00
Jonathan Coates
e1663f3df0
Fix malformed doc comments 2020-05-01 08:50:44 +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
Jonathan Coates
447c3ab125
Clean up dance.lua
Not sure what keys.escape was doing there. That's very old.
2020-04-28 09:51:06 +01:00
Jonathan Coates
8fac68386e
Fix usages of global variables
- Lint references to unknown fields of modules, excluding the keys and
   colours modules. This caught several silly errors in our stub files,
   but nothing else.
 - Lint on using unknown globals. This highlighted a couple of really
   silly mistakes. Fixes #427.
 - Add documentation for fs.attributes, fs.getCapacity and pocket, as
   they were not defined before.

Co-authored-by: JackMacWindows <jackmacwindowslinux@gmail.com>
2020-04-28 09:42:34 +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
ae7ef66dfa Bump version
Oh no. I don't want to have to beta test this :D:.
2020-04-23 09:56:56 +01:00
JakobDev
9748679484
Add mouse support for the menu in edit and paint (#419) 2020-04-23 09:33:35 +01:00
SquidDev
da419b24e7 Enable motd on non-pocket and command computers
- I'm excluding pocket computers, as they have such a tiny screen I'm
   not sure the screen estate is worth it.
   Pocket computers /generally/ aren't people's starter machine, so I
   think this is fine.
 - Prune the motd list, and try to make them a little shorter. I think
   this list is more of the interesting ones. We can modify this list in
   the future, as we get more feedback.[^1]
 - Also fix paint/edit not adding an extension when they should. This
   was caused by the settings rewrite, as the explicitly provided
   default shadowed the one provided by bios.lua.

[^1]: ~5 months ago I asked for some feedback about enabling motds by
      default. I only got something constructive back today >_>.
2020-04-22 17:45:06 +01:00
Jonathan Coates
2f42a4e85b
Add documentation for shell and multishell
Heh, one place we're more complete than cc.cc :p.
2020-04-22 14:39:39 +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
JakobDev
f3de97d67f
Remove / and \ at the start of shell.setDir() (#410)
Uses fs.combine to normalise the file path. This removes leading/trailing
slashes, as well as any redundant "../"s within the path.
2020-04-22 06:30:49 +01:00
Wojbie
463635a459
Fix save() sPath param. 2020-04-21 18:28:55 +02:00
SquidDev
3b7b845930 Some tiny bits of documentation cleanup
I'm really good at this English lark :D:.
2020-04-21 12:12:44 +01:00
Jonathan Coates
1fc0214857
Some redesigning of the settings API (#408)
- The store is now split into two sections:
   - A list of possible options, with some metadata about them.
   - A list of values which have been changed.
 - settings.define can be used to register a new option. We have
   migrated all existing options over to use it. This can be used to
   define a default value, description, and a type the setting must have
   (such as `string` or `boolean).

 - settings.{set,unset,clear,load,store} operate using this value list.
   This means that only values which have been changed are stored to
   disk.
   Furthermore, clearing/unsetting will reset to the /default/ value,
   rather than removing entirely.

 - The set program will now display descriptions.

 - settings.{load,save} now default to `.settings` if no path is given.
2020-04-21 11:37:56 +01:00
Jonathan Coates
11bf601db9
Backport 1.15's terminal rendering code (#412)
This is a backport of 1.15's terminal rendering code with some further
improvements. This duplicates a fair bit of code, and is much more
efficient.

I expect the work done in #409 will supersede this, but that's unlikely
to make its way into the next release so it's worth getting this in for
now.

 - Refactor a lot of common terminal code into
   `FixedWithFontRenderer`. This shouldn't change any behaviour, but
   makes a lot of our terminal renderers (printed pages, terminals,
   monitors) a lot cleaner.

 - Terminal rendering is done using a single mode/vertex format. Rather
   than drawing an untextured quad for the background colours, we use an
   entirely white piece of the terminal font. This allows us to batch
   draws together more elegantly.

 - Some minor optimisations:
   - Skip rendering `"\0"` and `" "` characters. These characters occur
     pretty often, especially on blank monitors and, as the font is empty
     here, it is safe to skip them.
   - Batch together adjacent background cells of the same colour. Again,
     most terminals will have large runs of the same colour, so this is a
     worthwhile optimisation.

   These optimisations do mean that terminal performance is no longer
   consistent as "noisy" terminals will have worse performance. This is
   annoying, but still worthwhile.

 - Switch monitor rendering over to use VBOs.

   We also add a config option to switch between rendering backends. By
   default we'll choose the best one compatible with your GPU, but there
   is a config option to switch between VBOS (reasonable performance) and
   display lists (bad).

When benchmarking 30 full-sized monitors rendering a static image, this
improves my FPS[^1] from 7 to 95. This is obviously an extreme case -
monitor updates are still slow, and so more frequently updating screens
will still be less than stellar.

[^1]: My graphics card is an Intel HD Graphics 520. Obviously numbers
      will vary.
2020-04-21 10:43:26 +01:00
SquidDev
7c1154ddfc Avoid shadowing of names in peripheral.isPresent
Fixes #415
2020-04-21 08:51:49 +01:00
Jonathan Coates
b14c7842fc
Add textutils.unserialiseJSON (#407)
This is relatively unoptimised right now, but should be efficient enough
for most practical applications.

 - Add textutils.json_null. This will be serialized into a literal
   `null`. When deserializing, and parse_null is true, this will be
   returned instead of a nil.

 - Add textutils.unserializeJSON (and textutils.unserializeJSON). This
   is a standard compliant JSON parser (hopefully).

 - Passing in nbt_style to textutils.unserializeJSON will handle
   stringified NBT (no quotes around object keys, numeric suffices). We
   don't currently support byte/long/int arrays - something to add in
   a future commit.
2020-04-19 15:08:46 +01:00
SquidDev
eead8b5755 A small amount of Lua documentation
I'd forgotten how tedious this was. I can't say any of these docs are
especially good, but it's something.
2020-04-18 21:42:59 +01:00
SquidDev
10a27a7a25 Add utility to check table keys
expect.field acts very similarly to expect.expect, though checks a
specific table key rather than a function argument.
2020-04-18 14:38:20 +01:00
SquidDev
865fc239a0 Reformat bracketed expressions in Lua
- Parenthesised expressions (function calls, arguments, etc...) should
   never have spaces in them.
 - Tables always will have spaces inside.
2020-04-18 10:09:40 +01:00
SquidDev
cb8135a0d1 Bump Cobalt version
- Remove stub for table.pack/table.unpack.
 - Remove Lua 5.3 bitlib stub. We're not on 5.3, there's no
   point emulating it.
 - Change peripheral.call to correctly adjust the error level. This is a
   terrible hack, but I believe the only good option.

It'd be good to remove load as well, but it's a little more complex due
to our injecting of _ENV.

Closes #363
2020-04-16 10:48:26 +01:00
SquidDev
ef4b0a5632 Fix config name for enabling http API
It hasn't been http_enable for yonks - slightly worried I didn't notice
this earlier.
Also don't refer to ComputerCraft.cfg - the name has changed several
times across versions, so let's leave it ambiguous.
2020-04-13 11:00:31 +01:00
Jonathan Coates
ef8da8054f
An initial stab at documentation generation (#360)
This adds documentation comments to many of CC's Lua APIs, and
a couple of the Java ones, through the use of stubs. We then
export these to HTML using illuaminate [1] and upload them to our
documentation site [2].

Uploads currently occur on pushes to master and any release/tag. The
site is entirely static - there is no way to switch between versions,
etc... but hopefully we can improve this in the future.

[1]: github.com/SquidDev/illuaminate/
[2]: https://tweaked.cc/
2020-04-10 10:27:53 +01:00
E. Kim
1ccd687c00
Create ko_kr.lang (#381) 2020-04-09 22:31:20 +01:00
Christian L.W
a8ce5a5b20
Add Danish translation (#395) 2020-04-09 22:30:20 +01:00
Jonathan Coates
68e6bc464b
Bump illuaminate version
For now, we just perform the minimal number of changes to get this
working. We'll switch to a more strict bracket handling system in the
future.
2020-04-09 22:15:06 +01:00
SquidDev
419f29321a Port most recipes to use generators
Closes #354
2020-02-08 23:26:05 +00:00
Jonathan Coates
95fee95006
Fix spelling of Ctrl 2020-02-08 20:26:16 +00:00
Fatboychummy
8eae02c037
Fire mouse_up events in monitor.lua (#358)
We schedule a mouse_up event 0.1 seconds after receiving a
monitor_touch event.
2020-02-04 17:00:49 +00:00
SquidDev
649acbae1c Add back item frame rendering for printouts
Also fix a recipe loading issue, due to capitalisation of enums
2020-01-30 10:07:47 +00:00
SquidDev
05eada427b Add back custom block highlights
Also bump Forge version to enable this
2020-01-30 09:00:37 +00:00
SquidDev
d6ea3aab1c Switch generation of resources over to data generators
See #354

 - Remove Lua script to generate recipes/advancements for coloured
   disks, turtle upgrades and pocket upgrades. Replacing them with Lua
   ones.
 - Generate most block drops via the data generator system. Aside from
   cables, they all follow one of two templates.
2020-01-29 16:41:26 +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
0de5969ec1 Lint whitespace during CI 2020-01-23 15:12:12 +00:00
magiczocker10
3f98b2785e Fix turtle texture layout (#350) 2020-01-23 15:08:11 +00:00
Jonathan Coates
798868427e
Use a Wadler style pretty printer in the Lua REPL (#334)
- Add a cc.pretty module, which provides a Wadler style pretty printer [1].

 - The cc.pretty.pretty function converts an arbitrary object into a
   pretty-printed document. This can then be printed to the screen with
   cc.pretty.{write, print} or converted to a string with cc.pretty.render.

 - Convert the Lua REPL to use the pretty printer rather than
   textutils.serialise.

[1]: http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf
2020-01-17 22:51:36 +00:00
Jonathan Coates
1db3a14c54
Eta-reduce several calls to pcall 2020-01-15 09:29:11 +00:00
SquidDev
bf6d017ad1 Merge branch 'master' into mc-1.14.x 2020-01-14 08:52:59 +00:00
SquidDev
8b1773dd60 Fix peripheral.getMethods returning {}
I don't even know how this snuck past.

Closes #346
2020-01-14 08:45:08 +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
018ecfbaa0 ▲ version 2020-01-13 13:43:38 +00:00
Oliver Marks
35c1b10224 Anonymized GPS (#341)
GPS requests are now sent and received on CHANNEL_GPS by default
instead. This means it should not be possible to distinguish
computers (and thus locate them) via their GPS requests.
2020-01-08 17:07:01 +00:00
SquidDev
c1c01bef7c Fix argument index in expect call 2020-01-01 09:55:44 +00:00
SquidDev
a48c3d0ba8 A couple of io fixes
- Use expect within io.write before calling the handle's write
   function. Closes #338
 - Coerce to string in write before doing any writing. Fixes #339
2020-01-01 09:01:00 +00:00
Oliver Marks
393e628721 More MOTDs (#333) 2019-12-30 16:26:57 +00:00
Jonathan Coates
0bcd28e58c
Fix incorrect module names 2019-12-29 19:47:52 +00:00
SquidDev
42f5389fb8 Make Lua's "exit" function a little prettier
"exit" now has a custom __tostring method, which prints an explanation
message. This is very similar to how Python achives the same
functionality:

    lua> exit
    Call exit() to exit
    lua> exit()
    > Actually leaves the REPL
2019-12-29 18:51:39 +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
0dde859582 Bump version 2019-12-23 22:10:32 +00:00
SquidDev
ae928c4397 Make http domain configuration a little clearer 2019-12-23 18:59:36 +00:00
JakobDev
d254c6464b Add more MOTD messages again (#241) 2019-12-23 14:43:48 +00:00
Jonathan Coates
03b6d2f1ab
Replace string.len with # 2019-12-10 18:55:11 +00:00
Jared Allard
b0397ed3c5 Add support for HTTP PATCH and TRACE (#324) 2019-12-08 17:10:58 +00:00
Jonathan Coates
fa70ebcac2
Fix spacing on all of the rom (#323) 2019-12-07 10:33:47 +00:00
SquidDev
86e0330100 Lint bios and the rom (#321)
We now use illuaminate[1]'s linting facilities to check the rom and
bios.lua for a couple of common bugs and other problems.

Right now this doesn't detect any especially important bugs, though it
has caught lots of small things (unused variables, some noisy code). In
the future, the linter will grow in scope and features, which should
allow us to be stricter and catch most issues.

As a fun aside, we started off with ~150 bugs, and illuaminate was able
to fix all but 30 of them, which is pretty neat.

[1]: https://github.com/SquidDev/illuaminate
2019-12-03 23:26:13 +00:00
SquidDev
92567b4d7e Merge branch 'master' into mc-1.14.x 2019-11-29 20:23:56 +00:00
SquidDev
0ae70fed13 Correctly implement mouse movement within read
Note to self: if you're going to modify the rom, make sure you test on a
computer which doesn't overwrite the rom with something else.
2019-11-29 20:15:58 +00:00
SquidDev
642351af1a Merge branch 'master' into mc-1.14.x 2019-11-25 09:15:20 +00:00
SquidDev
121802a683 Bump version 2019-11-25 08:58:36 +00:00
SquidDev
08cf55e55f Correct implementation of clamp
That's what I get for inlining definitions.
2019-11-23 14:36:43 +00:00
SquidDev
c4d18aa9ca Allow navigating read's input using the mouse 2019-11-23 13:21:07 +00:00
SquidDev
44d0f78c1b Bump versions 2019-11-23 09:58:54 +00:00
SquidDev
3ea2d6a0a8 Merge branch 'master' into mc-1.14.x 2019-10-04 19:56:49 +01:00
SquidDev
c802290437 Bump version 2019-10-04 19:52:02 +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
Jonathan Coates
8e4d311cd9
Refactor shell completion into a separate module (#281)
- Adds cc.completions module, with a couple of helper functions for
   working with the more general completion functionality (i.e. that
   provided by read).
 - Adds cc.shell.completions module, which provides shell-specific
   completion functions.
 - Add a "program completion builder", which allows you to write stuff
   like this:

       shell.setCompletionFunction( "rom/programs/redstone.lua", 
         completion.build(
           { completion.choice, { "probe", "set ", "pulse " } },
           completion.side) )

Closes #232
2019-09-15 18:48:40 +01:00
SquidDev
49c37857d4 Window.reposition now allow changing the redirect buffer
See #270
2019-09-13 20:55:20 +01:00
Lignum
1c46949da7
Available 2019-08-15 07:37:02 +02:00
SquidDev
07a56454a0 Bumpity bumpity bump 2019-08-09 09:38:30 +01:00
SquidDev
46d78af068 Fix changelog being out-of-sync 2019-08-04 11:05:44 +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
eb5cff1045 Alright, let's do this one last time 2019-08-04 09:27:48 +01:00
SquidDev
cbe6e9b5f5 Make printers thread-safe 2019-08-01 13:48:03 +01:00
SquidDev
2ab79cf474 Version bumps 'n stuff 2019-07-30 15:48:05 +01:00
SquidDev
93310850d2 Use the "cc" module namespace instead of "craftos"
This is what we actually discussed in the issue, and I failed to
remember.
2019-07-27 11:34:59 +01:00
SquidDev
ccd85eb055 Bump Forge version 2019-07-21 09:41:58 +01:00
SquidDev
4ae77261fa Petty changes because I'm petty 2019-07-13 08:29:28 +01:00
liquid
85b740f484 Added term.getLine and window.getLine 2019-07-12 22:54:37 -05:00
SquidDev
f9929cb27d Fix the signature of loadfile
Lua 5.2+ uses loadfile(filename, mode, env), not loadfile(filename,
env). While this is a minor incompatibility, it'd be nice to be
consistent as much as possible.

We try to handle the incorrect case too, as obviously we don't want to
break existing programs.
2019-07-12 22:04:28 +01:00
SquidDev
bafab1ac07
Expose expect as a module (#267)
This moves expect from the bios into a new craftos.expect module,
removing the internal _G["~expect"] definition. Apparently people were
using this irrespective of the "don't use this" comment, so we need to
find another solution.

While this does introduce some ugliness (having to load the module in
weird ways for programs, duplicating the expect function in memory), it
does allow people to use the function in a supported way, and removes
the global ugliness.
2019-07-09 08:04:49 +01:00
SquidDev
6ea8ca991b Bump Forge to 1.14.3
Guess it's time for another release?
2019-06-26 08:25:32 +01:00
SquidDev
594bc4203c Fix block drops for computers and turtles 2019-06-15 09:07:31 +01:00
SquidDev
57318b022d Merge branch 'master' into mc-1.14.x 2019-06-15 08:00:20 +01:00
SquidDev
138a2cf08f Merge branches 'copycheck' and 'renamefix' 2019-06-13 08:03:35 +01:00
JakobDev
81daf82647 Add Checks to copy.lua 2019-06-13 08:03:01 +01:00
JakobDev
f3798bfb63 Improve rename.lua's argument validation 2019-06-13 08:00:06 +01:00
SquidDev
8dd1c2a6cc Finish off containers, somewhat fix block drops
- Add Forge's "name" field to the loot tables. This doesn't resolve all
   our missing loot providers, but it's a start.
 - Add back GUIs for pocket computers, printouts, view computer, etc...
2019-06-12 08:40:20 +01:00
SquidDev
d10b657a54 Initial work on GUIs
Needs a bit of a cleanup, but it's a start!
2019-06-11 21:03:40 +01:00