public virtual void drawTarget(string typeName = "app:") { if (bounds.Height <= 14) { return; } var text = "IP: " + targetIP; var destinationRectangle = bounds; destinationRectangle.Height = Math.Min(bounds.Height, 14); ++destinationRectangle.X; destinationRectangle.Width -= 2; spriteBatch.Draw(Utils.white, destinationRectangle, os.exeModuleTopBar); RenderedRectangle.doRectangleOutline(destinationRectangle.X, destinationRectangle.Y, destinationRectangle.Width, destinationRectangle.Height, 1, os.topBarColor); if (destinationRectangle.Height < 14) { return; } var vector2 = GuiData.detailfont.MeasureString(text); spriteBatch.DrawString(GuiData.detailfont, text, new Vector2(bounds.X + bounds.Width - vector2.X, bounds.Y), os.exeModuleTitleText); spriteBatch.DrawString(GuiData.detailfont, typeName + IdentifierName, new Vector2(bounds.X + 2, bounds.Y), os.exeModuleTitleText); }
private void DrawAssignmentPhase(float t) { Utils.FillEverywhereExcept(Utils.InsetRectangle(this.os.terminal.Bounds, 1), Utils.GetFullscreen(), this.spriteBatch, Color.Black * 0.8f); float num1 = Utils.CubicInCurve((float)(1.0 - (double)Math.Min(2f, this.TimeInThisState / 2f) / 2.0)); Rectangle rectangle = Utils.InsetRectangle(this.os.terminal.bounds, (int)(-1.0 * 200.0 * (double)num1)); float num2 = 1f - num1; if ((double)num2 >= 0.800000011920929) { num2 = (float)((1.0 - ((double)num2 - 0.800000011920929) * 5.0) * 0.800000011920929); } RenderedRectangle.doRectangleOutline(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, (int)(60.0 * (0.0599999986588955 + (double)num1)), new Color?(this.os.highlightColor * num2)); string wholeText = this.AssignmentsCompleteText; if (!this.AllAssignmentsComplete) { wholeText = this.IsOnAssignment1 ? this.Assignment1Text : this.Assignment2Text; } this.charsRenderedSoFar = TextWriterTimed.WriteTextToTerminal(wholeText, (object)this.os, 0.04f, 1f, 20f, this.TimeInThisState, this.charsRenderedSoFar); if (this.charsRenderedSoFar < wholeText.Length) { return; } this.StartAssignment(); }
public virtual void drawOutline() { Rectangle bounds = this.bounds; RenderedRectangle.doRectangleOutline(bounds.X, bounds.Y, bounds.Width, bounds.Height, 1, new Color?(this.os.moduleColorSolid)); ++bounds.X; ++bounds.Y; bounds.Width -= 2; bounds.Height -= 2; this.spriteBatch.Draw(Utils.white, bounds, this.os.moduleColorBacking * this.fade); }
public virtual void drawOutline() { var destinationRectangle = bounds; RenderedRectangle.doRectangleOutline(destinationRectangle.X, destinationRectangle.Y, destinationRectangle.Width, destinationRectangle.Height, 1, os.moduleColorSolid); ++destinationRectangle.X; ++destinationRectangle.Y; destinationRectangle.Width -= 2; destinationRectangle.Height -= 2; spriteBatch.Draw(Utils.white, destinationRectangle, os.moduleColorBacking * fade); }
public void drawFrame() { tmpRect = bounds; tmpRect.Y -= PANEL_HEIGHT; tmpRect.Height += PANEL_HEIGHT; spriteBatch.Draw(Utils.white, tmpRect, os.moduleColorBacking); RenderedRectangle.doRectangleOutline(tmpRect.X, tmpRect.Y, tmpRect.Width, tmpRect.Height, 1, os.moduleColorSolid); tmpRect.Height = PANEL_HEIGHT; spriteBatch.Draw(Utils.white, tmpRect, os.moduleColorStrong); spriteBatch.DrawString(GuiData.detailfont, name, new Vector2(tmpRect.X + 2, tmpRect.Y + 2), os.semiTransText); }
public void drawFrame() { Module.tmpRect = this.bounds; Module.tmpRect.Y -= Module.PANEL_HEIGHT; Module.tmpRect.Height += Module.PANEL_HEIGHT; this.spriteBatch.Draw(Utils.white, Module.tmpRect, this.os.moduleColorBacking); RenderedRectangle.doRectangleOutline(Module.tmpRect.X, Module.tmpRect.Y, Module.tmpRect.Width, Module.tmpRect.Height, 1, new Color?(this.os.moduleColorSolid)); Module.tmpRect.Height = Module.PANEL_HEIGHT; this.spriteBatch.Draw(Utils.white, Module.tmpRect, this.os.moduleColorStrong); this.spriteBatch.DrawString(GuiData.detailfont, this.name, new Vector2((float)(Module.tmpRect.X + 2), (float)(Module.tmpRect.Y + 2)), this.os.semiTransText); Module.tmpRect = this.bounds; Module.tmpRect.Y -= Module.PANEL_HEIGHT; Module.tmpRect.Height += Module.PANEL_HEIGHT; RenderedRectangle.doRectangleOutline(Module.tmpRect.X, Module.tmpRect.Y, Module.tmpRect.Width, Module.tmpRect.Height, 1, new Color?(this.os.moduleColorSolid)); }
public virtual void drawTarget(string typeName = "app:") { if (this.bounds.Height <= 14) { return; } string text = "IP: " + this.targetIP; Rectangle bounds = this.bounds; bounds.Height = Math.Min(this.bounds.Height, 14); ++bounds.X; bounds.Width -= 2; this.spriteBatch.Draw(Utils.white, bounds, this.os.exeModuleTopBar); RenderedRectangle.doRectangleOutline(bounds.X, bounds.Y, bounds.Width, bounds.Height, 1, new Color?(this.os.topBarColor)); if (bounds.Height >= 14) { Vector2 vector2 = GuiData.detailfont.MeasureString(text); this.spriteBatch.DrawString(GuiData.detailfont, text, new Vector2((float)(this.bounds.X + this.bounds.Width) - vector2.X, (float)this.bounds.Y), this.os.exeModuleTitleText); this.spriteBatch.DrawString(GuiData.detailfont, typeName + this.IdentifierName, new Vector2((float)(this.bounds.X + 2), (float)this.bounds.Y), this.os.exeModuleTitleText); } }
public override void Draw(GameTime gameTime) { base.Draw(gameTime); PostProcessor.begin(); ScreenManager.FadeBackBufferToBlack(255); GuiData.startDraw(); PatternDrawer.draw(new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height), 0.5f, Color.Black, new Color(2, 2, 2), GuiData.spriteBatch); if (Button.doButton("Back".GetHashCode(), 10, 10, 220, 30, "<- " + LocaleTerms.Loc("Back"), Color.Gray)) { if (IsChange && !Saved) { ScreenManager.AddScreen(MessageBox_NeedSave, ScreenManager.controllingPlayer); } SettingsLoader.writeStatusFile(); ExitScreen(); } if (Button.doButton("Save".GetHashCode(), 10, 45, 220, 30, "ModsCore.Mods.Save".Translate(), Color.Blue)) { Save(); } TextItem.doLabel(new Vector2(75, 100), $"Mods ({"ModsCore.Mods.Activate".Translate()})", null, 300); //打开了Setting界面不允许修改选定的Mod if (OpenSettingUI) { SelectableTextList.doFancyList(25, 50, 140, 300, ScreenManager.GraphicsDevice.Viewport.Height - 190, m_ActivatedMods.ToArray(), currentActMods, Color.White); } else { currentActMods = SelectableTextList.doFancyList(25, 50, 140, 300, ScreenManager.GraphicsDevice.Viewport.Height - 50, m_ActivatedMods.ToArray(), currentActMods, Color.White); } if (OpenSettingUI && Button.doButton("CloseSettingUI".GetHashCode(), 400, 210, 150, 30, "ModsCore.Mods.CloseSettingUI".Translate(), Color.BlueViolet)) { OpenSettingUI = false; } if (currentActMods > 0 && Button.doButton("Up".GetHashCode(), 400, 250, 150, 30, "ModsCore.Mods.Up".Translate(), Color.BlueViolet)) { MoveUp(); IsChange = true; Saved = false; } if (currentActMods >= 0 && currentActMods != m_ActivatedMods.Count - 1 && Button.doButton("Down".GetHashCode(), 400, 290, 150, 30, "ModsCore.Mods.Down".Translate(), Color.BlueViolet)) { MoveDown(); IsChange = true; Saved = false; } if (!OpenSettingUI && currentActMods != -1 && Button.doButton("OpenSettingUI".GetHashCode(), 400, 210, 150, 30, "ModsCore.Mods.OpenSettingUI".Translate(), Color.BlueViolet)) { OpenSettingUI = true; } if (currentActMods >= 0 && Button.doButton("DeactivateMod".GetHashCode(), 400, 330, 150, 30, "ModsCore.Mods.DeactivateMod".Translate(), Color.BlueViolet)) { IsChange = true; Saved = false; m_DeactivatedMods.Add(m_ActivatedMods[currentActMods]); m_DeactDicModModEntries.Add(m_ActivatedMods[currentActMods].GetHashCode(), m_ActDicModEntries[m_ActivatedMods[currentActMods].GetHashCode()]); m_ActDicModEntries.Remove(m_ActivatedMods[currentActMods].GetHashCode()); m_ActivatedMods.RemoveAt(currentActMods); ModManager.ModsConfig ModsConfig = (ModManager.ModsConfig)ModsConfig_FieldInfo.GetValue(new ModManager()); ModsConfig.EnabledMod.RemoveAt(currentActMods); ModsConfig_FieldInfo.SetValue(null, ModsConfig); currentDeactMods = m_DeactivatedMods.Count - 1; currentActMods = -1; } if (!OpenSettingUI && currentDeactMods >= 0 && Button.doButton("ActivateMod".GetHashCode(), 400, 370, 150, 30, "ModsCore.Mods.ActivateMod".Translate(), Color.BlueViolet)) { IsChange = true; Saved = false; m_ActivatedMods.Add(m_DeactivatedMods[currentDeactMods]); m_ActDicModEntries.Add(m_DeactivatedMods[currentDeactMods].GetHashCode(), m_DeactDicModModEntries[m_DeactivatedMods[currentDeactMods].GetHashCode()]); ModManager.ModsConfig ModsConfig = (ModManager.ModsConfig)ModsConfig_FieldInfo.GetValue(new ModManager()); ModsConfig.EnabledMod.Add(Path.GetFileName(m_DeactDicModModEntries[m_DeactivatedMods[currentDeactMods].GetHashCode()].Path)); ModsConfig_FieldInfo.SetValue(null, ModsConfig); m_DeactDicModModEntries.Remove(m_DeactivatedMods[currentDeactMods].GetHashCode()); m_DeactivatedMods.RemoveAt(currentDeactMods); currentActMods = m_ActivatedMods.Count - 1; currentDeactMods = -1; } if (OpenSettingUI && m_ActDicModEntries[m_ActivatedMods[currentActMods].GetHashCode()].Started && m_ActDicModEntries[m_ActivatedMods[currentActMods].GetHashCode()].DrawSettingUIMethod != null) { RenderedRectangle.doRectangleOutline(570, 100, ScreenManager.GraphicsDevice.Viewport.Width - 50 - 570, ScreenManager.GraphicsDevice.Viewport.Height - 100 - 50, 2, Color.White); m_ActDicModEntries[m_ActivatedMods[currentActMods].GetHashCode()].DrawSettingUIMethod(m_ActDicModEntries[m_ActivatedMods[currentActMods].GetHashCode()], new object[] { ScreenManager, 575, 100, ScreenManager.GraphicsDevice.Viewport.Width - 50 - 570, ScreenManager.GraphicsDevice.Viewport.Height - 100 - 50 }); } else { TextItem.doLabel(new Vector2(600, 100), $"Mods ({"ModsCore.Mods.Deactivate".Translate()})", null, 300); currentDeactMods = SelectableTextList.doFancyList(25, 575, 140, 300, ScreenManager.GraphicsDevice.Viewport.Height - 50, m_DeactivatedMods.ToArray(), currentDeactMods, null); } GuiData.endDraw(); PostProcessor.end(); }