Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
robincodex committed Nov 5, 2022
1 parent 0b85110 commit ca60a14
Show file tree
Hide file tree
Showing 25 changed files with 1,373 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ dist
*.vcss_c
*.vxml_c
*.bin
panorama_debugger.cfg
*.cfg
4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
build
coverage
**/dist
**/vue_example
.github
package.json
node_modules
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.exclude": {
"**/node_modules": true
// "**/node_modules/**": true,
"**/node_modules/[^b]**": true
}
}
Binary file added addon/content/solid-example/maps/test.vmap
Binary file not shown.
12 changes: 12 additions & 0 deletions addon/content/solid-example/panorama/layout/custom_game/app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<root>
<styles>
<include src="s2r://panorama/styles/dotastyles.vcss_c"/>
</styles>
<scripts>
<include src="file://{resources}/scripts/custom_game/panorama-polyfill.js" />
<include src="file://{resources}/scripts/custom_game/app.js" />
</scripts>
<Panel hittest="false" >
<Panel id="app" />
</Panel>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<root>
<scripts>
<include src="file://{resources}/scripts/custom_game/custom_loading_screen.js" />
</scripts>
<Panel>
</Panel>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<root>
<script>
//GameUI.SetRenderTopInsetOverride( 0 );
//GameUI.SetRenderBottomInsetOverride( 0 );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_PANEL, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ACTION_MINIMAP, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PANEL, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_SHOP, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_ITEMS, true );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_QUICKBUY, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_COURIER, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_PROTECT, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_INVENTORY_GOLD, false );
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_SHOP_SUGGESTEDITEMS, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FLYOUT_SCOREBOARD, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_MENU_BUTTONS, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_BAR_BACKGROUND, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_TIMEOFDAY, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_TOP_HEROES, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_QUICK_STATS, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_KILLCAM, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_TEAMS, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_GAME_NAME, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_HERO_SELECTION_CLOCK, false );
//GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_PREGAME_STRATEGYUI, false );
</script>
<Panel>
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/app.xml" />
</Panel>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<root>
<scripts>
<include src="file://{resources}/scripts/custom_game/panorama-polyfill.js" />
<include src="file://{resources}/scripts/custom_game/libs.js" />
</scripts>
<Panel hittest="false" >
</Panel>
</root>
39 changes: 39 additions & 0 deletions addon/content/solid-example/panorama/scripts/custom_game/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict'; const require = GameUI.__require;

var libs = require('./libs.js');

function Item(props) {
let [root, setRoot] = libs.createSignal(null);
let [text, setText] = libs.createSignal('');
let el;
libs.onMount(() => {
$.Msg('onMount ', el);
});
libs.createEffect(() => {
$.Msg('effect root ', root());
}, root);
return (() => {
const _el$ = libs.createElement("Panel", {
id: "root"
}, null),
_el$2 = libs.createElement("Label", {}, _el$);
const _ref$ = el;
typeof _ref$ === "function" ? libs.use(_ref$, _el$) : el = _el$;
libs.effect(_$p => libs.setProp(_el$2, "text", text(), _$p));
return _el$;
})();
}
function HelloWorld() {
return (() => {
const _el$3 = libs.createElement("Panel", {}, null);
libs.createTextNode(`Hello World!`, _el$3);
libs.setProp(_el$3, "style", {
flowChildren: 'right'
});
libs.insert(_el$3, libs.createComponent(Item, {
show: true
}, _el$3), null);
return _el$3;
})();
}
libs.render(() => libs.createComponent(HelloWorld, {}, null), $('#app'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

const root = $.GetContextPanel();
const modules = GameUI.__modules = {}
GameUI.__loadModule = function (name, exports) {
if (modules[name]) {
$.Msg(`Reload module: ${name} `, exports ? '👏' : '☠️')
}
modules[name] = exports
}
GameUI.__require = function (name) {
name = name.slice(2, name.length-3);
if (!modules[name]) {
const m = $.CreatePanel('Panel', root, name)
m.BLoadLayout(`file://{resources}/layout/custom_game/${name}.xml`, false, false);
$.Msg(`Load module: ${name} `, modules[name] ? '👏' : '☠️')
}
return modules[name]
}
Loading

0 comments on commit ca60a14

Please sign in to comment.