Skip to content

Commit 43f9974

Browse files
authored
Merge pull request ModDota#5 from ModDota/upgrades
Upgrades
2 parents d720bdf + 8c6e6dc commit 43f9974

File tree

25 files changed

+630
-337
lines changed

25 files changed

+630
-337
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules
22

33
/content/panorama/scripts/custom_game/**/*.js
44
/game/scripts/vscripts/**/*.lua
5-
!/game/scripts/vscripts/lib/timers.lua
65

76
# Dota 2 stuff
87
*.bin

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"css.lint.unknownProperties": "ignore"
3+
}

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# ModDota template
22

3-
A template for Dota 2 Custom Games built with modern technologies. It includes
3+
A template for Dota 2 Custom Games built with modern technologies.
4+
5+
[This tutorial](https://moddota.com/scripting/Typescript/typescript-introduction/) explains how to set up and use the template.
6+
7+
The template includes:
48

59
- [TypeScript for Panorama](https://moddota.com/panorama/introduction-to-panorama-ui-with-typescript)
610
- [TypeScript for VScripts](https://typescripttolua.github.io/)
@@ -15,6 +19,21 @@ A template for Dota 2 Custom Games built with modern technologies. It includes
1519

1620
After that you can press `Ctrl+Shift+B` in VSCode or run `npm run dev` command in terminal to compile your code and watch for changes.
1721

22+
## Contents:
23+
24+
* **[src/common]:** TypeScript .d.ts type declaration files with types that can be shared between Panorama and VScripts
25+
* **[src/vscripts]:** TypeScript code for Dota addon (Lua) vscripts. Compiles lua to game/scripts/vscripts.
26+
* **[src/panorama]:** TypeScript code for panorama UI. Compiles js to content/panorama/scripts/custom_game
27+
28+
--
29+
30+
* **[game/*]:** Dota game directory containing files such as npc kv files and compiled lua scripts.
31+
* **[content/*]:** Dota content directory containing panorama sources other than scripts (xml, css, compiled js)
32+
33+
--
34+
35+
* **[scripts/*]:** Repository installation scripts
36+
1837
## Continuous Integration
1938

2039
This template includes a [GitHub Actions](https://github.com/features/actions) [workflow](.github/workflows/ci.yml) that builds your custom game on every commit and fails when there are type errors.
68.3 KB
Loading
+17-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
<root>
22
<scripts>
3+
<!-- Included JS script files go here -->
34
<include src="file://{resources}/scripts/custom_game/hud.js" />
45
</scripts>
6+
57
<styles>
8+
<!-- Included css style files go here -->
69
<include src="s2r://panorama/styles/dotastyles.css" />
710
<include src="file://{resources}/styles/custom_game/hud.css" />
811
</styles>
9-
<snippets>
1012

13+
<snippets>
14+
<!-- Snippets go here -->
1115
</snippets>
16+
1217
<Panel hittest="false" class="MainHud">
18+
<Panel id="ExamplePanel">
19+
20+
<Image id="BannerImage" src="file://{resources}/images/custom_game/tstl.png" />
21+
22+
<Label class="ExampleTitle" text="TypeScript Dota Addon template" />
23+
24+
<Label class="ExampleParagraph" text="This is an example text box! Close it to apply the 'panic' modifier to your hero. You can remove this panel in content/panorama/layout/custom_game/hud.xml" />
1325

26+
<Button id="CloseButton" onactivate="OnCloseButtonClicked()">
27+
<Label text="Close" />
28+
</Button>
29+
</Panel>
1430
</Panel>
1531
</root>

content/panorama/scripts/custom_game/hud.ts

-7
This file was deleted.

content/panorama/scripts/custom_game/manifest.ts

-10
This file was deleted.

content/panorama/styles/custom_game/hud.css

+54
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,57 @@
22
width: 100%;
33
height: 100%;
44
}
5+
6+
#ExamplePanel {
7+
width: 500px;
8+
height: 500px;
9+
/* Using a background image already in dota */
10+
background-image: url("s2r://panorama/images/compendium/international2020/compendium/dashboard_panel_bg_psd.vtex");
11+
12+
horizontal-align: center;
13+
vertical-align: center;
14+
}
15+
16+
#ExamplePanel #BannerImage {
17+
width: 200px;
18+
height: 200px;
19+
horizontal-align: center;
20+
y: 40px;
21+
}
22+
23+
#ExamplePanel .ExampleTitle {
24+
horizontal-align: center;
25+
font-size: 30px;
26+
y: 260px;
27+
}
28+
29+
#ExamplePanel .ExampleParagraph {
30+
y: 320px;
31+
margin-left: 30px;
32+
margin-right: 30px;
33+
}
34+
35+
#ExamplePanel #CloseButton {
36+
width: 100px;
37+
height: 50px;
38+
background-color: rgb(228, 228, 228);
39+
horizontal-align: center;
40+
vertical-align: bottom;
41+
y: -30px;
42+
}
43+
44+
#ExamplePanel #CloseButton Label {
45+
horizontal-align: center;
46+
vertical-align: center;
47+
color: black;
48+
}
49+
50+
#ExamplePanel #CloseButton:hover {
51+
background-color: rgb(0, 135, 245);
52+
}
53+
54+
#ExamplePanel #CloseButton:hover Label {
55+
color: white;
56+
}
57+
58+

0 commit comments

Comments
 (0)