Exemplo n.º 1
0
        public void Save(SHDialogsXml Dialogs, ref SHStringXml DialogString)
        {
            // 문자열 저장
            File.Copy(SHGlobal.GetClientSystemFolder() + "\\lang\\ko_KR\\name_dialog.xml", Directory.GetCurrentDirectory() + "\\Backup\\string_name_dialog." + DateTime.Now.ToString("yy-MM-dd-HHmmss") + ".xml", true);

            DialogString.Clear();

            foreach (SHDialog dialog in Dialogs.dataList)
            {
                m_nSaySelectID = 0;

                string szKey = "DIALOG_TEXT_" + dialog.id.ToString();
                AddString(szKey, dialog.text, ref DialogString);

                if (dialog.Say != null)
                {
                    AddStringSay(dialog, dialog.Say, ref DialogString);
                }
            }

            DialogString.Compile();

            // Save
            SHGlobal.Serialize <SHStringXml>(SHGlobal.GetClientSystemFolder() + SHGlobal.Locale.Path(SHLocaleType.KO_KR) + "name_dialog.xml", DialogString, Encoding.UTF8);
        }
Exemplo n.º 2
0
        public void ReplaceStringToKey(ref SHDialogsXml Dialogs)
        {
            foreach (SHDialog dialog in Dialogs.dataList)
            {
                m_nSaySelectID = 0;

                if (dialog.Say != null)
                {
                    ReplaceStringToKey_Say(dialog.id, dialog.Say);
                }
            }
        }
Exemplo n.º 3
0
        public void LoadDialogs()
        {
            Dialogs = SHGlobal.Deserialize <SHDialogsXml>(SHGlobal.GetServerSystemFolder() + "\\dialog.xml", Encoding.UTF8);
            if (Dialogs == null)
            {
                Dialogs = new SHDialogsXml();
                Dialogs.LoadingFail();
            }

            SHDialogStringReplacer replacer = new SHDialogStringReplacer();

            replacer.ReplaceKeyToString(ref Dialogs, ref LocalXml.DialogString, true);

            Dialogs.Compile();
        }
Exemplo n.º 4
0
        public void ReplaceKeyToString(ref SHDialogsXml Dialogs, ref SHStringXml DialogString, bool bReplaceDialogText)
        {
            foreach (SHDialog dialog in Dialogs.dataList)
            {
                m_nSaySelectID = 0;

                string szKey;

                if (bReplaceDialogText)
                {
                    szKey = "DIALOG_TEXT_" + dialog.id.ToString();

                    if (DialogString.IsValid(szKey))
                    {
                        dialog.text = DialogString[szKey].ToString();
                    }
                }

                if (dialog.Say != null)
                {
                    ReplaceKeyToString_Say(dialog.id, dialog.Say, DialogString);
                }
            }
        }