Skip to content

Commit

Permalink
style: prettier proseWrap markdown
Browse files Browse the repository at this point in the history
Couldn't read this shit
  • Loading branch information
tsa96 committed Nov 15, 2024
1 parent a91c839 commit 4dc75b2
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 71 deletions.
12 changes: 8 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ Closes momentum-mod/game/issues/<!--(issue number here)-->

### Checks

- [ ] **I have thoroughly tested all of the code I have modified/added/removed to ensure something else did not break**
- [ ] I have followed [semantic commit messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) e.g. `feat: Add foo`, `chore: Update bar`, etc...
- [ ] **I have thoroughly tested all of the code I have modified/added/removed to ensure something else did not
break**
- [ ] I have followed [semantic commit messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716)
e.g. `feat: Add foo`, `chore: Update bar`, etc...
- [ ] My branch has a clear history of changes that can be easy to follow when being reviewed commit-by-commit
- [ ] My branch is functionally complete; the only changes to be done will be those potentially requested in code review
- [ ] My branch is functionally complete; the only changes to be done will be those potentially requested in code
review
- [ ] All changes requested in review have been `fixup`ed into my original commits.
- [ ] Fully tokenized all my strings (no hardcoded English strings!!) and supplied [bulk JSON strings](https://docs.momentum-mod.org/guide/localization/#bulk-adding-terms) below
- [ ] Fully tokenized all my strings (no hardcoded English strings!!) and supplied
[bulk JSON strings](https://docs.momentum-mod.org/guide/localization/#bulk-adding-terms) below

### POEditor JSON Strings (if needed)

Expand Down
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"arrowParens": "always",
"endOfLine": "lf",
"bracketSpacing": true,
"bracketSameLine": false
"bracketSameLine": false,
"proseWrap": "always"
}
13 changes: 10 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Copyright 2022 Momentum Team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63 changes: 47 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,49 @@
# Structure

The repository primarily consists of XML, SCSS and JavaScript/TypeScript files. It also includes all icons and various images and videos used by the UI.
The repository primarily consists of XML, SCSS and JavaScript/TypeScript files. It also includes all icons and various
images and videos used by the UI.

For a general overview of Panorama, see the [VDC page](https://developer.valvesoftware.com/wiki/Panorama).

## XML

XML, found in the `layout/` folder, is used to describe the overall _layout_ of all panels. These panels can then be manipulated by JavaScript and C++ code.
XML, found in the `layout/` folder, is used to describe the overall _layout_ of all panels. These panels can then be
manipulated by JavaScript and C++ code.

## CSS/SCSS

Panorama uses a variant of CSS for styling. Note that it does _not_ conform to the standard CSS spec, differing majorly in how it handles things like flow and scaling. A complete list of CSS properties can be found using `dump_panorama_css_properties markdown` in the ingame console (you will need to launch with -condebug and read the console.log output). The list is also kept on the [VDC](https://developer.valvesoftware.com/wiki/CSGO_Panorama_CSS_Properties) though this may not be fully up to date.
Panorama uses a variant of CSS for styling. Note that it does _not_ conform to the standard CSS spec, differing majorly
in how it handles things like flow and scaling. A complete list of CSS properties can be found using
`dump_panorama_css_properties markdown` in the ingame console (you will need to launch with -condebug and read the
console.log output). The list is also kept on the
[VDC](https://developer.valvesoftware.com/wiki/CSGO_Panorama_CSS_Properties) though this may not be fully up to date.

Momentum uses the [Sass](https://sass-lang.com/) preprocessor for all styling. This is compiled by the game itself on first load then cached for future loads if unchanged. Developers may therefore change any Sass styling and it will be recompiled on next launch or reload with `panorama_reload`, which is by default bound to F7.
Momentum uses the [Sass](https://sass-lang.com/) preprocessor for all styling. This is compiled by the game itself on
first load then cached for future loads if unchanged. Developers may therefore change any Sass styling and it will be
recompiled on next launch or reload with `panorama_reload`, which is by default bound to F7.

The Sass module structure, found in `styles/`, is quite conventional, with all top-level modules (besides `abstract/`) handled by `main.scss`. Any XML file then needs only include `main.scss` to access the entirety of the styling. We use the [BEM](http://getbem.com/) (Block Element Modifier) naming scheme for all classes, besides those that are referenced in C++ code, which use UpperCamelCase.
The Sass module structure, found in `styles/`, is quite conventional, with all top-level modules (besides `abstract/`)
handled by `main.scss`. Any XML file then needs only include `main.scss` to access the entirety of the styling. We use
the [BEM](http://getbem.com/) (Block Element Modifier) naming scheme for all classes, besides those that are referenced
in C++ code, which use UpperCamelCase.

## JavaScript/TypeScript

Panorama uses the [V8 JavaScript engine](https://v8.dev) to interpret and run the JavaScript files, found in `scripts/`, at runtime, which are included in XML files within `<scripts>` tags (similar to regular web development).
Panorama uses the [V8 JavaScript engine](https://v8.dev) to interpret and run the JavaScript files, found in `scripts/`,
at runtime, which are included in XML files within `<scripts>` tags (similar to regular web development).

We also support TypeScript - any `.ts` file `scripts/` are compiled to corresponding JavaScript files in `script_dist/`, whilst `.js` are just copied over. Note that we don't use any kind of import/module/bundling system as it's not supported in engine code. Instead we just declare the same XML `<scripts>` tags and scripts get the same scope (yeah, old school). Use `/// <reference path="foo.ts" />` to keep TypeScript happy.
We also support TypeScript - any `.ts` file `scripts/` are compiled to corresponding JavaScript files in `script_dist/`,
whilst `.js` are just copied over. Note that we don't use any kind of import/module/bundling system as it's not
supported in engine code. Instead we just declare the same XML `<scripts>` tags and scripts get the same scope (yeah,
old school). Use `/// <reference path="foo.ts" />` to keep TypeScript happy.

JavaScript communicates with the game via events and APIs exposed by the game. The [pano-typed](https://github.com/StrataSource/pano-typed) package (submoduled in `scripts/types/`) which provides types and documentation for the exposed APIs and events. These are updated manually, and some things may be missing. A full list of which can be found by running `dump_panorama_events markdown` and `dump_panorama_js_scopes markdown` in-game (best to the game in `-condebug` and read `momentum/console.log`). Feel free to add any APIs/events to the `pano-typed` package! If anything is missing completely, please contact us in Discord and we can check in engine code for you.
JavaScript communicates with the game via events and APIs exposed by the game. The
[pano-typed](https://github.com/StrataSource/pano-typed) package (submoduled in `scripts/types/`) which provides types
and documentation for the exposed APIs and events. These are updated manually, and some things may be missing. A full
list of which can be found by running `dump_panorama_events markdown` and `dump_panorama_js_scopes markdown` in-game
(best to the game in `-condebug` and read `momentum/console.log`). Feel free to add any APIs/events to the `pano-typed`
package! If anything is missing completely, please contact us in Discord and we can check in engine code for you.

# Setup

Expand All @@ -37,11 +57,14 @@ JavaScript communicates with the game via events and APIs exposed by the game. T

#### Recommendations

We highly suggest using @braem's [panorama-languages-support](https://marketplace.visualstudio.com/items?itemName=braemie.panorama-css) VSCode plugin for language support for Panorama's version of CSS
We highly suggest using @braem's
[panorama-languages-support](https://marketplace.visualstudio.com/items?itemName=braemie.panorama-css) VSCode plugin for
language support for Panorama's version of CSS

### Guide

The easiest way to develop for Momentum Mod Panorama is to fork this repository and mount it in your `momentum/custom/` folder, for example:
The easiest way to develop for Momentum Mod Panorama is to fork this repository and mount it in your `momentum/custom/`
folder, for example:

```bash
cd <Your Steam Momentum Mod or Momentum Mod Playtest install location>\momentum\custom\
Expand All @@ -52,10 +75,11 @@ git clone https://github.com/<your github account>/panorama.git

You should end up with `momentum/custom/PanoramaDev/panorama` containing the contents of this repository.

This will be mounted on game launch and override the files in your `momentum/panorama/` folder. To avoid any overlaps (e.g. if your branch renames or moves a file, the original file will still be mounted), you may want to temporarily rename your `momentum/panorama/` folder. (_NOTE: you'll need to do this after each Momentum Mod Steam update!_)
This will be mounted on game launch and override the files in your `momentum/panorama/` folder. To avoid any overlaps
(e.g. if your branch renames or moves a file, the original file will still be mounted), you may want to temporarily
rename your `momentum/panorama/` folder. (_NOTE: you'll need to do this after each Momentum Mod Steam update!_)

Install [Node.js](https://nodejs.org/en/download/) if you don't have it
already, then in a terminal run:
Install [Node.js](https://nodejs.org/en/download/) if you don't have it already, then in a terminal run:

`npm install`

Expand All @@ -65,12 +89,19 @@ You will need to run:

`npm run build`

at least once to compile JS/TS scripts to JS, and after any changes to files in `scripts/`. Use watch mode if you want to compile on change with
at least once to compile JS/TS scripts to JS, and after any changes to files in `scripts/`. Use watch mode if you want
to compile on change with

`npm run watch`

# Contributing

Most of our larger systems and components require significant work with (closed-source) game code and thus requires licensed C++ access or working tandem licensed C++ developer. Our work until now has been done internally by the core team. For 0.9.1 and onwards, we have exposed enough events and APIs that non-team developers should be able to work on areas like HUD components (for an example of non-licensed HUD work, we recommend [`scripts/hud/cgaz.js`](scripts/hud/cgaz.js)). We will continue to expose data as we best see fit for custom panels.
Most of our larger systems and components require significant work with (closed-source) game code and thus requires
licensed C++ access or working tandem licensed C++ developer. Our work until now has been done internally by the core
team. For 0.9.1 and onwards, we have exposed enough events and APIs that non-team developers should be able to work on
areas like HUD components (for an example of non-licensed HUD work, we recommend
[`scripts/hud/cgaz.js`](scripts/hud/cgaz.js)). We will continue to expose data as we best see fit for custom panels.

Therefore, those looking to contribute should look for issues **NOT** marked with "Needs C++". We also greatly encourage you to check out the the #panorama channel in our [Discord](https://discord.gg/momentummod) - whilst Panorama itself is poorly documented, we are happy to help any potential contributors further there!
Therefore, those looking to contribute should look for issues **NOT** marked with "Needs C++". We also greatly encourage
you to check out the the #panorama channel in our [Discord](https://discord.gg/momentummod) - whilst Panorama itself is
poorly documented, we are happy to help any potential contributors further there!
Loading

0 comments on commit 4dc75b2

Please sign in to comment.