Ejemplo n.º 1
0
        public Team(Color Color, string Name, Sprite CaptureIcon)
        {
            TeamId = CurrentTeamId;
            CurrentTeamId++;

            this.Color       = Color;
            ProtectionColor  = new Color(Color.r, Color.g, Color.b, 0.5f);
            HealthBar        = new HealthBar(ExtraResources.BUNDLE, Name);
            Name             = Name.ToLowerInvariant();
            this.Name        = Name;
            this.CaptureIcon = CaptureIcon;

            ColorFormat = $"[{Color.ToHexRGBA()}]";
            var Arguments = new Dictionary <string, Func <string> > {
                { "%c", () => ColorFormat },
                { "%w", () => LanguageManager.Get($"m.team.{Name}.whom") }
            };

            _Enable = MakeTeamToggle(Name, "enable", Arguments, GROUP_TEAMS);
            _Enable.ValueChanged += (Sender, Args) => {
                if (!_Enable.GetValue())
                {
                    TeamAffinityController.TeamDisabled(this);
                }
            };
        }
Ejemplo n.º 2
0
        public void GetALanguage()
        {
            LanguageManager manager  = new LanguageManager();
            Language        language = manager.Get(1);

            Assert.AreEqual(language.Name, "Español", "Debería ser español");
        }
Ejemplo n.º 3
0
        public void initlanguage()
        {
            btn1.Text = LanguageManager.Get("dialog_cancel");
            btn2.Text = "< " + LanguageManager.Get("dialog_back");
            if (wizardPageCollection1.SelectedIndex == wizardPageCollection1.TabPages.Count - 1)
            {
                btn3.Text = LanguageManager.Get("dialog_finish");
            }
            else
            {
                btn3.Text = LanguageManager.Get("dialog_next") + " >";
            }
            o_Text = LanguageManager.Get("dialogt_firsttime");
            Text   = o_Text + " - " + String.Format(LanguageManager.Get("dialogt_step"), new string[] { "2", o_Pages.ToString() });

            s2_Title.Text     = LanguageManager.Get("text_langselect");
            s2_lblAuthor.Text = LanguageManager.Get("field_author");
            s2_lblName.Text   = LanguageManager.Get("field_name");
            s2_lblFlag.Text   = LanguageManager.Get("field_flag");
            s2_lnkImport.Text = LanguageManager.Get("text_importlp");

            s3_Title.Text = LanguageManager.Get("text_configuration");
            s4_Title.Text = LanguageManager.Get("text_thanks");
            s4_Text.Text  = LanguageManager.Get("text_readytouse");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Muestra el formulario para la edición de un usuario existente.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ShowEditForm(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Session["Ubiquicity_itemId"]);

            try
            {
                LanguageManager    languageManager = new LanguageManager();
                Language           language        = languageManager.Get(id);
                List <Translation> translations    = languageManager.GetTranslations(id);

                if (languageManager.HasErrors)
                {
                    Alert.Show("Error", languageManager.Errors[0].description);
                }
                else
                {
                    Session["Ubiquicity_action"] = EDIT;
                    // Para evitar traer apbsolutamente todo el contenido del objeto
                    //(y facilitar la carga en la grilla inicial), las traducciones
                    //y el idioma asociado se recuperan por separado
                    UCFormLanguage.FillForm(language, translations);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "openModalEdit", "window.onload = function() { $('#ucModalLanguage').modal('show'); }", true);
                }
            }
            catch (Exception exception)
            {
                Alert.Show("Exception", exception.Message);
            }
        }
Ejemplo n.º 5
0
        public void Run(ChatCallback Callback, List <string> Args)
        {
            if (Args.Count == 0)
            {
                this.UsageError(Callback, "Укажите название команды, которую хотите выбрать");
                return;
            }

            var TeamName = Args[0];
            var Team     = TeamsController.GetByName(TeamName);

            if (Team == null)
            {
                this.UsageError(Callback, $"Команда {TeamName} не найдена!");
                return;
            }

            var Whom = LanguageManager.Get($"m.team.{TeamName}.whom");

            if (!Team.Enable)
            {
                Callback.Send($"К сожалению, команда {Whom} выключена");
                return;
            }

            Callback.Send($"Вы успешно привязаны к команде {Whom}!");

            TeamAffinityController.PreSetAffinity(Team);
        }
Ejemplo n.º 6
0
        public static void Postfix(IntroCutscene.CoBegin__d __instance)
        {
            var Extra = PlayerControl.LocalPlayer.Extra();
            var Team  = Extra.Team;
            var Role  = Extra.Role;

            var TeamName = LanguageManager.Get($"m.team.{Team.Name}.prefix");
            var RoleName = LanguageManager.Get($"m.{Role.Id}");

            var PersonText = LanguageManager.Get("m.person")
                             .Replace("%t", TeamName)
                             .Replace("%r", RoleName);
            var ModeBrief = LanguageManager.Get($"m.gamemode.{GameMode.Current.Id}.desc")
                            .Replace("%c", $"[{Team.Color.ToHexRGBA()}]")
                            .Replace("%whom", LanguageManager.Get($"m.team.{Team.Name}.whom"))
                            .Replace("%which", LanguageManager.Get($"m.team.{Team.Name}.which"))
                            .Replace("%r", Globals.FORMAT_WHITE);

            __instance.__this.Title.Text                   = PersonText;
            __instance.__this.Title.Color                  = Team.Color;
            __instance.__this.ImpostorText.Text            = ModeBrief;
            __instance.__this.BackgroundBar.material.color = Team.Color;

            HudManager.Instance.Chat.SetVisible(true);

            Roles.Role.RespawnAll();
            GunController.UpdateForPlayer();
        }
Ejemplo n.º 7
0
        private bool SaveFile(string tableName)
        {
            var tbl = StaticReference.GetTableByFullName(tableName);

            if (tbl == null)
            {
                return(true);
            }

            tbl.Save(); // save
            tbl.Altered = false;
            if (tcMain.SelectedTabPage.Text.Contains("(*)"))
            {
                tcMain.SelectedTabPage.Text = tcMain.SelectedTabPage.Text.Replace("(*)", "");
            }
            var page = GetTabPageByFilename(tableName);
            var view = GetViewFromTabPage(page);

            if (_editedCells.ContainsKey(view))
            {
                _editedCells.Remove(view);
                view.Invalidate();
            }
            ClearNewRowHighlight(view);
            StaticReference.ShowInformation(this, LanguageManager.Get("Message_SaveSuccess"));
            return(true);
        }
Ejemplo n.º 8
0
        private void decompressFileButton_Click(object sender, EventArgs e)
        {
            File f = fileTreeView.SelectedNode.Tag as File;

            try
            {
                try
                {
                    f.beginEdit(this);
                }
                catch (AlreadyEditingException)
                {
                    MessageBox.Show(LanguageManager.Get("Errors", "File"));
                    return;
                }
                byte[] CompFile = f.getContents();
                byte[] RawFile  = ROM.LZ77_Decompress(CompFile);
                f.replace(RawFile, this);
                UpdateFileInfo();
                f.endEdit(this);
            }
            catch (Exception)
            {
                MessageBox.Show(LanguageManager.Get("FilesystemBrowser", "DecompressionFail"));
                if (f.beingEditedBy(this))
                {
                    f.endEdit(this);
                }
            }
        }
Ejemplo n.º 9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            using (var sfd = new SaveFileDialog())
            {
                sfd.Title           = @"Select path and enter filename";
                sfd.Filter          = @"Knight OnLine data tables |*.tbl";
                sfd.OverwritePrompt = true;
                if (DialogResult.OK == sfd.ShowDialog())
                {
                    var tbl = StaticReference.GetTableByFullName(_tableName);

                    if (tbl == null)
                    {
                        StaticReference.ShowError(this, LanguageManager.Get("Message_FileNotOpen"));
                        Close();
                        return;
                    }

                    foreach (var v in StaticReference.EncryptionMethods.Where(v => string.Compare(v.Name(), cbEncryptionList.Text, StringComparison.Ordinal) == 0))
                    {
                        tbl.SetEncryption(v);
                    }
                    tbl.SaveAs(sfd.FileName);
                    StaticReference.ShowInformation(this, LanguageManager.Get("Message_Done"));
                    Close();
                    // tePath.Text = sfd.FileName;
                }
            }
        }
Ejemplo n.º 10
0
        public void UpdateButtons()
        {
            if (this.SelectedIndex == 0)
            {
                bckButton.Enabled = false;
            }
            else
            {
                bckButton.Enabled = true;
            }

            if (this.SelectedIndex == TabPages.Count - 1)
            {
                nxtButton.Tag     = WizardButton.Finish; nxtButton.Text = LanguageManager.Get("dialog_finish");
                bckButton.Enabled = false; cclButton.Enabled = false;
            }

            if ((bool)TabPages[SelectedIndex].Tag == true)
            {
                nxtButton.Enabled = true;
            }
            else
            {
                nxtButton.Enabled = false;
            }
        }
Ejemplo n.º 11
0
 public void InitBG()
 {
     if (Map.Background != "" && !File.Exists(Map.Background))
     {
         NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), LanguageManager.Get("BG_Loss_Tip_Text"));
         Map.Background = "";
     }
     if (Map.Background == "")
     {
         using (var s = new MemoryStream())
         {
             Resources.defaultBG.Save(s, ImageFormat.Png);
             s.Seek(0, SeekOrigin.Begin);
             _bgTexture = Texture2D.FromFile(device, s);
         }
     }
     else
     {
         using (var s = new FileStream(Map.Background, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
         {
             _bgTexture = Texture2D.FromFile(device, s);
         }
     }
     _bgScale  = Math.Min((float)_showRect.Width / _bgTexture.Width, (float)_showRect.Height / _bgTexture.Height);
     _bgCenter = new Vector2((float)_bgTexture.Width / 2, (float)_bgTexture.Height / 2);
 }
Ejemplo n.º 12
0
        public override void HandleAdditionalInfo(StringBuilder Builder)
        {
            Builder.AppendLine();
            var FlagText = LanguageManager.Get("m.flag");

            foreach (var Flag in FlagsController.GetFlags())
            {
                if (!Flag.Team.Enable)
                {
                    continue;
                }

                var Color    = Flag.Team.ColorFormat ?? Globals.FORMAT_WHITE;
                var Capturer = Flag.Capturer;

                Builder.Append(Color).Append(FlagText);

                if (Capturer == null)
                {
                    Builder.AppendLine();
                    continue;
                }

                var CapturerColor = Capturer.Extra().Team.ColorFormat;
                Builder.Append(Globals.FORMAT_WHITE).Append(" - ").Append(CapturerColor)
                .AppendLine(Capturer.Data.PlayerName);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Show a page
        /// </summary>
        /// <param name="id"></param>
        private void ShowPage(int id)
        {
            wizardPageCollection1.ShowPage(id);
            Text = o_Text + " - " + String.Format(LanguageManager.Get("dialogt_step"), new string[] { id.ToString(), o_Pages.ToString() });

            wizardPageCollection1.UpdateButtons();
        }
Ejemplo n.º 14
0
        public frmColumnEditor(string tableName)
        {
            _tableName = tableName;

            InitializeComponent();
            LanguageManager.LoadInterfaceLanguage(this);
            Text = string.Format(LanguageManager.Get("frmColumnEditor_Title"), tableName);
        }
Ejemplo n.º 15
0
        private protected override void GameOptionCreated(OptionBehaviour o)
        {
            if (!(o is ToggleOption Title))
            {
                return;
            }

            Title.TitleText.Text = $"{Globals.FORMAT_WHITE}{LanguageManager.Get(Name)}"
                                   .Argumentize(LocalizationArguments);
        }
Ejemplo n.º 16
0
        private protected override void GameOptionCreated(OptionBehaviour o)
        {
            if (!(o is ToggleOption toggle))
            {
                return;
            }

            toggle.TitleText.Text = $"{Globals.FORMAT_WHITE}{LanguageManager.Get(Name)}"
                                    .Argumentize(LocalizationArguments);
            toggle.CheckMark.enabled = toggle.oldValue = GetValue();
        }
Ejemplo n.º 17
0
        // NavGroups : ngSearch //
        private void ngSearch_Find_LinkPressed(object sender, NavBarLinkEventArgs e)
        {
            GridView view = GetViewFromSelectedTabPage();

            if (view == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_SelectPageFirst"));
                return;
            }
            view.ShowFindPanel();
        }
Ejemplo n.º 18
0
 private void frmExportAsSQL_Load(object sender, System.EventArgs e)
 {
     _tbl = StaticReference.GetTableByFullName(_tableName);
     if (_tbl == null)
     {
         StaticReference.ShowError(this, LanguageManager.Get("Message_NoFileOpen"));
         Close();
         return;
     }
     PopulateColumns();
     // meDescription.Text = StaticReference.GenerateKey(256);
 }
Ejemplo n.º 19
0
        public override void HandleAdditionalInfo(StringBuilder Builder)
        {
            Builder.AppendLine();
            var PointText = LanguageManager.Get("m.point");

            foreach (var Point in PointsController.GetPoints())
            {
                var Color = Point.CurrentTeam?.ColorFormat ?? Globals.FORMAT_WHITE;

                Builder.Append(Color).Append(PointText).Append(' ').AppendLine(Point.Name);
            }
        }
Ejemplo n.º 20
0
        private protected override void GameOptionCreated(OptionBehaviour o)
        {
            if (!(o is StringOption str))
            {
                return;
            }

            str.TitleText.Text = $"{Globals.FORMAT_WHITE}{LanguageManager.Get(Name)}"
                                 .Argumentize(LocalizationArguments);
            str.Value          = str.oldValue = GetValue();
            str.ValueText.Text = ToString();
        }
Ejemplo n.º 21
0
        public static void Init()
        {
            CustomOption.AddTitle("").Group = Team.GROUP_TEAMS;
            CustomOption.AddTitle(LanguageManager.Get("m.teams")).Group = Team.GROUP_TEAMS;

            Teams.Add(new Team(Color.red, "Red", ExtraResources.CAPTURE_RED));
            Teams.Add(new Team(Color.blue, "Blue", ExtraResources.CAPTURE_BLUE));
            Teams.Add(new Team(Color.green, "Green", ExtraResources.CAPTURE_GREEN));
            Teams.Add(new Team(Color.yellow, "Yellow", ExtraResources.CAPTURE_YELLOW));
            CustomOption.AddTitle("").Group = Team.GROUP_TEAMS;
            CustomOption.AddTitle(LanguageManager.Get("m.roles")).Group = Team.GROUP_TEAMS;
        }
Ejemplo n.º 22
0
        public static string ParseBodyReport(BodyReport br)
        {
            var VisualTime = Math.Round(br.KillAge / 1000).ToString(CultureInfo.InvariantCulture);
            var Medic      = MedicRole.INSTANCE;

            if (br.KillAge > Medic.KillerColorDuration * 1000)
            {
                return(LanguageManager.Get("er.medic.report.old")
                       .Replace("%t", VisualTime));
            }
            else if (br.DeathReason == (DeathReason)3)
            {
                return(LanguageManager.Get("er.medic.report.officer")
                       .Replace("%t", VisualTime));
            }
            else if (br.DeathReason == (DeathReason)4)
            {
                return(LanguageManager.Get("er.medic.report.zombie")
                       .Replace("%t", VisualTime));
            }
            else if (br.KillAge < Medic.KillerNameDuration * 1000)
            {
                return(LanguageManager.Get("er.medic.report.name")
                       .Replace("%t", VisualTime)
                       .Replace("%n", br.Killer.name));
            }
            else
            {
                var Darker  = LanguageManager.Get("er.darker");
                var Lighter = LanguageManager.Get("er.lighter");

                var Colors = new Dictionary <byte, string> {
                    { 0, Darker },
                    { 1, Darker },
                    { 2, Darker },
                    { 3, Lighter },
                    { 4, Lighter },
                    { 5, Lighter },
                    { 6, Darker },
                    { 7, Lighter },
                    { 8, Darker },
                    { 9, Darker },
                    { 10, Lighter },
                    { 11, Lighter },
                };
                var ColorType = Colors[br.Killer.Data.ColorId];

                return(LanguageManager.Get("er.medic.report.color")
                       .Replace("%t", VisualTime)
                       .Replace("%c", ColorType));
            }
        }
Ejemplo n.º 23
0
        private void ngFile_Save_LinkPressed(object sender, NavBarLinkEventArgs e)
        {
            if (tcMain.SelectedTabPageIndex == -1 || tcMain.SelectedTabPage == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_NoFileOpen"));
                return;
            }
            string fileName = tcMain.SelectedTabPage.Tag as string;

            if (SaveFile(fileName))
            {
            }
        }
Ejemplo n.º 24
0
        private void nbiSqlExport_LinkPressed(object sender, NavBarLinkEventArgs e)
        {
            if (tcMain.SelectedTabPageIndex == -1 || tcMain.SelectedTabPage == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_NoFileOpen"));
                return;
            }
            string fileName = tcMain.SelectedTabPage.Tag as string;

            using (frmExportAsSQL export = new frmExportAsSQL(fileName))
            {
                export.ShowDialog();
            }
        }
Ejemplo n.º 25
0
 private void ChooseColl_Load(object sender, EventArgs e)
 {
     ChooseColl_PlayListCurrentCount.Text = LanguageManager.Get("Current_Count_Text") + Core.PlayList.Count;
     ChooseColl_CollectionTitle_List.Items.Clear();
     foreach (string key in Core.Collections.Keys)
     {
         ChooseColl_CollectionTitle_List.Items.Add(key);
     }
     if (ChooseColl_CollectionTitle_List.Items.Count != 0)
     {
         ChooseColl_CollectionTitle_List.SelectedIndex = 0;
     }
     this.Width = TextRenderer.MeasureText(ChooseColl_Hint_Label.Text, ChooseColl_Hint_Label.Font).Width + TextRenderer.MeasureText(ChooseColl_PlayListCurrentCount.Text, ChooseColl_PlayListCurrentCount.Font).Width + 80;
 }
Ejemplo n.º 26
0
 private void BackgroundWorker3RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (_dulpdict.Count == 0)
     {
         MessageBox.Show(LanguageManager.Get("Scan_Zero_Text")); Dispose();
     }
     else
     {
         NotifySystem.Showtip(1000, "OSUplayer", string.Format(LanguageManager.Get("Scan_Complete_Text"), _dulpdict.Count));
         DelDulp_Status_Label.Text = string.Format(LanguageManager.Get("Scan_Complete_Text"), _dulpdict.Count);
         Adddul();
     }
     DelDulp_Cancel.Enabled = true;
 }
Ejemplo n.º 27
0
        private protected override void GameOptionCreated(OptionBehaviour o)
        {
            if (!(o is NumberOption number))
            {
                return;
            }

            number.TitleText.Text = $"{Globals.FORMAT_WHITE}{LanguageManager.Get(Name)}"
                                    .Argumentize(LocalizationArguments);
            number.ValidRange     = new FloatRange(Min, Max);
            number.Increment      = Increment;
            number.Value          = number.oldValue = GetValue();
            number.ValueText.Text = ToString();
        }
Ejemplo n.º 28
0
        private void hexEdButton_Click(object sender, EventArgs e)
        {
            File f = fileTreeView.SelectedNode.Tag as File;

            try
            {
                new FileHexEditor(f).Show();
            }
            catch (AlreadyEditingException)
            {
                MessageBox.Show(LanguageManager.Get("Errors", "File"));
                return;
            }
        }
Ejemplo n.º 29
0
        private void ngFile_SaveAs_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            if (tcMain.SelectedTabPageIndex == -1 || tcMain.SelectedTabPage == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_NoFileOpen"));
                return;
            }
            string fileName = tcMain.SelectedTabPage.Tag as string;

            using (frmSaveAs encSelect = new frmSaveAs(fileName))
            {
                encSelect.ShowDialog();
            }
        }
Ejemplo n.º 30
0
 public void RefreashMenu()
 {
     if (Core.CurrentBeatmap == null)
     {
         return;
     }
     TrayIcon_Artist.Text   = LanguageManager.Get("TrayIcon_Aritst_Text") + Core.CurrentBeatmap.Artist;
     TrayIcon_Title.Text    = LanguageManager.Get("TrayIcon_Title_Text") + Core.CurrentBeatmap.Title;
     TrayIcon_Diff.Text     = LanguageManager.Get("TrayIcon_Diff_Text") + Core.CurrentBeatmap.Version;
     TrayIcon_Play.Text     = LanguageManager.Get("TrayIcon_Play_Pause_Text");
     TrayIcon_PlayNext.Text = LanguageManager.Get("TrayIcon_PlayNext_Text");
     TrayIcon_PlayPrev.Text = LanguageManager.Get("TrayIcon_PlayPrev_Text");
     TrayIcon_Exit.Text     = LanguageManager.Get("TrayIcon_Exit_Text");
 }