Exemplo n.º 1
0
        public void refreshNotifsList()
        {
            string[] notifications = UpdateNotifsManager.getDispNotifs();
            bool     refresh       = false;

            if (notifications.Length == comboBoxProgressNotifs.Items.Count)
            {
                for (int i = 0; i < notifications.Length; i++)
                {
                    if (!notifications[i].Equals(comboBoxProgressNotifs.Items[i]))
                    {
                        refresh = true;
                    }
                }
            }
            else
            {
                refresh = true;
            }

            if (refresh)
            {
                comboBoxProgressNotifs.Items.Clear();
                comboBoxProgressNotifs.Items.AddRange(UpdateNotifsManager.getDispNotifs());
            }
        }
Exemplo n.º 2
0
        public void SetForm(CoreDetails core)
        {
            textBoxQuestTitle.Text = core.QuestTitle;
            textBoxQuestDesc.Text  = core.QuestDesc;
            textBoxFPKName.Text    = core.FpkName;
            textBoxQuestNum.Text   = core.QuestNum;

            locationID = core.locationID;

            switch (locationID)
            {
            case 10:
                comboBoxRegion.Text = "Afghanistan";
                break;

            case 20:
                comboBoxRegion.Text = "Central Africa";
                break;

            case 50:
                comboBoxRegion.Text = "Mother Base";
                break;
            }

            comboBoxLoadArea.Text = core.loadArea;

            textBoxXCoord.Text = core.coords.xCoord;
            textBoxYCoord.Text = core.coords.yCoord;
            textBoxZCoord.Text = core.coords.zCoord;

            comboBoxRadius.Text   = core.radius;
            comboBoxCategory.Text = core.category;
            comboBoxReward.Text   = core.reward;

            comboBoxCP.Text = core.CPName;

            refreshNotifsList();
            string displayNotification = UpdateNotifsManager.GetDisplayNotification(core.progressLangID);

            if (displayNotification != null)
            {
                comboBoxProgressNotifs.Text = displayNotification;
            }
            else if (comboBoxProgressNotifs.Items.Count > 0)
            {
                comboBoxProgressNotifs.SelectedIndex = 0;
            }

            refreshRoutesList();
            if (!string.IsNullOrEmpty(core.routeName) && comboBoxRoute.Items.Contains(core.routeName))
            {
                comboBoxRoute.SelectedItem = core.routeName;
            }
            else
            {
                comboBoxRoute.SelectedItem = "NONE";
            }
        }
Exemplo n.º 3
0
 private void buttonCreateEntry_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(textBoxLangId.Text) || string.IsNullOrEmpty(textBoxLangValue.Text))
     {
         return;
     }
     UpdateNotifsManager.addNotification(textBoxLangId.Text, textBoxLangValue.Text);
     MessageBox.Show(string.Format("\"{0}\" added to notification list", textBoxLangValue.Text), "Entry Added", MessageBoxButtons.OK, MessageBoxIcon.Information);
     Close();
 }
Exemplo n.º 4
0
        public static void WriteQuestLangs(string dir, params CoreDetails[] coreDetails)
        {
            List <LangEntry> langList            = new List <LangEntry>();
            List <string>    notificationLangIds = new List <string>();

            foreach (CoreDetails core in coreDetails)
            {
                string notifId = core.progressLangID;

                if (!notificationLangIds.Contains(notifId) && UpdateNotifsManager.isCustomNotification(notifId))
                {
                    notificationLangIds.Add(notifId);
                }

                langList.Add(new LangEntry("name_q" + core.QuestNum, core.QuestTitle, 5));
                langList.Add(new LangEntry("info_q" + core.QuestNum, core.QuestDesc, 5));
            }

            foreach (string langId in notificationLangIds)
            {
                langList.Add(new LangEntry(langId, UpdateNotifsManager.GetDisplayNotification(langId) + " [%d/%d]", 5));
            }

            LangFile questLng = new LangFile(langList);

            string fileName = "";

            if (coreDetails.Length > 1)
            {
                fileName = $"ih_q{coreDetails[0].QuestNum}_q{coreDetails[coreDetails.Length - 1].QuestNum}";
            }
            else if (coreDetails.Length > 0)
            {
                fileName = $"ih_quest_q{coreDetails[0].QuestNum}";
            }

            foreach (string language in lngLanguages)
            {
                string lngPath = $@"{dir}/Assets/tpp/pack/ui/lang/lang_default_data_{language}_fpk/Assets/tpp/lang/ui";
                string lngFile = Path.Combine(lngPath, $"{fileName}.{language}.lng2");
                Directory.CreateDirectory(lngPath);

                using (FileStream outputStream = new FileStream(lngFile, FileMode.Create))
                {
                    questLng.Write(outputStream);
                }
            }
        }
Exemplo n.º 5
0
 public void refreshNotifsList()
 {
     UpdateComboBox(comboBoxProgressNotifs, UpdateNotifsManager.GetAllDisplayNotifications());
 }