protected override void ProcessOptionSelection(ButtonHolder holder) { PlayClickSound(); uint levelNo = uint.Parse(holder.Value.Substring(LanguageResources.GetString(LanguageKey.Level).Length)); gameEventListener.StartGame(levelNo, EngineConfig.CurrentPlayerPlaneType); }
protected override List <object> GetAvailableOptions() { List <object> availableModes = new List <object>(); ConfigOption_NativePtr videoModeOption; // staram sie znalezc opcje konfiguracyjna Video Mode ConfigOptionMap map = Root.Singleton.RenderSystem.GetConfigOptions(); foreach (KeyValuePair <string, ConfigOption_NativePtr> m in map) { if (m.Value.name.Equals(C_VSYNC)) { videoModeOption = m.Value; break; } } // nie ma takiej mozliwosci, zebym nie znalazl // konwertuje wektor na liste foreach (String s in videoModeOption.possibleValues) { availableModes.Add(LanguageResources.GetString(s)); } availableModes.Sort(); return(availableModes); }
protected override void ProcessOptionSelection(ButtonHolder holder) { //EngineConfig.InverseKeys = "Yes".Equals(selected); EngineConfig.InverseKeys = LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value); EngineConfig.SaveEngineConfig(); RecreateGUI(); }
public InitializeMainGUI(IMSApiSessionContextStruct sessionContext, ApplicationConfiguration config, MainView view, LanguageResources lang) { this.sessionContext = sessionContext; this.config = config; this.view = view; this.lang = lang; }
private void LoadLanguage(LanguageResources resources) { _translations = resources.Translations; SelectedLanguage = new CultureInfo(resources.Language); AvailableLanguages = resources.AvailableLanguages.Select(n => new CultureInfo(n)).ToList(); LanguageChanged?.Invoke(this, EventArgs.Empty); }
protected override void DisplayControlChangeWindow(uint id) { if (onControlsCaptureStarted != null) { onControlsCaptureStarted(); } ActivateKeyboard(); string caption = ""; currentKeyId = id; caption += LanguageResources.GetString(GetLanguageKeyById(id)); caption += " = ... "; //LanguageResources.GetString(LanguageKey.Pause); float width = ViewHelper.MeasureText(parentGui.mFont, caption + " (1/2) ", parentGui.mFontSize); controlChangeWindow = parentGui.createWindow(new Vector4(parentGuiWindow.x + (parentGuiWindow.w - width) / 2.0f, parentGuiWindow.y + parentGuiWindow.h / 4, width, parentGuiWindow.h / 2), "bgui.window", (int)wt.NONE, caption); if (GetLanguageKeyById(id).Equals(LanguageKey.Pitch)) { controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, parentGui.mFontSize + GUI.OVERLAY_TITLE_MARGIN, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.Pitch) + " (1/2)"); } if (GetLanguageKeyById(id).Equals(LanguageKey.AccelerateBreakTurn)) { controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, parentGui.mFontSize + GUI.OVERLAY_TITLE_MARGIN, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.AccelerateBreakTurn) + " (1/2)"); } controlChangeWindow.show(); }
void CreateJoystickPointerControl(Window parentWindow, float y, int axisNo) { ColourValue cv; string windowMaterial = "bgui.window"; if (axisNo == KeyMap.Instance.JoystickHorizontalAxisNo || axisNo == KeyMap.Instance.JoystickVerticalAxisNo) { cv = new ColourValue(1.0f, 0.8f, 0.0f); windowMaterial = "bgui.window.yellow"; } else { cv = ColourValue.White; } float pointerWindowSize = parentWindow.w * 0.4f; int yshift = (int)(joystickWindows.Count * (0.85f * GetTextVSpacing())); var pos = new Vector4(parentWindow.x + 0.5f * (parentWindow.w - pointerWindowSize), parentWindow.y + y + GetTextVSpacing() + yshift, pointerWindowSize, 0.75f * GetTextVSpacing()); joystickWindows.Add(mGui.createWindow(pos, windowMaterial, (int)wt.NONE, "")); int index = joystickWindows.Count - 1; pos.x = GetTextVSpacing(); // left pos.y -= parentWindow.y; pos.w = GetTextVSpacing(); // height parentWindow.createStaticText(pos, LanguageResources.GetString(LanguageKey.JoystickAxis) + " " + axisNo, cv); joystickPointerAxis.Add(axisNo); joystickPointers.Add(mGui.createWindow(getJoystickPointerRect(joystickWindows[index], axisNo), "bgui.window.pointer", (int)wt.NONE, "")); }
protected override void DisplayControlChangeWindow(uint id) { if (onControlsCaptureStarted != null) { onControlsCaptureStarted(); } // Console.WriteLine("DisplayControlChangeWindow"); ActivateJoysticks(); ActivateKeyboard(); string caption = ""; currentKeyId = id; caption += LanguageResources.GetString(GetLanguageKeyById(id)); caption += " = ... "; //LanguageResources.GetString(LanguageKey.Pause); float width = ViewHelper.MeasureText(parentGui.mFont, caption, parentGui.mFontSize); controlChangeWindow = parentGui.createWindow(new Vector4(parentGuiWindow.x + (parentGuiWindow.w - width) / 2.0f, parentGuiWindow.y + parentGuiWindow.h / 4, width, parentGuiWindow.h / 2), "bgui.window", (int)wt.NONE, caption); if (GetLanguageKeyById(id).Equals(LanguageKey.Pitch)) { controlChangeWindow.createStaticText(new Vector4(parentGui.mFontSize, parentGui.mFontSize, controlChangeWindow.w, parentGui.mFontSize), "Step 1..."); } controlChangeWindow.show(); }
private AppResourcesLisener() { isDispposing = false; languages = new LanguageResources(); themes = new ThemeResources(); images = new ImageResources(); }
protected override bool IsOptionSelected(int index, ButtonHolder holder) { string option = holder.Value; if (LanguageResources.GetString(LanguageKey.None).Equals(option)) { return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.None); } else if (LanguageResources.GetString(LanguageKey.Low).Equals(option)) { return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.Low); } else if (LanguageResources.GetString(LanguageKey.Medium).Equals(option)) { return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.Medium); } else if (LanguageResources.GetString(LanguageKey.High).Equals(option)) { return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.High); } return(false); }
/// <summary> /// The load file. /// </summary> /// <exception cref="ApplicationException"></exception> private void LoadFile() { if (this._fileName == string.Empty || !File.Exists(this._fileName)) { throw new ApplicationException("Invalid language file {0}".FormatWith(this._fileName)); } this._localizationLanguageResources = new LoadSerializedXmlFile <LanguageResources>().FromFile( this._fileName, "LOCALIZATIONFILE{0}".FormatWith(this._fileName), (r) => { // transform the page and tag name ToUpper... r.page.ForEach(p => p.name = p.name.ToUpper()); r.page.ForEach(p => p.Resource.ForEach(i => i.tag = i.tag.ToUpper())); }); var userLanguageCode = this._localizationLanguageResources.code.IsSet() ? this._localizationLanguageResources.code.Trim() : "en-US"; if (userLanguageCode.Length > 5) { userLanguageCode = this._localizationLanguageResources.code.Trim().Substring(0, 2); } this._currentCulture = new CultureInfo(userLanguageCode); }
protected override void ProcessOptionSelection(ButtonHolder holder) { /* * this.gameEventListener.MinimizeWindow(); * Thread.Sleep(500); * * string directory = System.Environment.CurrentDirectory; * * var pinfo = new ProcessStartInfo(); * pinfo.FileName = Path.Combine(directory,"bik/1.exe"); * pinfo.CreateNoWindow = true; * * Process movieProcess = Process.Start(pinfo); * movieProcess.WaitForExit(); * * this.gameEventListener.MaximizeWindow(); */ string selected = holder.Value; if (LanguageResources.GetString(LanguageKey.High).Equals(selected)) { EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Hard; } else if (LanguageResources.GetString(LanguageKey.Medium).Equals(selected)) { EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Medium; } else if (LanguageResources.GetString(LanguageKey.Low).Equals(selected)) { EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Easy; } EngineConfig.SaveEngineConfig(); RecreateGUI(); }
protected override void CreateGUI() { base.CreateGUI(); Vector2 m = GetMargin(); int h = (int)GetTextVSpacing(); guiWindow = mGui.createWindow(new Vector4(m.x, m.y, Viewport.ActualWidth / 2, Viewport.ActualHeight - m.y - h), "bgui.window", (int)wt.NONE, LanguageResources.GetString(LanguageKey.EnhancedVersion)); Callback cc = new Callback(this); // remember to give your program the BetaGUIListener interface mGui.mFontSize = fontSize; guiWindow.createStaticTextAutoSplit(new Vector4(5, 1.5f * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, 3 * GetTextVSpacing()), message); mGui.mFontSize = fontSize; initButtons(2, 1); buttons[0] = guiWindow.createButton(new Vector4(5, 7 * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button", LanguageResources.GetString(LanguageKey.GetEnhancedVersion), cc, 0); buttons[1] = guiWindow.createButton(new Vector4(5, 13 * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button", LanguageResources.GetString(LanguageKey.Back), cc, 0); selectButton(0); guiWindow.show(); }
private void worker_DoWork(object sender, DoWorkEventArgs e) { //添加你初始化的代码 res = new LanguageResources(); CommonModel commonModel = ReadIhasFileData.getInstance(); if (!isCanLogin) { sessionContextHandler = new SessionContextHeandler(null, this); } sessionValidationStruct = new IMSApiSessionValidationStruct(); sessionValidationStruct.stationNumber = commonModel.Station; sessionValidationStruct.stationPassword = ""; sessionValidationStruct.user = this.txtUserName.Text.Trim(); sessionValidationStruct.password = this.txtPassword.Text.Trim(); sessionValidationStruct.client = commonModel.Client; sessionValidationStruct.registrationType = commonModel.RegisterType; sessionValidationStruct.systemIdentifier = commonModel.Station; UserName = this.txtUserName.Text.Trim(); LoginResult = imsapi.regLogin(sessionValidationStruct, out sessionContext); if (LoginResult == 0) { LogHelper.Info("api regLogin.(error code=" + LoginResult + ")"); } else { LogHelper.Error("api regLogin.(error code=" + LoginResult + ")"); } LogHelper.Info("Login end..."); if (LoginResult != IMSApiDotNetConstants.RES_OK) { this.Invoke(new MethodInvoker(delegate { SetStatusLabelText("api regLogin error.(error code=" + LoginResult + ")", 1); SetControlStatus(true); })); return; } else { //add by qy 160614 if (!VerifyUserTeam()) { this.Invoke(new MethodInvoker(delegate { SetControlStatus(true); })); return; } this.Invoke(new MethodInvoker(delegate { this.Hide(); CloseSP(); //add by qy MainView view = new MainView(this.txtUserName.Text.Trim(), DateTime.Now, sessionContext); //edit by qy view.ShowDialog(); })); } }
protected override List <Button> buildButtons() { List <Button> ret = new List <Button>(); ret.Add(guiWindow.createButton(new Vector4(20, (this.messages.Count + 2) * GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button", LanguageResources.GetString(LanguageKey.Quit), cc)); return(ret); }
// GET: Alarms public ActionResult Index() { LanguageResources.Init(); FORIS.Interbilling.NTS.Mediation.Logger.Init(); DataAccess.Init(); Configuration.Init(); //initialise mediation configuration return(View()); }
private string GetValue() { if (_manager == null) //没有程序集信息,从站点资源目录中提取 { return(LanguageResources.Get(_resourceKey)); } return(_manager.GetString(_resourceKey, Language.Current)); }
protected override List <object> GetAvailableOptions() { List <object> availableModes = new List <object>(); availableModes.Add(LanguageResources.GetString(LanguageKey.No)); availableModes.Add(LanguageResources.GetString(LanguageKey.Yes)); return(availableModes); }
private void worker_DoWork(object sender, DoWorkEventArgs e) { //添加你初始化的代码 res = new LanguageResources(); sessionValidationStruct = new IMSApiSessionValidationStruct(); sessionValidationStruct.stationNumber = config.StationNumber; sessionValidationStruct.stationPassword = ""; sessionValidationStruct.user = this.txtUserName.Text.Trim(); sessionValidationStruct.password = this.txtPassword.Text.Trim(); sessionValidationStruct.client = config.Client; sessionValidationStruct.registrationType = config.RegistrationType; sessionValidationStruct.systemIdentifier = config.StationNumber; UserName = this.txtUserName.Text.Trim(); LoginResult = imsapi.regLogin(sessionValidationStruct, out sessionContext); if (LoginResult == 0) { LogHelper.Info("api regLogin.(error code=" + LoginResult + ")"); } else { LogHelper.Error("api regLogin.(error code=" + LoginResult + ")"); } LogHelper.Info("Login end..."); if (LoginResult != IMSApiDotNetConstants.RES_OK) { this.Invoke(new MethodInvoker(delegate { SetStatusLabelText("Api regLogin error(error code=" + LoginResult + ")", 1); SetControlStatus(true); })); return; } else { if (!VerifyTeamNumber()) { this.Invoke(new MethodInvoker(delegate { SetStatusLabelText("User not belong to the userteam.[" + config.AUTH_TEAM + "]", 1); SetControlStatus(true); })); return; } this.Invoke(new MethodInvoker(delegate { if (config.LogInType == "COM" && serialPort.IsOpen) { serialPort.Close(); } this.DialogResult = DialogResult.OK; view.isFormOutPoump = false; this.Close(); })); } }
protected override List <object> GetAvailableOptions() { List <object> availableModes = new List <object>(); FrameWorkStaticHelper.GetNumberOfAvailableJoysticks(); for (int i = 0; i < joysticks.Count; i++) { availableModes.Add(LanguageResources.GetString(LanguageKey.Joystick) + " " + (i + 1) + " - ID=" + joysticks[i].Vendor() + "_" + joysticks[i].ID); } return(availableModes); }
private static string ParseName(string name, string language) { const string prefix = "{Strings."; const string suffix = "}"; if (!(name.StartsWith(prefix) && name.EndsWith(suffix))) { return(name); } name = name.Substring(prefix.Length, name.Length - prefix.Length - suffix.Length); return(LanguageResources.Get(language, name)); }
/// <summary> /// Tworzy tekst statyczny ale string zostanie automatycznie podzielony na nowe linie tak aby pasowal do okienka w ktorym ma byc wyswietlony /// </summary> /// <param name="D"></param> /// <param name="T"></param> /// <returns></returns> public OverlayContainer createStaticTextAutoSplit(Vector4 D, String T) { uint h = this.mGUI.mFontSize; // margin and font size Font font = (Font)(Mogre.FontManager.Singleton.GetByName(this.mGUI.mFont).Target); Vector2 averageSize = ViewHelper.GetTextAverageSize(T, font, h); int charsPerLine = (int)Math.Floor((D.z - 2 * h) / averageSize.x); string multiline = LanguageResources.SplitInsertingNewLinesByLength(T, charsPerLine); return(createStaticText(D, multiline, ColourValue.White)); }
protected override bool IsOptionSelected(int index, ButtonHolder holder) { string curr = Root.Singleton.RenderSystem.GetConfigOptions()[C_VSYNC].currentValue; if (curr.Equals("Yes")) { return(LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value)); } else { return(LanguageResources.GetString(LanguageKey.No).Equals(holder.Value)); } }
private void worker_DoWork(object sender, DoWorkEventArgs e) { //添加你初始化的代码 res = new LanguageResources(); config = new ApplicationConfiguration(); if (!isCanLogin) { sessionContextHandler = new SessionContextHeandler(config, this); } sessionValidationStruct = new IMSApiSessionValidationStruct(); sessionValidationStruct.stationNumber = config.StationNumber; sessionValidationStruct.stationPassword = ""; sessionValidationStruct.user = this.txtUserName.Text.Trim(); sessionValidationStruct.password = this.txtPassword.Text.Trim(); sessionValidationStruct.client = config.Client; sessionValidationStruct.registrationType = config.RegistrationType; sessionValidationStruct.systemIdentifier = config.StationNumber; UserName = this.txtUserName.Text.Trim(); LoginResult = imsapi.regLogin(sessionValidationStruct, out sessionContext); if (LoginResult != IMSApiDotNetConstants.RES_OK) { this.Invoke(new MethodInvoker(delegate { SetStatusLabelText("api regLogin error.(result code=" + LoginResult + ")", 1); SetControlStatus(true); })); return; } else { LogHelper.Info("api regLogin success.(result code=" + LoginResult + ")"); if (!VerifyTeamNumber()) { this.Invoke(new MethodInvoker(delegate { SetStatusLabelText("验证Team number失败", 1); SetControlStatus(true); })); return; } this.Invoke(new MethodInvoker(delegate { this.Hide(); MainView view = new MainView(this.txtUserName.Text.Trim(), DateTime.Now, sessionContext, config); view.ShowDialog(); })); } LogHelper.Info("Login end..."); }
protected override List <PositionedMessage> buildMessages() { List <PositionedMessage> ret = new List <PositionedMessage>(); ret.Add( new PositionedMessage(20, 2 * GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), LanguageResources.GetString(LanguageKey.Credits))); foreach (string s in names) { ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s)); } return(ret); }
protected override void ProcessOptionSelection(ButtonHolder holder) { bool restart = false; EngineConfig.ShadowsQualityTypes old = EngineConfig.ShadowsQuality; if (LanguageResources.GetString(LanguageKey.None).Equals(holder.Value)) { EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.None; if (old > 0) { restart = true; } } else if (LanguageResources.GetString(LanguageKey.Low).Equals(holder.Value)) { EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Low; if (old == 0) { restart = true; } } else if (LanguageResources.GetString(LanguageKey.Medium).Equals(holder.Value)) { EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Medium; if (old == 0) { restart = true; } } else if (LanguageResources.GetString(LanguageKey.High).Equals(holder.Value)) { EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.High; if (old == 0) { restart = true; } } EngineConfig.SaveEngineConfig(); if (restart && EngineConfig.UseHydrax) { OptionsScreen.restartRequired = true; } RecreateGUI(); }
protected override void ProcessOptionSelection(ButtonHolder holder) { if (!Root.Singleton.RenderSystem.GetConfigOptions()[C_VSYNC].currentValue.Equals(holder.Value)) { if (LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value)) { Root.Singleton.RenderSystem.SetConfigOption(C_VSYNC, "Yes"); } else { Root.Singleton.RenderSystem.SetConfigOption(C_VSYNC, "No"); } OptionsScreen.restartRequired = true; } Root.Singleton.SaveConfig(); }
protected override List <Button> buildButtons() { float h = GetTextVSpacing(); List <Button> ret = new List <Button>(); ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth * 0.25f, Viewport.ActualHeight - 3 * h, Viewport.ActualWidth / 2, h), "bgui.button", LanguageResources.GetString(LanguageKey.OK), cc)); ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth - 6 * h, 2 * h, 5 * h, 2 * h), "bgui.button", "UP", cc)); ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth - 6 * h, Viewport.ActualHeight - 4 * h, 5 * h, 2 * h), "bgui.button", "DOWN", cc)); return(ret); }
public string GetDisplayName() { if (!isCustom) { uint?levelNo = GetLevelNo(Filename); if (!levelNo.HasValue) { levelNo = 0; } return(LanguageResources.GetString(LanguageKey.Level) + levelNo); } else { return(GetCustomLevelName(filename)); } }
protected override List <PositionedMessage> buildMessages() { float y = 2 * GetTextVSpacing(); List <PositionedMessage> ret = new List <PositionedMessage>(); ret.Add( new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(), LanguageResources.GetString(LanguageKey.LanguageDebugMode))); // y += GetTextVSpacing(); ret.Add( new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(), LanguageResources.GetString(LanguageKey.LanguageID))); /* y += GetTextVSpacing(); * ret.Add( * new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(), * LanguageResources.GetString(LanguageKey.LanguageID)));*/ FontPtr font = (FontPtr)Mogre.FontManager.Singleton.GetByName(FontManager.CurrentFont); // y += GetTextVSpacing(); ret.Add( new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(), font.Name)); ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), String.Format(LanguageResources.GetString(LanguageKey.TranslationCompleteness), translatedStrings, totalStrings), ColourValue.Green, ColourValue.Green)); ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), "")); // font.g foreach (string s in names) { if ("!!!".Equals(s)) { ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s, ColourValue.Red, ColourValue.Red)); } else { ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s)); } } return(ret); }