Try
Code: Select all
sleep(50);
Code: Select all
wait(ScoreMgr != Null);
Moderator: English Moderator
Code: Select all
wait(ScoreMgr != Null);
(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(LocalUser.Id, DataFileMgr.Campaigns[0].CampaignId));
Here's my code:Qlex wrote: ↑11 Sep 2017, 13:23 Alright, I think it's time to do it from a different context. Here's what I propose :
You should find the number of skillpoints from the main menu, then give it to the page using a variable for Page, and then the layer should get that variable and display it.
Can I find your code somewhere so I can see what's best to suggest?
Code: Select all
//--------------------------------------Race-->WH
Code: Select all
//--------------------------------------Race==>WH
Code: Select all
wait(ScoreMgr != Null);
(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(LocalUser.Id, DataFileMgr.Campaigns[0].CampaignId));
//(Page.GetFirstChild("Rank") as CMlLabel).SetText(""^ ScoreMgr.CampaignLeaderBoard_GetPlayerRanking(LocalUser.Id, DataFileMgr.Campaigns[0].CampaignId, LocalUser.ZonePath, False));
(Page.GetFirstChild("zone") as CMlLabel).SetText(LocalUser.ZonePath);
(Page.GetFirstChild("country") as CMlQuad).ImageUrl = LocalUser.ZoneFlagUrl;
log("Successfully opened TM2UF campaign manialink");
while(True)
{...
I have an solution to the whole problem. I will include the first frame of solo.xml to main menu script with charts, so game will be able to load the datas, so no error will be thrown. I will write here if a problem wll occur
Code: Select all
SendCustomEvent("solo", ["ask_skillpoints"]);
Code: Select all
if (Event.CustomEventType == "solo") {
switch (Event.CustomEventData[0]) {
case "ask_skillpoints" : {
declare CUILayer SoloLayer = Event.CustomEventLayer;
declare Integer Page_SoloSP for SoloLayer.LocalPage;
Page_SoloSP = ScoreMgr.Campaign_GetSkillPoints(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId);
LayerCustomEvent(SoloLayer , "skillpoints_sent", Text[]);
}
Code: Select all
foreach(Event in PendingEvents) {
switch (Event.Type) {
case CMlScriptEvent::Type::PluginCustomEvent: {
switch (Event.CustomEventType) {
case "skillpoints_sent" : {
declare Integer Page_SoloSP for Page;
(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ Page_SoloSP);
}
}
}
}
}
Users browsing this forum: No registered users and 1 guest