Ejemplo n.º 1
0
void MkFileSystem::SetSystemSetting(const MkDataNode& node)
{
	// chunk size
	unsigned int chunkSizeInMB;
	if (node.GetData(L"ChunkSizeInMB", chunkSizeInMB, 0))
	{
		SetChunkSizeGuideline(chunkSizeInMB);
	}

	// comp limit
	unsigned int percentageForCompressing;
	if (node.GetData(L"PercentageForCompressing", percentageForCompressing, 0))
	{
		SetPercentageForCompressing(percentageForCompressing);
	}

	// name rule
	MkStr prefix, extension;
	if (node.GetData(L"Prefix", prefix, 0) && node.GetData(L"Extension", extension, 0))
	{
		SetChunkFileNamingRule(prefix, extension);
	}

	// filtering
	MkArray<MkStr> filterBuffer;
	MkArray<MkPathName> exceptionFilter;
	if (node.GetData(L"ExceptionFilter", filterBuffer))
	{
		exceptionFilter.Reserve(filterBuffer.GetSize());
		MK_INDEXING_LOOP(filterBuffer, i)
		{
			exceptionFilter.PushBack(filterBuffer[i]);
		}
void MkCheckBoxControlNode::SetObjectTemplate(MkDataNode& node)
{
	MkWindowBaseNode::SetObjectTemplate(node);

	// ObjKey_CaptionTextName
	node.CreateUnit(ObjKey_CaptionString, MkStr::EMPTY);
	node.CreateUnit(ObjKey_OnCheck, false);
}
Ejemplo n.º 3
0
void MkWindowThemedNode::ChangeThemeName(const MkHashStr& srcThemeName, const MkHashStr& destThemeName)
{
	MkArray<MkHashStr> names(2);
	names.PushBack(srcThemeName);
	names.PushBack(destThemeName);
	MkDataNode argument;
	argument.CreateUnitEx(ArgKey_ChangeTheme, names);

	SendNodeCommandTypeEvent(ePA_SNE_ChangeTheme, &argument);
}
Ejemplo n.º 4
0
void MkWindowBaseNode::SetObjectTemplate(MkDataNode& node)
{
	MkWindowThemedNode::SetObjectTemplate(node);

	// update attribute
	MkBitField32 attr;
	node.GetData(ObjKey_Attribute, attr.m_Field, 0);
	attr.Assign(ePA_SNA_AcceptInput, true);
	attr.Assign(ePA_SNA_Enable, true);
	node.SetData(ObjKey_Attribute, attr.m_Field, 0);
}
Ejemplo n.º 5
0
	GP_SupplyDepotWindow(const MkHashStr& name) : MkBaseWindowNode(name)
	{
		MkDataNode node;
		if (node.Load(L"Scene\\supply_depot_page.msd"))
		{
			Load(node);

			AttachChildNode(GameSharedUI::SystemCB);

			m_StartBtnKey = L"Start";
			m_BackBtnKey = L"Back";
		}
	}
Ejemplo n.º 6
0
	static void Proceed(const MkDataNode& targetNode, const MkHashStr& unitName, MkInterfaceForDataWriting& dwInterface)
	{
		MkArray<DataType> dataList;
		targetNode.GetData(unitName, dataList);
		MK_INDEXING_LOOP(dataList, i)
		{
			dwInterface.Write(dataList[i]);
		}
Ejemplo n.º 7
0
void MkLineShape::SaveObject(MkDataNode& node) const
{
	// attribute
	node.SetData(ObjKey_Attribute, m_Attribute.m_Field, 0);

	// local vertices
	node.SetDataEx(ObjKey_LocalVertices, m_LocalVertices);

	// local depth
	node.SetData(ObjKey_LocalDepth, m_LocalDepth, 0);

	// indice
	node.SetData(ObjKey_Indice, m_Indices);

	// color
	node.SetData(ObjKey_Color, m_Color.ConvertToD3DCOLOR(), 0);
}
void MkBodyFrameControlNode::LoadObject(const MkDataNode& node)
{
	// SetClientSize() 호출 전 hanging type이 세팅되어 있어야 함
	int hangingType = static_cast<int>(eHT_None);
	node.GetData(ObjKey_HangingType, hangingType, 0);
	m_HangingType = static_cast<eHangingType>(hangingType);

	MkWindowBaseNode::LoadObject(node);
}
void MkCheckBoxControlNode::SaveObject(MkDataNode& node) const
{
	MkWindowBaseNode::SaveObject(node);

	// caption
	if (ChildExist(CaptionNodeName))
	{
		const MkWindowTagNode* captionNode = dynamic_cast<const MkWindowTagNode*>(GetChildNode(CaptionNodeName));
		if (captionNode != NULL)
		{
			node.CreateUnitEx(ObjKey_CaptionTextName, captionNode->GetTextName());
			node.SetData(ObjKey_CaptionString, m_CaptionString, 0);
		}
	}

	// check
	node.SetData(ObjKey_OnCheck, m_OnCheck, 0);
}
Ejemplo n.º 10
0
void MkLineShape::LoadObject(const MkDataNode& node)
{
	// attribute
	node.GetData(ObjKey_Attribute, m_Attribute.m_Field, 0);

	// local vertices
	node.GetDataEx(ObjKey_LocalVertices, m_LocalVertices);

	// local depth
	node.GetData(ObjKey_LocalDepth, m_LocalDepth, 0);

	// indice
	node.GetData(ObjKey_Indice, m_Indices);

	// color
	unsigned int color;
	if (node.GetData(ObjKey_Color, color, 0))
	{
		m_Color.SetByD3DCOLOR(color);
	}
}
Ejemplo n.º 11
0
void MkCheckBoxControlNode::LoadObject(const MkDataNode& node)
{
	MkWindowBaseNode::LoadObject(node);

	// caption
	MkArray<MkHashStr> textName;
	if (node.GetDataEx(ObjKey_CaptionTextName, textName) && (!textName.Empty()))
	{
		MkStr caption;
		node.GetData(ObjKey_CaptionString, caption, 0);

		_SetCaption(textName, caption);
	}

	// check
	bool onCheck;
	if (node.GetData(ObjKey_OnCheck, onCheck, 0))
	{
		SetCheck(onCheck);
	}
}
Ejemplo n.º 12
0
void MkWindowThemedNode::SaveObject(MkDataNode& node) const
{
	MkVisualPatternNode::SaveObject(node);

	// theme name
	node.SetDataEx(ObjKey_ThemeName, m_ThemeName, 0);
	
	// component
	if ((m_ComponentType > MkWindowThemeData::eCT_None) && (m_ComponentType < MkWindowThemeData::eCT_RegularMax))
	{
		node.SetDataEx(ObjKey_ComponentType, MkWindowThemeData::ComponentTypeName[m_ComponentType], 0);
	}
	else if (m_ComponentType == MkWindowThemeData::eCT_CustomForm)
	{
		node.SetDataEx(ObjKey_CustomFormName, m_CustomFormName, 0);
	}

	// use shadow
	node.SetData(ObjKey_UseShadow, m_UseShadow, 0);

	// client size
	node.SetDataEx(ObjKey_ClientSize, m_ClientRect.size, 0);

	// frame type
	if ((m_FrameType > MkWindowThemeData::eFT_None) && (m_FrameType < MkWindowThemeData::eFT_Max))
	{
		node.SetDataEx(ObjKey_FrameType, MkWindowThemeData::FrameTypeName[m_FrameType], 0);
	}
}
Ejemplo n.º 13
0
void MkLineShape::SetObjectTemplate(MkDataNode& node)
{
	// attribute
	MkBitField32 attr;
	attr.Assign(eRecordable, false);
	attr.Assign(eVisible, true);
	node.CreateUnit(ObjKey_Attribute, attr.m_Field);

	// local vertices
	MkArray<MkFloat2> fEmpty;
	node.CreateUnitEx(ObjKey_LocalVertices, fEmpty);

	// local depth
	node.CreateUnit(ObjKey_LocalDepth, 0.f);

	// indice
	MkArray<unsigned int> uiEmpty;
	node.CreateUnit(ObjKey_Indice, uiEmpty);

	// color
	node.CreateUnit(ObjKey_Color, MkColor::White.ConvertToD3DCOLOR());
}
Ejemplo n.º 14
0
void MkWindowBaseNode::_StartCursorReport(ePA_SceneNodeEvent evt, const MkInt2& position)
{
	// report
	MkFloat2 worldPos(static_cast<float>(position.x), static_cast<float>(position.y));
	MkFloat2 localPos = worldPos - GetWorldPosition();

	MkDataNode arg;
	arg.CreateUnit(MkWindowBaseNode::ArgKey_CursorLocalPosition, MkVec2(localPos.x, localPos.y));
	arg.CreateUnit(MkWindowBaseNode::ArgKey_CursorWorldPosition, MkVec2(worldPos.x, worldPos.y));
	StartNodeReportTypeEvent(evt, &arg);

	// call back
	if (!m_CallBackTargetWindowPath.Empty())
	{
		do
		{
			MkSceneNode* mgrNode = FindNearestDerivedNode(ePA_SNT_WindowManagerNode); // 소속 window mananger
			if (mgrNode == NULL)
				break;

			MkSceneNode* targetNode = mgrNode->GetChildNode(m_CallBackTargetWindowPath); // call back을 호출 할 node
			if ((targetNode == NULL) || (!targetNode->IsDerivedFrom(ePA_SNT_WindowBaseNode)))
				break;

			MkWindowBaseNode* winBase = dynamic_cast<MkWindowBaseNode*>(targetNode);
			if (winBase == NULL)
				break;

			MkArray<MkHashStr> myPath;
			GetWindowPath(myPath);
			winBase->CallBackOperation(evt, &arg, myPath);
			return;
		}
		while (false);

		m_CallBackTargetWindowPath.Clear(); // 부정 경로. 초기화
	}
}
Ejemplo n.º 15
0
void MkWindowThemedNode::SetObjectTemplate(MkDataNode& node)
{
	MkVisualPatternNode::SetObjectTemplate(node);

	node.CreateUnit(ObjKey_ThemeName, MkStr::EMPTY);
	node.CreateUnit(ObjKey_ComponentType, MkStr::EMPTY);
	node.CreateUnit(ObjKey_CustomFormName, MkStr::EMPTY);
	node.CreateUnit(ObjKey_UseShadow, false);
	node.CreateUnitEx(ObjKey_ClientSize, MkFloat2::Zero);
	node.CreateUnit(ObjKey_FrameType, MkStr::EMPTY);
	
}
Ejemplo n.º 16
0
void MkWindowThemedNode::LoadObject(const MkDataNode& node)
{
	MkVisualPatternNode::LoadObject(node);

	// theme name
	MkHashStr themeName;
	if (node.GetDataEx(ObjKey_ThemeName, themeName, 0) && (!themeName.Empty()))
	{
		SetThemeName(themeName);
	}

	// component
	MkHashStr componentBuffer;
	if (node.GetDataEx(ObjKey_ComponentType, componentBuffer, 0) && (!componentBuffer.Empty()))
	{
		SetComponentType(MkWindowThemeData::ConvertComponentNameToType(componentBuffer));
	}
	else if (node.GetDataEx(ObjKey_CustomFormName, componentBuffer, 0) && (!componentBuffer.Empty()))
	{
		SetComponentType(MkWindowThemeData::eCT_CustomForm);
		SetCustomForm(componentBuffer);
	}

	// shadow
	bool useShadow;
	if (node.GetData(ObjKey_UseShadow, useShadow, 0))
	{
		SetShadowUsage(useShadow);
	}

	// client size
	MkFloat2 clientSize;
	if (node.GetDataEx(ObjKey_ClientSize, clientSize, 0))
	{
		SetClientSize(clientSize);
	}

	// frame type
	MkHashStr frameTypeName;
	if (node.GetDataEx(ObjKey_FrameType, frameTypeName, 0) && (!frameTypeName.Empty()))
	{
		m_FrameType = MkWindowThemeData::ConvertFrameNameToType(frameTypeName);
	}

	// form state -> default
	SetFormState(MkWindowThemeFormData::eS_Default);
}
Ejemplo n.º 17
0
	virtual bool SetUp(MkDataNode& sharingNode)
	{
		// 파일로부터 읽음
		MkDataNode dataNode;
		dataNode.Load(L"..\\..\\test01.txt");

		// 노드 탐색
		MkDataNode* orcNode = dataNode.GetChildNode(L"MonsterTable")->GetChildNode(L"Orc");

		// 값 확인 : KoreanName(overwrite)
		MkStr koreanName;
		if (orcNode->GetData(L"KoreanName", koreanName, 0))
		{
			MK_DEV_PANEL.MsgToLog(L"");
			MK_DEV_PANEL.MsgToLog(L"KoreanName : " + koreanName);
		}

		// 값 확인 : intelligence(overwrite)
		int intelligence;
		if (orcNode->GetData(L"intelligence", intelligence, 0))
		{
			MK_DEV_PANEL.MsgToLog(L"");
			MK_DEV_PANEL.MsgToLog(L"intelligence : " + MkStr(intelligence));
		}

		// 값 확인 : threeSize(템플릿에만 존재)
		MkArray<unsigned int> threeSize;
		if (orcNode->GetData(L"threeSize", threeSize))
		{
			MK_DEV_PANEL.MsgToLog(L"");
			MK_DEV_PANEL.MsgToLog(L"threeSize :");

			MK_INDEXING_LOOP(threeSize, i)
			{
				MK_DEV_PANEL.MsgToLog(L"   - " + MkStr(threeSize[i]));
			}
void MkBodyFrameControlNode::SetObjectTemplate(MkDataNode& node)
{
	MkWindowBaseNode::SetObjectTemplate(node);

	node.CreateUnit(ObjKey_HangingType, static_cast<int>(eHT_None));
}
void MkBodyFrameControlNode::SaveObject(MkDataNode& node) const
{
	MkWindowBaseNode::SaveObject(node);

	node.SetData(ObjKey_HangingType, static_cast<int>(m_HangingType), 0);
}
Ejemplo n.º 20
0
void MkWindowBaseNode::UpdateCursorInput
(const MkInt2& position, const MkInt2& movement, bool cursorInside, eButtonState leftBS, eButtonState middleBS, eButtonState rightBS, int wheelDelta)
{
	if (cursorInside)
	{
		if (IsQuadForm())
		{
			switch (leftBS)
			{
			case eBS_None:
			case eBS_Released:
				SetFormState(MkWindowThemeFormData::eS_Focus);
				break;

			case eBS_Pushing:
			case eBS_Pressed:
			case eBS_DoubleClicked:
				SetFormState(MkWindowThemeFormData::eS_Pushing);
				break;
			}
		}

		if (!m_CursorInside)
		{
			StartNodeReportTypeEvent(ePA_SNE_CursorEntered, NULL);
		}

		switch (leftBS)
		{
		case eBS_Released:
			_StartCursorReport(ePA_SNE_CursorLBtnReleased, position);
			m_HoldingEventType = ePA_SNE_None;
			break;
		case eBS_Pressed:
			_StartCursorReport(ePA_SNE_CursorLBtnPressed, position);
			_StartHoldingCheck(ePA_SNE_CursorLBtnHold, position);
			break;
		case eBS_DoubleClicked:
			_StartCursorReport(ePA_SNE_CursorLBtnDBClicked, position);
			_StartHoldingCheck(ePA_SNE_CursorLBtnHold, position);
			break;
		}

		switch (middleBS)
		{
		case eBS_Released:
			_StartCursorReport(ePA_SNE_CursorMBtnReleased, position);
			m_HoldingEventType = ePA_SNE_None;
			break;
		case eBS_Pressed:
			_StartCursorReport(ePA_SNE_CursorMBtnPressed, position);
			_StartHoldingCheck(ePA_SNE_CursorMBtnHold, position);
			break;
		case eBS_DoubleClicked:
			_StartCursorReport(ePA_SNE_CursorMBtnDBClicked, position);
			_StartHoldingCheck(ePA_SNE_CursorMBtnHold, position);
			break;
		}

		switch (rightBS)
		{
		case eBS_Released:
			_StartCursorReport(ePA_SNE_CursorRBtnReleased, position);
			m_HoldingEventType = ePA_SNE_None;
			break;
		case eBS_Pressed:
			_StartCursorReport(ePA_SNE_CursorRBtnPressed, position);
			_StartHoldingCheck(ePA_SNE_CursorRBtnHold, position);
			break;
		case eBS_DoubleClicked:
			_StartCursorReport(ePA_SNE_CursorRBtnDBClicked, position);
			_StartHoldingCheck(ePA_SNE_CursorRBtnHold, position);
			break;
		}

		// holding check
		if ((m_HoldingEventType == ePA_SNE_CursorLBtnHold) || (m_HoldingEventType == ePA_SNE_CursorMBtnHold) || (m_HoldingEventType == ePA_SNE_CursorRBtnHold))
		{
			MkTimeState ts;
			MK_TIME_MGR.GetCurrentTimeState(ts);

			if (m_HoldingCounter.OnTick(ts))
			{
				_StartCursorReport(m_HoldingEventType, position);

				m_HoldingEventType = ePA_SNE_None;
			}
		}

		if (wheelDelta != 0)
		{
			MkDataNode arg;
			arg.CreateUnit(MkWindowBaseNode::ArgKey_WheelDelta, wheelDelta);
			StartNodeReportTypeEvent(ePA_SNE_WheelMoved, &arg);
		}
	}
	else
	{
		if (IsQuadForm())
		{
			SetFormState(MkWindowThemeFormData::eS_Normal);
		}

		StartNodeReportTypeEvent(ePA_SNE_CursorLeft, NULL);

		m_HoldingEventType = ePA_SNE_None;
	}

	m_CursorInside = cursorInside;
}