//damage,..... public void UpdateInfo(float cValue, float nValue, int maxLevel, int level, int uType) { currentValueText.SetText(Math.SignificantFigures(cValue, 4).ToString()); if (level == maxLevel) { nextValueText.Visible = false; arrowImage.Visible = false; } else { arrowImage.Visible = true; nextValueText.Visible = true; nextValueText.SetText(Math.SignificantFigures(nValue, 4).ToString()); } if (uType == 1) { currentValueText.SetText(currentValueText.GetText() + "s"); nextValueText.SetText(nextValueText.GetText() + "s"); } else if (uType == 2) { currentValueText.SetText(currentValueText.GetText() + "%"); nextValueText.SetText(nextValueText.GetText() + "%"); } UpdateStarBackground(maxLevel); UpdateStar(level); }
public void V2Test(string key, string expected) { var lorem = new UIText("lorem"); var actual = lorem.GetText(102, key); Assert.Equal(expected, actual); }
public void MiltilineV2() { var expected = $"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc gravida nunc non justo pretium consectetur. Sed tempus libero ac ligula aliquam elementum. Duis vitae interdum leo. Sed semper nulla %1 a lectus dictum dictum.{Environment.NewLine}{Environment.NewLine}Quisque vehicula, nisi ut scelerisque sodales, nisi ipsum sodales ipsum, in rutrum tellus lacus sed nibh. Etiam mauris velit, elementum sed placerat et, elementum et tellus. Duis vitae elit fermentum, viverra lorem in, lobortis elit."; var lorem = new UIText("lorem"); var actual = lorem.GetText(102, "Multiline"); Assert.Equal(expected, actual); }
public void MiltilineV1() { var expected = $"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce justo dui, rhoncus a pulvinar sit amet, fermentum vitae lorem. Maecenas nec nisi sit amet eros rutrum congue. In sagittis suscipit arcu, ac vestibulum nunc feugiat volutpat.{Environment.NewLine}{Environment.NewLine}Vivamus consequat velit dui, sit amet rhoncus dui malesuada a. Maecenas hendrerit commodo mi et scelerisque. Cras pharetra ultrices aliquam. Praesent ac efficitur magna, vitae scelerisque metus."; var lorem = new UIText("lorem"); var actual = lorem.GetText(101, 4); Assert.Equal(expected, actual); }
void submitBtn_Click(object sender, EventArgs e) { try { var text = new UIText(langTxtBox.Text.ToLowerInvariant()); if (int.TryParse(idTxtBox.Text, out int value)) { sampleTxtBox.Text = text.GetText(value, keyTxtBox.Text); } } catch (Exception err) { sampleTxtBox.Text = err.Message; } }