2020-09-01 04:54:39 +03:00
|
|
|
:: launch [landscape]:
|
|
|
|
::
|
|
|
|
:: registers Landscape (and third party) applications, tiles
|
|
|
|
::
|
2020-05-20 22:12:53 +03:00
|
|
|
/+ store=launch-store, default-agent, dbug
|
2019-11-21 02:39:46 +03:00
|
|
|
|%
|
2020-05-07 03:42:23 +03:00
|
|
|
+$ card card:agent:gall
|
2019-11-21 02:39:46 +03:00
|
|
|
+$ versioned-state
|
2020-05-05 20:10:58 +03:00
|
|
|
$% [%0 *]
|
|
|
|
[%1 *]
|
|
|
|
[%2 *]
|
|
|
|
[%3 *]
|
|
|
|
[%4 state-zero]
|
2020-09-25 03:44:24 +03:00
|
|
|
[%5 state-zero]
|
2020-11-09 22:27:41 +03:00
|
|
|
[%6 state-zero]
|
2019-11-21 02:39:46 +03:00
|
|
|
==
|
2020-05-06 01:27:39 +03:00
|
|
|
::
|
2019-11-21 02:39:46 +03:00
|
|
|
+$ state-zero
|
2020-05-20 22:12:53 +03:00
|
|
|
$: =tiles:store
|
|
|
|
=tile-ordering:store
|
|
|
|
first-time=?
|
2020-03-20 22:06:10 +03:00
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
--
|
|
|
|
::
|
2020-11-09 22:27:41 +03:00
|
|
|
=| [%6 state-zero]
|
2019-11-21 02:39:46 +03:00
|
|
|
=* state -
|
2020-03-12 03:33:48 +03:00
|
|
|
%- agent:dbug
|
2019-11-21 02:39:46 +03:00
|
|
|
^- agent:gall
|
2020-05-07 03:42:23 +03:00
|
|
|
|_ =bowl:gall
|
2019-11-21 02:39:46 +03:00
|
|
|
+* this .
|
2020-05-07 03:42:23 +03:00
|
|
|
def ~(. (default-agent this %|) bowl)
|
2020-05-05 20:10:58 +03:00
|
|
|
::
|
2019-11-21 02:39:46 +03:00
|
|
|
++ on-init
|
|
|
|
^- (quip card _this)
|
2020-05-07 03:42:23 +03:00
|
|
|
=/ new-state *state-zero
|
|
|
|
=. new-state
|
|
|
|
%_ new-state
|
|
|
|
tiles
|
2020-05-20 22:12:53 +03:00
|
|
|
%- ~(gas by *tiles:store)
|
2020-11-09 22:27:41 +03:00
|
|
|
%+ turn `(list term)`[%weather %clock %term ~]
|
2020-05-07 03:42:23 +03:00
|
|
|
|= =term
|
|
|
|
:- term
|
2020-05-20 22:12:53 +03:00
|
|
|
^- tile:store
|
2020-11-09 22:27:41 +03:00
|
|
|
?+ term [[%custom ~] %.y]
|
|
|
|
%term [[%basic 'Terminal' '/~landscape/img/term.png' '/~term'] %.y]
|
2020-05-07 03:42:23 +03:00
|
|
|
==
|
2020-11-09 22:27:41 +03:00
|
|
|
tile-ordering [%weather %clock %term ~]
|
2020-05-07 03:42:23 +03:00
|
|
|
==
|
2020-11-09 22:27:41 +03:00
|
|
|
[~ this(state [%6 new-state])]
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
2020-03-20 22:06:10 +03:00
|
|
|
^- (quip card _this)
|
|
|
|
=/ old-state !<(versioned-state old)
|
2020-11-09 22:27:41 +03:00
|
|
|
=| cards=(list card)
|
|
|
|
|- ^- (quip card _this)
|
|
|
|
?: ?=(%6 -.old-state)
|
|
|
|
[cards this(state old-state)]
|
2020-09-30 16:48:33 +03:00
|
|
|
?: ?=(%5 -.old-state)
|
2020-11-09 22:27:41 +03:00
|
|
|
:: replace %dojo with %term
|
|
|
|
::
|
|
|
|
=. tiles.old-state
|
|
|
|
%+ ~(put by (~(del by tiles.old-state) %dojo))
|
|
|
|
%term
|
|
|
|
:_ is-shown:(~(gut by tiles.old-state) %dojo *tile:store)
|
|
|
|
[%basic 'Terminal' '/~landscape/img/term.png' '/~term']
|
|
|
|
=. tile-ordering.old-state
|
|
|
|
%+ turn tile-ordering.old-state
|
|
|
|
|=(t=term ?:(=(%dojo t) %term t))
|
|
|
|
$(old-state [%6 +.old-state])
|
2020-09-30 16:48:33 +03:00
|
|
|
?: ?=(%4 -.old-state)
|
2020-11-09 22:27:41 +03:00
|
|
|
=. cards
|
|
|
|
%+ snoc cards
|
|
|
|
[%pass / %arvo %e %disconnect [~ /]]
|
2020-09-25 03:44:24 +03:00
|
|
|
=. tiles.old-state
|
|
|
|
(~(del by tiles.old-state) %chat)
|
|
|
|
=. tiles.old-state
|
|
|
|
(~(del by tiles.old-state) %publish)
|
|
|
|
=. tiles.old-state
|
|
|
|
(~(del by tiles.old-state) %links)
|
|
|
|
=. tile-ordering.old-state
|
|
|
|
(skip tile-ordering.old-state |=(=term ?=(?(%links %chat %publish) term)))
|
2020-11-09 22:27:41 +03:00
|
|
|
$(old-state [%5 +.old-state])
|
2020-05-07 03:42:23 +03:00
|
|
|
=/ new-state *state-zero
|
|
|
|
=. new-state
|
|
|
|
%_ new-state
|
|
|
|
tiles
|
2020-05-20 22:12:53 +03:00
|
|
|
%- ~(gas by *tiles:store)
|
2020-09-25 03:44:24 +03:00
|
|
|
%+ turn `(list term)`[%weather %clock %dojo ~]
|
2020-05-07 03:42:23 +03:00
|
|
|
|= =term
|
|
|
|
:- term
|
2020-05-20 22:12:53 +03:00
|
|
|
^- tile:store
|
2020-05-07 03:42:23 +03:00
|
|
|
?+ term [[%custom ~] %.y]
|
|
|
|
%dojo [[%basic 'Dojo' '/~landscape/img/Dojo.png' '/~dojo'] %.y]
|
|
|
|
==
|
2020-09-25 03:44:24 +03:00
|
|
|
tile-ordering [%weather %clock %dojo ~]
|
2020-05-07 03:42:23 +03:00
|
|
|
==
|
2020-11-09 22:27:41 +03:00
|
|
|
%_ $
|
|
|
|
old-state [%5 new-state]
|
|
|
|
::
|
|
|
|
cards
|
|
|
|
%+ welp
|
|
|
|
:~ [%pass / %arvo %e %disconnect [~ /]]
|
|
|
|
:* %pass /srv %agent [our.bowl %file-server]
|
|
|
|
%poke %file-server-action
|
|
|
|
!>([%serve-dir / /app/landscape %.n %.y])
|
|
|
|
==
|
|
|
|
==
|
|
|
|
%+ turn ~(tap by wex.bowl)
|
|
|
|
|= [[=wire =ship =term] *]
|
|
|
|
^- card
|
|
|
|
[%pass wire %agent [ship term] %leave ~]
|
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-poke
|
2020-05-07 03:42:23 +03:00
|
|
|
|= [=mark =vase]
|
2019-11-21 02:39:46 +03:00
|
|
|
^- (quip card _this)
|
2020-05-07 03:42:23 +03:00
|
|
|
|^
|
2020-05-28 01:56:20 +03:00
|
|
|
?> (team:title our.bowl src.bowl)
|
2020-05-07 03:42:23 +03:00
|
|
|
=^ cards state
|
|
|
|
?+ mark (on-poke:def mark vase)
|
2020-05-20 22:12:53 +03:00
|
|
|
%launch-action (poke-action !<(action:store vase))
|
2020-05-07 03:42:23 +03:00
|
|
|
==
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ poke-action
|
2020-05-20 22:12:53 +03:00
|
|
|
|= =action:store
|
2020-05-07 03:42:23 +03:00
|
|
|
^- (quip card _state)
|
|
|
|
?- -.action
|
|
|
|
%add
|
|
|
|
?< (~(has by tiles) name.action)
|
|
|
|
:- (give [/all /keys ~] action)
|
|
|
|
%_ state
|
|
|
|
tiles (~(put by tiles) name.action tile.action)
|
|
|
|
tile-ordering (snoc tile-ordering name.action)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%remove
|
|
|
|
:- (give [/all /keys ~] action)
|
|
|
|
%_ state
|
|
|
|
tiles (~(del by tiles) name.action)
|
|
|
|
tile-ordering
|
|
|
|
%+ skip tile-ordering
|
|
|
|
|=(=term =(term name.action))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%change-order
|
|
|
|
?> =(~(key by tiles) (silt tile-ordering.action))
|
|
|
|
:- (give [/all]~ action)
|
|
|
|
state(tile-ordering tile-ordering.action)
|
|
|
|
::
|
|
|
|
%change-is-shown
|
2020-05-20 22:12:53 +03:00
|
|
|
=/ =tile:store (~(got by tiles) name.action)
|
2020-05-07 03:42:23 +03:00
|
|
|
?. =(is-shown.tile is-shown.action) [~ state]
|
|
|
|
=. is-shown.tile is-shown.action
|
|
|
|
:- (give [/all]~ action)
|
|
|
|
state(tiles (~(put by tiles) name.action tile))
|
2020-05-20 22:12:53 +03:00
|
|
|
::
|
|
|
|
%change-first-time
|
|
|
|
:- (give [/all]~ action)
|
|
|
|
state(first-time first-time.action)
|
2020-05-07 03:42:23 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ give
|
2020-05-20 22:12:53 +03:00
|
|
|
|= [paths=(list path) =update:store]
|
2020-05-07 03:42:23 +03:00
|
|
|
^- (list card)
|
|
|
|
[%give %fact paths [%launch-update !>(update)]]~
|
|
|
|
--
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-watch
|
2020-05-05 20:10:58 +03:00
|
|
|
|= =path
|
2019-11-21 02:39:46 +03:00
|
|
|
^- (quip card _this)
|
2020-05-07 03:42:23 +03:00
|
|
|
|^
|
|
|
|
?> (team:title our.bowl src.bowl)
|
|
|
|
=/ cards=(list card)
|
2020-05-20 22:12:53 +03:00
|
|
|
?+ path (on-watch:def path)
|
|
|
|
[%all ~] (give [%initial tiles tile-ordering first-time])
|
2020-05-07 03:42:23 +03:00
|
|
|
[%keys ~] (give [%keys ~(key by tiles)])
|
|
|
|
==
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ give
|
2020-05-20 22:12:53 +03:00
|
|
|
|= =update:store
|
2020-05-07 03:42:23 +03:00
|
|
|
^- (list card)
|
|
|
|
[%give %fact ~ [%launch-update !>(update)]]~
|
|
|
|
--
|
2020-05-06 01:27:39 +03:00
|
|
|
::
|
2020-05-20 22:12:53 +03:00
|
|
|
++ on-peek
|
|
|
|
|= =path
|
|
|
|
^- (unit (unit cage))
|
2020-08-19 21:46:52 +03:00
|
|
|
?. (team:title our.bowl src.bowl) ~
|
|
|
|
?+ path [~ ~]
|
|
|
|
[%x %tiles ~] ``noun+!>([tiles tile-ordering])
|
2020-08-19 03:25:51 +03:00
|
|
|
[%x %first-time ~] ``noun+!>(first-time)
|
2020-08-19 21:46:52 +03:00
|
|
|
[%x %keys ~] ``noun+!>(~(key by tiles))
|
2020-05-20 22:12:53 +03:00
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [wir=wire sin=sign-arvo]
|
|
|
|
^- (quip card:agent:gall _this)
|
2020-05-05 20:10:58 +03:00
|
|
|
?: ?=(%bound +<.sin) [~ this]
|
|
|
|
(on-arvo:def wir sin)
|
2020-05-06 01:27:39 +03:00
|
|
|
::
|
2020-05-05 20:10:58 +03:00
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-fail on-fail:def
|
2019-11-21 02:39:46 +03:00
|
|
|
--
|