Я в точности следую гайду по созданию окошка с квестами, но то что я вижу в доте не совпадает с видео гайдом, хотя код аналогичный. В доте с 2017 года что-то поменялось?
CSS:
.QuestRoot{
height: 500px;
width: 500px;
horizontal-align:left;
background-color: green;
vertical-align:center;
}
#QuestName
{
horizontal-align:center;
font-size:24px;
color:white;
text-decoration: underline;
}
#Quests{
flow-children: down;
}
.Quest{
background-color: white;
flow-children: right;
}
#LeftSide{
width: 50px;
height: 50px;
margin: 5px 5px 5px 5px;
background-color:purple;
}
HTML:
<root>
<styles>
<include src="file://{resources}/styles/custom_game/generalPanel.css" />
</styles>
<scripts>
<include src="file://{resources}/scripts/custom_game/generalPanel.js" />
</scripts>
<snippets>
<snippet name="Quest">
<Panel class="Quest">
<Panel id="LeftSide">
<Panel id="QuestImage">
</Panel>
</Panel>
<Panel id="RightSide">
<Panel id="TopSide">
<Label id="QuestTitle" text="Sample Quest Title" />
</Panel>
<Panel id="BottomSide">
<Panel id="Background" />
<Label id="QuestDiscription" text="Simple Quest Desc" />
<Label id="QuestProgress" text="0/1" />
</Panel>
</Panel>
</Panel>
</snippet>
</snippets>
<Panel class="QuestRoot" >
<Label id="QuestName" text="Quests" />
<Panel id="Quests">
</Panel>
</Panel>
</root>
Код:
function AddDebugQuest(){
var panel = $.CreatePanel("Panel", $("#Quests"), '');
panel.SetHasClass("Quest",true);
}
function debug(){
$.Msg("Debug!");
AddDebugQuest();
AddDebugQuest();
}
debug();
Последнее редактирование: