Skip to content

Commit 1bded06

Browse files
author
Frotty
committed
first stdlib package doc
1 parent a3b2adb commit 1bded06

File tree

8 files changed

+96
-17
lines changed

8 files changed

+96
-17
lines changed

Gemfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
source "https://rubygems.org"
22
ruby RUBY_VERSION
33

4-
gem "github-pages", group: :jekyll_plugins
5-
gem 'jekyll-seo-tag'
6-
gem 'jekyll-redirect-from'
7-
gem 'jekyll-sitemap'
8-
94
gem "jekyll", ">= 3.6.3"
10-
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
5+
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
6+
7+
group :jekyll_plugins do
8+
gem "github-pages"
9+
gem 'jekyll-seo-tag'
10+
gem 'jekyll-redirect-from'
11+
gem 'jekyll-sitemap'
12+
gem "jekyll-gist"
13+
end

Gemfile.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ GEM
3232
ffi (1.9.25-x86-mingw32)
3333
forwardable-extended (2.6.0)
3434
gemoji (3.0.0)
35-
github-pages (192)
35+
github-pages (193)
3636
activesupport (= 4.2.10)
3737
github-pages-health-check (= 1.8.1)
3838
jekyll (= 3.7.4)
3939
jekyll-avatar (= 0.6.0)
4040
jekyll-coffeescript (= 1.1.1)
4141
jekyll-commonmark-ghpages (= 0.1.5)
4242
jekyll-default-layout (= 0.1.4)
43-
jekyll-feed (= 0.10.0)
43+
jekyll-feed (= 0.11.0)
4444
jekyll-gist (= 1.5.0)
4545
jekyll-github-metadata (= 2.9.4)
4646
jekyll-mentions (= 1.4.1)
@@ -83,7 +83,7 @@ GEM
8383
octokit (~> 4.0)
8484
public_suffix (~> 2.0)
8585
typhoeus (~> 1.3)
86-
html-pipeline (2.9.0)
86+
html-pipeline (2.9.1)
8787
activesupport (>= 2)
8888
nokogiri (>= 1.4)
8989
http_parser.rb (0.6.0)
@@ -116,7 +116,7 @@ GEM
116116
rouge (~> 2)
117117
jekyll-default-layout (0.1.4)
118118
jekyll (~> 3.0)
119-
jekyll-feed (0.10.0)
119+
jekyll-feed (0.11.0)
120120
jekyll (~> 3.3)
121121
jekyll-gist (1.5.0)
122122
octokit (~> 4.2)
@@ -250,6 +250,7 @@ PLATFORMS
250250
DEPENDENCIES
251251
github-pages
252252
jekyll (>= 3.6.3)
253+
jekyll-gist
253254
jekyll-redirect-from
254255
jekyll-seo-tag
255256
jekyll-sitemap

_doc/manual/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Put spaces around binary operators (`a + b`).
8080

8181
Do not put spaces around unary operators (`a++`)
8282

83-
Put single spaces between control flow keywords (`if`, `switch`, `for` and `while`) and the following expression. Do not use parenthesis unless it improves the readability of big bool terms.
83+
Put single spaces between control flow keywords (`if`, `switch`, `for` and `while`) and the following expression. Do not use parenthesis unless it improves the readability of big terms.
8484

8585
Do not put a space before an opening parenthesis in a method declaration or method call.
8686

_doc/stdlib.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ color: pink
66
icon:
77
type: fa
88
name: fa-cubes
9-
tagline: Standard Library Documentation
10-
heading: Latest Posts
11-
navigation:
12-
- /blog/bestofthewurst8
9+
sections:
10+
- /stdlib/intro
1311
---

_doc/stdlib/closure_events.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Closure Events
3+
color: blue
4+
sections:
5+
- /stdlib/closures/event_listening
6+
---
7+
8+
**[SOURCE ON GITHUB](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/ClosureEvents.wurst)**
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Generic Events
3+
sections:
4+
- Intro
5+
- Generic events
6+
- Special events
7+
- Cast events
8+
---
9+
10+
### Intro
11+
12+
`ClosureEvents.wurst` is a generalized event listener wrapper around warcraft 3 events with closures as listeners.
13+
The usage of closures allows you to carry over data and save the listeners in a variable.
14+
15+
> Make sure to always use the EVENT_UNIT_**PLAYER** variants of the events for Closure events, even if it's just for a single unit. Instead use an appropriate version of .add() with unit argument
16+
17+
### Generic events
18+
19+
In most cases you will want to use the generic `EvenetListener.add(..)` api. A few examples:
20+
21+
```wurst
22+
EventListener.add(EVENT_PLAYER_UNIT_DEATH) ->
23+
<any unit death actions>
24+
25+
EventListener.add(someUnit, EVENT_PLAYER_UNIT_DEATH) ->
26+
<only 'someUnit' death actions>
27+
```
28+
29+
### Special events
30+
31+
The following events can also be used, but aren't of `EVENT_PLAYER_UNIT_*` type:
32+
33+
- EVENT_PLAYER_LEAVE
34+
- EVENT_UNIT_DAMAGED
35+
- EVENT_PLAYER_CHAT_FILTER
36+
- EVENT_PLAYER_ARROW_*
37+
38+
### Cast events
39+
40+
For cast events there exist comfort wrappers starting with `EventListener.on`. For example:
41+
42+
```wurst
43+
EventListener.onCast(MY_SPELL_ID) caster ->
44+
<some non target spell event for all units>
45+
46+
EventListener.onCast(myUnit, MY_SPELL_ID) caster ->
47+
<some non target spell for 'myUnit'>
48+
49+
EventListener.onPointCast(myUnit, MY_SPELL_ID) (caster, target) ->
50+
<actions for a point cast spell. 'target' is the vec2 target point>
51+
```

_doc/stdlib/intro.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: WurstScript Standard Library
3+
sections:
4+
- Intro
5+
- Overview
6+
---
7+
8+
### Intro
9+
10+
The WurstScript standard library provides a vast amount of useful packages to developers starting out with Wurst. Many commonly used data structures, wc3 specific utility packages, Object Editing and extension wrappers for the blizzard natives have been implemented, are unit tested and ready to use in production immediately.
11+
12+
### Overview
13+
14+
### *&nbsp;*{: .fa .fa-folder-open} Object Editing
15+
16+
### *&nbsp;*{: .fa .fa-folder-open} Closures
17+
18+
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;*{: .fa .fa-file} [Closure Events](stdlib/closure_events)

_sass/landing.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
}
1111

1212
.header-links-container {
13-
font-size: 24px;
13+
font-size: 21px;
1414
font-weight: 600;
1515

1616
& a {
1717
color: rgba(223, 252, 255, 0.75);
1818
text-decoration: none;
1919
transition: 0.3s;
2020
letter-spacing: 0.04em;
21-
font-size: 22px;
21+
font-size: 20px;
2222

2323
&:hover {
2424
color:white;

0 commit comments

Comments
 (0)