restructure
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/custom_loading_screen.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/movie.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/custom_loading_screen.vjs_c" />
|
||||
</scripts>
|
||||
<Panel>
|
||||
<Panel id="MoviePlayPanel" />
|
||||
<Panel id="loading_png" />
|
||||
<Label id="loading_text" text="Loading..." />
|
||||
</Panel>
|
||||
</root>
|
||||
46
content/panorama/layout/custom_game/custom_ui_manifest.xml
Normal file
46
content/panorama/layout/custom_game/custom_ui_manifest.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<root>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/util.vjs_c" />
|
||||
</scripts>
|
||||
|
||||
<script>
|
||||
//GameUI.CustomUIConfig().Config =
|
||||
//{
|
||||
// game_name: "touhou"
|
||||
//};
|
||||
|
||||
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_FLYOUT_SCOREBOARD, false );
|
||||
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ENDGAME, false );
|
||||
|
||||
HidePickScreen();
|
||||
function HidePickScreen() {
|
||||
if (Game.GameStateIsBefore(DOTA_GameState.DOTA_GAMERULES_STATE_HERO_SELECTION)) {
|
||||
FindDotaHudElement("PreGame").style.opacity = "0";
|
||||
$.Schedule(0.6, HidePickScreen);
|
||||
} else {
|
||||
FindDotaHudElement("PreGame").style.opacity = "1";
|
||||
}
|
||||
}
|
||||
|
||||
GameEvents.Subscribe('debug_msg', (data) => {
|
||||
if (typeof data.msg == 'object') {
|
||||
$.Msg("-------- " + Math.floor(Game.GetGameTime() * 100 + 0.5) / 100 + " : " + data.msg);
|
||||
for (k in data.msg){
|
||||
$.Msg(k + " : " + data.msg[k]);
|
||||
}
|
||||
} else {
|
||||
$.Msg("-------- " + Math.floor(Game.GetGameTime() * 100 + 0.5) / 100 + " : " + data.msg);
|
||||
}
|
||||
});
|
||||
|
||||
FindDotaHudElement( "PreGame" ).FindChild( "Header" ).style.visibility = "collapse";
|
||||
</script>
|
||||
|
||||
<Panel>
|
||||
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/frames/message/message.xml" />
|
||||
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/dps_panel.xml" />
|
||||
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/info.xml" />
|
||||
<CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/shop.xml" />
|
||||
<CustomUIElement type="EndScreen" layoutfile="file://{resources}/layout/custom_game/end_screen.xml" />
|
||||
</Panel>
|
||||
</root>
|
||||
34
content/panorama/layout/custom_game/dps_panel.xml
Normal file
34
content/panorama/layout/custom_game/dps_panel.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/dps_panel.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/dps_panel.vjs_c" />
|
||||
</scripts>
|
||||
<snippets>
|
||||
<snippet name="Tower">
|
||||
<Panel class="Tower" >
|
||||
<DOTAItemImage id="Item" itemname="" hittest="false" />
|
||||
<Panel id="DPS_info" >
|
||||
<Panel id="DPS_bar" />
|
||||
<Label id="DPS" text="" />
|
||||
<Label id="DPS_pct" text="%" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
</snippets>
|
||||
<Panel hittest="false" class="DPSPanelRoot ShowTime">
|
||||
<Panel id="TowerListHeader" onactivate="$.GetContextPanel().ToggleClass('ShowTime')" >
|
||||
<Label text="#td_tower_dps_title" />
|
||||
</Panel>
|
||||
|
||||
<Panel id="FoodCountPanel" onmouseover="DOTAShowTextTooltip(td_food_count_text)" onmouseout="DOTAHideTextTooltip()" >
|
||||
<Label id="FoodCount" text="#td_food_count" />
|
||||
</Panel>
|
||||
<Panel id="TowerList" >
|
||||
<Panel />
|
||||
</Panel>
|
||||
<Label id="KillCount" text="#td_creature_kill_count" />
|
||||
</Panel>
|
||||
</root>
|
||||
42
content/panorama/layout/custom_game/end_screen.xml
Normal file
42
content/panorama/layout/custom_game/end_screen.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/end_screen.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/end_screen.vjs_c" />
|
||||
</scripts>
|
||||
<snippets>
|
||||
<snippet name="player">
|
||||
<Panel class="Player">
|
||||
<Panel id="PlayerColor"/>
|
||||
<DOTAAvatarImage id="AvatarImage" class="ScoreboardAvatar"/>
|
||||
<Panel id="PlayerAndHeroNameContainer" class="TopBottomFlow">
|
||||
<Label id="PlayerNameLabel" class="PlayerNameLabel" text=""/>
|
||||
<Label id="HeroNameLabel" class="HeroNameLabel" text=""/>
|
||||
</Panel>
|
||||
<Label id="KillCount" text="0" />
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- PlayerStatus -->
|
||||
<snippet name="PlayerStatus">
|
||||
<Panel class="PlayerStatus">
|
||||
<Panel id="StatusICON" />
|
||||
<DOTAAvatarImage id="AvatarImage" class="ScoreboardAvatar"/>
|
||||
<Label id="StatusText" html="true" text="" />
|
||||
</Panel>
|
||||
</snippet>
|
||||
</snippets>
|
||||
<Panel hittest="true" class="EndScreenRoot" >
|
||||
<Label id="WinText" text="" />
|
||||
<Panel id="PlayersPanel" >
|
||||
<Panel id="PlayersPanelHeader" >
|
||||
<Label id="KillCountTitle" text="#td_creature_kill_count_text" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<Button id="ContinueButton" class="Hide" onactivate="Game.FinishGame();">
|
||||
<Label text="#DOTA_Continue" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</root>
|
||||
@@ -0,0 +1,172 @@
|
||||
#CosmeticMenu {
|
||||
horizontal-align: center;
|
||||
vertical-align: bottom;
|
||||
flow-children: down;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
margin-right: 58px;
|
||||
margin-left: 58px;
|
||||
margin-bottom: 145px;
|
||||
transition-property: height;
|
||||
transition-duration: 0.2s;
|
||||
}
|
||||
|
||||
.Open #CosmeticMenu {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
#CosmeticMenuButton {
|
||||
horizontal-align: right;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
background-color: "#000E";
|
||||
background-image: url( "s2r://panorama/images/backgrounds/background_play_button_2x_png.vtex" );
|
||||
}
|
||||
|
||||
#CosmeticMenuButtonText {
|
||||
color: #ffffff;
|
||||
horizontal-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#CosmeticMenuMain {
|
||||
horizontal-align: center;
|
||||
vertical-align: bottom;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #263238;
|
||||
background-image: url( "s2r://panorama/images/hud/reborn/ability_bg_psd.vtex" );
|
||||
background-size: 100%;
|
||||
padding: 30px 60px 60px;
|
||||
}
|
||||
|
||||
#CosmeticContainer {
|
||||
flow-children: right;
|
||||
horizontal-align: center;
|
||||
vertical-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#AnimationPanel {
|
||||
width: 185px;
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
#AnimationContainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba( 8, 8, 8, 0.9 );
|
||||
}
|
||||
|
||||
#BorderAnimation {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url( "s2r://panorama/images/hud/passive_ability_border_png.vtex" );
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#CosmeticAbilitiesContainer {
|
||||
margin-left: 30px;
|
||||
flow-children: down;
|
||||
}
|
||||
|
||||
.AbilitiesRow {
|
||||
margin-top: 10px;
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
#ImagePreview {
|
||||
margin: 0px 3px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#BarOverAbilities {
|
||||
vertical-align: bottom;
|
||||
margin-left: 285px;
|
||||
margin-bottom: 145px;
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
#BarOverAbilities.FiveAbilities {
|
||||
margin-left: 283px;
|
||||
}
|
||||
|
||||
.SlotOverAbility {
|
||||
vertical-align: bottom;
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.FiveAbilities .SlotOverAbility {
|
||||
vertical-align: bottom;
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#BarOverItems {
|
||||
horizontal-align: right;
|
||||
vertical-align: bottom;
|
||||
margin-right: 59px;
|
||||
margin-bottom: 145px;
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
.SlotOverItems {
|
||||
vertical-align: bottom;
|
||||
min-width: 60px;
|
||||
min-height: 60px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#Image {
|
||||
horizontal-align: center;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.SlotOverAbility #Image {
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
}
|
||||
|
||||
.SlotOverItems #Image {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#Cooldown {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#CooldownEffect {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba( 0, 0, 0, 0.85 );
|
||||
}
|
||||
|
||||
#CooldownCountdown {
|
||||
vertical-align: bottom;
|
||||
padding: 0px 2px;
|
||||
text-shadow: 2px 2px 4px 2 black;
|
||||
font-size: 16px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#DeleteButton {
|
||||
visibility: collapse;
|
||||
horizontal-align: right;
|
||||
background-color: rgb( 11, 11, 11 );
|
||||
background-image: url( "s2r://panorama/images/control_icons/x_close_png.vtex" );
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-size: 16px 16px;
|
||||
}
|
||||
|
||||
.Open #DeleteButton {
|
||||
visibility: visible;
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
var IMAGES = {}
|
||||
var cosmeticAbilities = {
|
||||
"high_five": true,
|
||||
"seasonal_ti9_banner": true,
|
||||
"seasonal_summon_cny_balloon": true,
|
||||
"seasonal_summon_dragon": true,
|
||||
"seasonal_summon_cny_tree": true,
|
||||
"seasonal_firecrackers": true,
|
||||
"seasonal_ti9_shovel": true,
|
||||
"seasonal_ti9_instruments": true,
|
||||
"seasonal_ti9_monkey": true,
|
||||
"seasonal_summon_ti9_balloon": true,
|
||||
"seasonal_throw_snowball": true,
|
||||
"seasonal_festive_firework": true,
|
||||
"seasonal_decorate_tree": true,
|
||||
"seasonal_summon_snowman": true
|
||||
}
|
||||
var permanentAbilitySlots = {
|
||||
"high_five": 4,
|
||||
"seasonal_ti9_banner": 5
|
||||
}
|
||||
var abilitiesToTake = [
|
||||
"seasonal_summon_cny_balloon",
|
||||
"seasonal_summon_dragon",
|
||||
"seasonal_summon_cny_tree",
|
||||
"seasonal_firecrackers",
|
||||
"seasonal_ti9_shovel",
|
||||
"seasonal_ti9_instruments",
|
||||
"seasonal_ti9_monkey",
|
||||
"seasonal_summon_ti9_balloon",
|
||||
"seasonal_throw_snowball",
|
||||
"seasonal_festive_firework",
|
||||
"seasonal_decorate_tree",
|
||||
"seasonal_summon_snowman"
|
||||
]
|
||||
var ABILITIES_CANT_BE_REMOVED = {
|
||||
"high_five": true,
|
||||
"seasonal_ti9_banner": true,
|
||||
}
|
||||
var abillity_name_to_webm = {
|
||||
"seasonal_summon_cny_balloon":"40XJ9",
|
||||
"seasonal_summon_dragon":"Ry9Mv",
|
||||
"seasonal_summon_cny_tree":"rVY9D",
|
||||
"seasonal_firecrackers":"Lxe64",
|
||||
"seasonal_ti9_shovel":"b1dNv",
|
||||
"seasonal_ti9_instruments":"5d1Rr",
|
||||
"seasonal_ti9_monkey":"XEjX7",
|
||||
"seasonal_summon_ti9_balloon":"BAEq9",
|
||||
"seasonal_throw_snowball":"8mBLL",
|
||||
"seasonal_festive_firework":"voBa5",
|
||||
"seasonal_decorate_tree":"Px17L",
|
||||
"seasonal_summon_snowman":"na38r"
|
||||
}
|
||||
var showcaseAbilitiesSlot = 6
|
||||
|
||||
var slots = []
|
||||
|
||||
var currentUnit = null
|
||||
var currentAbilitiesCount = 0
|
||||
var animation = {}
|
||||
|
||||
function ToggleCosmeticMenu() {
|
||||
$.GetContextPanel().ToggleClass( "Open" )
|
||||
}
|
||||
|
||||
function Ability( slot, abilityName ) {
|
||||
this.abilityName = abilityName
|
||||
|
||||
var image_path = IMAGES[abilityName] || "file://{images}/spellicons/consumables/" + abilityName + ".png"
|
||||
|
||||
this.image = $.CreatePanel( "Image", slot.panel, "Image" )
|
||||
this.image.SetImage( image_path )
|
||||
|
||||
this.image.SetPanelEvent( "onactivate", function() {
|
||||
if ( Entities.IsControllableByPlayer( currentUnit, Players.GetLocalPlayer() ) ) {
|
||||
var ability = Entities.GetAbilityByName( currentUnit, abilityName )
|
||||
|
||||
if ( Abilities.IsActivated( ability ) ) {
|
||||
Abilities.ExecuteAbility( ability, currentUnit, false )
|
||||
} else {
|
||||
GameEvents.SendCustomGameEventToServer( "cosmetic_abilities_try_activate", { unit: currentUnit, ability: abilityName } )
|
||||
}
|
||||
}
|
||||
} )
|
||||
|
||||
var panel = this.image
|
||||
|
||||
this.image.SetPanelEvent( "onmouseover", function() {
|
||||
$.DispatchEvent( "DOTAShowAbilityTooltip", panel, abilityName )
|
||||
} )
|
||||
this.image.SetPanelEvent( "onmouseout", function() {
|
||||
$.DispatchEvent( "DOTAHideAbilityTooltip", panel )
|
||||
} )
|
||||
|
||||
this.cooldown = $.CreatePanel( "Panel", this.image, "Cooldown" )
|
||||
this.cooldownEffect = $.CreatePanel( "Panel", this.cooldown, "CooldownEffect" )
|
||||
this.cooldownEffect.style["opacity-mask"] = "url( '" + image_path + "' )"
|
||||
this.cooldownCountdown = $.CreatePanel( "Label", this.cooldown, "CooldownCountdown" )
|
||||
|
||||
if ( !ABILITIES_CANT_BE_REMOVED[abilityName] ) {
|
||||
var deleteButton = $.CreatePanel( "Button", this.image, "DeleteButton" )
|
||||
|
||||
deleteButton.SetPanelEvent( "onactivate", function() {
|
||||
if ( Entities.IsControllableByPlayer( currentUnit, Players.GetLocalPlayer() ) ) {
|
||||
GameEvents.SendCustomGameEventToServer( "cosmetic_abilities_delete", { unit: currentUnit, ability: abilityName } )
|
||||
}
|
||||
} )
|
||||
}
|
||||
|
||||
this.Update = function() {
|
||||
var ability = Entities.GetAbilityByName( currentUnit, this.abilityName )
|
||||
|
||||
if ( !Abilities.IsCooldownReady( ability ) ) {
|
||||
var remaining = Abilities.GetCooldownTimeRemaining( ability )
|
||||
var progress = remaining / Abilities.GetCooldownLength( ability ) * -360
|
||||
|
||||
this.cooldown.style.visibility = "visible"
|
||||
this.cooldownEffect.style.clip = "radial( 50% 75%, 0deg, " + progress + "deg )"
|
||||
this.cooldownCountdown.text = Math.ceil( remaining )
|
||||
} else {
|
||||
this.cooldown.style.visibility = "collapse"
|
||||
}
|
||||
}
|
||||
|
||||
this.Delete = function() {
|
||||
this.image.DeleteAsync( 0 )
|
||||
}
|
||||
}
|
||||
|
||||
function Slot( parent, index, style ) {
|
||||
this.panel = $.CreatePanel( "Panel", parent, "Slot" + index )
|
||||
this.panel.AddClass( style )
|
||||
|
||||
this.Update = function() {
|
||||
if ( this.content && this.content.Update ) {
|
||||
this.content.Update()
|
||||
}
|
||||
}
|
||||
|
||||
this.Clear = function() {
|
||||
if ( this.content ) {
|
||||
this.content.Delete()
|
||||
this.content = null
|
||||
}
|
||||
}
|
||||
|
||||
this.AddContent = function( content ) {
|
||||
this.Clear()
|
||||
this.content = content
|
||||
}
|
||||
}
|
||||
|
||||
function Reload() {
|
||||
currentUnit = Players.GetLocalPlayerPortraitUnit()
|
||||
|
||||
for ( i in slots ) {
|
||||
var slot = slots[i]
|
||||
slot.Clear()
|
||||
}
|
||||
|
||||
var visible_abilities = 0
|
||||
|
||||
for ( var i = 0; i < Entities.GetAbilityCount( currentUnit ); i++ ) {
|
||||
var ability = Entities.GetAbility( currentUnit, i )
|
||||
var name = Abilities.GetAbilityName( ability )
|
||||
|
||||
if ( !Abilities.IsHidden( ability ) && i < 6 ) {
|
||||
visible_abilities++
|
||||
}
|
||||
|
||||
if ( cosmeticAbilities[name] ) {
|
||||
var permSlot = permanentAbilitySlots[name]
|
||||
|
||||
if ( permSlot ) {
|
||||
slots[permSlot].AddContent( new Ability( slots[permSlot], name ) )
|
||||
} else {
|
||||
for ( s in slots ) {
|
||||
var slot = slots[s]
|
||||
|
||||
if ( !slot.content ) {
|
||||
slot.AddContent( new Ability( slot, name ) )
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( Entities.IsRealHero( currentUnit ) ) {
|
||||
$( "#CosmeticMenu" ).style.visibility = "visible"
|
||||
} else {
|
||||
$( "#CosmeticMenu" ).style.visibility = "collapse"
|
||||
}
|
||||
|
||||
if ( visible_abilities > 4 ) {
|
||||
$( "#BarOverAbilities" ).AddClass( "FiveAbilities" )
|
||||
} else {
|
||||
$( "#BarOverAbilities" ).RemoveClass( "FiveAbilities" )
|
||||
}
|
||||
}
|
||||
|
||||
function Update() {
|
||||
if ( Players.GetLocalPlayerPortraitUnit() != currentUnit ) {
|
||||
Reload()
|
||||
} else {
|
||||
for ( i in slots ) {
|
||||
var slot = slots[i]
|
||||
slot.Update()
|
||||
}
|
||||
}
|
||||
|
||||
$.Schedule( 1 / 60, Update )
|
||||
}
|
||||
|
||||
for ( var i = 0; i < 7; i++ ) {
|
||||
if ( i > 3 ) {
|
||||
slots[i] = new Slot( $( "#BarOverItems" ), i, "SlotOverItems" )
|
||||
} else {
|
||||
slots[i] = new Slot( $( "#BarOverAbilities" ), i, "SlotOverAbility" )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GameEvents.Subscribe( "cosmetic_abilities_reload_hud", Reload )
|
||||
|
||||
Update()
|
||||
|
||||
function CreateAbilityToTake( row, abilityName ) {
|
||||
var image = $.CreatePanel( "Image", row, "ImagePreview" )
|
||||
image.SetImage( IMAGES[abilityName] || "file://{images}/spellicons/consumables/" + abilityName + ".png")
|
||||
|
||||
animation[abilityName] = $.CreatePanel( "Panel", $( "#AnimationContainer" ), "" )
|
||||
animation[abilityName].BLoadLayoutFromString( '<root><Panel><MoviePanel src="http://s1.webmshare.com/'+abillity_name_to_webm[abilityName]+'.webm" repeat="true" autoplay="onload" /></Panel></root>', false, false )
|
||||
animation[abilityName].visible = false
|
||||
|
||||
image.SetPanelEvent( "onactivate", function() {
|
||||
if ( Entities.IsControllableByPlayer( currentUnit, Players.GetLocalPlayer() ) ) {
|
||||
GameEvents.SendCustomGameEventToServer( "cosmetic_abilities_take", { unit: currentUnit, ability: abilityName } )
|
||||
}
|
||||
} )
|
||||
|
||||
image.SetPanelEvent( "onmouseover", function() {
|
||||
$.DispatchEvent( "DOTAShowAbilityTooltip", image, abilityName )
|
||||
|
||||
animation[abilityName].visible = true
|
||||
} )
|
||||
|
||||
image.SetPanelEvent( "onmouseout", function() {
|
||||
$.DispatchEvent( "DOTAHideAbilityTooltip", image )
|
||||
|
||||
animation[abilityName].visible = false
|
||||
} )
|
||||
}
|
||||
|
||||
function CreateAbilitiesToTake() {
|
||||
var abilities_row = null
|
||||
|
||||
for ( var i = 0; i < abilitiesToTake.length; i++ ) {
|
||||
if ( i % 4 == 0 ) {
|
||||
abilities_row = $.CreatePanel( "Panel", $( "#CosmeticAbilitiesContainer" ), "" )
|
||||
abilities_row.AddClass( "AbilitiesRow" )
|
||||
}
|
||||
|
||||
CreateAbilityToTake( abilities_row, abilitiesToTake[i] )
|
||||
}
|
||||
}
|
||||
|
||||
CreateAbilitiesToTake()
|
||||
@@ -0,0 +1,30 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/layout/custom_game/frames/cosmetic_abilities/cosmetic_abilities.vcss_c" />
|
||||
</styles>
|
||||
|
||||
<scripts>
|
||||
<include src="s2r://panorama/layout/custom_game/frames/cosmetic_abilities/cosmetic_abilities.vjs_c" />
|
||||
</scripts>
|
||||
|
||||
<Panel style="width: 100%; height: 100%;" hittest="false">
|
||||
<Panel id="CosmeticMenu">
|
||||
<Button id="CosmeticMenuButton" onactivate="ToggleCosmeticMenu()">
|
||||
<Label id="CosmeticMenuButtonText" text="#td_cosmetic" />
|
||||
</Button>
|
||||
<Panel id="CosmeticMenuMain">
|
||||
<Panel id="CosmeticContainer">
|
||||
<Panel id="AnimationPanel">
|
||||
<Panel id="AnimationContainer"></Panel>
|
||||
<Panel id="BorderAnimation" />
|
||||
</Panel>
|
||||
<Panel id="CosmeticAbilitiesContainer"></Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
<Panel id="BarOverAbilities" hittest="false">
|
||||
</Panel>
|
||||
<Panel id="BarOverItems" hittest="false">
|
||||
</Panel>
|
||||
</Panel>
|
||||
</root>
|
||||
@@ -0,0 +1,57 @@
|
||||
var COSMETIC_ABILITIES = {
|
||||
"high_five": true,
|
||||
"seasonal_ti9_banner": true,
|
||||
"seasonal_summon_cny_balloon": true,
|
||||
"seasonal_summon_dragon": true,
|
||||
"seasonal_summon_cny_tree": true,
|
||||
"seasonal_firecrackers": true,
|
||||
"seasonal_ti9_shovel": true,
|
||||
"seasonal_ti9_instruments": true,
|
||||
"seasonal_ti9_monkey": true,
|
||||
"seasonal_summon_ti9_balloon": true,
|
||||
"seasonal_throw_snowball": true,
|
||||
"seasonal_festive_firework": true,
|
||||
"seasonal_decorate_tree": true,
|
||||
"seasonal_summon_snowman": true
|
||||
}
|
||||
|
||||
var hud = $.GetContextPanel().GetParent().GetParent().GetParent()
|
||||
var lower_hud = hud.FindChildTraverse( "HUDElements" ).FindChild( "lower_hud" )
|
||||
var center_with_stats = lower_hud.FindChild( "center_with_stats" )
|
||||
var center_block = center_with_stats.FindChild( "center_block" )
|
||||
var buff_container = lower_hud.FindChild( "BuffContainer" )
|
||||
|
||||
lower_hud.style.height = "100%"
|
||||
center_with_stats.style.height = "100%"
|
||||
center_block.style.height = "100%"
|
||||
|
||||
buff_container.FindChild( "buffs" ).style.transform = "translateY( -50px )"
|
||||
buff_container.FindChild( "debuffs" ).style.transform = "translateY( -50px )"
|
||||
|
||||
if ( !center_block.FindChild( "CosmeticAbilities" ) ) {
|
||||
var newPanel = $.CreatePanel( "Panel", center_block, "CosmeticAbilities" )
|
||||
newPanel.BLoadLayout( "file://{resources}/layout/custom_game/frames/cosmetic_abilities/cosmetic_abilities.xml", false, false )
|
||||
center_block.MoveChildBefore( newPanel, center_block.FindChild( "center_bg" ) )
|
||||
}
|
||||
|
||||
center_block.FindChildrenWithClassTraverse( "TertiaryAbilityContainer" )[0].style.visibility = "collapse"
|
||||
|
||||
var abilities_panel = center_block.FindChild( "AbilitiesAndStatBranch" ).FindChildTraverse( "abilities" )
|
||||
|
||||
function HideAbilities() {
|
||||
var abilities = abilities_panel.Children()
|
||||
|
||||
for ( i in abilities ) {
|
||||
var ability_name = abilities[i].FindChildTraverse( "AbilityImage" ).abilityname
|
||||
|
||||
if ( COSMETIC_ABILITIES[ability_name] ) {
|
||||
abilities[i].style.visibility = "collapse"
|
||||
} else {
|
||||
abilities[i].style.visibility = "visible"
|
||||
}
|
||||
}
|
||||
|
||||
$.Schedule( 0.001, HideAbilities )
|
||||
}
|
||||
|
||||
HideAbilities()
|
||||
@@ -0,0 +1,21 @@
|
||||
.MessageRoot{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#Content {
|
||||
margin: 300px 100px;
|
||||
vertical-align: bottom;
|
||||
flow-children: down;
|
||||
}
|
||||
|
||||
.Message {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.Message Label {
|
||||
color: #fff;
|
||||
width: 500px;
|
||||
text-shadow: #000 0px 0px 2px 2.0;
|
||||
font-size: 20px;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
function ShowMessage(msg, duration, params, color) {
|
||||
color = color || "#fff";
|
||||
|
||||
var msgPanel = $.CreatePanel("Panel", $("#Content"), "");
|
||||
msgPanel.AddClass("Message");
|
||||
|
||||
var label = $.CreatePanel("Label", msgPanel, "");
|
||||
|
||||
if (params) {
|
||||
for(var i in params) {
|
||||
var v = params[i];
|
||||
if (typeof v === 'number') {
|
||||
label.SetDialogVariableInt(i, v);
|
||||
} else {
|
||||
label.SetDialogVariable(i, $.Localize(String(v)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label.html = true;
|
||||
label.text = $.Localize(msg, label).replace(/%%/g,"%");
|
||||
label.style.color = color;
|
||||
|
||||
msgPanel.DeleteAsync(duration);
|
||||
}
|
||||
|
||||
GameEvents.Subscribe("show_message", function (data) {
|
||||
ShowMessage(data.msg, data.duration || 5, data.params, data.color);
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/layout/custom_game/frames/message/message.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/layout/custom_game/frames/message/message.vjs_c" />
|
||||
</scripts>
|
||||
<Panel hittest="false" hittestchildren="false" class="MessageRoot" >
|
||||
<Panel id="Content" />
|
||||
</Panel>
|
||||
</root>
|
||||
287
content/panorama/layout/custom_game/frames/payment/payment.css
Normal file
287
content/panorama/layout/custom_game/frames/payment/payment.css
Normal file
@@ -0,0 +1,287 @@
|
||||
.PaymentRoot{
|
||||
width: 800px;
|
||||
height: 500px;
|
||||
background-color: #151515;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #555;
|
||||
}
|
||||
|
||||
|
||||
.line {
|
||||
flow-children: right;
|
||||
}
|
||||
.center {
|
||||
horizontal-align: center;
|
||||
}
|
||||
.margin-sm {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#PetInputPage,
|
||||
#InputPage,
|
||||
#HtmlPage {
|
||||
horizontal-align: center;
|
||||
vertical-align: middle;
|
||||
transition-property: opacity, transform;
|
||||
transition-duration: 0.3s;
|
||||
}
|
||||
|
||||
#PetInputPage,
|
||||
#InputPage {
|
||||
flow-children: down;
|
||||
}
|
||||
|
||||
#PetInputPage .t1,
|
||||
#InputPage .t1 {
|
||||
horizontal-align: center;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#PetInputPage .t2,
|
||||
#InputPage .t2 {
|
||||
horizontal-align: center;
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
#PetTextPanel,
|
||||
#AvalonCoinPanel {
|
||||
width: 120px;
|
||||
background-color: #000;
|
||||
vertical-align: middle;
|
||||
border: 1px solid #FFED83;
|
||||
}
|
||||
|
||||
#PetLevelText,
|
||||
#AvalonCoin{
|
||||
width: fit-children;
|
||||
background-color: none;
|
||||
text-align: right;
|
||||
text-overflow: clip;
|
||||
horizontal-align: center;
|
||||
border: 0;
|
||||
transform: translateX(6px);
|
||||
font-size: 25px;
|
||||
min-width: 20px;
|
||||
color: gradient( linear, 0% 100%, 0% 0%, from( #FFED83 ), to( #DE8B00 ) );
|
||||
}
|
||||
|
||||
#PetInputPage .title,
|
||||
#InputPage .title{
|
||||
font-size: 30px;
|
||||
color: gradient( linear, 0% 100%, 0% 0%, from( #FFED83 ), to( #DE8B00 ) );
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#PetPrePayButton,
|
||||
#PrePayButton{
|
||||
horizontal-align: center;
|
||||
margin: 30px;
|
||||
flow-children: down;
|
||||
}
|
||||
|
||||
#PetPrePayButton .title,
|
||||
#PrePayButton .title{
|
||||
font-size: 20px;
|
||||
color: gradient( linear, 0% 100%, 0% 0%, from( #FFED83 ), to( #DE8B00 ) );
|
||||
text-shadow: #000 0px 0px 4px 1.0;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
horizontal-align: center;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn,
|
||||
#PrePayButton .pay-btn{
|
||||
padding: 10px 15px;
|
||||
flow-children: right;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn.alipay,
|
||||
#PrePayButton .pay-btn.alipay{
|
||||
background-color: #108EE9;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn.wechatpay,
|
||||
#PrePayButton .pay-btn.wechatpay{
|
||||
background-color: #3eb94e;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn Image,
|
||||
#PrePayButton .pay-btn Image{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn Label,
|
||||
#PrePayButton .pay-btn Label{
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn.alipay:hover,
|
||||
#PrePayButton .pay-btn.alipay:hover{
|
||||
box-shadow: #108EE9 0px 0px 4px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn.wechatpay:hover,
|
||||
#PrePayButton .pay-btn.wechatpay:hover{
|
||||
box-shadow: #3eb94e 0px 0px 4px;
|
||||
}
|
||||
|
||||
#PetPrePayButton .pay-btn:active,
|
||||
#PrePayButton .pay-btn:active{
|
||||
transform: scale3d(0.9,0.9,1);
|
||||
}
|
||||
|
||||
#AddPetLevel,
|
||||
#AddAvalonCoin{
|
||||
horizontal-align: center;
|
||||
margin-top: 15px;
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
#AddPetLevel .btn,
|
||||
#AddAvalonCoin .btn{
|
||||
background-color: #414141;
|
||||
padding: 2px 4px;
|
||||
border-radius: 5px;
|
||||
margin: 0px 3px;
|
||||
}
|
||||
|
||||
#AddPetLevel .btn Label,
|
||||
#AddAvalonCoin .btn Label{
|
||||
margin-top: 3px;
|
||||
color: gradient( linear, 0% 100%, 0% 0%, from( #FFED83 ), to( #DE8B00 ) );
|
||||
}
|
||||
|
||||
#AddPetLevel .btn:hover,
|
||||
#AddAvalonCoin .btn:hover{
|
||||
brightness: 2;
|
||||
}
|
||||
|
||||
#AddPetLevel .btn:active,
|
||||
#AddAvalonCoin .btn:active{
|
||||
transform: scale3d(0.9,0.9,1);
|
||||
}
|
||||
|
||||
/*=======================*/
|
||||
#HtmlPage {
|
||||
flow-children: down;
|
||||
}
|
||||
|
||||
#HtmlPage .btn{
|
||||
background-color: #414141;
|
||||
padding: 2px 4px;
|
||||
border-radius: 5px;
|
||||
margin: 0px 3px;
|
||||
horizontal-align: center;
|
||||
}
|
||||
|
||||
#HtmlPage .btn Label{
|
||||
margin-top: 3px;
|
||||
color: gradient( linear, 0% 100%, 0% 0%, from( #FFED83 ), to( #DE8B00 ) );
|
||||
}
|
||||
|
||||
#HtmlPage .btn:hover{
|
||||
brightness: 2;
|
||||
}
|
||||
|
||||
#HtmlPage .btn:active{
|
||||
transform: scale3d(0.9,0.9,1);
|
||||
}
|
||||
|
||||
|
||||
#Html {
|
||||
width: 700px;
|
||||
height: 360px;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#GoBackButton {
|
||||
padding: 5px 15px;
|
||||
horizontal-align: center;
|
||||
border-radius: 3px;
|
||||
margin-top: 10px;
|
||||
background-color: gradient(linear, 0% 100%, 0% 0%, from(#3F0600), to(#5B0900));
|
||||
}
|
||||
#GoBackButton:hover {
|
||||
box-shadow: #A41C00 0px 0px 5px;
|
||||
}
|
||||
#GoBackButton Label {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#CloseButton {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background-image: url("s2r://panorama/images/control_icons/x_close_png.vtex");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
wash-color: #eee2dd;
|
||||
margin-top: 2px;
|
||||
margin-right: 5px;
|
||||
horizontal-align: right;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#CloseButton:hover {
|
||||
wash-color: #fac900;
|
||||
}
|
||||
|
||||
#PageModeToggle {
|
||||
horizontal-align: center;
|
||||
vertical-align: top;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
#PageModeToggle {
|
||||
flow-children: right;
|
||||
}
|
||||
|
||||
#PageModeToggle RadioButton {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#PageModeToggle RadioButton .TickBox {
|
||||
background-color: #0000;
|
||||
border: 2px solid #6c9fcb;
|
||||
box-shadow: #abffff 0px 0px 0px;
|
||||
}
|
||||
|
||||
#PageModeToggle RadioButton Label {
|
||||
color: #EEE;
|
||||
}
|
||||
#PageModeToggle RadioButton:selected Label {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#PageModeToggle RadioButton:selected .TickBox {
|
||||
background-color: #abffff;
|
||||
border: 2px solid #6c9fcb;
|
||||
box-shadow: #abffff 0px 0px 6px;
|
||||
}
|
||||
|
||||
|
||||
#PayQrPanel {
|
||||
width: 700px;
|
||||
height: 360px;
|
||||
background-color: #000;
|
||||
horizontal-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#PayQrPanel Label {
|
||||
color: #EEE;
|
||||
font-size: 25px;
|
||||
horizontal-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#PayQrImg {
|
||||
width: 312px;
|
||||
height: 312px;
|
||||
horizontal-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
279
content/panorama/layout/custom_game/frames/payment/payment.js
Normal file
279
content/panorama/layout/custom_game/frames/payment/payment.js
Normal file
@@ -0,0 +1,279 @@
|
||||
"use strict";
|
||||
|
||||
var PayAmount = 0;
|
||||
var Price = 0.0;
|
||||
|
||||
var PetPayAmount = 0;
|
||||
var PetPrice = 0;
|
||||
|
||||
var IsInQuery = false;
|
||||
var SelectedPage = 1;
|
||||
|
||||
var BackTimeOutCount = 60;
|
||||
var EndTimeOutCount = 300;
|
||||
|
||||
function ShowMessage(text, time, iserror, marginTop) {
|
||||
var label = $.CreatePanel("Label", $.GetContextPanel(), "");
|
||||
label.style["background-color"] = iserror ? "#A22C00" : "#000E";
|
||||
label.style["color"] = iserror ? "#fff" : "#F37702";
|
||||
label.style["padding"] = "20px";
|
||||
label.style["font-size"] = "30px";
|
||||
if (marginTop) label.style["margin-top"] = marginTop;
|
||||
label.style["horizontal-align"] = "center";
|
||||
label.style["vertical-align"] = "center";
|
||||
label.html = true;
|
||||
label.text = text;
|
||||
label.DeleteAsync(time > 0 ? time : 3);
|
||||
}
|
||||
|
||||
function PageModeSelect(type) {
|
||||
if (type === "fairy") {
|
||||
SelectedPage = 1;
|
||||
$("#InputPage").visible = true;
|
||||
$("#PetInputPage").visible = false;
|
||||
$("#HtmlPage").visible = false;
|
||||
$("#AvalonCoin").text = "";
|
||||
return;
|
||||
}
|
||||
if (type === "pet") {
|
||||
SelectedPage = 2;
|
||||
$("#InputPage").visible = false;
|
||||
$("#PetInputPage").visible = true;
|
||||
$("#HtmlPage").visible = false;
|
||||
$("#PetLevelText").text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ShowModeSelectTip(index) {
|
||||
$.DispatchEvent("DOTAShowTextTooltip", $("#PageModeToggle").GetChild(index), $.Localize("#pay_tip_mode" + index));
|
||||
}
|
||||
|
||||
function HideModeSelectTip() {
|
||||
$.DispatchEvent("DOTAHideTextTooltip")
|
||||
}
|
||||
|
||||
function GoBack() {
|
||||
$("#InputPage").visible = SelectedPage === 1;
|
||||
$("#PetInputPage").visible = SelectedPage === 2;
|
||||
$("#HtmlPage").visible = false;
|
||||
$("#AvalonCoin").text = "";
|
||||
$("#PetLevelText").text = "";
|
||||
EndTimeOutCount = 0;
|
||||
BackTimeOutCount = 0;
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_pay_auto_query", {});
|
||||
}
|
||||
|
||||
function Pay( method, type ) {
|
||||
if ((!Price || Price < 0) && (!PetPrice || PetPrice < 0)) return;
|
||||
|
||||
$("#PayQrImg").SetImage("");
|
||||
$("#InputPage").visible = false;
|
||||
$("#PetInputPage").visible = false;
|
||||
$("#HtmlPage").visible = true;
|
||||
$("#CompleteButton").visible = false;
|
||||
$("#GoBackButton").enabled = false;
|
||||
|
||||
BackTimeOutCount = 30;
|
||||
GoBackTimeCount();
|
||||
|
||||
EndTimeOutCount = 300;
|
||||
EndBackTimeCount()
|
||||
|
||||
var payType = 2;
|
||||
if (method === "alipay") {
|
||||
payType = 1;
|
||||
} else if (method === "wechatpay") {
|
||||
payType = 2;
|
||||
}
|
||||
|
||||
if (type === "fairy") {
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_pay_select", {"method":payType, "amount":PayAmount, "price":Price * 100, "type": type});
|
||||
} else if (type === "pet") {
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_pay_select", {"method":payType, "amount":PetPayAmount, "price":PetPrice * 100, "type": type});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function GoBackTimeCount() {
|
||||
if (BackTimeOutCount <= 0) {
|
||||
$("#GoBackButton").enabled = true;
|
||||
$("#GoBackButton").SetDialogVariableInt("timeout", 0)
|
||||
$("#CompleteButton").visible = true;
|
||||
return;
|
||||
}
|
||||
BackTimeOutCount--;
|
||||
$("#GoBackButton").SetDialogVariableInt("timeout", BackTimeOutCount)
|
||||
$.Schedule(1, GoBackTimeCount);
|
||||
}
|
||||
|
||||
|
||||
function EndBackTimeCount() {
|
||||
if (EndTimeOutCount <= 0) {
|
||||
return;
|
||||
}
|
||||
EndTimeOutCount--;
|
||||
var m = Math.floor(EndTimeOutCount/60);
|
||||
var s = EndTimeOutCount%60;
|
||||
var note = m > 0 ? (m + "分") : "";
|
||||
note += s > 0 ? (s + "秒") : "";
|
||||
if (note === "") note = "0秒(已过期,请返回)";
|
||||
$("#HtmlPage").SetDialogVariable("LeftTime", note);
|
||||
$.Schedule(1, EndBackTimeCount);
|
||||
}
|
||||
|
||||
function PayComplete() {
|
||||
if (IsInQuery) return;
|
||||
IsInQuery = true;
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_pay_query", {});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 文本改变
|
||||
var AvalonCoinLock = false;
|
||||
function OnAvalonCoinChange() {
|
||||
if (AvalonCoinLock) return;
|
||||
AvalonCoinLock=true;
|
||||
|
||||
var AvalonCoin = $("#AvalonCoin");
|
||||
var text = AvalonCoin.text;
|
||||
var m = text.replace(/\D+/g,"");
|
||||
var amount = parseInt(m);
|
||||
if (amount >= 10) {
|
||||
AvalonCoin.text = parseInt(m);
|
||||
}
|
||||
else {
|
||||
amount = 0;
|
||||
AvalonCoin.text = "";
|
||||
}
|
||||
|
||||
if (amount > 0) {
|
||||
// $("#PrePayButton").SetDialogVariable("Amount",((100 * amount / 2 - RandomInt(0, 100))/100).toFixed(2).toString());
|
||||
if (PayAmount != amount) {
|
||||
PayAmount = amount;
|
||||
Price = (100 * amount * 0.5 - RandomInt(0, 100))/100;
|
||||
$("#PrePayButton").SetDialogVariable("Amount",Price.toString());
|
||||
$("#HtmlPage").SetDialogVariable("Amount",Price.toString());
|
||||
}
|
||||
} else {
|
||||
PayAmount = 0;
|
||||
Price = 0.0;
|
||||
$("#PrePayButton").SetDialogVariable("Amount", "0");
|
||||
$("#HtmlPage").SetDialogVariable("Amount", "0");
|
||||
}
|
||||
AvalonCoinLock = false;
|
||||
}
|
||||
|
||||
// 文本改变
|
||||
var PetlevelLock = false;
|
||||
function OnPetLevelChange() {
|
||||
if (PetlevelLock) return;
|
||||
PetlevelLock=true;
|
||||
|
||||
var PetLevelText = $("#PetLevelText");
|
||||
var text = PetLevelText.text;
|
||||
var m = text.replace(/\D+/g,"");
|
||||
var amount = parseInt(m);
|
||||
if (amount > 0) {
|
||||
PetLevelText.text = parseInt(m);
|
||||
}
|
||||
else {
|
||||
amount = 0;
|
||||
PetLevelText.text = "";
|
||||
}
|
||||
|
||||
if (amount > 0) {
|
||||
if (PetPayAmount != amount) {
|
||||
PetPayAmount = amount;
|
||||
PetPrice = (100 * amount * 30 - RandomInt(0, 100))/100;
|
||||
$("#PetPrePayButton").SetDialogVariable("Amount",PetPrice.toString());
|
||||
$("#HtmlPage").SetDialogVariable("Amount",PetPrice.toString());
|
||||
}
|
||||
} else {
|
||||
PetPayAmount = 0;
|
||||
PetPrice = 0.0;
|
||||
$("#PetPrePayButton").SetDialogVariable("Amount", "0");
|
||||
$("#HtmlPage").SetDialogVariable("Amount", "0");
|
||||
}
|
||||
PetlevelLock = false;
|
||||
}
|
||||
|
||||
function RandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
function AddAvalonCoin(num) {
|
||||
var AvalonCoin = $("#AvalonCoin");
|
||||
var text = AvalonCoin.text;
|
||||
var amount = parseInt(text);
|
||||
if (!amount || amount < 0) amount = 0;
|
||||
if (num > 0)
|
||||
AvalonCoin.text = (amount + num);
|
||||
else
|
||||
AvalonCoin.text = "";
|
||||
}
|
||||
|
||||
function AddPetLevel(num) {
|
||||
var PetLevelText = $("#PetLevelText");
|
||||
var text = PetLevelText.text;
|
||||
var amount = parseInt(text);
|
||||
if (!amount || amount < 0) amount = 0;
|
||||
if (num > 0)
|
||||
PetLevelText.text = (amount + num);
|
||||
else
|
||||
PetLevelText.text = "";
|
||||
}
|
||||
|
||||
var closeHandle = null;
|
||||
function Close() {
|
||||
if (closeHandle) {
|
||||
closeHandle();
|
||||
}
|
||||
}
|
||||
|
||||
function AvalonCoinInputFocus(){
|
||||
// $("#PetTextPanel").SetFocus();
|
||||
}
|
||||
|
||||
function PetInputFocus() {
|
||||
$("#PetLevelText").SetFocus();
|
||||
}
|
||||
|
||||
|
||||
;(function(){
|
||||
$("#PrePayButton").SetDialogVariable("Amount", "0");
|
||||
$("#HtmlPage").SetDialogVariable("Amount", "0");
|
||||
$("#HtmlPage").visible = false;
|
||||
$("#AvalonCoin").enabled = false;
|
||||
$("#InputPage").visible = SelectedPage === 1;
|
||||
$("#PetInputPage").visible = SelectedPage === 2;
|
||||
|
||||
$.GetContextPanel().OnClose = function (f) { closeHandle = f };
|
||||
|
||||
GameEvents.Subscribe("thtd_pay_post", function (data){
|
||||
if (data.code === 1) {
|
||||
// $("#Html").SetURL(data.url);占用性能
|
||||
// $("#PayQrImg").SetImage(data.url);
|
||||
$("#PayQrImg").SetImage(data.method === 1 ? "s2r://panorama/images/custom_game/qr_alipay_png.vtex" : "s2r://panorama/images/custom_game/qr_wechat_png.vtex");
|
||||
} else {
|
||||
// $("#Html").SetURL("https://qrcode/error.jpg");
|
||||
$("#PayQrImg").SetImage("");
|
||||
ShowMessage("获取支付码失败," + data.msg, 10, true);
|
||||
}
|
||||
});
|
||||
|
||||
GameEvents.Subscribe("thtd_pay_result", function (data){
|
||||
IsInQuery = false;
|
||||
if (data.code === "0000") {
|
||||
ShowMessage(data.msg, 5);
|
||||
Game.EmitSound("Quest.Completed");
|
||||
BackTimeOutCount = 0;
|
||||
} else {
|
||||
ShowMessage(data.msg, 5, true);
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
111
content/panorama/layout/custom_game/frames/payment/payment.xml
Normal file
111
content/panorama/layout/custom_game/frames/payment/payment.xml
Normal file
@@ -0,0 +1,111 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/layout/custom_game/frames/payment/payment.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/layout/custom_game/frames/payment/payment.vjs_c" />
|
||||
</scripts>
|
||||
<Panel class="PaymentRoot" onactivate="" >
|
||||
<Button id="CloseButton" onactivate="Close()" />
|
||||
|
||||
<Panel id="PageModeToggle" >
|
||||
<Label style="color:#fff;vertical-align: middle;" text="#td_type" />
|
||||
<RadioButton id="fairy" selected="true" text="符卡精华" group="mode_group" onactivate="PageModeSelect('fairy')" onmouseover="ShowModeSelectTip(1)" onmouseout="HideModeSelectTip()" />
|
||||
<RadioButton id="pet" selected="false" text="宠物等级和奖励时间" group="mode_group" onactivate="PageModeSelect('pet')" onmouseover="ShowModeSelectTip(2)" onmouseout="HideModeSelectTip()" />
|
||||
</Panel>
|
||||
|
||||
<Panel id="InputPage">
|
||||
<!-- <Label class="t1" text="需要的符卡精华数量" /> -->
|
||||
<Panel class="t2" hittest="false">
|
||||
<Panel id="AvalonCoinPanel" onactivate="AvalonCoinInputFocus()">
|
||||
<TextEntry id="AvalonCoin" maxchars="7" ontextentrychange="OnAvalonCoinChange()" />
|
||||
</Panel>
|
||||
<Label class="title" text=" 符卡精华" />
|
||||
</Panel>
|
||||
<!-- 自动增加 -->
|
||||
<Panel id="AddAvalonCoin" >
|
||||
<Button class="btn" onactivate="AddAvalonCoin(100)">
|
||||
<Label text="+100" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddAvalonCoin(500)">
|
||||
<Label text="+500" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddAvalonCoin(20)">
|
||||
<Label text="+20" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddAvalonCoin(0)">
|
||||
<Label text="重置" />
|
||||
</Button>
|
||||
</Panel>
|
||||
<!-- 支付按钮 -->
|
||||
<Panel id="PrePayButton" >
|
||||
<Label class="title" html="true" text="请赞助 {s:Amount} 元" />
|
||||
<Panel class="line center">
|
||||
<Button class="pay-btn alipay" onactivate="Pay('alipay','fairy')">
|
||||
<Image src="s2r://panorama/images/custom_game/alipay_png.vtex" />
|
||||
<Label text="支付宝" />
|
||||
</Button>
|
||||
<Button class="pay-btn wechatpay" onactivate="Pay('wechatpay','fairy')">
|
||||
<Image src="s2r://panorama/images/custom_game/wechatpay_png.vtex" />
|
||||
<Label text="微信" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<Panel id="PetInputPage">
|
||||
<Label class="t1" text="每级获得2个月的特别奖励时间" />
|
||||
<Panel class="t2" hittest="false">
|
||||
<Panel id="PetTextPanel" onactivate="PetInputFocus()">
|
||||
<TextEntry id="PetLevelText" maxchars="5" ontextentrychange="OnPetLevelChange()" />
|
||||
</Panel>
|
||||
<Label class="title" text=" 宠物等级" />
|
||||
</Panel>
|
||||
<!-- 自动增加 -->
|
||||
<Panel id="AddPetLevel" >
|
||||
<Button class="btn" onactivate="AddPetLevel(1)">
|
||||
<Label text="+1" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddPetLevel(5)">
|
||||
<Label text="+5" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddPetLevel(10)">
|
||||
<Label text="+10" />
|
||||
</Button>
|
||||
<Button class="btn" onactivate="AddPetLevel(0)">
|
||||
<Label text="重置" />
|
||||
</Button>
|
||||
</Panel>
|
||||
<!-- 支付按钮 -->
|
||||
<Panel id="PetPrePayButton" >
|
||||
<Label class="title" html="true" text="请赞助 {s:Amount} 元" />
|
||||
<Panel class="line center">
|
||||
<Button class="pay-btn alipay" onactivate="Pay('alipay','pet')">
|
||||
<Image src="s2r://panorama/images/custom_game/alipay_png.vtex" />
|
||||
<Label text="支付宝" />
|
||||
</Button>
|
||||
<Button class="pay-btn wechatpay" onactivate="Pay('wechatpay','pet')">
|
||||
<Image src="s2r://panorama/images/custom_game/wechatpay_png.vtex" />
|
||||
<Label text="微信" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<Panel id="HtmlPage" onactivate="">
|
||||
<!-- <DOTAHTMLPanel id="Html" url="" ></DOTAHTMLPanel> -->
|
||||
<Panel id="PayQrPanel">
|
||||
<Label html="true" text="获取二维码中,请稍等" />
|
||||
<Image id="PayQrImg" src="" scaling="none" />
|
||||
</Panel>
|
||||
<Label class="center margin-sm" html="true" text="#sponsor_note" />
|
||||
<Button id="CompleteButton" class="btn" onactivate="PayComplete()">
|
||||
<Label text="#pay_complete" />
|
||||
</Button>
|
||||
<Button id="GoBackButton" onactivate="GoBack()">
|
||||
<Label text="#pay_back_button" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</root>
|
||||
516
content/panorama/layout/custom_game/info.xml
Normal file
516
content/panorama/layout/custom_game/info.xml
Normal file
@@ -0,0 +1,516 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/info.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/power.vjs_c" />
|
||||
<include src="s2r://panorama/scripts/custom_game/info.vjs_c" />
|
||||
<include src="s2r://panorama/scripts/custom_game/display_error.vjs_c" />
|
||||
<!-- <include src="s2r://panorama/layout/custom_game/frames/cosmetic_abilities/creator.vjs_c" /> -->
|
||||
</scripts>
|
||||
<snippets>
|
||||
<!-- 卡片 -->
|
||||
<snippet name="CardPoolCard">
|
||||
<Panel class="Card" >
|
||||
<Image id="CardImage" src="" />
|
||||
<Panel class="CardBar"/>
|
||||
<Panel class="CardType"/>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 卡组详情 -->
|
||||
<snippet name="RankDetailCard">
|
||||
<Panel class="RankDetailItem" >
|
||||
<Panel id="CardRankContent"/>
|
||||
<Panel id="StarContent">
|
||||
<Image src="s2r://panorama/images/custom_game/star_png.vtex" />
|
||||
<Image src="s2r://panorama/images/custom_game/star_png.vtex" />
|
||||
<Image src="s2r://panorama/images/custom_game/star_png.vtex" />
|
||||
<Image src="s2r://panorama/images/custom_game/star_png.vtex" />
|
||||
<Image src="s2r://panorama/images/custom_game/star_png.vtex" />
|
||||
</Panel>
|
||||
<Panel id="EquipContent">
|
||||
<DOTAItemImage itemname="" />
|
||||
<DOTAItemImage itemname="" />
|
||||
<DOTAItemImage itemname="" />
|
||||
<DOTAItemImage itemname="" />
|
||||
<DOTAItemImage itemname="" />
|
||||
<DOTAItemImage itemname="" />
|
||||
</Panel>
|
||||
<Panel id="TextContent">
|
||||
<Label html="true" text="" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 攻略列表项目 -->
|
||||
<snippet name="StrategyListItem">
|
||||
<Panel class="URLItem">
|
||||
<Label class="LeftTitle" text="" />
|
||||
<Panel class="TopBottomFlow MiddleAlign">
|
||||
<Label class="URLItemTitle" text="" />
|
||||
<Label class="URLItemSubTitle" text="" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 排行榜列表项目 -->
|
||||
<snippet name="RankListItem">
|
||||
<Panel class="RankItem" onactivate="RankDetail()">
|
||||
<Label class="RankLeftTitle" html="true" text="" />
|
||||
<Panel id="PlayerList">
|
||||
</Panel>
|
||||
<Panel class="TopBottomFlow MiddleAlign">
|
||||
<Label class="URLItemTitle" html="true" text="" />
|
||||
<Label class="URLItemSubTitle" html="true" text="" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 卡池卡片 -->
|
||||
<snippet name="Tower">
|
||||
<Panel class="Tower" >
|
||||
<DOTAItemImage id="Item" itemname="" hittest="false" />
|
||||
<Label id="xxx" text="x" />
|
||||
<Label id="Count" text="" />
|
||||
</Panel>
|
||||
</snippet>
|
||||
</snippets>
|
||||
<Panel hittest="false" class="InfoRoot" >
|
||||
<!--顶部菜单-->
|
||||
<Panel id="iconlist" class="">
|
||||
<Panel id="UpdatePoint" onmouseover="DOTAShowTextTooltip(td_refresh_desc)" onmouseout="DOTAHideTextTooltip()" onactivate="UpdateGamePoint()" >
|
||||
<Image src="s2r://panorama/images/custom_game/refresh2_png.vtex" />
|
||||
</Panel>
|
||||
<Button onmouseover="DOTAShowTextTooltip(td_patron_desc)" onmouseout="DOTAHideTextTooltip()" onactivate="$('#PatronStore').RemoveClass('Hide')" >
|
||||
<Label text="赞助" />
|
||||
</Button>
|
||||
<Label id="AccountID" text="" />
|
||||
</Panel>
|
||||
|
||||
<!-- 商城 -->
|
||||
<Panel id="PatronStore" class="Hide" />
|
||||
|
||||
<!-- 进攻进度 -->
|
||||
<Panel id="AttackingPanel" >
|
||||
<Panel id="CreepCountProcessBar" >
|
||||
<Panel id="CreepCountProcessBarPCT" >
|
||||
</Panel>
|
||||
<Label id="CreepCount" text="#td_pawn_count" />
|
||||
</Panel>
|
||||
<Panel id="DifficultyWavePanel" >
|
||||
<Label id="Difficulty" text="" />
|
||||
<Label id="WaveText" html="true" text="#td_attacking_wave" />
|
||||
</Panel>
|
||||
<Panel id="AttackingProcessTimePanel" >
|
||||
<Label id="AttackingProcessTime" text="5" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 卡池 -->
|
||||
<Panel id="CardPoolPanel" hittest="false">
|
||||
<Panel id="CardPoolHeader" onactivate="$('#CardPoolPanel').ToggleClass('ShowTime')" >
|
||||
<Label text="#td_card_pool" />
|
||||
</Panel>
|
||||
<Panel id="CardPoolContent" />
|
||||
</Panel>
|
||||
|
||||
<!-- 商店 todo-->
|
||||
<Panel id="Shop" />
|
||||
|
||||
<!-- 选择卡片 -->
|
||||
<Panel id="SelectCardPanel" hittest="false" class="Hide">
|
||||
<Panel id="SelectCardHeader" >
|
||||
<Label id="SelectCardHeaderText" text="#td_select_card" />
|
||||
</Panel>
|
||||
<Button id="SelectCardCloseButton" onactivate="SelectCardClose()" >
|
||||
</Button>
|
||||
<Panel id="SelectCardPoolContent" />
|
||||
</Panel>
|
||||
|
||||
<!-- 选择初始卡 -->
|
||||
<Panel id="SelectStartCard" >
|
||||
<Panel class="Card" onactivate="SelectStartCard('item_0001')">
|
||||
<Panel class="ItemImage">
|
||||
<DOTAItemImage hittest="false" itemname="item_0001" />
|
||||
</Panel>
|
||||
<Label class="ItemName" html="true" text="{s:item1}" />
|
||||
<Panel class="ItemContent">
|
||||
<Panel id="Item1Description" class="Description" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<Panel class="Card" onactivate="SelectStartCard('item_0002')">
|
||||
<Panel class="ItemImage">
|
||||
<DOTAItemImage hittest="false" itemname="item_0002" />
|
||||
</Panel>
|
||||
<Label class="ItemName" html="true" text="{s:item2}" />
|
||||
<Panel class="ItemContent">
|
||||
<Panel id="Item2Description" class="Description" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<Panel class="Card" onactivate="SelectStartCard('item_0003')">
|
||||
<Panel class="ItemImage">
|
||||
<DOTAItemImage hittest="false" itemname="item_0003" />
|
||||
</Panel>
|
||||
<Label class="ItemName" html="true" text="{s:item3}" />
|
||||
<Panel class="ItemContent">
|
||||
<Panel id="Item3Description" class="Description" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 打开攻略 -->
|
||||
<Button id="VideosButton" onactivate="VideosPanelOpen()" >
|
||||
<Label text="#td_tutorial_video" />
|
||||
</Button>
|
||||
|
||||
<!-- 踢人按钮 -->
|
||||
<Button id="KickButton" onactivate="KickVoteOpen()" >
|
||||
<Label text="#td_kick_vote" />
|
||||
</Button>
|
||||
|
||||
<!-- 永久暂停按钮 -->
|
||||
<Button id="PauseButton" onactivate="PauseGame()" >
|
||||
<Label text="#pause_game_btn" />
|
||||
</Button>
|
||||
|
||||
<!-- 排行榜按钮 -->
|
||||
<Button id="RankButton" onactivate="RankPanelOpen()" >
|
||||
<Label text="#td_rank_list_100" onmouseover="ShowRankButtonTip(1)" onmouseout="HideRankButtonTip()"/>
|
||||
</Button>
|
||||
|
||||
<!-- 组队排行榜按钮 -->
|
||||
<Button id="TeamRankButton" onactivate="TeamRankPanelOpen()" >
|
||||
<Label text="#td_team_rank_list_100" onmouseover="ShowRankButtonTip(2)" onmouseout="HideRankButtonTip()"/>
|
||||
</Button>
|
||||
|
||||
<!-- 攻略 -->
|
||||
<Panel id="VideosPanel" hittest="false" class="Hide">
|
||||
<Panel id="VideoListWindow" class="Hide" >
|
||||
<Button class="CloseButton" onactivate="VideosPanelClose()" />
|
||||
<Panel id="VideoDescription" >
|
||||
<Label html="true" text="#td_video_tip" />
|
||||
</Panel>
|
||||
<Panel id="URLList" />
|
||||
</Panel>
|
||||
|
||||
<Panel id="StrategyWindow" class="Hide" >
|
||||
<Button class="CloseButton" onactivate="CloseStrategyWindow()" />
|
||||
|
||||
<Label class="StrategyTitle" html="true" text="{s:StrategyTitle1}" />
|
||||
<Label class="StrategyText" html="true" text="{s:StrategyText1}" />
|
||||
|
||||
<Label class="StrategyTitle" html="true" text="{s:StrategyTitle2}" />
|
||||
<Label class="StrategyText" html="true" text="{s:StrategyText2}" />
|
||||
|
||||
<Label class="StrategyTitle" html="true" text="{s:StrategyTitle3}" />
|
||||
<Label class="StrategyText" html="true" text="{s:StrategyText3}" />
|
||||
|
||||
<Label class="StrategyTitle" html="true" text="{s:StrategyTitle4}" />
|
||||
<Label class="StrategyText" html="true" text="{s:StrategyText4}" />
|
||||
|
||||
<Image id="StrategyImage" src="" scaling="stretch-to-fit-preserve-aspect"/>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
|
||||
<!-- 投票踢人 -->
|
||||
<Panel id="KickVotePanel" hittest="false" class="Hide">
|
||||
<Panel id="KickVoteMain" hittest="false">
|
||||
<Button class="KickVoteButton" onactivate="KickVote(1)" >
|
||||
<Label html="true" class="Title" text="#kick_player_1" />
|
||||
<Label html="true" class="Title" text="{s:PlayerName1}" />
|
||||
</Button>
|
||||
<Button class="KickVoteButton" onactivate="KickVote(2)" >
|
||||
<Label html="true" class="Title" text="#kick_player_2" />
|
||||
<Label html="true" class="Title" text="{s:PlayerName2}" />
|
||||
</Button>
|
||||
<Button class="KickVoteButton" onactivate="KickVote(3)" >
|
||||
<Label html="true" class="Title" text="#kick_player_3" />
|
||||
<Label html="true" class="Title" text="{s:PlayerName3}" />
|
||||
</Button>
|
||||
<Button class="KickVoteButton" onactivate="KickVote(4)" >
|
||||
<Label html="true" class="Title" text="#kick_player_4" />
|
||||
<Label html="true" class="Title" text="{s:PlayerName4}" />
|
||||
</Button>
|
||||
<Button id="KickVoteCancelButton" onactivate="KickVoteClose()" >
|
||||
<Label html="true" text="#DOTA_UI_Cancel" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
<!-- 投票踢人确认 -->
|
||||
<Panel id="KickAcceptPanel" class="Hide">
|
||||
<Panel id="KickAcceptText">
|
||||
<Label html="true" text="{s:msg}" />
|
||||
<Label html="true" text="#kick_player_ask" />
|
||||
<Label html="true" text="{d:remaing_time}" />
|
||||
</Panel>
|
||||
<Button id="KickYesButton" class="Ok">
|
||||
<Label text="#yes" />
|
||||
</Button>
|
||||
<Button id="KickNoButton" class="Cancel">
|
||||
<Label text="#no" />
|
||||
</Button>
|
||||
</Panel>
|
||||
|
||||
|
||||
<!-- 排行榜 -->
|
||||
<Panel id="RankPanel" hittest="false" class="Hide">
|
||||
<Panel id="RankListWindow" class="Hide" >
|
||||
<Button class="CloseButton" onactivate="RankPanelClose()" />
|
||||
<Panel id="RankDescription" >
|
||||
<Label html="true" text="#td_rank_list_100_desc" />
|
||||
</Panel>
|
||||
<Panel id="RankList" />
|
||||
</Panel>
|
||||
|
||||
<Panel id="RankDetailWindow" class="Hide" >
|
||||
<Panel class="RightTopButtons">
|
||||
<Button id="ResetRankAll" class="Hide" onactivate="RankResetAll()">
|
||||
<Label text="全部重置" />
|
||||
</Button>
|
||||
<Button id="ResetRank" onactivate="">
|
||||
<Label text="重置" />
|
||||
</Button>
|
||||
<Button class="CloseButton" onactivate="RankDetailClose()" />
|
||||
</Panel>
|
||||
<Panel id="RankDetail" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 组队排行榜 -->
|
||||
<Panel id="TeamRankPanel" hittest="false" class="Hide">
|
||||
<Panel id="TeamRankListWindow" class="Hide" >
|
||||
<Button class="CloseButton" onactivate="TeamRankPanelClose()" />
|
||||
<Panel id="TeamRankDescription" >
|
||||
<Label html="true" text="#td_team_rank_list_100_desc" />
|
||||
</Panel>
|
||||
<Panel id="TeamRankList" />
|
||||
</Panel>
|
||||
|
||||
<Panel id="TeamRankDetailWindow" class="Hide" >
|
||||
<Panel class="RightTopButtons">
|
||||
<Button id="TeamResetRankAll" class="Hide" onactivate="TeamRankResetAll()">
|
||||
<Label text="全部重置" />
|
||||
</Button>
|
||||
<Button id="TeamResetRank" onactivate="">
|
||||
<Label text="重置" />
|
||||
</Button>
|
||||
<Button class="CloseButton" onactivate="TeamRankDetailClose()" />
|
||||
</Panel>
|
||||
<Panel id="TeamRankDetail" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 玩家头像 -->
|
||||
<Panel id="PlayerAvatarElements" class="Hide">
|
||||
<!-- <DOTAAvatarImage hittest="false" hittestchildren="false" /> -->
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
</Panel>
|
||||
|
||||
<!-- 玩家头像 -->
|
||||
<Panel id="TeamPlayerAvatarElements" class="Hide">
|
||||
<!-- <DOTAAvatarImage hittest="false" hittestchildren="false" /> -->
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
<DOTAAvatarImage />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</root>
|
||||
23
content/panorama/layout/custom_game/shop.xml
Normal file
23
content/panorama/layout/custom_game/shop.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/shop.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/shop.vjs_c" />
|
||||
</scripts>
|
||||
<Panel hittest="false" class="ShopRoot" >
|
||||
<Panel id="ShopContent" class="Hidden" onactivate="" >
|
||||
<Panel id="AbilityList" />
|
||||
<Button id="CloseShopButton" onactivate="ToggleStyle(ShopContent, Hidden)" >
|
||||
</Button>
|
||||
</Panel>
|
||||
<Panel id="BottomBar" >
|
||||
<Panel id="BottomBarBG" />
|
||||
<Button id="ShopButton" onactivate="ToggleStyle(ShopContent, Hidden)">
|
||||
<Label id="GoldText" text="" />
|
||||
<Panel id="GoldIcon" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</root>
|
||||
305
content/panorama/layout/custom_game/team_select.xml
Normal file
305
content/panorama/layout/custom_game/team_select.xml
Normal file
@@ -0,0 +1,305 @@
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/team_select.vcss_c" />
|
||||
</styles>
|
||||
<scripts>
|
||||
<include src="s2r://panorama/scripts/custom_game/team_select.vjs_c" />
|
||||
<include src="s2r://panorama/scripts/custom_game/team_select_card.vjs_c" />
|
||||
</scripts>
|
||||
<snippets>
|
||||
<!-- 已选卡片 -->
|
||||
<snippet name="SelectedCard">
|
||||
<Panel class="Card">
|
||||
<Panel id="Content" >
|
||||
<Panel id="ItemInfo" >
|
||||
<DOTAItemImage id="ItemImage" hittest="false" itemname="" />
|
||||
<Label id="ItemName" text="{s:itemname}" />
|
||||
</Panel>
|
||||
<Panel class="Count">
|
||||
<Label class="x" text="x" />
|
||||
<Label class="Text" text="{d:count}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<DOTAScenePanel id="Effect" hittest="false" map="td/selected_card" camera="default" />
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 卡片 -->
|
||||
<snippet name="CardPoolCard">
|
||||
<Panel class="Card" >
|
||||
<Image id="CardBackGround" src="s2r://panorama/images/custom_game/cards/item_n_png.vtex"/>
|
||||
<Image id="CardImage" src="s2r://panorama/images/custom_game/cards/remilia_png.vtex" />
|
||||
<Panel class="CardBar"/>
|
||||
<Panel class="CardType"/>
|
||||
<Panel class="CardRemainingCount">
|
||||
<Label text="x{s:remaining_count}" />
|
||||
</Panel>
|
||||
<Panel class="CardLevel">
|
||||
<Label text="Lv{s:level}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 卡片技能 -->
|
||||
<snippet name="CardAbility">
|
||||
<Panel class="Ability">
|
||||
<Panel class="AbilityHeader">
|
||||
<DOTAAbilityImage id="AbilityImage" abilityname="" />
|
||||
<Label id="AbilityName" html="true" text="" />
|
||||
</Panel>
|
||||
<Panel class="AbilityBody" >
|
||||
<Label id="AbilityDescription" html="true" text="" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 难度槽 -->
|
||||
<snippet name="DifficultyContainer">
|
||||
<Panel class="DifficultyContainer">
|
||||
<Panel class="OptionButtonBackground">
|
||||
<Panel class="Left" />
|
||||
<Panel class="Middle" />
|
||||
<Panel class="Right" />
|
||||
</Panel>
|
||||
<Panel class="MiddleAlign LeftRightFlow">
|
||||
<Panel class="TopBottomFlow">
|
||||
<Label class="T1" text="{d:difficulty}" />
|
||||
<Label class="T2" text="{s:difficultyText}" />
|
||||
</Panel>
|
||||
<Panel id="PlayerList" >
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</snippet>
|
||||
|
||||
<!-- 卡组 -->
|
||||
<snippet name="CardGroupItem">
|
||||
<Panel class="CardGroupItem">
|
||||
<Button>
|
||||
<Label id="GroupName" html="true" text="" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</snippet>
|
||||
</snippets>
|
||||
<Panel hittest="false" class="TeamSelectRoot">
|
||||
<!-- 界面标题 -->
|
||||
<Panel id="SetupTitlePanel" >
|
||||
<Panel id="SetupTitleBG">
|
||||
<Panel class="Left" />
|
||||
<Panel class="Right" />
|
||||
</Panel>
|
||||
<Label id="SetupTitle" text="#addon_game_name" />
|
||||
</Panel>
|
||||
|
||||
<!-- 副标题 -->
|
||||
<Panel id="SetupTitleHR" />
|
||||
<Label id="SetupDescription" html="true" text="#addon_game_name" />
|
||||
|
||||
<!-- 显示时间 -->
|
||||
<Panel id="ReadyTimePanel" >
|
||||
<Label id="ReadyTime" text="" />
|
||||
</Panel>
|
||||
|
||||
<!-- 操作提示 -->
|
||||
<Panel id="CardsPanelTips" >
|
||||
<Panel class="CardPoolNote" >
|
||||
<Panel class="Tip" onmouseover="DOTAShowTextTooltip(td_card_pool_note_desc)" onmouseout="DOTAHideTextTooltip()" >
|
||||
<Image src="s2r://panorama/images/custom_game/note_png.vtex" />
|
||||
<Label text="#td_card_pool_note" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 卡片 -->
|
||||
<Panel id="CardsPanel" hittest="false" >
|
||||
<!-- 左边 - 已选卡组 -->
|
||||
<Panel id="SelectedCard" >
|
||||
<Label id="CardGroupText" html="true" class="Hide" text="" />
|
||||
|
||||
<!-- 显示每种卡片类型数量 -->
|
||||
<Panel id="CardTypeCount">
|
||||
<Panel class="Center LeftRightFlow">
|
||||
<!-- 显示SSR数量 -->
|
||||
<Panel class="CardType SSR" >
|
||||
<Panel class="Block">
|
||||
<Label class="Count" text="{d:ssr_count}" />
|
||||
<Label class="MaxCount" text="/{d:ssr_maxcount}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<!-- 显示SR数量 -->
|
||||
<Panel class="CardType SR" >
|
||||
<Panel class="Block">
|
||||
<Label class="Count" text="{d:sr_count}" />
|
||||
<Label class="MaxCount" text="/{d:sr_maxcount}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<!-- 显示R数量 -->
|
||||
<Panel class="CardType R" >
|
||||
<Panel class="Block">
|
||||
<Label class="Count" text="{d:r_count}" />
|
||||
<Label class="MaxCount" text="/{d:r_maxcount}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
<!-- 显示N数量 -->
|
||||
<Panel class="CardType N" >
|
||||
<Panel class="Block">
|
||||
<Label class="Count" text="{d:n_count}" />
|
||||
<Label class="MaxCount" text="/{d:n_maxcount}+" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 显示已选卡片 -->
|
||||
<Panel id="SelectedCardList" >
|
||||
</Panel>
|
||||
|
||||
<!-- 卡组清单 -->
|
||||
<Panel id="CardGroupOptions" class="Hide" />
|
||||
|
||||
<!-- 按钮 -->
|
||||
<Panel id="CardGroupOptionsButton" class="LeftRightFlow Hide">
|
||||
<Button id="BackToGroupOptions" onactivate="ShowCardGroupList(true)" >
|
||||
<Label text="#page_back" />
|
||||
</Button>
|
||||
<Button id="SaveGroupOptions" onactivate="SaveCardGroup()" >
|
||||
<Label text="#DOTA_Filter_SaveRule" />
|
||||
</Button>
|
||||
</Panel>
|
||||
<Panel id="CardGroupOptionsButton2" class="LeftRightFlow Hide">
|
||||
<Button id="RenameGroupOptions" onactivate="RenameCardGroupDialog()" >
|
||||
<Label text="#td_rename_group" />
|
||||
</Button>
|
||||
<Button id="ClearGroupOptions" onactivate="ClearCardGroupDialog()" >
|
||||
<Label text="#td_clear_all" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 中间 - 卡池 -->
|
||||
<Panel id="CardPool" >
|
||||
<Panel id="CardPoolBackground" />
|
||||
<Panel class="TopBottomFlow FullWidth FullHeight">
|
||||
<Panel id="CardPoolHeader" >
|
||||
<Panel id="CardPoolFilter">
|
||||
<Label style="color:#fff;vertical-align: middle;" text="#td_type" />
|
||||
<ToggleButton id="SSR" selected="true" text="SSR" onactivate="ShowCardFromFilter()" />
|
||||
<ToggleButton id="SR" selected="true" text="SR" onactivate="ShowCardFromFilter()" />
|
||||
<ToggleButton id="R" selected="true" text="R" onactivate="ShowCardFromFilter()" />
|
||||
<ToggleButton id="N" selected="true" text="N" onactivate="ShowCardFromFilter()" />
|
||||
</Panel>
|
||||
<Panel class="RightAlign LeftRightFlow">
|
||||
<Panel id="UpdatePoint" onmouseover="DOTAShowTextTooltip(td_refresh_desc)" onmouseout="DOTAHideTextTooltip()" onactivate="UpdateGamePoint()" >
|
||||
<Image src="s2r://panorama/images/custom_game/refresh_png.vtex" />
|
||||
</Panel>
|
||||
<Panel id="GamePoint" onmouseover="DOTAShowTextTooltip(td_gamepoint_desc)" onmouseout="DOTAHideTextTooltip()" >
|
||||
<Image src="s2r://panorama/images/custom_game/fairy_png.vtex" />
|
||||
<Label text="{d:game_point}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
<Panel id="CardPoolContent" >
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 右边 - 卡片信息 -->
|
||||
<Panel id="CardInfo" >
|
||||
<Panel id="CardInfoContent" >
|
||||
<Panel class="Card" >
|
||||
<DOTAScenePanel id="CardEffect" map="td/card" camera="default" />
|
||||
<Image id="CardBackGround" src="s2r://panorama/images/custom_game/cards/item_n_png.vtex"/>
|
||||
<Image id="CardImage" src="s2r://panorama/images/custom_game/cards/remilia_png.vtex" />
|
||||
<Image id="CardName" src="s2r://panorama/images/custom_game/cards/remilia_name_png.vtex"/>
|
||||
<Panel class="CardBar"/>
|
||||
<Panel class="CardType"/>
|
||||
</Panel>
|
||||
<Button id="DecomposeCardButton" onmouseover="DOTAShowTextTooltip(td_train_card_question)" onmouseout="DOTAHideTextTooltip()" onactivate="TrainCard(1)" oncontextmenu="TrainCard(50)">
|
||||
<Panel class="Center LeftRightFlow MiddleAlign">
|
||||
<Label html="true" text="#td_train_card_title" />
|
||||
<Image src="s2r://panorama/images/custom_game/fairy_png.vtex" />
|
||||
<Label html="true" text="#td_train_card_cost" />
|
||||
</Panel>
|
||||
</Button>
|
||||
<Label id="CardInfoName" html="true" text="" />
|
||||
<Panel id="CardAbilities" >
|
||||
</Panel>
|
||||
<DOTAItemImage id="CardInfoItem" itemname="item_0001" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 难度选择 -->
|
||||
<Panel id="DifficultyPanel" >
|
||||
</Panel>
|
||||
|
||||
<!-- 底部 -->
|
||||
<Panel id="BottomContent" >
|
||||
<Panel class="LeftRightFlow">
|
||||
<Button id="BackButton" onactivate="OnBack()">
|
||||
<Label text="#page_back" />
|
||||
</Button>
|
||||
<Button id="ContinueButton" onactivate="OnContinue()">
|
||||
<Label text="{s:continue_text}" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 玩家头像,必须事先在Xml中创建,snippets和js创建无效 -->
|
||||
<Panel id="PlayerAvatarElements" class="Hide">
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
<DOTAAvatarImage hittest="false" hittestchildren="false" />
|
||||
</Panel>
|
||||
|
||||
<!-- 准备就绪 -->
|
||||
<Panel id="WaitOtherPlayersPanel" >
|
||||
<Panel id="PlayerList" >
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
<!-- 右上角按钮 -->
|
||||
<Panel id="RightTopButtons">
|
||||
<Button onactivate="$('#DonatePanel').RemoveClass('Hide')" >
|
||||
<Label text="#donate" />
|
||||
</Button>
|
||||
</Panel>
|
||||
|
||||
<!-- 赞助 -->
|
||||
<Panel id="DonatePanel" class="Hide" />
|
||||
|
||||
<DOTAScenePanel id="ClickedEffect" hittest="false" map="td/clicked_test" camera="default" />
|
||||
|
||||
<Panel id="LockFrame">
|
||||
<Panel class="loading_ico"/>
|
||||
<Label class="loading" text="Loading..." />
|
||||
<Label id="loading_tips" html="true" text="#td_load_tips" />
|
||||
</Panel>
|
||||
|
||||
<!-- 对话框-->
|
||||
<Panel id="MessageDialog">
|
||||
<Label html="true" text="{s:msg}" />
|
||||
<TextEntry id="MessageInput" maxchars="20" placeholder="" oninputsubmit="" />
|
||||
<Button class="Ok" onactivate="OnMessageDialogOK()">
|
||||
<Label text="#DOTA_UI_Ok" />
|
||||
</Button>
|
||||
<Button class="Cancel" onactivate="CloseMessageDialog()">
|
||||
<Label text="#DOTA_UI_Cancel" />
|
||||
</Button>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</root>
|
||||
380
content/panorama/scripts/custom_game/custom_loading_screen.js
Normal file
380
content/panorama/scripts/custom_game/custom_loading_screen.js
Normal file
@@ -0,0 +1,380 @@
|
||||
|
||||
//Base64字符串编码解码,UTF8,支持汉字。
|
||||
//编码后字符包括+/=,仍然会因为特殊字符被某些应用拒绝,本应用即不行
|
||||
var Base64 = {
|
||||
|
||||
// private property
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||
|
||||
// public method for encoding
|
||||
encode: function(input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = Base64._utf8_encode(input);
|
||||
|
||||
while (i < input.length) {
|
||||
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
|
||||
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
||||
|
||||
}
|
||||
|
||||
return output;
|
||||
},
|
||||
|
||||
// public method for decoding
|
||||
decode: function(input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
|
||||
while (i < input.length) {
|
||||
|
||||
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
||||
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << 6) | enc4;
|
||||
|
||||
output = output + String.fromCharCode(chr1);
|
||||
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
output = Base64._utf8_decode(output);
|
||||
|
||||
return output;
|
||||
|
||||
},
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
_utf8_encode: function(string) {
|
||||
string = string.replace(/\r\n/g, "\n");
|
||||
var utftext = "";
|
||||
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
|
||||
var c = string.charCodeAt(n);
|
||||
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if ((c > 127) && (c < 2048)) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return utftext;
|
||||
},
|
||||
|
||||
// private method for UTF-8 decoding
|
||||
_utf8_decode: function(utftext) {
|
||||
var string = "";
|
||||
var i = 0;
|
||||
var c = c1 = c2 = 0;
|
||||
|
||||
while (i < utftext.length) {
|
||||
|
||||
c = utftext.charCodeAt(i);
|
||||
|
||||
if (c < 128) {
|
||||
string += String.fromCharCode(c);
|
||||
i++;
|
||||
} else if ((c > 191) && (c < 224)) {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
||||
i += 2;
|
||||
} else {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
c3 = utftext.charCodeAt(i + 2);
|
||||
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
||||
i += 3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//字符串与十六进制字符串相互转换,UTF8,支持汉字
|
||||
//防止特殊符号被应用拒绝
|
||||
var StringHex = {
|
||||
|
||||
// public method, Hex字符串编码
|
||||
encode: function(str){
|
||||
var charBuf = StringHex.writeUTF(str, true);
|
||||
var re = '';
|
||||
for(var i = 0; i < charBuf.length; i ++){
|
||||
var x = (charBuf[i] & 0xFF).toString(16);
|
||||
if(x.length === 1){
|
||||
x = '0' + x;
|
||||
}
|
||||
re += x;
|
||||
}
|
||||
return re;
|
||||
},
|
||||
|
||||
// public method,Hex字符串解码
|
||||
decode: function (hexStr) {
|
||||
var buf = [];
|
||||
for(var i = 0; i < hexStr.length; i += 2){
|
||||
buf.push(parseInt(hexStr.substring(i, i+2), 16));
|
||||
}
|
||||
return StringHex.readUTF(buf);
|
||||
},
|
||||
|
||||
// private method
|
||||
writeUTF: function (str, isGetBytes) {
|
||||
var back = [];
|
||||
var byteSize = 0;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var code = str.charCodeAt(i);
|
||||
if (0x00 <= code && code <= 0x7f) {
|
||||
byteSize += 1;
|
||||
back.push(code);
|
||||
} else if (0x80 <= code && code <= 0x7ff) {
|
||||
byteSize += 2;
|
||||
back.push((192 | (31 & (code >> 6))));
|
||||
back.push((128 | (63 & code)))
|
||||
} else if ((0x800 <= code && code <= 0xd7ff)
|
||||
|| (0xe000 <= code && code <= 0xffff)) {
|
||||
byteSize += 3;
|
||||
back.push((224 | (15 & (code >> 12))));
|
||||
back.push((128 | (63 & (code >> 6))));
|
||||
back.push((128 | (63 & code)))
|
||||
}
|
||||
}
|
||||
for (i = 0; i < back.length; i++) {
|
||||
back[i] &= 0xff;
|
||||
}
|
||||
if (isGetBytes) {
|
||||
return back
|
||||
}
|
||||
if (byteSize <= 0xff) {
|
||||
return [0, byteSize].concat(back);
|
||||
} else {
|
||||
return [byteSize >> 8, byteSize & 0xff].concat(back);
|
||||
}
|
||||
},
|
||||
|
||||
// private method
|
||||
readUTF: function (arr) {
|
||||
if (typeof arr === 'string') {
|
||||
return arr;
|
||||
}
|
||||
var UTF = '', _arr = arr;
|
||||
for (var i = 0; i < _arr.length; i++) {
|
||||
var one = _arr[i].toString(2),
|
||||
v = one.match(/^1+?(?=0)/);
|
||||
if (v && one.length == 8) {
|
||||
var bytesLength = v[0].length;
|
||||
var store = _arr[i].toString(2).slice(7 - bytesLength);
|
||||
for (var st = 1; st < bytesLength; st++) {
|
||||
if (st + i < _arr.length) store += _arr[st + i].toString(2).slice(2);
|
||||
}
|
||||
UTF += String.fromCharCode(parseInt(store, 2));
|
||||
i += bytesLength - 1
|
||||
} else {
|
||||
UTF += String.fromCharCode(_arr[i])
|
||||
}
|
||||
}
|
||||
return UTF
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 需要 Base64 支持
|
||||
var StringCode = {
|
||||
encrypt: function(str, pwd) {
|
||||
str = Base64.encode(str);//Base64加密
|
||||
var prand = "";
|
||||
for(var i=0; i<pwd.length; i++) {
|
||||
prand += pwd.charCodeAt(i).toString();
|
||||
}
|
||||
var sPos = Math.floor(prand.length / 5);
|
||||
var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
|
||||
var incr = Math.ceil(pwd.length / 2);
|
||||
var modu = Math.pow(2, 31) - 1;
|
||||
if(mult < 2) {
|
||||
$.Msg("------ Please choose a more complex or longer password.");
|
||||
return null;
|
||||
}
|
||||
var salt = Math.round(Math.random() * 1000000000) % 100000000;
|
||||
prand += salt;
|
||||
while(prand.length > 10) {
|
||||
prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
|
||||
}
|
||||
prand = (mult * prand + incr) % modu;
|
||||
var enc_chr = "";
|
||||
var enc_str = "";
|
||||
for(var i=0; i<str.length; i++) {
|
||||
enc_chr = parseInt(str.charCodeAt(i) ^ Math.floor((prand / modu) * 255));
|
||||
if(enc_chr < 16) {
|
||||
enc_str += "0" + enc_chr.toString(16);
|
||||
} else enc_str += enc_chr.toString(16);
|
||||
prand = (mult * prand + incr) % modu;
|
||||
}
|
||||
salt = salt.toString(16);
|
||||
while(salt.length < 8)salt = "0" + salt;
|
||||
enc_str += salt;
|
||||
return enc_str;
|
||||
},
|
||||
|
||||
decrypt: function(str, pwd) {
|
||||
var prand = "";
|
||||
for(var i=0; i<pwd.length; i++) {
|
||||
prand += pwd.charCodeAt(i).toString();
|
||||
}
|
||||
var sPos = Math.floor(prand.length / 5);
|
||||
var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
|
||||
var incr = Math.round(pwd.length / 2);
|
||||
var modu = Math.pow(2, 31) - 1;
|
||||
var salt = parseInt(str.substring(str.length - 8, str.length), 16);
|
||||
str = str.substring(0, str.length - 8);
|
||||
prand += salt;
|
||||
while(prand.length > 10) {
|
||||
prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
|
||||
}
|
||||
prand = (mult * prand + incr) % modu;
|
||||
var enc_chr = "";
|
||||
var enc_str = "";
|
||||
for(var i=0; i<str.length; i+=2) {
|
||||
enc_chr = parseInt(parseInt(str.substring(i, i+2), 16) ^ Math.floor((prand / modu) * 255));
|
||||
enc_str += String.fromCharCode(enc_chr);
|
||||
prand = (mult * prand + incr) % modu;
|
||||
}
|
||||
//return enc_str;
|
||||
return Base64.decode(enc_str);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
GameUI.Base64 = Base64;
|
||||
GameUI.StringHex = StringHex;
|
||||
GameUI.StringCode = StringCode;
|
||||
|
||||
GameUI.Cheated = false;
|
||||
|
||||
// 创建网页
|
||||
function script() {
|
||||
var fn = arguments[0];
|
||||
var text = fn.toString().split('\n').slice(1,-1).join('\n') + '\n';
|
||||
var len = arguments.length;
|
||||
|
||||
for (var i = 1; i < len; i++) {
|
||||
text = text.replace(new RegExp('\\{'+i+'\\}', 'g'), arguments[i].toString());
|
||||
}
|
||||
return text;
|
||||
}
|
||||
GameUI.CreateHtml = script;
|
||||
|
||||
|
||||
//播放视频,所在页定义一个Panel即可,如 <Panel id="MoviePanel" /> //BLoadLayoutFromString已失效,此方法废弃
|
||||
var moviePage = script(function(){/*
|
||||
<root>
|
||||
<styles>
|
||||
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
|
||||
<include src="s2r://panorama/styles/custom_game/movie.vcss_c" />
|
||||
</styles>
|
||||
<script>
|
||||
var closeHandle = null;
|
||||
function Close() {
|
||||
if (closeHandle) {
|
||||
closeHandle();
|
||||
}
|
||||
}
|
||||
(function() {
|
||||
$.GetContextPanel().OnClose = function (f) { closeHandle = f };
|
||||
$.GetContextPanel().ShowClose = function (isShowClose) { $("#CloseButtonBig").SetHasClass("Hide", isShowClose !== true) };
|
||||
})();
|
||||
</script>
|
||||
<Panel class="MovieRootPanel">
|
||||
<MoviePanel class="Movie" src="file://{resources}/videos/{movie}.webm" repeat="true" autoplay="onload" />
|
||||
<Button id="CloseMoviePlayButton" onactivate="MovieClose()" />
|
||||
</Panel>
|
||||
</root>
|
||||
*/});
|
||||
|
||||
// 刀塔2021.09.18更新后官方移除BLoadLayoutFromString,改造后需要配合xml
|
||||
GameUI.PlayMovie = function (panel, movie, duration, isShowClose) {
|
||||
if (!panel) return;
|
||||
if (!movie) return;
|
||||
panel.RemoveAndDeleteChildren();
|
||||
$.CreatePanelWithProperties( "MoviePanel", panel, "MovieContentPanel", {class:"Movie", src: "file://{resources}/videos/" + movie + ".webm", repeat: "true", autoplay: "onload"} );
|
||||
if (isShowClose === true) {
|
||||
$.CreatePanelWithProperties( "Button", panel, "CloseMoviePlayButton", {onactivate: "$.GetContextPanel().ToggleClass('Hide')"} );
|
||||
}
|
||||
if (duration) {
|
||||
$.Schedule(duration, function () {
|
||||
panel.RemoveAndDeleteChildren();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//将系统API获取的颜色转化为html格式,如 i = Players.GetPlayerColor(id)
|
||||
GameUI.DotaColorToHtml = function (i) {
|
||||
return "#" + ('00' + ( i & 0xFF).toString( 16 ) ).substr( -2 ) +
|
||||
('00' + ( ( i >> 8 ) & 0xFF ).toString( 16 ) ).substr( -2 ) +
|
||||
('00' + ( ( i >> 16 ) & 0xFF ).toString( 16 ) ).substr( -2 ) +
|
||||
('00' + ( ( i >> 24 ) & 0xFF ).toString( 16 ) ).substr( -2 );
|
||||
};
|
||||
|
||||
|
||||
//打印消息
|
||||
GameUI.Print = function (msg) {
|
||||
$.Msg("-------- " + Math.floor(Game.GetGameTime() * 100 + 0.5) / 100 + " : " + msg);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Loading
|
||||
function Loading() {
|
||||
if (Game.GameStateIs(DOTA_GameState.DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP)) {
|
||||
$("#loading_png").visible = false;
|
||||
$("#loading_text").visible = false;
|
||||
return;
|
||||
}
|
||||
$.Schedule(0.5, Loading);
|
||||
}
|
||||
|
||||
;(function() {
|
||||
GameUI.PlayMovie($("#MoviePlayPanel"), "promo/outlanders_bg");
|
||||
Loading();
|
||||
})();
|
||||
53
content/panorama/scripts/custom_game/display_error.js
Normal file
53
content/panorama/scripts/custom_game/display_error.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// steamid至accountid(Dota2数字账户)的转换,字符串
|
||||
function GetAccountID () {
|
||||
var playerInfo = Game.GetPlayerInfo(Game.GetLocalPlayerID());
|
||||
var steamID64 = playerInfo.player_steamid,
|
||||
steamIDPart = Number(steamID64.substring(3)),
|
||||
steamID32 = String(steamIDPart - 61197960265728);
|
||||
return steamID32;
|
||||
}
|
||||
|
||||
// 只能使用kv本地化文件中定义的标签
|
||||
function Errors(data)
|
||||
{
|
||||
GameEvents.SendEventClientSide("dota_hud_error_message", {
|
||||
"splitscreenplayer": 0,
|
||||
"reason": 80,
|
||||
"message": data.msg
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 在聊天频道显示,队友可见
|
||||
function Chat(data)
|
||||
{
|
||||
// 注意 $.Localize 首次使用时必须带第二个参数,之后不需要。
|
||||
// var text = $.Localize(, $.GetContextPanel());
|
||||
var params = data.params;
|
||||
|
||||
var msgPanel = $.CreatePanel("Panel", $.GetContextPanel(), "");
|
||||
msgPanel.visible = false;
|
||||
|
||||
var label = $.CreatePanel("Label", msgPanel, "");
|
||||
|
||||
if (params) {
|
||||
for(var i in params) {
|
||||
var v = params[i];
|
||||
if (typeof v === 'number') {
|
||||
label.SetDialogVariableInt(i, v);
|
||||
} else {
|
||||
label.SetDialogVariable(i, $.Localize(String(v)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label.text = $.Localize(data.msg, label).replace(/%%/g,"%");
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_chat_msg", {'msg':label.text});
|
||||
msgPanel.DeleteAsync(0);
|
||||
}
|
||||
|
||||
(function()
|
||||
{
|
||||
GameEvents.Subscribe("display_custom_error", Errors);
|
||||
GameEvents.Subscribe("display_chat_msg", Chat);
|
||||
})();
|
||||
157
content/panorama/scripts/custom_game/dps_panel.js
Normal file
157
content/panorama/scripts/custom_game/dps_panel.js
Normal file
@@ -0,0 +1,157 @@
|
||||
"use strict";
|
||||
|
||||
// 获取steamid
|
||||
var m_SteamID = null;
|
||||
function GetSteamID() {
|
||||
if (!m_SteamID) {
|
||||
m_SteamID = Game.GetLocalPlayerInfo().player_steamid.toString();
|
||||
}
|
||||
return m_SteamID;
|
||||
}
|
||||
|
||||
var TowerList = CustomNetTables.GetTableValue("CustomGameInfo", "thtd_tower_list");
|
||||
|
||||
GameUI.SetGamePoint = function (point) {
|
||||
var panel = $("#KillCount");
|
||||
if (panel) panel.SetDialogVariableInt("point", point);
|
||||
};
|
||||
|
||||
function FindItemName( unitname ) {
|
||||
for(var itemname in TowerList) {
|
||||
if (TowerList[itemname]["cardname"] === unitname) {
|
||||
return itemname;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function SetTowerTooltip( panel ) {
|
||||
panel.SetPanelEvent("onmouseover", function () {
|
||||
var text = $.Localize(panel.GetAttributeString("UnitName", ""));
|
||||
$.DispatchEvent("DOTAShowTextTooltip", panel, text)
|
||||
});
|
||||
panel.SetPanelEvent("onmouseout", function () {
|
||||
$.DispatchEvent("DOTAHideTextTooltip")
|
||||
});
|
||||
panel.SetPanelEvent("onactivate", function () {
|
||||
var ent = panel.GetAttributeInt("Ent", 0);
|
||||
GameEvents.SendCustomGameEventToServer("custom_game_show_dps_card", {"ent": ent});
|
||||
});
|
||||
}
|
||||
|
||||
function UpdateTowerList( list , dps_max ) {
|
||||
var len = list.length;
|
||||
var TowerList = $("#TowerList");
|
||||
var index = 1;
|
||||
var dps_highest = 0;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var data = list[i];
|
||||
var panel = TowerList.GetChild(index++);
|
||||
if (!panel) {
|
||||
panel = $.CreatePanel("Panel", TowerList, "");
|
||||
panel.BLoadLayoutSnippet("Tower");
|
||||
SetTowerTooltip(panel);
|
||||
}
|
||||
if (index==2) {
|
||||
dps_highest = data.damage;
|
||||
}
|
||||
|
||||
panel.FindChild("Item").itemname = data.itemname;
|
||||
var dpstext = "";
|
||||
var dpsfixed = GameUI.DpsFix(data.damage, GameUI.Wave);
|
||||
if (dpsfixed < 100) {
|
||||
dpstext = dpsfixed * 100;
|
||||
} else {
|
||||
var wan = Math.floor(dpsfixed / 100 + 0.5);
|
||||
if (wan < 10000) {
|
||||
dpstext = wan + "万";
|
||||
} else {
|
||||
dpstext = Math.floor(wan/10000) + "亿" + wan%10000 + "万";
|
||||
}
|
||||
}
|
||||
panel.FindChildTraverse("DPS").text = dpstext;
|
||||
var dps_bar_pct = ( (data.damage/dps_highest)*100 || 0);
|
||||
panel.FindChildTraverse("DPS_bar").style.width = dps_bar_pct + "%";
|
||||
var dps_pct = ( (data.damage/dps_max)*100 || 0);
|
||||
panel.FindChildTraverse("DPS_pct").text = dps_pct.toFixed(1) + "%";
|
||||
panel.SetAttributeString("UnitName", data.unitname);
|
||||
panel.SetAttributeInt("Ent", data.ent);
|
||||
panel.visible = true;
|
||||
}
|
||||
var max = TowerList.GetChildCount();
|
||||
for (var i = index; i < max; i++) {
|
||||
TowerList.GetChild(i).visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
function Update(damagelist) {
|
||||
if (!$.GetContextPanel().BHasClass("ShowTime")) return;
|
||||
if (!damagelist) return;
|
||||
|
||||
var list = [];
|
||||
var dps_max = 0;
|
||||
|
||||
var keys = Object.keys(damagelist); //for (var i in data) 取不到值
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var damage = damagelist[keys[i]];
|
||||
var ent = parseInt(keys[i]);
|
||||
var unitname = Entities.GetUnitName(ent);
|
||||
if (unitname == null || unitname == "") continue;
|
||||
var itemname = FindItemName(unitname);
|
||||
list.push({'itemname':itemname, 'damage':Math.floor(damage), 'unitname': unitname, 'ent': ent});
|
||||
dps_max = dps_max + Math.floor(damage);
|
||||
}
|
||||
|
||||
list.sort(function (a, b) {
|
||||
if (a.damage < b.damage) return 1;
|
||||
if (a.damage == b.damage) return 0;
|
||||
if (a.damage > b.damage) return -1;
|
||||
})
|
||||
|
||||
UpdateTowerList( list, dps_max);
|
||||
}
|
||||
|
||||
// {"creature_kill_count":0,"creep_count":0,"food_count":0}
|
||||
function UpdateInfo(table) {
|
||||
if (!table) return;
|
||||
|
||||
var FoodCount = $("#FoodCount");
|
||||
FoodCount.SetDialogVariableInt("count", table["food_count"]);
|
||||
FoodCount.SetDialogVariableInt("max_count", GameUI.GameData.max_food);
|
||||
$("#KillCount").SetDialogVariableInt("count", table["creature_kill_count"]);
|
||||
}
|
||||
|
||||
;(function(){
|
||||
$("#FoodCount").SetDialogVariableInt("count", 0);
|
||||
$("#FoodCount").SetDialogVariableInt("max_count", 12);
|
||||
$("#KillCount").SetDialogVariableInt("count", 0);
|
||||
$("#KillCount").SetDialogVariableInt("point", 0);
|
||||
|
||||
if (Players.IsSpectator(Players.GetLocalPlayer())) {
|
||||
$("#TowerList").visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
GameUI.SetGamePoint(GameUI.PlayerData.point);
|
||||
|
||||
CustomNetTables.SubscribeNetTableListener("TowerListInfo", OnNetTableTowerListInfo);
|
||||
CustomNetTables.SubscribeNetTableListener("CustomGameInfo", OnNetTableCustomGameInfo);
|
||||
})();
|
||||
|
||||
function OnNetTableTowerListInfo(table_name, key, data) {
|
||||
// $.Msg( "---------- Table: ", table_name, ", changed: '", key, "' = ", data );
|
||||
|
||||
if (key === "damagelist" + GetSteamID()) {
|
||||
Update(data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function OnNetTableCustomGameInfo(table_name, key, data) {
|
||||
// $.Msg( "---------- Table: ", table_name, ", changed: '", key, "' = ", data );
|
||||
|
||||
if (key === "game_info" + GetSteamID()) {
|
||||
UpdateInfo(data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
34
content/panorama/scripts/custom_game/end_screen.js
Normal file
34
content/panorama/scripts/custom_game/end_screen.js
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
(function(){
|
||||
GameUI.SetDefaultUIEnabled( DotaDefaultUIElement_t.DOTA_DEFAULT_UI_ENDGAME, false );
|
||||
|
||||
var playerIDs = Game.GetPlayerIDsOnTeam(DOTATeam_t.DOTA_TEAM_GOODGUYS);
|
||||
for (var i = 0; i < playerIDs.length; i++) {
|
||||
var id = playerIDs[i];
|
||||
var info = Game.GetPlayerInfo(id);
|
||||
var panel = $.CreatePanel("Panel", $("#PlayersPanel"), "");
|
||||
panel.BLoadLayoutSnippet("player");
|
||||
|
||||
panel.FindChild("PlayerColor").style.backgroundColor = GameUI.DotaColorToHtml(Players.GetPlayerColor(id));
|
||||
|
||||
panel.FindChild("AvatarImage").steamid = info.player_steamid;
|
||||
panel.FindChild("PlayerAndHeroNameContainer").FindChild("PlayerNameLabel").text = info.player_name;
|
||||
panel.FindChild("PlayerAndHeroNameContainer").FindChild("HeroNameLabel").text = $.Localize(info.player_selected_hero);
|
||||
|
||||
var table = CustomNetTables.GetTableValue("CustomGameInfo", "game_info" + info.player_steamid);
|
||||
var KillCount = panel.FindChild("KillCount");
|
||||
KillCount.text = table["creature_kill_count"];
|
||||
}
|
||||
|
||||
if (Game.GetGameWinner() === DOTATeam_t.DOTA_TEAM_GOODGUYS) {
|
||||
$("#WinText").text = $.Localize("#dota_match_history_win");
|
||||
} else {
|
||||
$("#WinText").AddClass("fail");
|
||||
$("#WinText").text = $.Localize("#dota_match_history_loss");
|
||||
}
|
||||
|
||||
$.Schedule(5, function () {
|
||||
$("#ContinueButton").RemoveClass('Hide');
|
||||
})
|
||||
})();
|
||||
1361
content/panorama/scripts/custom_game/info.js
Normal file
1361
content/panorama/scripts/custom_game/info.js
Normal file
File diff suppressed because it is too large
Load Diff
268
content/panorama/scripts/custom_game/power.js
Normal file
268
content/panorama/scripts/custom_game/power.js
Normal file
@@ -0,0 +1,268 @@
|
||||
var PowerLabelModifier;
|
||||
var CritDamageLabelModifier;
|
||||
var CritChanceLabelModifier;
|
||||
var itemList = [];
|
||||
|
||||
function CustomPowerPanelRefresh() {
|
||||
var mainSelected = Players.GetLocalPlayerPortraitUnit();
|
||||
if(mainSelected != null && mainSelected != -1) {
|
||||
if (Entities.GetTeamNumber(mainSelected) == DOTATeam_t.DOTA_TEAM_GOODGUYS) {
|
||||
var basePower = Entities.GetDayTimeVisionRange(mainSelected) - 800;
|
||||
var percentage = Entities.GetNightTimeVisionRange(mainSelected) - 800;
|
||||
var bonusPower = Math.floor(basePower * percentage/100);
|
||||
if (!Entities.IsRooted(mainSelected)) {
|
||||
basePower = 0;
|
||||
bonusPower = 0;
|
||||
}
|
||||
if (bonusPower > 0) {
|
||||
PowerLabelModifier.text = basePower.toString() + "<font color='#2dc03a'>+" + bonusPower.toString() + "</font>";
|
||||
} else if (bonusPower == 0) {
|
||||
PowerLabelModifier.text = basePower.toString();
|
||||
} else {
|
||||
PowerLabelModifier.text = basePower.toString() + "<font color='red'>-" + Math.abs(bonusPower).toString() + "</font>";
|
||||
}
|
||||
|
||||
var buffs = Entities.GetNumBuffs(mainSelected);
|
||||
var isCritZero = true;
|
||||
var isChanceZero = true;
|
||||
var isCritFind = false;
|
||||
var isChanceFind = false;
|
||||
for (var i = 0; i < buffs; i++) {
|
||||
var buff = Entities.GetBuff(mainSelected, i);
|
||||
var buffname = Buffs.GetName( mainSelected, buff);
|
||||
if (!isCritFind && buffname === "modifier_touhoutd_crit_damage") {
|
||||
CritDamageLabelModifier.text = "<font color='yellow'>" + Buffs.GetStackCount(mainSelected, buff) + "%</font>";
|
||||
isCritZero = false;
|
||||
isCritFind = true;
|
||||
if (isChanceFind) break;
|
||||
} else if (!isChanceFind && buffname === "modifier_touhoutd_crit_chance") {
|
||||
CritChanceLabelModifier.text = "<font color='#c9520d'>" + Buffs.GetStackCount(mainSelected, buff) + "%</font>";
|
||||
isChanceZero = false;
|
||||
isChanceFind = true;
|
||||
if (isCritFind) break;
|
||||
}
|
||||
}
|
||||
if (isCritZero) CritDamageLabelModifier.text = "<font color='yellow'>0%</font>";
|
||||
if (isChanceZero) CritChanceLabelModifier.text = "<font color='#c9520d'>0%</font>";
|
||||
} else {
|
||||
PowerLabelModifier.text = "0";
|
||||
CritDamageLabelModifier.text = "<font color='yellow'>0%</font>";
|
||||
CritChanceLabelModifier.text = "<font color='#c9520d'>0%</font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CustomStarPanelRefresh() {
|
||||
var mainSelected = Players.GetLocalPlayerPortraitUnit();
|
||||
if(mainSelected != null && mainSelected != -1) {
|
||||
for (var i = 0; i <= 5; i++ ) {
|
||||
var ent = Entities.GetItemInSlot(mainSelected, i);
|
||||
if (ent != "-1" && ent != "32767") {
|
||||
var star = 0;
|
||||
var level = 0;
|
||||
var itemName = Abilities.GetAbilityName(ent);
|
||||
if (itemName.substr(0,6) === "item_0") {
|
||||
var itemLevel = Abilities.GetLevel(ent);
|
||||
star = Math.floor((itemLevel-1)/10) + 1;
|
||||
level = itemLevel - (star-1) * 10;
|
||||
} else {
|
||||
if (itemName == "item_1003" || itemName == "item_1011") {
|
||||
star = 1;
|
||||
level = 10;
|
||||
} else if (itemName == "item_1004" || itemName == "item_1012") {
|
||||
star = 2;
|
||||
level = 10;
|
||||
} else if (itemName == "item_1005" || itemName == "item_1013") {
|
||||
star = 3;
|
||||
level = 10;
|
||||
} else if (itemName == "item_1006" || itemName == "item_1014") {
|
||||
star = 4;
|
||||
level = 10;
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 1; j <= 5; j++) {
|
||||
itemList[i][j].visible = j <= star;
|
||||
}
|
||||
itemList[i][6].visible = level > 0;
|
||||
itemList[i][6].text = level > 0 ? level.toString() : "";
|
||||
} else {
|
||||
for ( var j = 1; j <= 6; j++ ) {
|
||||
itemList[i][j].visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CustomPanelRefresh () {
|
||||
CustomPowerPanelRefresh();
|
||||
CustomStarPanelRefresh();
|
||||
return $.Schedule(0.15, CustomPanelRefresh);
|
||||
}
|
||||
|
||||
|
||||
;(function(){
|
||||
// 能量显示
|
||||
var root = $.GetContextPanel().GetParent().GetParent().GetParent();
|
||||
var stats = root.FindChild("HUDElements").FindChild("lower_hud").FindChild("center_with_stats").FindChild("center_block").FindChild("stats_container");
|
||||
stats.FindChildTraverse("stats").style["height"] = "110px";
|
||||
stats.FindChildTraverse("stragiint").visible = false;
|
||||
var statContainer = stats.FindChildTraverse("stats").FindChild("Aligner").FindChild("StatContainer");
|
||||
if(statContainer.FindChildTraverse("power") == null)
|
||||
{
|
||||
var power = $.CreatePanel("Panel", statContainer, "power");
|
||||
power.AddClass("StatIconLabel");
|
||||
var column = $.CreatePanel("Panel", power, "column");
|
||||
column.AddClass("LabelColumn");
|
||||
var container = $.CreatePanel("Panel", column, "container");
|
||||
container.AddClass("DamageLabelContainer");
|
||||
var labelmodifier = $.CreatePanel("Label", container, "labelmodifier");
|
||||
labelmodifier.AddClass("MonoNumbersFont");
|
||||
labelmodifier.AddClass("StatRegionLabel");
|
||||
labelmodifier.AddClass("StatModifier");
|
||||
labelmodifier.style["margin-top"] = "1px";
|
||||
labelmodifier.html = true;
|
||||
labelmodifier.text = "0";
|
||||
PowerLabelModifier = labelmodifier;
|
||||
var icon = $.CreatePanel("Panel", power, "DamageIcon");
|
||||
icon.AddClass("StatIcon");
|
||||
}
|
||||
if(statContainer.FindChildTraverse("crit_damage") == null)
|
||||
{
|
||||
var power = $.CreatePanel("Panel", statContainer, "crit_damage");
|
||||
power.AddClass("StatIconLabel");
|
||||
var column = $.CreatePanel("Panel", power, "column");
|
||||
column.AddClass("LabelColumn");
|
||||
var container = $.CreatePanel("Panel", column, "container");
|
||||
container.AddClass("DamageLabelContainer");
|
||||
var labelmodifier = $.CreatePanel("Label", container, "labelmodifier");
|
||||
labelmodifier.AddClass("MonoNumbersFont");
|
||||
labelmodifier.AddClass("StatRegionLabel");
|
||||
labelmodifier.AddClass("StatModifier");
|
||||
// labelmodifier.style["margin-top"] = "1px";
|
||||
labelmodifier.html = true;
|
||||
labelmodifier.text = "<font color='yellow'>0%</font>";
|
||||
CritDamageLabelModifier = labelmodifier;
|
||||
var icon = $.CreatePanel("Panel", power, "DamageIcon");
|
||||
icon.AddClass("StatIcon");
|
||||
}
|
||||
if(statContainer.FindChildTraverse("crit_chance") == null)
|
||||
{
|
||||
var power = $.CreatePanel("Panel", statContainer, "crit_chance");
|
||||
power.AddClass("StatIconLabel");
|
||||
var column = $.CreatePanel("Panel", power, "column");
|
||||
column.AddClass("LabelColumn");
|
||||
var container = $.CreatePanel("Panel", column, "container");
|
||||
container.AddClass("DamageLabelContainer");
|
||||
var labelmodifier = $.CreatePanel("Label", container, "labelmodifier");
|
||||
labelmodifier.AddClass("MonoNumbersFont");
|
||||
labelmodifier.AddClass("StatRegionLabel");
|
||||
labelmodifier.AddClass("StatModifier");
|
||||
// labelmodifier.style["margin-top"] = "1px";
|
||||
labelmodifier.html = true;
|
||||
labelmodifier.text = "<font color='#c9520d'>0%</font>";
|
||||
CritChanceLabelModifier = labelmodifier;
|
||||
var icon = $.CreatePanel("Panel", power, "DamageIcon");
|
||||
icon.AddClass("StatIcon");
|
||||
}
|
||||
|
||||
|
||||
// 背包物品星级和等级
|
||||
var centerBlock = root.FindChild("HUDElements").FindChild("lower_hud").FindChild("center_with_stats").FindChild("center_block");
|
||||
var inventory = centerBlock.FindChild("inventory");
|
||||
|
||||
var list = inventory.FindChildTraverse("inventory_list");
|
||||
for ( var i = 0; i <= 2; i++ ) {
|
||||
var slot = list.FindChildTraverse("inventory_slot_" + i.toString());
|
||||
var item = slot.FindChildTraverse("AbilityButton");
|
||||
|
||||
itemList[i] = item;
|
||||
|
||||
var labelmodifier = $.CreatePanel("Label", item, "labellevel");
|
||||
itemList[i][6] = labelmodifier;
|
||||
labelmodifier.style.width = "16px";
|
||||
labelmodifier.style.height = "16px";
|
||||
labelmodifier.style.color = "#FFCC33";
|
||||
labelmodifier.style["horizontal-align"] = "right";
|
||||
labelmodifier.style["vertical-align"] = "top";
|
||||
labelmodifier.style["font-size"] = "16px";
|
||||
labelmodifier.style["text-shadow"] = "0px 0px 4px 4 #000000";
|
||||
labelmodifier.style["letter-spacing"] = "0 px";
|
||||
labelmodifier.text = "";
|
||||
|
||||
for ( var j = 1; j <= 5; j++ )
|
||||
{
|
||||
var img = $.CreatePanel("Image", item, "Image_" + j.toString());
|
||||
var imgNum = "Image_"+j.toString();
|
||||
img.SetImage("s2r://panorama/images/custom_game/star_png.vtex");
|
||||
img.style.width = "12px";
|
||||
img.style.height = "12px";
|
||||
img.style.x = (12* (j-1)).toString() + "px";
|
||||
img.style["horizontal-align"] = "left";
|
||||
img.style["vertical-align"] = "bottom";
|
||||
itemList[i][j] = img;
|
||||
img.visible = false;
|
||||
}
|
||||
}
|
||||
list = inventory.FindChildTraverse("inventory_list2");
|
||||
for ( var i = 3; i <= 5; i++ ) {
|
||||
var slot = list.FindChildTraverse("inventory_slot_" + i.toString());
|
||||
var item = slot.FindChildTraverse("AbilityButton");
|
||||
|
||||
itemList[i] = item;
|
||||
|
||||
var labelmodifier = $.CreatePanel("Label", item, "labellevel");
|
||||
itemList[i][6] = labelmodifier;
|
||||
labelmodifier.style.width = "16px";
|
||||
labelmodifier.style.height = "16px";
|
||||
labelmodifier.style.color = "#FFCC33";
|
||||
labelmodifier.style["horizontal-align"] = "right";
|
||||
labelmodifier.style["vertical-align"] = "top";
|
||||
labelmodifier.style["font-size"] = "16px";
|
||||
labelmodifier.style["text-shadow"] = "0px 0px 4px 4 #000000";
|
||||
labelmodifier.style["letter-spacing"] = "0 px";
|
||||
labelmodifier.text = "";
|
||||
|
||||
|
||||
for ( var j = 1; j <= 5; j++ )
|
||||
{
|
||||
var img = $.CreatePanel("Image", item, "Image_" + j.toString());
|
||||
var imgNum = "Image_"+j.toString();
|
||||
img.SetImage("s2r://panorama/images/custom_game/star_png.vtex");
|
||||
img.style.width = "12px";
|
||||
img.style.height = "12px";
|
||||
img.style.x = (12* (j-1)).toString() + "px";
|
||||
img.style["horizontal-align"] = "left";
|
||||
img.style["vertical-align"] = "bottom";
|
||||
itemList[i][j] = img;
|
||||
img.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
CustomPanelRefresh();
|
||||
|
||||
GameEvents.Subscribe("dota_inventory_changed", OnDotaInventoryChanged);
|
||||
GameEvents.Subscribe("dota_inventory_item_changed", OnDotaInventoryChanged);
|
||||
// GameEvents.Subscribe("dota_player_update_selected_unit", OnDotaPlayerUpdateSelectedUnit);
|
||||
// GameEvents.Subscribe("dota_player_update_query_unit", OnDotaPlayerUpdateSelectedUnit); //点击单位
|
||||
// GameEvents.Subscribe("thtd_power_update", CustomPowerPanelRefresh);
|
||||
// GameEvents.Subscribe("dota_portrait_unit_modifiers_changed", OnDotaPortraitUnitModifiersChanged);
|
||||
})();
|
||||
|
||||
|
||||
function OnDotaInventoryChanged(data) {
|
||||
// 背包有物品称动、入、出均可触发
|
||||
CustomStarPanelRefresh();
|
||||
}
|
||||
|
||||
// function OnDotaPlayerUpdateSelectedUnit(data) {
|
||||
// CustomPowerPanelRefresh();
|
||||
// CustomStarPanelRefresh();
|
||||
// }
|
||||
|
||||
// function OnDotaPortraitUnitModifiersChanged(data) {
|
||||
// CustomPowerPanelRefresh();
|
||||
// }
|
||||
|
||||
|
||||
75
content/panorama/scripts/custom_game/shop.js
Normal file
75
content/panorama/scripts/custom_game/shop.js
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
var ShopUnit = -1;
|
||||
|
||||
function Update() {
|
||||
var gold = Players.GetGold(Players.GetLocalPlayer()) + Players.GetLastBuybackTime(Players.GetLocalPlayer());
|
||||
$("#GoldText").text = gold;
|
||||
|
||||
var AbilityList = $("#AbilityList");
|
||||
var max = AbilityList.GetChildCount();
|
||||
for (var i = 0; i < max; i++) {
|
||||
var panel = AbilityList.GetChild(i);
|
||||
panel.SetHasClass("CanBuy", gold >= panel.GetAttributeInt("Gold", 0));
|
||||
}
|
||||
|
||||
$.Schedule(0.2, Update);
|
||||
}
|
||||
|
||||
if (!Players.IsSpectator(Players.GetLocalPlayer())) {
|
||||
Update();
|
||||
} else {
|
||||
$("#ShopContent").DeleteAsync(0.0);
|
||||
$("#BottomBar").DeleteAsync(0.0);
|
||||
}
|
||||
|
||||
// 获取商店单位
|
||||
$.Schedule(5, function () {
|
||||
if (Players.IsSpectator(Players.GetLocalPlayer())) {
|
||||
return;
|
||||
}
|
||||
var unitList = Entities.GetAllEntitiesByClassname("npc_dota_creature");
|
||||
for (var i = 0; i < unitList.length; i++) {
|
||||
if (Entities.GetUnitName(unitList[i]) === "minoriko_shop" &&
|
||||
Entities.IsControllableByPlayer(unitList[i], Players.GetLocalPlayer())) {
|
||||
ShopUnit = unitList[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function setAbilityEvent( panel ) {
|
||||
panel.SetDraggable(true);
|
||||
panel.SetPanelEvent("onmouseover", function () {
|
||||
$.DispatchEvent("DOTAShowAbilityTooltip", panel, panel.abilityname);
|
||||
});
|
||||
panel.SetPanelEvent("onmouseout", function () {
|
||||
$.DispatchEvent("DOTAHideAbilityTooltip");
|
||||
});
|
||||
panel.SetPanelEvent("oncontextmenu", function () {
|
||||
Game.PrepareUnitOrders({
|
||||
OrderType: dotaunitorder_t.DOTA_UNIT_ORDER_CAST_NO_TARGET,
|
||||
UnitIndex: ShopUnit,
|
||||
AbilityIndex: panel.contextEntityIndex,
|
||||
OrderIssuer: PlayerOrderIssuer_t.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var AbilityList = $("#AbilityList");
|
||||
for (var i = 0; i < 7; i++) {
|
||||
var ability = Entities.GetAbility( ShopUnit, i )
|
||||
if (ability > 0) {
|
||||
// var abilityname = Abilities.GetAbilityName(ability);
|
||||
if (Abilities.IsHidden(ability) || Abilities.IsAutocast(ability)) continue;
|
||||
var panel = $.CreatePanel("DOTAAbilityImage", AbilityList, "");
|
||||
var gold = Abilities.GetSpecialValueFor(ability, "cost") || 0;
|
||||
panel.contextEntityIndex = ability;
|
||||
panel.SetAttributeInt("Gold", gold);
|
||||
setAbilityEvent( panel );
|
||||
|
||||
var label = $.CreatePanel("Label", panel, "");
|
||||
label.text = gold
|
||||
label.AddClass("Gold");
|
||||
}
|
||||
}
|
||||
})
|
||||
1070
content/panorama/scripts/custom_game/team_select.js
Normal file
1070
content/panorama/scripts/custom_game/team_select.js
Normal file
File diff suppressed because it is too large
Load Diff
259
content/panorama/scripts/custom_game/team_select_card.js
Normal file
259
content/panorama/scripts/custom_game/team_select_card.js
Normal file
@@ -0,0 +1,259 @@
|
||||
|
||||
|
||||
// 卡池中的卡片事件
|
||||
function setCardPoolEvent(panel, card) {
|
||||
panel.SetPanelEvent("oncontextmenu", function () {
|
||||
if (card.IsDisabled() || ShowingCardGroup) return;
|
||||
card.Select();
|
||||
})
|
||||
panel.SetPanelEvent("ondblclick", function () {
|
||||
if (card.IsDisabled() || ShowingCardGroup) return;
|
||||
card.Select();
|
||||
})
|
||||
panel.SetPanelEvent("onactivate", function () {
|
||||
card.ShowInfo();
|
||||
Game.EmitSound("UI.ClickCard");
|
||||
})
|
||||
}
|
||||
|
||||
function TouhouCard( parent, itemName, itemData, isPreview ) {
|
||||
var panel = $.CreatePanel("Panel", parent, "");
|
||||
panel.BLoadLayoutSnippet("CardPoolCard");
|
||||
setCardPoolEvent(panel, this);
|
||||
|
||||
panel.SetDialogVariable("remaining_count", "0");
|
||||
panel.SetDialogVariable("level", "0");
|
||||
panel.SetAttributeString("itemname", itemName);
|
||||
panel.SetHasClass(GetQualityText(itemData.quality), true);
|
||||
panel.FindChild("CardBackGround").SetImage("s2r://panorama/images/custom_game/cards/item_" + GetQualityText(itemData.quality) + "_png.vtex");
|
||||
panel.FindChild("CardImage").SetImage("s2r://panorama/images/custom_game/cards/" + itemData.cardname + "_png.vtex");
|
||||
|
||||
this.hPanel = panel;
|
||||
this.szItemName = itemName;
|
||||
this.hItemData = itemData;
|
||||
this.bIsItem = itemData.cardname.indexOf("item_") === 0;
|
||||
this.nSelectedCount = 0;
|
||||
if (itemName === "item_2021" || itemName === "item_2022")
|
||||
this.nMaxCount = 1;
|
||||
else if (isPreview)
|
||||
this.nMaxCount = 0;
|
||||
else
|
||||
this.nMaxCount = GetSingleCardMaxCount(itemData.quality, this.bIsItem);
|
||||
|
||||
if (this.bIsItem) {
|
||||
panel.GetChild(panel.GetChildCount() - 1).visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 物品名称
|
||||
TouhouCard.prototype.GetItemName = function() {
|
||||
return this.szItemName
|
||||
};
|
||||
|
||||
//
|
||||
TouhouCard.prototype.GetItemData = function() {
|
||||
return this.hItemData
|
||||
};
|
||||
|
||||
// 获取已选数量
|
||||
TouhouCard.prototype.GetSelectedCount = function() {
|
||||
return this.nSelectedCount
|
||||
};
|
||||
|
||||
// 获取品质
|
||||
TouhouCard.prototype.GetQuality = function() {
|
||||
return this.hItemData.quality
|
||||
};
|
||||
|
||||
// 更新卡牌
|
||||
TouhouCard.prototype.Update = function() {
|
||||
var itemname = this.szItemName;
|
||||
var isItem = this.bIsItem;
|
||||
var quality = this.hItemData.quality;
|
||||
var singleCount = this.nSelectedCount;
|
||||
var maxCount = this.nMaxCount;
|
||||
var remainingCount = maxCount - singleCount;
|
||||
var panel = this.hPanel;
|
||||
|
||||
// 设置剩余数量
|
||||
if (ShowingCardGroup) {
|
||||
this.nSelectedCount = 0;
|
||||
panel.SetDialogVariable("remaining_count", maxCount.toString());
|
||||
} else {
|
||||
panel.SetDialogVariable("remaining_count", remainingCount.toString());
|
||||
}
|
||||
|
||||
if (!isItem) {
|
||||
var level = GameUI.PowerLevel && GameUI.PowerLevel[itemname] ? GameUI.PowerLevel[itemname] : 0;
|
||||
panel.SetDialogVariable("level", level.toString());
|
||||
panel.GetChild(panel.GetChildCount() - 1).visible = level > 0;
|
||||
}
|
||||
|
||||
if (quality === 4) Current_SSR_Count = FindCardCount(4);
|
||||
else if (quality === 3) Current_SR_Count = FindCardCount(3);
|
||||
else if (quality === 2) Current_R_Count = FindCardCount(2);
|
||||
else if (quality === 1) Current_N_Count = FindCardCount(1);
|
||||
|
||||
// 设置禁用状态
|
||||
if (ShowingCardGroup) {
|
||||
panel.SetHasClass("disable", true);
|
||||
|
||||
} else if (remainingCount <= 0) {
|
||||
panel.SetHasClass("disable", true);
|
||||
|
||||
} else if (quality === 4) {
|
||||
panel.SetHasClass("disable", (Current_SSR_Count === CardCount_SSR) || singleCount >= maxCount);
|
||||
|
||||
} else if (quality === 3) {
|
||||
panel.SetHasClass("disable", (Current_SR_Count === CardCount_SR) || singleCount >= maxCount);
|
||||
|
||||
} else if (quality === 2) {
|
||||
panel.SetHasClass("disable", (Current_R_Count === CardCount_R) || singleCount >= maxCount);
|
||||
|
||||
} else if (quality === 1) {
|
||||
panel.SetHasClass("disable", (Current_N_Count >= MaxCardCount_N) || singleCount >= maxCount);
|
||||
}
|
||||
};
|
||||
|
||||
// 是否为禁用状态
|
||||
TouhouCard.prototype.IsDisabled = function() {
|
||||
return this.hPanel.BHasClass("disable");
|
||||
};
|
||||
|
||||
// 选择卡牌
|
||||
TouhouCard.prototype.Select = function() {
|
||||
var count = FindCardCount(quality);
|
||||
if (count >= GetQualityMaxCount(quality)) return;
|
||||
|
||||
var data = this.hItemData;
|
||||
var quality = data.quality;
|
||||
var itemname = this.szItemName;
|
||||
var singleCount = this.nSelectedCount;
|
||||
var maxCount = this.nMaxCount;
|
||||
var isItem = this.bIsItem;
|
||||
|
||||
if (singleCount >= maxCount) {
|
||||
this.Update();
|
||||
return;
|
||||
}
|
||||
|
||||
this.nSelectedCount++;
|
||||
|
||||
UpdateSelectedCards(itemname);
|
||||
UpdateCardPool();
|
||||
|
||||
Game.EmitSound('UI.SelectCard');
|
||||
};
|
||||
|
||||
// 移除卡牌
|
||||
TouhouCard.prototype.Remove = function() {
|
||||
this.nSelectedCount--;
|
||||
if (this.nSelectedCount < 0) this.nSelectedCount = 0;
|
||||
UpdateCardPool();
|
||||
};
|
||||
|
||||
// 显示查看卡牌信息
|
||||
TouhouCard.prototype.ShowInfo = function() {
|
||||
if (LastShowInfoCard) {
|
||||
LastShowInfoCard.hPanel.SetHasClass("ShowInfo", false);
|
||||
}
|
||||
this.hPanel.SetHasClass("ShowInfo", true);
|
||||
LastShowInfoCard = this;
|
||||
|
||||
var data = this.hItemData;
|
||||
var isItem = this.bIsItem;
|
||||
var quality = data.quality;
|
||||
if ( isItem ) {
|
||||
$("#CardInfoName").text = $.Localize("DOTA_Tooltip_ability_" + data.cardname);
|
||||
} else {
|
||||
$("#CardInfoName").text = $.Localize(data.cardname);
|
||||
}
|
||||
|
||||
var CardInfoContent = $("#CardInfoContent");
|
||||
var Card = CardInfoContent.GetChild(0);
|
||||
Card.SetHasClass("SwapCard", false);
|
||||
Card.SetHasClass("SwapCard", true);
|
||||
Card.SetHasClass("SSR", false);
|
||||
Card.SetHasClass("SR", false);
|
||||
Card.SetHasClass("R", false);
|
||||
Card.SetHasClass("N", false);
|
||||
Card.SetHasClass(GetQualityText(quality), true);
|
||||
if (data.cardname.indexOf("item_") === 0) {
|
||||
Card.FindChildTraverse("CardImage").SetImage("s2r://panorama/images/custom_game/cards/" + data.cardname + "_png.vtex");
|
||||
} else {
|
||||
Card.FindChildTraverse("CardImage").SetImage("s2r://panorama/images/custom_game/cards/" + data.cardname + "_big_png.vtex");
|
||||
}
|
||||
|
||||
if (GameUI.LuckCardCrit > 0 && (data.cardname === GameUI.LuckCardName || GameUI.LuckCardName === "all")) {
|
||||
Card.FindChildTraverse("CardName").SetImage("s2r://panorama/images/custom_game/cards/luck_png.vtex");
|
||||
} else {
|
||||
Card.FindChildTraverse("CardName").SetImage("s2r://panorama/images/custom_game/cards/" + data.cardname + "_name_png.vtex");
|
||||
}
|
||||
|
||||
Card.FindChildTraverse("CardBackGround").SetImage("s2r://panorama/images/custom_game/cards/item_" + GetQualityText(quality) + "_png.vtex");
|
||||
|
||||
// 特效
|
||||
var CardEffect = Card.FindChildTraverse("CardEffect");
|
||||
CardEffect.FireEntityInput("SSR", "StopPlayEndCap", "1");
|
||||
CardEffect.FireEntityInput("SR", "StopPlayEndCap", "1");
|
||||
CardEffect.FireEntityInput(GetQualityText(quality), "Start", "1");
|
||||
|
||||
// 显示培养按钮
|
||||
|
||||
var decomposeValue = 0;
|
||||
if (quality === 1)
|
||||
decomposeValue = 5;
|
||||
else
|
||||
decomposeValue = 10;
|
||||
|
||||
var DecomposeCardButton = $("#DecomposeCardButton");
|
||||
DecomposeCardButton.enabled = !isItem && decomposeValue > 0;
|
||||
DecomposeCardButton.SetDialogVariableInt("amount", decomposeValue);
|
||||
|
||||
// 显示技能
|
||||
var CardAbilities = $("#CardAbilities");
|
||||
var index = 0;
|
||||
if (isItem) {
|
||||
$("#CardInfoItem").visible = true;
|
||||
$("#CardInfoItem").itemname = data.cardname;
|
||||
} else {
|
||||
$("#CardInfoItem").visible = false;
|
||||
|
||||
// 显示技能
|
||||
for (var i = 0; i < 8; i++) {
|
||||
var abilityname = "thtd_" + data.cardname + "_0" + i;
|
||||
var key = "DOTA_Tooltip_ability_" + abilityname;
|
||||
var nameText = $.Localize(key);
|
||||
if (nameText !== key) {
|
||||
if (nameText.substr(0, 5) === "link_") {
|
||||
key = nameText.substr(5, nameText.length - 5);
|
||||
abilityname = key.substr("DOTA_Tooltip_ability_".length, key.length - "DOTA_Tooltip_ability_".length);
|
||||
nameText = $.Localize(key);
|
||||
}
|
||||
var panel = CardAbilities.GetChild(index++);
|
||||
if (!panel) {
|
||||
var panel = $.CreatePanel("Panel", CardAbilities, "");
|
||||
panel.BLoadLayoutSnippet("CardAbility");
|
||||
(function (main) {
|
||||
main.SetPanelEvent("onmouseover", function () {
|
||||
var name = main.GetAttributeString("abilityname", "");
|
||||
$.DispatchEvent("DOTAShowAbilityTooltip", main, name);
|
||||
});
|
||||
main.SetPanelEvent("onmouseout", function () {
|
||||
$.DispatchEvent("DOTAHideAbilityTooltip");
|
||||
});
|
||||
})(panel)
|
||||
}
|
||||
panel.SetAttributeString("abilityname", abilityname);
|
||||
panel.FindChildTraverse("AbilityImage").abilityname = abilityname;
|
||||
panel.FindChildTraverse("AbilityName").text = nameText;
|
||||
panel.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var max = CardAbilities.GetChildCount();
|
||||
for (var i = index; i < max; i++) {
|
||||
CardAbilities.GetChild(i).visible = false;
|
||||
}
|
||||
};
|
||||
67
content/panorama/scripts/custom_game/util.js
Normal file
67
content/panorama/scripts/custom_game/util.js
Normal file
@@ -0,0 +1,67 @@
|
||||
var DOTA_TEAM_SPECTATOR = 1;
|
||||
|
||||
function GetDotaHud() {
|
||||
var p = $.GetContextPanel();
|
||||
while (p !== null && p.id !== 'Hud') {
|
||||
p = p.GetParent();
|
||||
}
|
||||
if (p === null) {
|
||||
throw new HudNotFoundException('Could not find Hud root as parent of panel with id: ' + $.GetContextPanel().id);
|
||||
} else {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
function SubscribeToNetTableKey(tableName, key, callback) {
|
||||
var immediateValue = CustomNetTables.GetTableValue(tableName, key) || {};
|
||||
if (immediateValue != null) callback(immediateValue);
|
||||
CustomNetTables.SubscribeNetTableListener(tableName, function (_tableName, currentKey, value) {
|
||||
if (currentKey === key && value != null) callback(value);
|
||||
});
|
||||
}
|
||||
|
||||
function FindDotaHudElement(id) {
|
||||
return GetDotaHud().FindChildTraverse(id);
|
||||
}
|
||||
|
||||
function GetHEXPlayerColor(playerId) {
|
||||
var playerColor = Players.GetPlayerColor(playerId).toString(16);
|
||||
return playerColor == null ? '#000000' : ('#' + playerColor.substring(6, 8) + playerColor.substring(4, 6) + playerColor.substring(2, 4) + playerColor.substring(0, 2));
|
||||
}
|
||||
|
||||
function secondsToMS(seconds, bTwoChars) {
|
||||
var sec_num = parseInt(seconds, 10);
|
||||
var minutes = Math.floor(sec_num / 60);
|
||||
var seconds = Math.floor(sec_num - minutes * 60);
|
||||
|
||||
if (bTwoChars && minutes < 10)
|
||||
minutes = '0' + minutes;
|
||||
if (seconds < 10)
|
||||
seconds = '0' + seconds;
|
||||
return minutes + ':' + seconds;
|
||||
}
|
||||
|
||||
function dynamicSort(property) {
|
||||
var sortOrder = 1;
|
||||
if (property[0] === "-") {
|
||||
sortOrder = -1;
|
||||
property = property.substr(1);
|
||||
}
|
||||
return function(a, b) {
|
||||
var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;
|
||||
return result * sortOrder;
|
||||
}
|
||||
}
|
||||
|
||||
function SortPanelChildren(panel, sortFunc, compareFunc) {
|
||||
var tlc = panel.Children().sort(sortFunc)
|
||||
$.Each(tlc, function(child) {
|
||||
for (var k in tlc) {
|
||||
var child2 = tlc[k]
|
||||
if (child != child2 && compareFunc(child, child2)) {
|
||||
panel.MoveChildBefore(child, child2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user