//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiConnectInfo::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
	if (Ini.Load(Buff))
	{
		Init(&Ini, "RuningImgBg");
		m_ConfirmBtn.Init(&Ini, "ConfirmBtn");
		m_InputPwdWnd.Init(&Ini, "Password");
		m_DelRoleBtn.Init(&Ini, "DelRole");
		m_DelRoleBgImg.Init(&Ini, "DelRoleBgImg");
		m_CancelDelRoleBtn.Init(&Ini, "CancelDelRole");

		Ini.GetString("Message", "MsgColor", "0,0,0", Buff, sizeof(Buff));
		m_uMsgColor = GetColor(Buff);
		Ini.GetString("Message", "MsgBorderColor", "0,0,0", Buff, sizeof(Buff));
		m_uMsgBorderColor = GetColor(Buff);
		Ini.GetString("Message", "MsgColor2", "0,0,0", Buff, sizeof(Buff));
		m_uMsgColor2=  GetColor(Buff);
		Ini.GetString("Message", "MsgBorderColor2", "0,0,0", Buff, sizeof(Buff));
		m_uMsgBorderColor2=  GetColor(Buff);
		Ini.GetInteger("Message", "ColorChangeInterval", 0, (int*)&m_uMsgColorChangeInterval);
		Ini.GetInteger("Message", "Font", 12, &m_nFont);

		int	x, y, w, h;
		Ini.GetInteger2("Message", "Pos", &x, &y);
		Ini.GetInteger2("Message", "Size", &w, &h);
		m_nTextCentreX = x + w / 2;
		m_nTextCentreY = y;

		Ini.GetString("RuningImgBg", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}
}
/*********************************************************************
* 功能:载入界面方案
**********************************************************************/
void KUiTongAssignBox::LoadScheme(const char* pScheme)
{
	if(ms_pSelf)
	{
		char		Buff[128];
		KIniFile	Ini;
		sprintf(Buff, "%s\\%s", pScheme, TONG_ASSIGN_BOX_INI);

		if(Ini.Load(Buff))
		{
			ms_pSelf->Init(&Ini, "Main");

			ms_pSelf->m_BtnPilgarlic.Init(&Ini, "BtnMember");
			ms_pSelf->m_BtnCaptain.Init(&Ini, "BtnManager");
			ms_pSelf->m_BtnConfirm.Init(&Ini, "BtnConfirm");
			ms_pSelf->m_BtnElder.Init(&Ini, "BtnDirector");
			ms_pSelf->m_BtnCancel.Init(&Ini, "BtnCancel");
			ms_pSelf->m_TargetName.Init(&Ini, "PlayerName");
			ms_pSelf->m_TextError.Init(&Ini, "ErrorBox");

			ms_pSelf->m_BtnElder.SetText("长老");
			ms_pSelf->m_BtnCaptain.SetText("队长");
			ms_pSelf->m_BtnPilgarlic.SetText("帮众");

			Ini.GetString("Main", "AssignString", "", ms_pSelf->m_szAssign, sizeof(ms_pSelf->m_szAssign));
			Ini.GetString("Main", "CancelString", "", ms_pSelf->m_szCancel, sizeof(ms_pSelf->m_szCancel));
			Ini.GetString("Main", "ConfirmString", "", ms_pSelf->m_szConfirm, sizeof(ms_pSelf->m_szConfirm));
			Ini.GetString("Main", "ErrorFigure", "请选择职位", ms_pSelf->m_szErrorNotSelectFigure, sizeof(ms_pSelf->m_szErrorNotSelectFigure));
		}
	}
}
//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiFriendInterview::LoadScheme(const char* pScheme)
{
	if (m_pFirstSelf == NULL)
		return;
	if (pScheme == NULL)
	{
		char Scheme[128];
		g_UiBase.GetCurSchemePath(Scheme, 256);
		pScheme = Scheme;
	}

	KUiPlayerBaseInfo	Info;
	memset(&Info, 0, sizeof(KUiPlayerBaseInfo));
	if (g_pCoreShell)
	{
		g_pCoreShell->GetGameData(GDI_PLAYER_BASE_INFO, (int)&Info, 0);
		SetSelfName(Info.Name);
	}

	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\"SCHEME_INI, pScheme);
	if (Ini.Load(Buff))
	{
		m_pFirstSelf->Init(&Ini, "Main");
		m_pFirstSelf->m_MsgList	.Init(&Ini, "MsgList");
		m_pFirstSelf->m_MsgScroll.Init(&Ini, "MsgScroll");
		m_pFirstSelf->m_InputWnd.Init(&Ini, "Input");
		m_pFirstSelf->m_SendBtn.Init(&Ini, "SendBtn");
		m_pFirstSelf->m_ColorBtn.Init(&Ini, "ColorBtn");
		m_pFirstSelf->m_CloseBtn.Init(&Ini, "CloseBtn");
		m_pFirstSelf->m_FaceBtn.Init(&Ini, "FaceBtn");
		m_pFirstSelf->m_FriendName.Init(&Ini, "FriendName");
		Ini.GetString("MsgList", "MsgColor", "0,0,0", Buff, sizeof(Buff));
		m_uLastTextColor = (::GetColor(Buff) & 0xFFFFFF);
	}

	KIniFile* pSetting = g_UiBase.GetPrivateSettingFile();
	if (pSetting)
	{
		if (pSetting->GetString("UiConfig", "ChatColor", "0,0,0", Buff, sizeof(Buff)))
			m_uLastTextColor = (::GetColor(Buff) & 0xFFFFFF);
		g_UiBase.ClosePrivateSettingFile(false);
	}
	m_pFirstSelf->m_SelfTextColor.Color_dw = m_uLastTextColor;
	m_pFirstSelf->m_InputWnd.SetColor(m_uLastTextColor);

	KUiFriendInterview* pWnd = m_pFirstSelf->m_pNextSelf;
	while(pWnd)
	{
		m_pFirstSelf->CloneTheme(pWnd);
		pWnd = pWnd->m_pNextSelf;
	}
}
Beispiel #4
0
/**************************************************************************
*功能:弹出错误描述窗口
***************************************************************************/
void Error_Box()
{
	if(s_uErrorCode)
	{
    	KIniFile Ini;
    	char szFormatString[512], szOutputInfo[512], szBuf[16];

        //嗷,开始显示错误信息咯
	    Ini.Load(ERROR_STRING);

        Ini.GetString("Strings", itoa(s_uErrorCode,szBuf,10), "", szFormatString, sizeof(szFormatString));
		if(szFormatString[0] == 0)
		{
			Ini.GetString("Strings", "Unknown", "", szFormatString, sizeof(szFormatString));
			if(szFormatString[0] == 0)
			    strcpy(szFormatString, "未知的错误(错误号: %d)");
		}
		while(true)
		{
			char* pszNextLine = strchr(szFormatString, NEXT_LINE_CHARA);
			if (pszNextLine == NULL)
				break;
			*pszNextLine = '\n';
		}
		const char* pszCodePos = strstr(szFormatString, "%d");
		const char* pszStringPos = strstr(szFormatString, "%s");
		if (pszCodePos)
		{
			if (pszStringPos)
			{
				if (pszCodePos < pszStringPos)
					sprintf(szOutputInfo, szFormatString, s_uErrorCode, s_szErrorString);
				else
					sprintf(szOutputInfo, szFormatString, s_szErrorString, s_uErrorCode);
			}
			else
			{
				sprintf(szOutputInfo, szFormatString, s_uErrorCode);
			}
		}
		else if (pszStringPos)
		{
			sprintf(szOutputInfo, szFormatString, s_szErrorString);
		}
		else
			strcpy(szOutputInfo, szFormatString);

	    MessageBox(NULL, szOutputInfo, "剑侠情缘网络版", MB_OK | MB_ICONERROR);

	    s_uErrorCode = 0;
	}
	s_szErrorString[0] = 0;
}
Beispiel #5
0
//--------------------------------------------------------------------------
//	功能:读取以前的的登陆选择
//--------------------------------------------------------------------------
void KLogin::LoadLoginChoice()
{
	if (m_Choices.bLoaded)
		return;
	memset(&m_Choices, 0, sizeof(m_Choices));
	ClearAccountPassword(true, true);

	m_Choices.bLoaded = true;

	KIniFile* pSetting = g_UiBase.GetCommSettingFile();
	char	szAccount[32];
    KSG_PASSWORD Password;
	if (pSetting)
	{
		pSetting->GetInteger($LOGIN, "SelServerRegion", 0, &m_Choices.nServerRegionIndex);
		pSetting->GetString($LOGIN, "LastGameServer", "", m_Choices.AccountServer.Title, sizeof(m_Choices.AccountServer.Title));

		szAccount[0] = 0;
		pSetting->GetStruct($LOGIN, $LAST_ACCOUNT, szAccount, sizeof(szAccount));
		if (szAccount[0])
		{
			EDOneTimePad_Decipher(szAccount, strlen(szAccount));
			m_Choices.bRememberAccount = true;
			SetAccountPassword(szAccount, NULL);

			Password.szPassword[0] = '\0';
			pSetting->GetStruct($LOGIN, $LAST_PASSWORD, Password.szPassword, sizeof(Password.szPassword));
			if (Password.szPassword[0])
			{
				EDOneTimePad_Decipher(Password.szPassword, strlen(Password.szPassword));
				m_Choices.bRememberAll = true;
				SetAccountPassword(NULL, &Password);
				memset(&Password, 0, sizeof(Password));
			}
		}

		if (szAccount[0])
		{
			KIniFile* pPrivate = g_UiBase.GetPrivateSettingFile();
			if (pPrivate)
			{
				if (pPrivate->GetString("Main", "LastSelCharacter", "",
					m_Choices.szProcessingRoleName, sizeof(m_Choices.szProcessingRoleName)))
				{
					EDOneTimePad_Decipher(m_Choices.szProcessingRoleName, strlen(m_Choices.szProcessingRoleName));
				}
			}
			g_UiBase.ClosePrivateSettingFile(false);
		}

		g_UiBase.CloseCommSettingFile(false);
	}
}
Beispiel #6
0
//载入界面方案
void KMouseOver::LoadScheme(const char* pScheme)
{
	if (pScheme == NULL)
		return;
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
	if (Ini.Load(Buff))
	{
		Ini.GetInteger("Main", "ImgWidth",    0, &m_nImgWidth);
		Ini.GetInteger("Main", "ImgHeight",   0, &m_nImgHeight);
		Ini.GetInteger("Main", "Indent",      0, &m_nIndent);
		Ini.GetInteger("Main", "Font",        0, &m_nFontSize);

		if(m_nImgWidth < 0)
			m_nImgWidth = 0;
		if(m_nImgHeight < 0)
			m_nImgWidth = 0;
		if(m_nFontSize < 8)
			m_nFontSize = 8;
		int nValue;
		Ini.GetInteger("Main", "ImgType", 0, &nValue);
		if (nValue == 1)
		{
			m_Image.nType = ISI_T_BITMAP16;
			m_Image.bRenderStyle = IMAGE_RENDER_STYLE_OPACITY;
		}
		else
		{
			m_Image.nType = ISI_T_SPR;
			m_Image.bRenderStyle = IMAGE_RENDER_STYLE_ALPHA;
			m_Image.Color.Color_b.a = 255;
		}
		m_Image.uImage = 0;
		m_Image.nISPosition = IMAGE_IS_POSITION_INIT;
		Ini.GetString("Main", "Image", "" , m_Image.szImage, sizeof(m_Image.szImage));
		Ini.GetInteger("Main", "Frame", 0, &nValue);
		m_Image.nFrame = nValue;

		Ini.GetString("Main", "TitleBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uTitleBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Ini.GetString("Main", "PropBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uPropBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Ini.GetString("Main", "DescBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uDescBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Update((m_nLeft + m_nWndWidth) / 2, m_nTop);
	}
}
Beispiel #7
0
void KUiBase::LoadPrivateConfig()
{
	CreateBlackListUnit();

	KIniFile*	pConfigFile = GetPrivateSettingFile();

	if (pConfigFile)
	{
		//----获取窗口方案设定----
		char	SchemeName[32];
		if (pConfigFile->GetString("Main", "Scheme", "", SchemeName, 32))
		{
			if (SchemeName[0] && LoadScheme(SchemeName))
			{
			//----逐个窗口载入配置设定----
				KUiPlayerBar::LoadPrivateSetting(pConfigFile);
				KUiSkillTree::LoadConfig(pConfigFile);
				KShortcutKeyCentre::LoadPrivateSetting(pConfigFile);
				KUiChatCentre::LoadPrivateSetting(pConfigFile);	//在KShortcutKeyCentre之后,因为会有脚本生成Unit
			//----逐个窗口载入配置设定结束----
			}
		}
		::LoadStallPrivateConfig(pConfigFile);			//摆摊标价存盘
		ClosePrivateSettingFile(false);
	}
}
Beispiel #8
0
//--------------------------------------------------------------------------
//	功能:初始化
//--------------------------------------------------------------------------
int KUiBase::Init()
{
	if (g_pIme)
	{
		g_pIme->DisableLanguageChange();
		g_pIme->CloseIME();
		g_pIme->TurnOn();
	}

	KIniFile* pSetting = GetCommSettingFile();
	char	SchemeName[32] = "";
	int		nInterval = 20;
	if (pSetting)
	{
		pSetting->GetString("Main", "LastUsedScheme", "", SchemeName, 32);
		pSetting->GetInteger("Main", "WndMoveInterval", 20, &nInterval);
		#ifdef _DEBUG
			int	nValue;
			pSetting->GetInteger("Main", "ShowDebugFrameText", 0, &nValue);
			WND_SHOW_DEBUG_FRAME_TEXT = nValue;
			pSetting->GetInteger("Main", "ShowMouseOverWnd", 0, &nValue);
			WND_SHOW_MOUSE_OVER_WND = nValue;
		#endif
			CloseCommSettingFile(false);
	}
	g_CreatePath(UI_USER_DATA_FOLDER);
	g_CreatePath(UI_USER_DATA_TEMP_FOLDER);
	KWndShowAnimate::SetInterval(nInterval);
	LoadScheme(SchemeName);
	return true;
}
Beispiel #9
0
void KUiConnectInfo::SetInfoMsg(LOGIN_BG_INFO_MSG_INDEX eIndex)
{
	m_DelRoleBgImg.LeaveAlone();
	m_DelRoleBtn.LeaveAlone();
	m_CancelDelRoleBtn.LeaveAlone();
	m_ConfirmBtn.LeaveAlone();
	m_ContinueBtn.LeaveAlone();
	m_InputPwdWnd.LeaveAlone();
//	m_BtnUnlockLink.LeaveAlone();
	m_RoleName.LeaveAlone();

	m_szMessage[0] = 0;
	m_nMsgLen = 0;
	m_nColor2CharacterStartIndex = 0;
	m_nColor2CharacterEndIndex = 0;

	KIniFile*	pIni = g_UiBase.GetCommConfigFile();
	if (pIni)
	{
		char	szKey[8];
		char	szBuff[64];
		itoa(eIndex, szKey, 10);
		pIni->GetString("InfoString", szKey, "", szBuff, sizeof(szBuff));
		m_nMsgLen = sprintf(m_szMessage, szBuff, m_szString);
		if (m_nMsgLen)
		{
			m_uLastMsgColorChanageTime = IR_GetCurrentTime();
			m_nColor2CharacterEndIndex =
				TSplitString(m_szMessage, m_nColor2CharacterStartIndex + 1, false);
		}
	}

	if (eIndex == CI_MI_TO_DEL_ROLE)	//13=要删除角色
	{
		AddChild(&m_DelRoleBgImg);
		AddChild(&m_InputPwdWnd);
		AddChild(&m_DelRoleBtn);
		AddChild(&m_RoleName);
		char szBuff[64];
		sprintf(szBuff, "角色名字:%s", m_szString);
		m_RoleName.SetText(szBuff);
		AddChild(&m_CancelDelRoleBtn);
		Wnd_SetFocusWnd(&m_InputPwdWnd);
	}
	else if (eIndex == CI_MI_TO_TRANSFER_ROLE)
	{
		AddChild(&m_ContinueBtn);
	}
	else if (eIndex != CI_MI_ENTERING_GAME)
	{
//		if(eIndex == CI_MI_ACCOUNT_LOCKED)
//		{
//			AddChild(&m_BtnUnlockLink);
//		}
		AddChild(&m_ConfirmBtn);
	}
}
Beispiel #10
0
// -------------------------------------------------------------------------
// 函数		: KUiSelPlayer::LoadScheme
// 功能		: 载入界面方案
// -------------------------------------------------------------------------
void KUiSelPlayer::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELPLAYER);
	if (Ini.Load(Buff))
	{
		Init(&Ini, "SelRole");	// 窗口背景数据
		Ini.GetString("SelRole", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
		Ini.GetString("SelRole", "PlayerImgPrefix", "", m_szPlayerImgPrefix, sizeof(m_szPlayerImgPrefix));

		Buff[0] = '\0';	// 清空缓存
		m_btnOk.Init(&Ini, "Ok");
		m_btnCancel.Init(&Ini, "Cancel");
		m_btnDel.Init(&Ini, "Del");
		m_btnNew.Init(&Ini, "New");
		m_ButterflyWnd.Init(&Ini, "Butterfly");

		m_player[0].Init(&Ini, "Player");
		m_Name[0].Init(&Ini, "Name");
		m_Level[0].Init(&Ini, "Level");
		m_PlayerInfoBg[0].Init(&Ini, "PlayerInfoBg");
		for (int i = 1; i < MAX_PLAYER_PER_ACCOUNT; i ++)
		{
			m_player[0].Clone(&m_player[i]);
			m_Name[0].Clone(&m_Name[i]);
			m_Level[0].Clone(&m_Level[i]);
			m_PlayerInfoBg[0].Clone(&m_PlayerInfoBg[i]);
		}

		Ini.GetInteger("SelRole", "Player2Pos_0",  0, &m_ChildWndXOffset[0]);
		Ini.GetInteger("SelRole", "Player2Pos_1",  0, &m_ChildWndXOffset[1]);
		Ini.GetInteger("SelRole", "Player3Pos_0",  0, &m_ChildWndXOffset[2]);
		Ini.GetInteger("SelRole", "Player3Pos_1",  0, &m_ChildWndYOffset);
		Ini.GetInteger("SelRole", "Player3Pos_2",  0, &m_ChildWndXOffset[3]);

		m_player[0].GetPosition(&m_ChildPos[0], NULL);
		m_Name[0].GetPosition(&m_ChildPos[1], NULL);
		m_Level[0].GetPosition(&m_ChildPos[2], NULL);
		m_PlayerInfoBg[0].GetPosition(&m_ChildPos[3], NULL);

		m_LifeTimeText.Init(&Ini, "LifeTime");
	}
}
Beispiel #11
0
//--------------------------------------------------------------------------
//	功能:获得当前指定界面方案的目录名,如果未能找到指定的方案,则取第一个
//		 方案(默认方案)作为当前方案
//	参数:pScheme --> 指定界面方案名称
//--------------------------------------------------------------------------
int KUiBase::GetSchemePath(const char* pScheme)
{
	KIniFile* pIni = NULL;
	int			nCount;
	char		Buff[32], Key[32];

	if (pScheme == NULL ||
		(pIni = GetCommConfigFile()) == NULL)
		return false;

	pIni->GetInteger(THEME_SECTION, "Count", 0, &nCount);
	for (int i = 0; i < nCount; i++)
	{
		itoa(i, Key, 10);
		if (pIni->GetString(THEME_SECTION, Key, "", Buff, 32))
		{
			if (strcmp(Buff, pScheme) == 0)
			{
				strcpy(m_CurScheme, pScheme);
				strcat(Key, "_Path");
				if (pIni->GetString(THEME_SECTION, Key, "", Buff, 32) && Buff[0])
				{
					sprintf(m_CurSchemePath, "%s\\%s", UI_INFO_FILE_PATH, Buff);
					CloseCommConfigFile();
					return true;
				}
			}
		}
	}
	if (pIni->GetString(THEME_SECTION, "0", "", m_CurScheme, 32) &&
		pIni->GetString(THEME_SECTION, "0_Path", "", Buff, 32) && Buff[0])
	{
		sprintf(m_CurSchemePath, "%s\\%s", UI_INFO_FILE_PATH, Buff);
		CloseCommConfigFile();
		return true;
	}
	CloseCommConfigFile();
	return false;
}
Beispiel #12
0
//载入设定
bool UiSoundLoadSetting()
{
	KIniFile	Setting;
	if (!Setting.Load(SETTING_FILE))
		return false;
	char	szSection[8];
	for (int i = 0; i < (int)UI_SOUND_COUNT; i++)
	{
		itoa(i, szSection, 10);
		Setting.GetString("Ui", szSection, "", s_SoundFileName[i], sizeof(s_SoundFileName[i]));
	}
	return true;
}
Beispiel #13
0
//--------------------------------------------------------------------------
//	功能:获得某个界面方案的名称与路径
//	参数:pName --> 用于获取方案的名称,为指向一个长度不小于的32的缓冲区的指针,或者空指针。
//		  pPath --> 用于获取方案的路径,为指向一个长度不小于的32的缓冲区的指针,或者空指针。
//--------------------------------------------------------------------------
int KUiBase::GetScheme(int nIndex, char* pName, char* pPath)
{
	KIniFile	Ini;
	int			nCount = 0;
	KIniFile*	pIni = GetCommConfigFile();
	if (pIni)
	{
		Ini.GetInteger(THEME_SECTION, "Count", 0, &nCount);
		if (nIndex >= 0 && nIndex < nCount)
		{
			char	Num[8] = "";
			itoa(nIndex, Num, 10);
			if (pName)
				Ini.GetString(THEME_SECTION, Num, "", pName, 32);
			if (pPath)
				Ini.GetString(THEME_SECTION, Num, "", pPath, 32);
			return true;
		}
		CloseCommConfigFile();
	}
	return false;
}
Beispiel #14
0
BOOL KInlinePicSink::Init(iRepresentShell* pShell)
{
	m_pRepShell = pShell;
	if (!m_pRepShell)
		return FALSE;
	KIniFile ini;
#define CHAR_BUFFER_LEN	32
	char szBuffer[CHAR_BUFFER_LEN * 2], szIndex[8];
	int nPicCount = 0, i = 0;
	KUiImageRef CurrentImg;
	KImageParam	Param;

	if (!ini.Load(CHAT_FACE_INI_FILE))
		return FALSE;
	//ini.GetString("Main", "Path", "\\spr\\Ui\\聊天\\表情", szPath, CHAR_BUFFER_LEN);
	ini.GetInteger("List", "Count", 0, &nPicCount);

	if (nPicCount > MAX_SYSTEM_INLINE_PICTURES)
		nPicCount = MAX_SYSTEM_INLINE_PICTURES;

	for (i = 0; i < nPicCount; i++)
	{
		sprintf(szIndex, "Face%d", i + 1);
		if (!ini.GetString(szIndex, "Spr", "", szBuffer, CHAR_BUFFER_LEN))
		{
			_ASSERT(0);
			break;
		}
		IR_InitUiImageRef(CurrentImg);
		CurrentImg.nFlipTime = 0;
		CurrentImg.nInterval = 0;
		CurrentImg.nNumFrames = 0;
		strncpy(CurrentImg.szImage, szBuffer, sizeof(CurrentImg.szImage));
		CurrentImg.szImage[sizeof(CurrentImg.szImage) - 1] = 0;
		CurrentImg.bRenderFlag = RUIMAGE_RENDER_FLAG_REF_SPOT;
		CurrentImg.nType = ISI_T_SPR;
		memset(&Param, 0, sizeof(Param));
		pShell->GetImageParam(CurrentImg.szImage, &Param, CurrentImg.nType);
		m_Images.push_back(CurrentImg);
		m_ImageParams.push_back(Param);
	}

	if (FAILED(m_pRepShell->AdviseRepresent(this)))
		return FALSE;
	if (FAILED(AdviseEngine(this)))
		return FALSE;
	return TRUE;
}
Beispiel #15
0
//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiSelServer::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELSERV);
	if (Ini.Load(Buff))
	{
		KWndShowAnimate::Init(&Ini, "Main");
		m_List     .Init(&Ini, "List");
		m_ScrollBar.Init(&Ini, "Scroll");
		m_Login    .Init(&Ini, "Login");
		m_Cancel   .Init(&Ini, "Cancel");

		Ini.GetString("Main", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}
}
Beispiel #16
0
//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiInit::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_INIT);
	if (Ini.Load(Buff))
	{
		KWndShowAnimate::Init(&Ini, "Main");
		m_EnterGame.	Init(&Ini, "EnterGame");
		m_GameConfig.	Init(&Ini, "GameConfig");
		m_DesignerList.	Init(&Ini, "DesignerList");
//		m_AutoLogin.	Init(&Ini, "AutoLogin");
		m_ExitGame.		Init(&Ini, "ExitGame");

		Ini.GetString("Main", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}	
}
Beispiel #17
0
//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiLogin::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_LOGIN);
	if (Ini.Load(Buff))
	{
		KWndShowAnimate::Init(&Ini, "Main");
		m_Account .Init(&Ini, "Account");
		m_PassWord.Init(&Ini, "Password");
		m_Login   .Init(&Ini, "Login");
		m_Cancel  .Init(&Ini, "Cancel");
		m_RememberAccount.Init(&Ini, "Remember");
		m_InvisibleLogin.Init(&Ini, "Invisible");
		Ini.GetString("Main", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}
}
Beispiel #18
0
//--------------------------------------------------------------------------
//	功能:获取服务器区域的列表
//--------------------------------------------------------------------------
KLoginServer*	KLogin::GetServerRegionList(int& nCount, int& nAdviceChoice)
{
	KLoginServer* pServers = NULL;
	nCount = 0;
	nAdviceChoice = 0;

	KIniFile	File;
	int			i;
	if (File.Load(SERVER_LIST_FILE))
	{
		int		nReadCount = 0;
		char	szKey[32];
		File.GetInteger("List", "RegionCount", 0, &nReadCount);
		if (nReadCount > 0)
		{
			pServers = (KLoginServer*)malloc(sizeof(KLoginServer) * nReadCount);
			if (pServers)
			{
				for (i = 0; i < nReadCount; i++)
				{
					sprintf(szKey, "Region_%d", i);
					if (File.GetString("List", szKey, "", pServers[nCount].Title,
						sizeof(pServers[nCount].Title)) &&
						pServers[nCount].Title[0])
					{
						nCount ++;
					}
				}
				if (nCount == 0)
				{
					free(pServers);
					pServers = NULL;
				}
			}
		}
	}

	if (m_Choices.nServerRegionIndex < 0 || m_Choices.nServerRegionIndex >= nCount)
		m_Choices.nServerRegionIndex = 0;
	nAdviceChoice = m_Choices.nServerRegionIndex;
	return pServers;
}
Beispiel #19
0
void KUiConnectInfo::SetInfoMsg(LOGIN_BG_INFO_MSG_INDEX eIndex)
{
	m_DelRoleBgImg.LeaveAlone();
	m_DelRoleBtn.LeaveAlone();
	m_CancelDelRoleBtn.LeaveAlone();
	m_ConfirmBtn.LeaveAlone();
	m_InputPwdWnd.LeaveAlone();

	m_szMessage[0] = 0;
	m_nMsgLen = 0;
	m_nColor2CharacterStartIndex = 0;
	m_nColor2CharacterEndIndex = 0;

	KIniFile*	pIni = g_UiBase.GetCommConfigFile();
	if (pIni)
	{
		char	szKey[8];
		itoa(eIndex, szKey, 10);
		pIni->GetString("InfoString", szKey, "", m_szMessage, sizeof(m_szMessage));
		m_nMsgLen = strlen(m_szMessage);
		if (m_nMsgLen)
		{
			m_uLastMsgColorChanageTime = IR_GetCurrentTime();
			m_nColor2CharacterEndIndex =
				TSplitString(m_szMessage, m_nColor2CharacterStartIndex + 1, false);
		}
	}

	if (eIndex == CI_MI_TO_DEL_ROLE)	//13=要删除角色
	{
		AddChild(&m_DelRoleBgImg);
		AddChild(&m_InputPwdWnd);
		AddChild(&m_DelRoleBtn);
		AddChild(&m_CancelDelRoleBtn);
		Wnd_SetFocusWnd(&m_InputPwdWnd);
	}
	else if (eIndex != CI_MI_ENTERING_GAME)
	{
		AddChild(&m_ConfirmBtn);
	}
}
Beispiel #20
0
void KUiInit::PlayTitleMusic()
{
	char	szMusic[128] = "";
	KIniFile	Ini;
	if (Ini.Load(LAUNCH_GAME_INI))
	{
		int	nCount = 0;
		Ini.GetInteger("JustLaunched", "TitleMusicCount", 0, &nCount);
		if (nCount > 0)
		{
			char	szKey[16];
			sprintf(szKey, "TitleMusic_%d", rand() % nCount);
			Ini.GetString("JustLaunched", szKey, "", szMusic, sizeof(szMusic));
			if (szMusic[0])
			{
				g_pMusic->Stop();
				g_pMusic->Open((char*)szMusic);
				g_pMusic->Play(true);
			}
		}
	}
}
Beispiel #21
0
void KUiInit::PlayStartMovie()
{
	KIniFile	Ini;

	char	szMovieIndex[32], szFile[128];
	char	szPathFile[MAX_PATH];

	if (Ini.Load(LAUNCH_GAME_INI))
	{
		int		nSkipable;
		sprintf(szMovieIndex, "Movie_%d", m_nCurrentMovieIndex);
		Ini.GetString("JustLaunched", szMovieIndex, "", szFile, sizeof(szFile));
		strcat(szMovieIndex, "_Skipable");
		Ini.GetInteger("JustLaunched", szMovieIndex, 0, &nSkipable);

		if (szFile[0])
		{			
			KUiPlayVideo* pPlayer = KUiPlayVideo::OpenWindow();
			if (pPlayer)
			{
				pPlayer->SetPosition(0, 0);
				int nWidth, nHeight;
				Wnd_GetScreenSize(nWidth, nHeight);
				pPlayer->SetSize(nWidth, nHeight);
				pPlayer->Setting(nSkipable != 0, false, this, 0);
		
				g_GetFullPath(szPathFile, szFile);
				if (pPlayer->OpenVideo(szPathFile))
				{	//成功播放影片
					m_nCurrentMovieIndex++;
					return;
				}
			}
		}
	}
	KUiPlayVideo::CloseWindow(true);
	Wnd_ShowCursor(true);
	OpenWindow(true, false);
}
Beispiel #22
0
/*
                      .-~~-.--.                     :         )

               .~ ~ -.\       /.- ~~ .               >       `.   .'       <

              (         .- -.         )               `- -.-~  `- -'  ~-.- -'

                 (        :        )           _ _ .-:

                  ~--.    :    .--~        .-~  .-~  }

                      ~-.-^-.-~ \_      .~  .-~   .~

                               \ \'     \ '_ _ -~

                                `.`.    //

                       . - ~ ~-.__`.`-.//

                   .-~   . - ~  }~ ~ ~-.~-.

                 .' .-~      .-~       :/~-.~-./:

                /_~_ _ . - ~                 ~-.~-._

                                                 ~-.<
(给你,最可爱的人 :)
//初始化头像
*/
int	KUiPortrait::InitializeProtrait()
{
	KIniFile Ini;

	if(Ini.Load(PORTRAIT_IMAGE_INI))
	{
		Ini.GetInteger("Main", "Count", 0, &m_PortraitParam.nPortraitCount);
		Ini.GetInteger("Main", "Width", 0, &m_PortraitParam.nPortraitWidth);
		Ini.GetInteger("Main", "Height", 0, &m_PortraitParam.nPortraitHeight);

		if(m_pImage)
		{
			delete m_pImage;
			m_pImage = NULL;
		}
		m_pImage = new KUiImageRef[m_PortraitParam.nPortraitCount + 1];
		if(m_pImage)
		{
			char szBuf[8];
			for(int i = 1;i < m_PortraitParam.nPortraitCount + 1;i++)
			{
				IR_InitUiImageRef(m_pImage[i]);
				Ini.GetString("Image", itoa(i, szBuf, 10), "", m_pImage[i].szImage, sizeof(m_pImage[i].szImage));
				m_pImage[i].bRenderFlag = RUIMAGE_RENDER_FLAG_REF_SPOT;
				m_pImage[i].nType = ISI_T_SPR;
				m_pImage[i].nFlipTime  = 0;
				m_pImage[i].nInterval  = 0;
				m_pImage[i].nNumFrames = 0;
				m_pImage[i].Color.Color_b.r = 0;
				m_pImage[i].Color.Color_b.g = 0;
				m_pImage[i].Color.Color_b.b = 0;
				m_pImage[i].Color.Color_b.a = LOLIGHT_ALPHA;
			}
			return 1;
		}
	}
	return 0;
}
Beispiel #23
0
//--------------------------------------------------------------------------
//	功能:初始化
//--------------------------------------------------------------------------
void KUiLoginBackGround::Initialize()
{
	AddChild(&m_VersionWnd);
	m_szConfig[0] = 0;
	for (int i = 0; i < MAX_NUM_BUTTERFLY; i++)
	{
		m_uAdviceIntervalMin[i] = 0;
		m_uInterval[i] = 0;
		m_uLastSleepTime[i] = 0;
		AddChild(&m_Butterflys[i]); 
	}

	char	szVersion[80] = "";
	KIniFile* pSetting = g_UiBase.GetCommConfigFile();
	if (pSetting)
	{
		if (pSetting)
			pSetting->GetString("Main", "GameVersion", "", szVersion, sizeof(szVersion));
		g_UiBase.CloseCommConfigFile();
	}
	m_VersionWnd.SetText(szVersion);

	Wnd_AddWindow(this, WL_LOWEST);
}
Beispiel #24
0
//--------------------------------------------------------------------------
//	功能:登陆服务器列表获取
//--------------------------------------------------------------------------
KLoginServer* KLogin::GetServerList(int nRegion, int& nCount, int& nAdviceChoice)
{
	KLoginServer* pServers = NULL;
	nCount = 0;
	nAdviceChoice = 0;

	if (nRegion < 0)
	{
		KIniFile* pSetting = g_UiBase.GetCommSettingFile();
		if (pSetting)
		{
			pSetting->GetInteger($LOGIN, "SelServerRegion", 0, &nRegion);
			g_UiBase.CloseCommSettingFile(false);
		}
	}

	KIniFile	File;
	int			i;
	if (File.Load(SERVER_LIST_FILE))
	{
		int		nReadCount = 0;
		char	szSection[32], szKey[32], szBuffer[32];

		File.GetInteger("List", "RegionCount", 0, &nReadCount);	//区域的数目

		if (nReadCount > 0 || nRegion >= 0 && nRegion < nReadCount)
		{
			m_Choices.nServerRegionIndex = nRegion;
			sprintf(szSection, "Region_%d", nRegion);
			File.GetInteger(szSection, "Count", 0, &nReadCount);	//该区域服务器的数目
			if (nReadCount > 0)
			{
				pServers = (KLoginServer*)malloc(sizeof(KLoginServer) * nReadCount);
				if (pServers)
				{
					for (i = 0; i < nReadCount; i++)
					{
						sprintf(szKey, "%d_Address", i);
						if (!File.GetString(szSection, szKey, "", szBuffer, sizeof(szBuffer)) ||
							GetIpAddress(szBuffer, pServers[nCount].Address) == false)
						{
							continue;
						}
						sprintf(szKey, "%d_Title", i);
						if (File.GetString(szSection, szKey, "", pServers[nCount].Title,
							sizeof(pServers[nCount].Title)) &&
							pServers[nCount].Title[0])
						{
							nCount ++;
						}
					}
					if (nCount == 0)
					{
						free(pServers);
						pServers = NULL;
					}
				}
			}
		}
	}

	if (nCount)
	{
		for (i = 0; i < nCount; i++)
		{
			if (strcmp(pServers[i].Title, m_Choices.AccountServer.Title) == 0)
			{
				nAdviceChoice = i;
				break;
			}
		}
		if (i >= nCount)
			strcpy(m_Choices.AccountServer.Title, pServers[nAdviceChoice].Title);
		m_Choices.AccountServer.Address[0] = pServers[nAdviceChoice].Address[0];
		m_Choices.AccountServer.Address[1] = pServers[nAdviceChoice].Address[1];
		m_Choices.AccountServer.Address[2] = pServers[nAdviceChoice].Address[2];
		m_Choices.AccountServer.Address[3] = pServers[nAdviceChoice].Address[3];
	}
	return pServers;
}
Beispiel #25
0
//--------------------------------------------------------------------------
//	功能:按照某种方案载入界面(Skin)
//--------------------------------------------------------------------------
int KUiBase::LoadScheme(const char* pScheme)
{
    _KSG_GetWindowVersion();

	if (pScheme == NULL)
		return false;

	if (m_CurScheme[0] != 0 && strcmp(pScheme, m_CurScheme) == 0)
		return true;

	char	Buffer[128];

	sprintf(Buffer, "%s\\"UI_PUBLIC_SETTING, m_CurSchemePath);
	if (GetSchemePath(pScheme))
	{
		int			nCount, nId, i;
		KIniFile	Ini;

		char		Section[8];
		//----卸载字体----
		if (g_pRepresentShell && Ini.Load(Buffer) &&
			Ini.GetInteger(FONT_SECTION, "Count", 0, &nCount))
		{
			for (i = 0; i < nCount; i++)
			{
				itoa(i, Section, 10);
				if (Ini.GetInteger(FONT_SECTION, Section, 0, &nId))
					g_pRepresentShell->ReleaseAFont(nId);
			}
		}

		sprintf(Buffer, "%s\\"UI_PUBLIC_SETTING, m_CurSchemePath);
		Ini.Load(Buffer);

		//----载入字体----
		if (g_pRepresentShell && Ini.GetInteger(FONT_SECTION, "Count", 0, &nCount))
		{
			for (i = 0; i < nCount; i++)
			{
				itoa(i, Section, 10);
				if (Ini.GetInteger(FONT_SECTION, Section, 0, &nId))
				{
					strcat(Section, "_File");
					if (Ini.GetString(FONT_SECTION, Section, "", Buffer, sizeof(Buffer)) &&
							Buffer[0])
					{
						g_pRepresentShell->CreateAFont(Buffer, CHARACTER_CODE_SET_GBK, nId);
					}
				}
			}
		}
		//----载入字体结束----
		WndObjContainerInit(&Ini);

		for (i = CURSOR_NORMAL; i < CURSOR_INDEX_COUNT; i++)
		{
			itoa(i, Section, 10);
            if (g_nWindowNTFlag)
			    Ini.GetString("CursorList", Section, "", Buffer, sizeof(Buffer));
            else    // Win9x
			    Ini.GetString("CursorList98", Section, "", Buffer, sizeof(Buffer));

			Wnd_LoadCursor(i, Buffer);//载入鼠标指针资源
		}

		LoadSchemeForEachWnd();

		return true;
	}
	return false;
}
Beispiel #26
0
// -------------------------------------------------------------------------
// 功能	: 更新
// -------------------------------------------------------------------------
void KUiSelPlayer::UpdateData()
{
	int nSel;
	m_nNumPlayer = g_LoginLogic.GetRoleCount(nSel);
	if (m_nNumPlayer > 0 && nSel < 0)
		m_nSelPlayer = 0;
	else
		m_nSelPlayer = nSel;

	int	x, y;
	//---调整子窗口位置----
	switch(m_nNumPlayer)
	{
	case 1:
		m_player[0].GetPosition(&x, &y);
		x = m_ChildPos[0];
		m_player[0].SetPosition(x, y);
		m_Name[0].GetPosition(&x, &y);
		x = m_ChildPos[1];
		m_Name[0].SetPosition(x, y);
        m_Level[0].GetPosition(&x, &y);
		x = m_ChildPos[2];
		m_Level[0].SetPosition(x, y);
        m_PlayerInfoBg[0].GetPosition(&x, &y);
		x = m_ChildPos[3];
		m_PlayerInfoBg[0].SetPosition(x, y);
		break;
	case 2:
		m_player[0].GetPosition(&x, &y);
		x = m_ChildPos[0] + m_ChildWndXOffset[0];
		m_player[0].SetPosition(x, y);
		x = m_ChildPos[0] + m_ChildWndXOffset[1];
		m_player[1].SetPosition(x, y);

		m_Name[0].GetPosition(&x, &y);
		x = m_ChildPos[1] + m_ChildWndXOffset[0];
		m_Name[0].SetPosition(x, y);
		x = m_ChildPos[1] + m_ChildWndXOffset[1];
		m_Name[1].SetPosition(x, y);

        m_Level[0].GetPosition(&x, &y);
		x = m_ChildPos[2] + m_ChildWndXOffset[0];
		m_Level[0].SetPosition(x, y);
		x = m_ChildPos[2] + m_ChildWndXOffset[1];
		m_Level[1].SetPosition(x, y);

        m_PlayerInfoBg[0].GetPosition(&x, &y);
		x = m_ChildPos[3] + m_ChildWndXOffset[0];
		m_PlayerInfoBg[0].SetPosition(x, y);
		x = m_ChildPos[3] + m_ChildWndXOffset[1];
		m_PlayerInfoBg[1].SetPosition(x, y);
		break;
	case 3:
		m_player[0].GetPosition(&x, &y);
		x = m_ChildPos[0];
		m_player[1].SetPosition(x, y + m_ChildWndYOffset);
		x += m_ChildWndXOffset[2];
		m_player[0].SetPosition(x, y);
		x = m_ChildPos[0] + m_ChildWndXOffset[3];
		m_player[2].SetPosition(x, y);

		m_Name[0].GetPosition(&x, &y);
		x = m_ChildPos[1];
		m_Name[1].SetPosition(x, y + m_ChildWndYOffset);
		x += m_ChildWndXOffset[2];
		m_Name[0].SetPosition(x, y);
		x = m_ChildPos[1] + m_ChildWndXOffset[3];
		m_Name[2].SetPosition(x, y);

        m_Level[0].GetPosition(&x, &y);
		x = m_ChildPos[2];
		m_Level[1].SetPosition(x, y + m_ChildWndYOffset);
		x += m_ChildWndXOffset[2];
		m_Level[0].SetPosition(x, y);
		x = m_ChildPos[2] + m_ChildWndXOffset[3];
		m_Level[2].SetPosition(x, y);

        m_PlayerInfoBg[0].GetPosition(&x, &y);
		x = m_ChildPos[3];
		m_PlayerInfoBg[1].SetPosition(x, y + m_ChildWndYOffset);
		x += m_ChildWndXOffset[2];
		m_PlayerInfoBg[0].SetPosition(x, y);
		x = m_ChildPos[3] + m_ChildWndXOffset[3];
		m_PlayerInfoBg[2].SetPosition(x, y);
		break;
	}

	int		i;
	char	szFileName[128];
	if (m_nNumPlayer > 0)
	{
		KIniFile	Ini;
		Ini.Load(SERIES_INI);

		for (i = 0; i < m_nNumPlayer; i++)
		{
			KRoleChiefInfo	Info;
			g_LoginLogic.GetRoleInfo(i, &Info);
			m_Name[i].SetText(Info.Name);
			m_Level[i].SetIntText(Info.nLevel);
			AddChild(&m_PlayerInfoBg[i]);
			AddChild(&m_player[i]);
			AddChild(&m_Name[i]);
			AddChild(&m_Level[i]);
			m_Gender[i] = Info.Gender;
			m_Attribute[i] = Info.Attribute;

			m_szSelPlayerSound[i][0] = 0;
			Ini.GetString(PROP_GetTitleString((OBJ_ATTRIBYTE_TYPE)Info.Attribute),
				Info.Gender ? "SelSound_f" : "SelSound_m", "",
				m_szSelPlayerSound[i], sizeof(m_szSelPlayerSound[i]));
			GetRoleImageName(szFileName, m_szPlayerImgPrefix, Info.Gender, Info.Attribute, 2);
			m_player[i].SetImage(ISI_T_SPR, szFileName);
			m_player[i].SetFrame(0);
		}

		if (m_nSelPlayer < 0)
			m_nSelPlayer = 0;

		OnSelectPlayer(m_nSelPlayer);
	}

	for (i = m_nNumPlayer; i < MAX_PLAYER_PER_ACCOUNT; i++)
	{
		m_player[i].LeaveAlone();
		m_Name[i].LeaveAlone();
		m_Level[i].LeaveAlone();
		m_PlayerInfoBg[i].LeaveAlone();
	}

	m_btnOk.BringToTop();
	m_btnCancel.BringToTop();
	m_btnDel.BringToTop();
	m_btnNew.BringToTop();

	m_btnNew.Enable(m_nNumPlayer < MAX_PLAYER_PER_ACCOUNT);
	m_btnDel.Enable(m_nNumPlayer > 0 && m_nSelPlayer >= 0);
	m_btnOk.Enable(m_nNumPlayer > 0 && m_nSelPlayer >= 0);

	unsigned long uTotalTime, uTimeOfPoint;
	g_LoginLogic.GetAccountLifeTime(uTotalTime, uTimeOfPoint);
	unsigned long uTimeLine = (uTotalTime - uTimeOfPoint);

	char	szInfo[256];
	int		nLen;
	KIniFile* pSetting = g_UiBase.GetCommConfigFile();

	szInfo[0] = '\0';
	nLen = 0;
	//----包月或包周----
	if (uTimeLine)
	{
		if (pSetting)
		{
			pSetting->GetString("InfoString", LIFE_TIME_LINE_ID,
				"", szInfo, sizeof(szInfo));
			nLen = strlen(szInfo);
		}
		time_t t;
		time(&t);
		t += uTimeLine;
		struct tm * lt = localtime(&t);
		assert(lt);
		//校正处理
		if (lt->tm_hour > 12)
		{
			t += 43200;//半天
			lt = localtime(&t);
			assert(lt);
		}
		nLen += sprintf(szInfo + nLen, " %d-%d-%d ",
			lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday);
	}

	if (uTimeOfPoint || uTimeLine == 0)
	{
		if (uTimeLine)
			nLen = strlen(strcat(szInfo, "   "));

		int		nHours, nMinutes;
		nHours = uTimeOfPoint / 3600;
		uTimeOfPoint -= nHours * 3600;
		nMinutes = uTimeOfPoint / 60;

		char	szHour[16] = "hour(s)";
		char	szMinute[16] = "minute(s)";

		if (pSetting)
		{
			pSetting->GetString("InfoString",
				uTimeLine ? LIFE_TIME_AND_STRING_ID : LIFE_TIME_STRING_ID,
				"", szInfo + nLen, sizeof(szInfo) - nLen);
			nLen = strlen(szInfo);
			pSetting->GetString("InfoString", LIFE_TIME_HOUR_ID,
				"hour(s)", szHour, sizeof(szHour));
			pSetting->GetString("InfoString", LIFE_TIME_MINUTE_ID,
				"minute(s)", szMinute, sizeof(szMinute));
		}

		if (nHours)
		{
			nLen += sprintf(szInfo + nLen, "%d%s", nHours, szHour);
		}
		if (nMinutes || nHours == 0)
		{
			nLen += sprintf(szInfo + nLen, "%d%s", nMinutes, szMinute);
		}
		szInfo[nLen] = ' ';
		nLen ++;
		szInfo[nLen] = '\0';
	}

	m_LifeTimeText.SetText(szInfo, nLen);
	if (pSetting)
		g_UiBase.CloseCommConfigFile();
}