void _XWindow_TrainingSpell::DecideSuccess(void) { m_SuccessPoint++; m_StaySuccessAreaTime = 0; AddGauge(m_SuccessPoint); m_bDrawMouseSuccessAnimation = true; // m_GaugeGradeImage.SetClipRect(0, 82, (m_SuccessPoint*19), 93); m_SuccessAlphaValue = 255; m_SuccessImageStartTime = g_LocalSystemTime; m_SuccessImagePosition.x = m_CurrentMousePos.x - 20; m_SuccessImagePosition.y = m_WindowPosition.y + 25; _XPlayInterfaceSound(ID_SR_INTERFACE_TRA_OK01_WAV); if(m_SuccessPoint >= 12) { // Send Packet g_NetworkKernel.SendPacket(MSG_NO_MINIGAME_MAST_STAGE_C_S, m_TrainingGrade); m_bWaitForServerRes = TRUE; } }
void GaugePanel::InitFromXMLNode(XMLNode gaugeNode) { Check(gaugeNode.IsValid() && gaugeNode.GetName() == "Panel"); // Create gauges as described by the XML file XMLNode::NodeList nodeList = gaugeNode.GetChildList("Gauge"); XMLNode::NodeList::iterator iter; for (iter = nodeList.begin(); iter != nodeList.end(); ++iter) { Gauge *pGauge = GaugeFactory::CreateGaugeInstance(*iter); if (pGauge != NULL) { pGauge->SetParentRenderObject(this); AddGauge(pGauge); } } double scale = globals->m_PrefManager->GetPrefD("DefaultPanelScale"); double zoom = globals->m_PrefManager->GetPrefD("Zoom"); double x, y; // temp variables // Set the units per pixel if (gaugeNode.HasChild("UnitsPerPixel")) { SetUnitsPerPixel(gaugeNode.GetChild("UnitsPerPixel").GetTextAsDouble()); } else { SetUnitsPerPixel(globals->m_PrefManager->GetPrefD("UnitsPerPixel")); } // Set the scale if (gaugeNode.HasChild("Scale")) { gaugeNode.GetChild("Scale").GetTextAsCoord(x, y); SetScale(x * zoom * scale, y * zoom * scale); } else { SetScale(zoom * scale, zoom * scale); } // Set the position if (gaugeNode.HasChild("Position")) { gaugeNode.GetChild("Position").GetTextAsCoord(x, y); SetPosition(x * zoom, y * zoom); } else { SetPosition(0.0, 0.0); } // Set the size if (gaugeNode.HasChild("Size")) { gaugeNode.GetChild("Size").GetTextAsCoord(x, y); SetSize(x, y); } else { SetSize(0.0, 0.0); } // Set the gauge outline if (gaugeNode.HasChild("Outline")) { SetPanelOutline(gaugeNode.GetChild("Outline").GetTextAsBool()); } }