private void Initialize() { #if DEBUG DebugUtils.CreateShortcuts(this); DebugDisp = DebugUtils.CreateDisplay(this); #endif if (!MonoSAMGame.IsIOS()) { AddAgent(new ExitAgent()); } List <OverworldNode> nodesList = new List <OverworldNode>(); nodesList.Add(new OverworldNode_Tutorial(this, FPoint.Zero)); nodesList.Add(new OverworldNode_W1(this, FPoint.Zero)); nodesList.Add(new OverworldNode_W2(this, FPoint.Zero)); nodesList.Add(new OverworldNode_W3(this, FPoint.Zero)); nodesList.Add(new OverworldNode_W4(this, FPoint.Zero)); if (MainGame.Flavor != GDFlavor.FREE && MainGame.Flavor != GDFlavor.FULL_NOMP && MainGame.Flavor != GDFlavor.IAB_NOMP) { nodesList.Add(new OverworldNode_MP(this, FPoint.Zero)); } if (MainGame.Flavor != GDFlavor.FREE) { nodesList.Add(new OverworldNode_SCCM(this, FPoint.Zero)); } foreach (var node in nodesList) { Entities.AddEntity(node); } AddAgent(ScrollAgent = new OverworldScrollAgent(nodesList.ToArray())); _banner.TargetRect = new FRectangle(0 * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH, 16 * GDConstants.TILE_WIDTH, 4 * GDConstants.TILE_WIDTH).AsDeflated(0.25f * GDConstants.TILE_WIDTH); _banner.Text = GDConstants.LOGO_STRING; _banner.UseCPUParticles = false; _banner.AnimationTime = 4f; _banner.AnimationStartDelay = 1f; if (!MainGame.IsShaderless()) { _banner.CreateEntities(ParticlePresets.GetConfigLetterGreenGas()); } }
public override void OnInitialize() { base.OnInitialize(); var imgWidth = WIDTH - 2 * ELEM_MARGIN; var imgHeight = imgWidth * (Textures.TexLogo.Height * 1f / Textures.TexLogo.Width); AddElement(new HUDImage(1) { Alignment = HUDAlignment.TOPCENTER, RelativePosition = new FPoint(0, ELEM_MARGIN), Size = new FSize(imgWidth, imgHeight), Image = Textures.TexLogo, }); var btn1y = ELEM_MARGIN + imgHeight; AddElement(new HUDTextButton(1) { TextAlignment = HUDAlignment.CENTER, Alignment = HUDAlignment.TOPCENTER, RelativePosition = new FPoint(0, btn1y), Size = new FSize(imgWidth, BUTTON_HEIGHT), Font = Textures.HUDFontRegular, FontSize = 52, L10NText = L10NImpl.STR_ATTRIBUTIONS, TextColor = Color.White, TextPadding = 16, BackgroundNormal = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 16), BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 16), ClickMode = HUDButton.HUDButtonClickMode.Single, Click = OnClickAttributions, }); var btn2y = btn1y + BUTTON_HEIGHT + ELEM_MARGIN; AddElement(new HUDTextButton(1) { TextAlignment = HUDAlignment.CENTER, Alignment = HUDAlignment.TOPCENTER, RelativePosition = new FPoint(0, btn2y), Size = new FSize(imgWidth, BUTTON_HEIGHT), Font = Textures.HUDFontRegular, FontSize = 52, L10NText = L10NImpl.STR_CREDPNL_HEADER, TextColor = Color.White, TextPadding = 16, BackgroundNormal = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 16), BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 16), ClickMode = HUDButton.HUDButtonClickMode.Single, Click = OnClickAcknowledgements, }); var btn3y = btn2y + BUTTON_HEIGHT + ELEM_MARGIN; AddElement(btnUnlock = new HUDTextButton(1) { TextAlignment = HUDAlignment.CENTER, Alignment = HUDAlignment.TOPCENTER, RelativePosition = new FPoint(0, btn3y), Size = new FSize(imgWidth, BUTTON_HEIGHT), Font = Textures.HUDFontRegular, FontSize = 52, L10NText = L10NImpl.STR_UNLOCK, TextColor = Color.White, TextPadding = 16, BackgroundNormal = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 16), BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 16), ClickMode = HUDButton.HUDButtonClickMode.Single, Click = OnClickUnlock, IsVisible = !MonoSAMGame.IsIOS(), }); AddElement(new HUDTextButton(1) { TextAlignment = HUDAlignment.CENTER, Alignment = HUDAlignment.BOTTOMLEFT, RelativePosition = new FPoint(ELEM_MARGIN, ELEM_MARGIN), Size = new FSize(WIDTH - (BFB_WIDTH + 3 * ELEM_MARGIN), BFB_WIDTH - 10), Font = Textures.HUDFontRegular, FontSize = 52, L10NText = L10NImpl.STR_RESTOREPURCHASES, TextColor = Color.White, TextPadding = 16, BackgroundNormal = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 16), BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 16), ClickMode = HUDButton.HUDButtonClickMode.Single, Click = OnClickPurchaseRestore, IsVisible = MonoSAMGame.IsIOS() && MainGame.IsIAB(), }); AddElement(new TimesheetAnimationPresenter(1) { Animation = Animations.AnimationBlackForestBytesLogo, Alignment = HUDAlignment.BOTTOMRIGHT, RelativePosition = new FPoint(ELEM_MARGIN, ELEM_MARGIN), Size = new FSize(BFB_WIDTH, BFB_WIDTH), Click = OnClickBFB, }); }