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

            QuestString.Clear();

            foreach (SHQuest quest in Quests.dataList)
            {
                string szKey = "QUEST_TITLE_" + quest.id.ToString();
                AddString(szKey, quest.title, ref QuestString);

                szKey = "QUEST_DESC_" + quest.id.ToString();
                AddString(szKey, quest.desc, ref QuestString);

                szKey = "QUEST_CATEGORY_" + quest.id.ToString();
                AddString(szKey, quest.category, ref QuestString);

                if (quest.Objectives != null)
                {
                    for (int r = 0; r < quest.Objectives.dataList.Count; r++)
                    {
                        SHQuestObjective obj = (SHQuestObjective)quest.Objectives.dataList[r];

                        szKey = "QUEST_OBJ_DESC_" + quest.id.ToString();
                        szKey = szKey + "_" + obj.id.ToString();
                        AddString(szKey, obj.desc, ref QuestString);
                    }
                }
            }
            QuestString.Compile();

            // Save
            SHGlobal.Serialize <SHStringXml>(SHGlobal.GetClientSystemFolder() + SHGlobal.Locale.Path(SHLocaleType.KO_KR) + "name_quest.xml", QuestString, Encoding.UTF8);
        }
Exemplo n.º 2
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.º 3
0
        protected void AddString(string szKey, string szValue, ref SHStringXml stringXml)
        {
            SHString newTitleString = new SHString();

            newTitleString.Key    = szKey;
            newTitleString.String = szValue;
            stringXml.Add(newTitleString);
        }
Exemplo n.º 4
0
 public void LoadStrings()
 {
     Strings = SHGlobal.Deserialize <SHStringXml>(SHGlobal.GetClientSystemFolder() + "\\lang\\ko_KR\\strings.xml", Encoding.UTF8);
     if (Strings == null)
     {
         Strings = new SHStringXml();
         Strings.LoadingFail();
     }
     Strings.Compile();
 }
Exemplo n.º 5
0
        private void AddStringSay(SHDialog dialog, SHDialogSay dialogSay, ref SHStringXml DialogString)
        {
            m_nSaySelectID++;

            string szKey = "DIALOG_SAY_TEXT_" + dialog.id.ToString() + "_" + m_nSaySelectID;

            AddString(szKey, dialogSay.text, ref DialogString);

            foreach (SHDialogSelect dialogSelect in dialogSay.dataList)
            {
                AddStringSelect(dialog, dialogSelect, ref DialogString);
            }
        }
Exemplo n.º 6
0
        private void AddStringSelect(SHDialog dialog, SHDialogSelect dialogSelect, ref SHStringXml DialogString)
        {
            m_nSaySelectID++;

            string szKey = "DIALOG_SELECT_TEXT_" + dialog.id.ToString() + "_" + m_nSaySelectID;

            AddString(szKey, dialogSelect.text, ref DialogString);

            if (dialogSelect.Say != null)
            {
                AddStringSay(dialog, dialogSelect.Say, ref DialogString);
            }
        }
Exemplo n.º 7
0
        private void ReplaceKeyToString_Say(int nDialogID, SHDialogSay dialogSay, SHStringXml DialogString)
        {
            m_nSaySelectID++;

            string szKey = "DIALOG_SAY_TEXT_" + nDialogID.ToString() + "_" + m_nSaySelectID.ToString();

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

            foreach (SHDialogSelect dialogSelect in dialogSay.dataList)
            {
                ReplaceKeyToString_Select(nDialogID, dialogSelect, DialogString);
            }
        }
Exemplo n.º 8
0
        public void ReplaceKeyToString(ref SHQuestsXml Quests, ref SHStringXml QuestString, bool bReplaceTitle)
        {
            foreach (SHQuest quest in Quests.dataList)
            {
                string szKey;

                if (bReplaceTitle)
                {
                    szKey = "QUEST_TITLE_" + quest.id.ToString();

                    if (QuestString.IsValid(szKey))
                    {
                        quest.title = QuestString[szKey].ToString();
                    }
                }

                szKey = "QUEST_DESC_" + quest.id.ToString();

                if (QuestString.IsValid(szKey))
                {
                    quest.desc = QuestString[szKey].ToString();
                }

                szKey = "QUEST_CATEGORY_" + quest.id.ToString();

                if (QuestString.IsValid(szKey))
                {
                    quest.category = QuestString[szKey].ToString();
                }

                if (quest.Objectives != null)
                {
                    for (int r = 0; r < quest.Objectives.dataList.Count; r++)
                    {
                        SHQuestObjective obj = (SHQuestObjective)quest.Objectives.dataList[r];

                        szKey = "QUEST_OBJ_DESC_" + quest.id.ToString() + "_" + obj.id.ToString();

                        if (QuestString.IsValid(szKey))
                        {
                            obj.desc = QuestString[szKey].ToString();
                        }
                    }
                }
            }
        }
Exemplo n.º 9
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);
                }
            }
        }
Exemplo n.º 10
0
        private void ReplaceKeyToString_Select(int nDialogID, SHDialogSelect dialogSelect, SHStringXml DialogString)
        {
            m_nSaySelectID++;

            string szKey = "DIALOG_SELECT_TEXT_" + nDialogID.ToString() + "_" + m_nSaySelectID.ToString();

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

            if (dialogSelect.Say != null)
            {
                ReplaceKeyToString_Say(nDialogID, dialogSelect.Say, DialogString);
            }
        }