Commit Graph

768 Commits

Author SHA1 Message Date
Karl Ostmo
37b0e3fc8a
Preserve seed upon restart (#787)
Part of #549

Before this change, if the Classic scenario was started:

```
stack run -- --scenario data/scenarios/classic.yaml
```
and then "Start over" is selected from the Quit dialog, a new seed was generated.

Now, the previous seed is re-used.
2022-10-24 17:14:34 +00:00
Brent Yorgey
1dc22919ba
tell brick to join lines inside dialogs too (#783)
Closes #780.
2022-10-24 12:02:43 +00:00
Karl Ostmo
13e7dfeb52
Use scenario name as Goal dialog title (#774)
part of #760
2022-10-23 16:39:40 +00:00
Brent Yorgey
e6a39593bd
make inventory sort case-insensitive (#775)
Part of #519.
2022-10-23 11:46:51 +00:00
Karl Ostmo
f480426162
Add a button to the Quit dialog to restart a scenario. (#767)
Closes #549
2022-10-22 15:07:56 -07:00
Ondřej Šebek
696ff4b639
Default invisibity to system robot value (#768)
- closes #726
2022-10-22 22:01:04 +00:00
Karl Ostmo
71403e9393
rerun fourmolu globally (#772)
There was one file that is not currently formatted.
2022-10-22 00:47:53 -07:00
Karl Ostmo
fe21480eba
fix typo: "inhabitants" (#771) 2022-10-21 22:26:08 +00:00
Brent Yorgey
9942c2c3da
Make sure newly built robots consistently face north (#766)
Closes #757 .  As discussed there:

- Default direction for robots whose parents have no direction is now `north`
- Fix the `scan` tutorial `base` to be facing north
- Clarify the text in the `build` tutorial to state that newly built robots face the same direction as their parent, which in the tutorial will always be north.
2022-10-21 10:37:02 +00:00
Brent Yorgey
f54d8339d0
Improve user experience around quitting & moving between tutorial challenges (#754)
- Help modal now says "quit the current scenario" instead of "quit game" for Ctrl-q
- If you select "Keep playing" after completing a challenge scenario, it will now pop up a modal advising you to hit Ctrl-q whenever you're ready to move on.
- Added a note at the beginning of the tutorial reassuring that your progress will be saved and you can pick up where you left off from the menu.
- Improved quit dialog in a couple ways:
    - Now warns that "your progress *on the current scenario* will be lost" (to emphasize that e.g. your progress on the entire tutorial won't be lost).
    - Now says "quit to XXX menu" where XXX is the specific menu you will return to.

Closes #595. Closes #759.
2022-10-21 10:24:02 +00:00
Ondřej Šebek
d0305c4285
Fix backstory loop (#762)
- closes #756
2022-10-19 12:59:22 +00:00
Steven Garcia
758b3d0192
Add void type (#735)
Closes #665 

### todo
- [x] add void to the parser for types
- [x] add two tests
- [ ] mention `void` in the description of an `ADT calculator`
2022-10-19 01:28:37 +00:00
Brent Yorgey
faab7046b9
improved handling of REPL mouse clicks (#750)
- Never clear the `uiWorldCursor`.
    - In practice it seemed annoying and glitchy to understand when it would or wouldn't clear.  After clicking somewhere on the map to see the coordinates I was always afraid I was going to do the wrong thing and cause the cursor display to clear before I could make use of it.
- Pass on mouse clicks to the REPL input form 
    - This means you can click in the middle of the input to move the cursor 
    - Closes #470.
2022-10-18 18:02:31 +00:00
Ondřej Šebek
0efb1c3e6d
Use Node 16 in both VS Code actions (#751) 2022-10-18 19:24:41 +02:00
Ondřej Šebek
b8956689d9
Move TH GitInfo back to Main (#749)
It is probably safer to have Template Haskell GitInfo in Main and not depend on it in Swarm modules.

Depending on how the build system and TH interact we were either recompiling too often or not often enough.
- if the git info was evaluated once and not again after making a commit, then it was not up to date
- if the git info was reevaluated on every commit then we would needlessly recompile dependent modules

I believe it was only the former, but this helps even in that case (any code change recompiles Main).
2022-10-16 22:17:34 +00:00
Valentin Golev
977e0edd68
expose the last evaluated result as it in REPL (#734)
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Brent Yorgey <byorgey@gmail.com>
2022-10-16 22:21:36 +02:00
Brent Yorgey
683508f36e
CHANGELOG for 0.1.1 release (#747)
I propose making a 0.1.1.0 release with the Hackage hsnoise fix and the few extra features we've accumulated so far.
2022-10-14 11:09:53 +00:00
Brent Yorgey
58ff215480
upgrade to hsnoise-0.0.3 (#746)
Closes #745.
2022-10-13 20:48:56 +00:00
Brent Yorgey
03509d7ae8 fix Haddock typo 2022-10-12 15:07:10 -05:00
Tamas Zsar
727a5b26b3
Handle Ctrl-D in REPL and trigger toggling Quit Modal (#743)
Implements #345 

When Ctrl-D is received by `handleREPLEvent`, it checks if the prompt is empty (for both `CmdPrompt` and `SearchPrompt` cases). If it is empty, it calls `toggleModal`.

I'm new to Haskell in general, so if there's a better way to do this, please let me know.
2022-10-12 18:56:11 +00:00
Ondřej Šebek
4122ea5207
Add a note about installing fourmolu (#744)
- note how to install Fourmolu and run it from shell
- refactor the conventions to use subsections for easier readability
- simplify restyled arguments for Fourmolu 0.4
2022-10-12 18:23:05 +00:00
Ondřej Šebek
a7aceec9c4
Add blank world (#741)
- closes #740
2022-10-11 01:38:52 +02:00
Valentin Golev
5085f710b3
Persist the type of the last expression in the REPL UI (#733)
- adds `PolyUnit` pattern (just seemed useful?)
- persists the last type/value into the `REPLDone (Maybe (Polytype, Value))` constructor
    - `value` is not needed right now, but I'm thinking about using it for #304
    - I'm also considering if pretty-printing the last value in that cozy corner could also be a good idea
- notion of the "active" type (last or currently-executing) and the corresponding `Getter`: `replActiveType`
- show this active type in the REPL UI (fixes #692)
2022-10-07 12:10:37 +00:00
Ondřej Šebek
e1b4733f66 Bump VSCode plugin version 2022-10-06 23:18:10 +02:00
Brent Yorgey
4c793ccb85
final polishing of alpha release announcement blog post (#732) 2022-10-06 21:14:55 +00:00
Ondřej Šebek
5fad2d9a91 VSCode 0.0.7 release 2022-10-06 23:11:41 +02:00
Brent Yorgey
1731b9e873 0.1.0.1 bugfix release
Also rename `data.zip` to `swarm-data.zip`
2022-10-06 14:19:55 -05:00
Ondřej Šebek
49c4405543
Run data files (#730)
- add fallback to the swarm data directory when the run file is not found
2022-10-06 19:03:37 +00:00
Ondřej Šebek
11b8ac76a5 Fix version check when there is no GitInfo 2022-10-06 19:52:16 +02:00
Ondřej Šebek
7097b2558d
Add release badges (#725) 2022-10-06 16:59:28 +00:00
Ondřej Šebek
53b169eb07
Release version 0.1.0.0 (#727)
- bump Swarm version in Cabal
- write CHANGELOG for the first release
2022-10-06 16:39:02 +00:00
Brent Yorgey
afffe95f76
Update README with more explicit instructions about installation (#722) 2022-10-06 16:26:24 +00:00
Brent Yorgey
ce14f03d20
handle panel shortcuts before modal event handler (#728)
This way, shortcuts like M-e, M-r, etc. work even when a modal dialog is open.  Closes #723.
2022-10-06 16:25:40 +00:00
Ondřej Šebek
3fcc2bda5f
Refactor move tutorial using split and whoami (#724) 2022-10-06 15:30:41 +00:00
Ondřej Šebek
73a8784aba
Add split and text length functions (#720)
- add `split: int -> text -> (text * text)`
- add `chars: text -> int`
- test using property tests
2022-10-06 11:23:15 +00:00
Ondřej Šebek
e57743da91
Add release action (#716)
- create the release on pushed PVP-style tag
- publish the binary, zipped data and license to the release
- publish to Hackage
- closes #673
2022-10-05 23:25:29 +00:00
Ondřej Šebek
3324cf1f0c
Make multistep move tutorial (#708)
The goal is to make the move tutorial more interesting, by using multiple objectives in sequence:

- _move twice_ (the current **Moving, part 1**) teaches the `move` command
- _move six times_ (**new**) will teach about using <kbd>↑</kbd> to get previous commands in REPL and chaining with `;`
- _turn and move_ (part of the current **Moving, part 2**) teaches the `turn` command and `left`/`right`
- _repeat_ (part of the current **Moving, part 2**) will let the player enjoy reusing previous commands

The map of the next part will be revealed (🪄 🧙) upon fulfilling the objective.
```
+--+
|> |
+--+
```
move seven times:
```
+--+------+
| >       |
+--+------+
```
turn and move:
```
       +--+
       |  |
       +  |
       |  |
       |  |
+--+---+  +
|        >|
+--+------+
```
repeat:
```
+---------+
|         |
|  +------+
|  |
|  |
|  +---+--+
|        ^|
+------+  |
       |  |
       |  |
+--+---+  +
|         |
+--+------+
```

---
<sup>The number of moves and the shape itself is subject to change. 😉 </sup>
2022-10-05 23:25:20 +00:00
Brent Yorgey
7729369d50 some updates to README and COMMUNITY 2022-10-05 17:52:52 -05:00
Ondřej Šebek
956dcb9ecf Fix default robot direction
I am not sure what it was doing, but it was not what
I expected. Now it should accept missing dir field.
2022-10-05 21:37:51 +02:00
Brent Yorgey
faad903863
Add author (optional) and version (required) fields to scenarios (#719)
Closes #611 .
2022-10-05 18:01:32 +00:00
Brent Yorgey
871e68b38f mention external editors in def Tutorial challenge 2022-10-04 07:08:31 -05:00
Brent Yorgey
af6cb9b8d1 fix typo 2022-10-04 07:03:06 -05:00
Brent Yorgey
553723b83e the base now faces north by default 2022-10-03 21:22:51 -05:00
Ondřej Šebek
88eee0aaab
Rename the bug tag 2022-10-03 08:36:35 +02:00
Brent Yorgey
ffd94792cf
set up config for issue template chooser, with link to COMMUNITY (#718) 2022-10-02 23:40:38 +00:00
Brent Yorgey
5fb85328b0 better tutorial/log screenshot 2022-10-02 15:51:30 -05:00
Brent Yorgey
e58c43e16c put some screenshots in alpha release blog post 2022-10-02 15:45:28 -05:00
Ondřej Šebek
0d0cd91208
Catch release query errors (#714)
- catch `HttpException` thrown when the query to GitHub API fails
- refactor the version error handling
2022-10-02 07:11:57 +00:00
Ondřej Šebek
e13dced169
Fallback to XDG data directory (#678)
- when `datadir` is not available, try using the XDG data directory

This way the game can be installed as an executable and data files unpacked to  `~/.local/share/swarm/data`.
Notice that the XDG data folder is  `~/.local/share/swarm`; inside it is the unpacked `data`.

The alternative approach is to use the environment variable `swarm_datadir` and set that to the unpacked data folder.
That works (even after this change) but is not very beginner friendly.

Ideally, we would like to set this in Cabal when building executable, for example to `/usr/share/swarm/<version>`.
Reading through haskell/cabal#5997, it looks like that is not supported.
2022-10-01 20:40:56 +00:00
Ondřej Šebek
559a3450bd
Allow multiple robots in palette (#711)
- support specifying multiple robots in a cell
- add a test with multiple robots revealing new rooms
  - add T shaped walls
- closes #710
2022-10-01 15:26:05 +00:00