From 32b5594f09500664b677f4def9b048da4bc12ba9 Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:07:55 +0100 Subject: [PATCH 1/6] Added JetBrains IDE to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 804bb12..c8de261 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .sass-cache _site node_modules +.idea \ No newline at end of file From 71bb4c3a079a253fb2e39128ce7a2bbd2fa81ced Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:08:10 +0100 Subject: [PATCH 2/6] Added required webrick module to Gemfile --- Gemfile | 2 + Gemfile.lock | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 292 insertions(+) create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile index 5c41b36..96e1f8d 100644 --- a/Gemfile +++ b/Gemfile @@ -15,3 +15,5 @@ group :jekyll_plugins do gem "jekyll-include-cache" gem "jekyll-algolia" end + +gem "webrick", "~> 1.8" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..583f36d --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,290 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (3.2.22.5) + i18n (~> 0.6, >= 0.6.4) + multi_json (~> 1.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + algolia_html_extractor (2.6.4) + json (~> 2.0) + nokogiri (~> 1.10) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.23.7) + concurrent-ruby (1.2.0) + dnsruby (1.61.9) + simpleidn (~> 0.1) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) + eventmachine (1.2.7) + execjs (2.8.1) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + ffi (1.15.5-x64-mingw-ucrt) + filesize (0.2.0) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (227) + github-pages-health-check (= 1.17.9) + jekyll (= 3.9.2) + jekyll-avatar (= 0.7.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.2.0) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.15.1) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.13.0) + jekyll-include-cache (= 0.2.1) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.3) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.8.0) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.12.0) + kramdown (= 2.3.2) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.3) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.13.6, < 2.0) + rouge (= 3.26.0) + terminal-table (~> 1.4) + github-pages-health-check (1.17.9) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (>= 3.0, < 5.0) + typhoeus (~> 1.3) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.8.0) + httpclient (2.8.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.9.2) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-algolia (1.7.1) + algolia_html_extractor (~> 2.6) + algoliasearch (~> 1.26) + filesize (~> 0.1) + jekyll (>= 3.6, < 5.0) + json (~> 2.0) + nokogiri (~> 1.6) + progressbar (~> 1.9) + verbal_expressions (~> 0.1.5) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.2.0) + commonmarker (~> 0.23.4) + jekyll (~> 3.9.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 4.0) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.15.1) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) + octokit (~> 4.0, != 4.4.0) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-mentions (1.6.0) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.6.0) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.12.0) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + json (2.6.3) + kramdown (2.3.2) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + multi_json (1.15.0) + nokogiri (1.14.1-x64-mingw-ucrt) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + progressbar (1.11.0) + public_suffix (4.0.7) + racc (1.6.2) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.5) + rouge (3.26.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + simpleidn (0.2.1) + unf (~> 0.1.4) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + tzinfo-data (1.2022.7) + tzinfo (>= 1.0.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2-x64-mingw-ucrt) + unicode-display_width (1.8.0) + verbal_expressions (0.1.5) + wdm (0.1.1) + webrick (1.8.1) + +PLATFORMS + x64-mingw-ucrt + +DEPENDENCIES + github-pages + jekyll-algolia + jekyll-feed + jekyll-gist + jekyll-include-cache + jekyll-paginate + jekyll-sitemap + jemoji + tzinfo-data + wdm (~> 0.1.0) + webrick (~> 1.8) + +BUNDLED WITH + 2.3.26 From 2c42222f7c6ce4f8998abbbdc48e14e339013fe9 Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:08:22 +0100 Subject: [PATCH 3/6] Added dev setup in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..524a82a --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# ChaosInitiative Wiki + +## Prerequisites +- Ruby 3 + +## Setup for development +- Run ``bundle install`` to install all dependencies +- Run ``bundle exec jekyll serve`` to start a watching dev server \ No newline at end of file From 796c035b934a1900c4ff6ffd7595b70a140ae11a Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:08:42 +0100 Subject: [PATCH 4/6] Moved label to Controls subfolder --- docs/Panorama/{ => Controls}/Label.md | 7 ++++--- docs/Panorama/controls.md | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) rename docs/Panorama/{ => Controls}/Label.md (93%) create mode 100644 docs/Panorama/controls.md diff --git a/docs/Panorama/Label.md b/docs/Panorama/Controls/Label.md similarity index 93% rename from docs/Panorama/Label.md rename to docs/Panorama/Controls/Label.md index 5d9b1ff..f86a14c 100644 --- a/docs/Panorama/Label.md +++ b/docs/Panorama/Controls/Label.md @@ -1,10 +1,11 @@ --- layout: default -title: "Control: Label" -parent: Panorama +title: "Label" +parent: Controls +grand_parent: Panorama --- -# Control: Label +# Label The Label control is a simple text display. diff --git a/docs/Panorama/controls.md b/docs/Panorama/controls.md new file mode 100644 index 0000000..ded7dc5 --- /dev/null +++ b/docs/Panorama/controls.md @@ -0,0 +1,12 @@ +--- +layout: default +title: Controls +parent: Panorama +nav_order: 999 +has_children: true +permalink: docs/Panorama/Controls +--- + +# Controls + +Documentation to specific controls in panorama. From 4c959128410eb916735435d0d7c1f23eed5939ad Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:08:54 +0100 Subject: [PATCH 5/6] Added reference to the template repo --- docs/Panorama/template.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/Panorama/template.md diff --git a/docs/Panorama/template.md b/docs/Panorama/template.md new file mode 100644 index 0000000..68b413f --- /dev/null +++ b/docs/Panorama/template.md @@ -0,0 +1,9 @@ +--- +layout: default +title: Template +parent: Panorama +nav_order: 2 +--- + +# Template +A boilerplate template for panorama UIs is available on [GitHub](https://github.com/ChaosInitiative/panorama-template). It provides a simple base with almost no styling. \ No newline at end of file From c9a51fffc81c0688be34050e10721420057507e2 Mon Sep 17 00:00:00 2001 From: Laura Sofia Heimann Date: Tue, 31 Jan 2023 21:09:59 +0100 Subject: [PATCH 6/6] Added documentation for the event system --- docs/Panorama/event-system.md | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 docs/Panorama/event-system.md diff --git a/docs/Panorama/event-system.md b/docs/Panorama/event-system.md new file mode 100644 index 0000000..159dc6a --- /dev/null +++ b/docs/Panorama/event-system.md @@ -0,0 +1,84 @@ +--- +layout: default +title: Event System +parent: Panorama +nav_order: 100 +--- + +# Event System +Panorama uses an event system to communicate between the engine and panels but also between panels. They can be defined and subscribed to via Javascript. + +## Defining Events +``` +**TODO** What is the difference between these two functions +``` +You can define your own global events within the ``scripts/util/event-definition.js`` file by calling the ``$.DefineEvent`` and ``$.DefinePanelEvent`` functions. + +### Example +```js +$.DefineEvent("LoadTutorialMap", 0); // Event "LoadTutorialMap" with no arguments +$.DefineEvent("LoadStoryMap", 1); // Event "LoadStoryMap" with one argument +``` + +## Subscribing to Events +Any panel can subscribe to an event by calling ``$.RegisterForUnhandledEvent`` or ``$.RegisterEventHandler`` within JavaScript. These functions will be called, when the event is fired. Some events may include additional parameters, which will be forwarded to your function. + +#### $.RegisterForUnhandledEvent(``EVENT_NAME``, ``CALLBACK``) +This function can be used to subscribe to events. + +#### $.RegisterEventHandler(``EVENT_NAME``, ``CONTEXT``, ``CALLBACK``) +This function can be used to subscribe to events within a specific context. This context can be another panel or its own panel by calling ``$.GetContextPanel()``. + +### Example +```js +class MainMenu { + static { + $.RegisterForUnhandledEvent("ChaosShowPauseMenu", this.onShowPauseMenu.bind(this)); + + // Custom Event with a parameter + $.DefineEvent("LoadMap", 1); + $.RegisterForUnhandledEvent("LoadMap", this.playMap.bind(this)); + } + + static onShowPauseMenu() { + // ... + } + static playMap(map) { + // [map] contains the parameters value + } +} +``` + +## Dispatching Events +Events can be dispached via JavaScript by calling ``$.DispatchEvent``. + +### Example +```js +$.DispatchEvent("LoadTutorialMap"); // Event "LoadTutorialMap" with no arguments +$.DispatchEvent("LoadStoryMap", "sp_a1_intro1"); // Event "LoadStoryMap" with one argument +``` + +## Global Events +Global events are events that are defined on an engine level. These events are usually prefixed by ``Chaos`` and are fired at various engine related events. + +### Event Reference + +| Event Name | Parameters | Description | +|----------------------------------|------------|-------------------------------------------------------------------| +| `ChaosShowMainMenu` | *None* | Shows the main menu. | +| `ChaosHideMainMenu` | *None* | Hides the main menu. | +| `ChaosShowPauseMenu` | *None* | Shows the pause menu. | +| `ChaosHidePauseMenu` | *None* | Hides the pause menu. | +| | | | +| `ChaosMainMenuPauseGame` | *None* | Pauses the game. | +| `ChaosMainMenuResumeGame` | *None* | Resumes the game if paused. | +| | | | +| `ChaosShowIntroMovie` | *None* | Display the intro movie. | +| `ChaosHideIntroMovie` | *None* | Hides the intro movie (Can also be used to skip the intro movie). | +| | | | +| `ChaosVideoSettingsInit` | *None* | Initialized video settings | +| `ChaosVideoSettingsResetDefault` | *None* | Resets the video settings to default | +| `ChaosApplyVideoSettings` | *None* | Applies the video settings | + +## Further documentation +[Panorama/Events on Valve Developer Community](https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Panorama/Events) \ No newline at end of file