use a monospaced font for the ticket amount to make it wobble around less

This commit is contained in:
Ellpeck 2020-07-09 13:43:58 +02:00
parent 5322ced801
commit 9442f95525
9 changed files with 2955 additions and 2920 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Font;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;
@ -16,7 +17,8 @@ namespace TouchyTickets {
public static SoundEffect BuySound { get; private set; } public static SoundEffect BuySound { get; private set; }
public static Vector2 TileSize { get; private set; } public static Vector2 TileSize { get; private set; }
public static SpriteFont Font { get; private set; } public static GenericFont Font { get; private set; }
public static GenericFont MonospacedFont { get; private set; }
public static void Load() { public static void Load() {
TilesTexture = new UniformTextureAtlas(MlemGame.LoadContent<Texture2D>("Textures/Tiles"), 16, 16); TilesTexture = new UniformTextureAtlas(MlemGame.LoadContent<Texture2D>("Textures/Tiles"), 16, 16);
@ -28,7 +30,8 @@ namespace TouchyTickets {
BuySound = MlemGame.LoadContent<SoundEffect>("Sounds/StarBuy"); BuySound = MlemGame.LoadContent<SoundEffect>("Sounds/StarBuy");
TileSize = new Vector2(AttractionTexture.RegionWidth, AttractionTexture.RegionHeight); TileSize = new Vector2(AttractionTexture.RegionWidth, AttractionTexture.RegionHeight);
Font = MlemGame.LoadContent<SpriteFont>("Fonts/" + Localization.Get("Font")); Font = new GenericSpriteFont(MlemGame.LoadContent<SpriteFont>("Fonts/" + Localization.Get("Font")));
MonospacedFont = new GenericSpriteFont(MlemGame.LoadContent<SpriteFont>("Fonts/Monospaced"));
} }
} }

View file

@ -26,12 +26,33 @@
#begin Localization/Localization.json #begin Localization/Localization.json
/copy:Localization/Localization.json /copy:Localization/Localization.json
#begin Localization/Localization.nl.json
/copy:Localization/Localization.nl.json
#begin Localization/Localization.ru.json
/copy:Localization/Localization.ru.json
#begin Localization/News.de.json #begin Localization/News.de.json
/copy:Localization/News.de.json /copy:Localization/News.de.json
#begin Localization/News.json #begin Localization/News.json
/copy:Localization/News.json /copy:Localization/News.json
#begin Localization/News.nl.json
/copy:Localization/News.nl.json
#begin Localization/News.ru.json
/copy:Localization/News.ru.json
#begin Localization/NumberFormat.de.json5
/copy:Localization/NumberFormat.de.json5
#begin Localization/NumberFormat.json5
/copy:Localization/NumberFormat.json5
#begin Localization/NumberFormat.ru.json5
/copy:Localization/NumberFormat.ru.json5
#begin Sounds/Click.wav #begin Sounds/Click.wav
/importer:WavImporter /importer:WavImporter
/processor:SoundEffectProcessor /processor:SoundEffectProcessor
@ -86,29 +107,8 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/Ui.png /build:Textures/Ui.png
#begin Localization/NumberFormat.de.json5 #begin Fonts/Monospaced.spritefont
/copy:Localization/NumberFormat.de.json5
#begin Localization/NumberFormat.json5
/copy:Localization/NumberFormat.json5
#begin Localization/Localization.nl.json
/copy:Localization/Localization.nl.json
#begin Localization/News.nl.json
/copy:Localization/News.nl.json
#begin Fonts/Russian.spritefont
/importer:FontDescriptionImporter /importer:FontDescriptionImporter
/processor:FontDescriptionProcessor /processor:FontDescriptionProcessor
/build:Fonts/Russian.spritefont /build:Fonts/Monospaced.spritefont
#begin Localization/Localization.ru.json
/copy:Localization/Localization.ru.json
#begin Localization/News.ru.json
/copy:Localization/News.ru.json
#begin Localization/NumberFormat.ru.json5
/copy:Localization/NumberFormat.ru.json5

View file

@ -1,5 +1,5 @@
{ {
"Font": "Russian", "Font": "Monospaced",
"TranslationBy": "Русский перевод от katoumegumi", "TranslationBy": "Русский перевод от katoumegumi",
"----- Ui -----": "", "----- Ui -----": "",
"Back": "Назад", "Back": "Назад",

View file

@ -1,14 +1,14 @@
[ [
"0", // Hundert "0", // Hundert
"0,.## t", // Tausend "0,.00 t", // Tausend
"0,,.## M", // Millionen "0,,.00 M", // Millionen
"0,,,.## Mr", // Milliarden "0,,,.00 Mr", // Milliarden
"0,,,,.## B", // Billionen "0,,,,.00 B", // Billionen
"0,,,,,.## Br", // Billiarden "0,,,,,.00 Br", // Billiarden
"0,,,,,,.## T", // Trillionen "0,,,,,,.00 T", // Trillionen
"0,,,,,,,.## Tr", // Trilliarden "0,,,,,,,.00 Tr", // Trilliarden
"0,,,,,,,,.## Q", // Quadrillionen "0,,,,,,,,.00 Q", // Quadrillionen
"0,,,,,,,,,.## Qr", // Quadrilliarden "0,,,,,,,,,.00 Qr", // Quadrilliarden
"0,,,,,,,,,,.## Qi", // Quintillionen "0,,,,,,,,,,.00 Qi", // Quintillionen
"0,,,,,,,,,,,.## Qir", // Quintilliarden "0,,,,,,,,,,,.00 Qir", // Quintilliarden
] ]

View file

@ -1,14 +1,14 @@
[ [
"0", // hundreds "0", // hundreds
"0,.## K", // thousands "0,.00 K", // thousands
"0,,.## M", // millions "0,,.00 M", // millions
"0,,,.## B", // billions "0,,,.00 B", // billions
"0,,,,.## T", // trillions "0,,,,.00 T", // trillions
"0,,,,,.## Q", // quadrillions "0,,,,,.00 Q", // quadrillions
"0,,,,,,.## Qi", // quintillions "0,,,,,,.00 Qi", // quintillions
"0,,,,,,,.## S", // sextillions "0,,,,,,,.00 S", // sextillions
"0,,,,,,,,.## Sp", // septillions "0,,,,,,,,.00 Sp", // septillions
"0,,,,,,,,,.## O", // octillions "0,,,,,,,,,.00 O", // octillions
"0,,,,,,,,,,.## N", // nonillions "0,,,,,,,,,,.00 N", // nonillions
"0,,,,,,,,,,,.## D", // decillions "0,,,,,,,,,,,.00 D", // decillions
] ]

View file

@ -1,14 +1,14 @@
[ [
"0", // hundreds "0", // hundreds
"0,.## K", // тысяч "0,.00 K", // тысяч
"0,,.## M", // миллионов "0,,.00 M", // миллионов
"0,,,.## B", // миллиардов "0,,,.00 B", // миллиардов
"0,,,,.## T", // триллионов "0,,,,.00 T", // триллионов
"0,,,,,.## Q", // квадриллионов "0,,,,,.00 Q", // квадриллионов
"0,,,,,,.## Qi", // квинтиллионов "0,,,,,,.00 Qi", // квинтиллионов
"0,,,,,,,.## S", // секстиллионов "0,,,,,,,.00 S", // секстиллионов
"0,,,,,,,,.## Sp", // септиллионов "0,,,,,,,,.00 Sp", // септиллионов
"0,,,,,,,,,.## O", // октиллионов "0,,,,,,,,,.00 O", // октиллионов
"0,,,,,,,,,,.## N", // нониллионов "0,,,,,,,,,,.00 N", // нониллионов
"0,,,,,,,,,,,.## D", // дециллионов "0,,,,,,,,,,,.00 D", // дециллионов
] ]

View file

@ -66,11 +66,10 @@ namespace TouchyTickets {
}); });
var ticketGroup = main.AddChild(new Group(Anchor.AutoCenter, new Vector2(1, 0.175F), false)); var ticketGroup = main.AddChild(new Group(Anchor.AutoCenter, new Vector2(1, 0.175F), false));
ticketGroup.AddChild(new Paragraph(Anchor.AutoCenter, 10000, p => PrettyPrintNumber(GameImpl.Instance.Tickets) + "<i ticket>", true) { ticketGroup.AddChild(new Paragraph(Anchor.AutoCenter, 10000, p => PrettyPrintNumber(GameImpl.Instance.Tickets) + "<i ticket>", true) {
RegularFont = Assets.MonospacedFont,
TextScale = 0.3F TextScale = 0.3F
}); });
ticketGroup.AddChild(new Paragraph(Anchor.AutoCenter, 1, p => GameImpl.Instance.Map.TicketsPerSecond.ToString("#,0.##") + "<i ticket>/s", true) { ticketGroup.AddChild(new Paragraph(Anchor.AutoCenter, 1, p => GameImpl.Instance.Map.TicketsPerSecond.ToString("#,0.##") + "<i ticket>/s", true));
PositionOffset = new Vector2(0, -5)
});
BigInteger lastTickets = 0; BigInteger lastTickets = 0;
ActiveCoroutine storeWobble = null; ActiveCoroutine storeWobble = null;
var storeGroup = main.AddChild(new CustomDrawGroup(Anchor.AutoCenter, new Vector2(1, 0.425F), null, null, false) { var storeGroup = main.AddChild(new CustomDrawGroup(Anchor.AutoCenter, new Vector2(1, 0.425F), null, null, false) {
@ -518,7 +517,7 @@ namespace TouchyTickets {
uiSystem.GlobalScale = 4; uiSystem.GlobalScale = 4;
uiSystem.AutoScaleWithScreen = true; uiSystem.AutoScaleWithScreen = true;
uiSystem.AutoScaleReferenceSize = new Point(720, 1280); uiSystem.AutoScaleReferenceSize = new Point(720, 1280);
uiSystem.Style.Font = new GenericSpriteFont(Assets.Font); uiSystem.Style.Font = Assets.Font;
uiSystem.Style.PanelTexture = uiSystem.Style.TextFieldTexture = uiSystem.Style.ScrollBarBackground = uiSystem.Style.CheckboxTexture = new NinePatch(Assets.UiTexture[2, 1], 4); uiSystem.Style.PanelTexture = uiSystem.Style.TextFieldTexture = uiSystem.Style.ScrollBarBackground = uiSystem.Style.CheckboxTexture = new NinePatch(Assets.UiTexture[2, 1], 4);
uiSystem.Style.ButtonTexture = uiSystem.Style.ScrollBarScrollerTexture = new NinePatch(Assets.UiTexture[3, 1], 4); uiSystem.Style.ButtonTexture = uiSystem.Style.ScrollBarScrollerTexture = new NinePatch(Assets.UiTexture[3, 1], 4);
uiSystem.Style.CheckboxCheckmark = Assets.UiTexture[4, 1]; uiSystem.Style.CheckboxCheckmark = Assets.UiTexture[4, 1];