static void TooltipFactory_ItemCommons_Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (techType == TechType.Beacon) { TooltipFactory.WriteDescription(sb, $"{L10n.str(L10n.ids_beaconName)}: \"{obj.GetComponent<Beacon>().label}\""); } }
static void TooltipFactory_ItemActions_Postfix(StringBuilder sb, InventoryItem item) { if (item.item.GetTechType() == TechType.MetalDetector && item.item.GetComponent <MetalDetector>()?.energyMixin?.charge > 0) { TooltipFactory.WriteAction(sb, buttons, L10n.str("ids_metalDetectorSwitchTarget")); } }
static void Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (techType == TechType.Flare && obj.GetComponent <Flare>().hasBeenThrown) { TooltipFactory.WriteDescription(sb, "[lighted]"); } }
static void Postfix(StringBuilder sb, InventoryItem item) { if (item.item.GetTechType() == TechType.Beacon) { TooltipFactory.WriteAction(sb, Strings.Mouse.middleButton, L10n.str(L10n.ids_rename)); } }
public static PaneQueryable getRicettaPane() { List <ImageNode> images = new List <ImageNode>(); images.Add(new InsertNode((a, b) => { MainPaneGestor.getInstance().setPanel(InsertPaneFactory.getInsertRicetta()); MainPaneGestor.getInstance().disableShowingSearch(); })); ToolTip ricettaTip = TooltipFactory.createBasicTooltip("Ricetta"); (from c in RicettarioDB.getInstance().Ricetta select c).ToList().ForEach(x => { images.Add(getImageNode(x, new Bitmap(x.Immagine), ricettaTip)); }); searchElement action = x => { List <Ricetta> list = (from c in RicettarioDB.getInstance().Ricetta where SqlMethods.Like(c.Nome, "%" + x + "%") select c).ToList(); List <Control> result = new List <Control>(); list.ForEach(z => { result.Add((getImageNode(z, new Bitmap(z.Immagine), ricettaTip)).getImage()); }); return(result); }; return(new SimplePaneImage(images, nodeFactory.createNodeFilter(), action)); }
static void TooltipFactory_ItemActions_Postfix(StringBuilder sb, InventoryItem item) { if (item == getTankInSlot()) { TooltipFactory.WriteAction(sb, Strings.Mouse.rightButton, L10n.str("ids_ToggleTankUsage")); } }
static void TooltipFactory_ItemCommons_Postfix(StringBuilder sb, GameObject obj) { if (getTankInSlot()?.item.gameObject == obj && !isTankUsed(obj.GetComponent <Oxygen>())) { TooltipFactory.WriteDescription(sb, L10n.str("ids_TankIsNotUsed")); } }
static void Postfix(StringBuilder sb, InventoryItem item) { if (item.item.GetTechType().isGravTrap()) { TooltipFactory.WriteAction(sb, buttons, L10n.str("ids_switchObjectsType")); } }
public MenuSelection(int idMenu) { InitializeComponent(); this.Icon = Properties.Resources.iconmain; this.idMenu = idMenu; this.tableLayoutPanel1.Dock = DockStyle.Fill; this.menu.TextAlign = ContentAlignment.MiddleCenter; this.StartPosition = FormStartPosition.CenterParent; Menù menu = (from m in RicettarioDB.getInstance().Menù where m.idMenù == idMenu select m).First(); this.menu.Text = menu.Nome; this.tipo.Text = "Tipo :" + menu.Tipo; this.immageGestor.Dock = DockStyle.Top; ToolTip ricettaTip = TooltipFactory.createBasicTooltip("Ricette"); menu.Assemblaggio.ToList().ForEach(x => { PictureBox picture = new PictureBox(); picture.Size = new Size(100, 100); picture.Image = new Bitmap(x.Ricetta.Immagine); picture.SizeMode = PictureBoxSizeMode.StretchImage; this.immageGestor.Controls.Add(picture); ricettaTip.SetToolTip(picture, "Nome " + x.Ricetta.Nome + "\nPortata " + x.Ricetta.portata + "\nPersone = " + x.Ricetta.Persone); picture.Click += (obj, arg) => new RicettaVisualizzation(x.Ricetta.idRicetta).ShowDialog(); }); }
internal static void ItemActions_Postfix(StringBuilder sb, InventoryItem item) { TechType itemTechType = item.item.GetTechType(); bool hasLeftAction = false; if (LeftClickActions.TryGetValue(itemTechType, out CustomItemAction action)) { if (action.Condition(item)) { sb.Append("\n"); TooltipFactory.WriteAction(sb, LeftClickMouseIcon, Language.main.Get(action.LanguageLineKey)); hasLeftAction = true; } } if (MiddleClickActions.TryGetValue(itemTechType, out action)) { if (action.Condition(item)) { if (!hasLeftAction) { sb.Append("\n"); } TooltipFactory.WriteAction(sb, MiddleClickMouseIcon, Language.main.Get(action.LanguageLineKey)); } } }
private static void ItemCommonsPrefix(StringBuilder sb, TechType techType, GameObject obj) { IBattery component4 = obj.GetComponent <IBattery>(); if (component4 != null) { TooltipFactory.WriteDescription(sb, Language.main.Get(TooltipFactory.techTypeTooltipStrings.Get(techType))); } }
public static void Postfix(bool locked, ref TooltipData data) { if (locked && GameModeUtils.RequiresBlueprints()) { data.prefix.Clear(); TooltipFactory.WriteTitle(data.prefix, Main.Config.UnKnownTitle); TooltipFactory.WriteDescription(data.prefix, Main.Config.UnKnownDescription); } }
public static bool GetInventoryDescription(StringBuilder sb, GameObject obj) { var component = obj.GetComponent <IInventoryDescriptionSN1>(); if (component != null) { TooltipFactory.WriteDescription(sb, component.GetInventoryDescription()); return(false); } return(true); }
static void Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (!techType.isGravTrap()) { return; } var objectsType = GravTrapObjectsType.getFrom(obj); objectsType.techTypeListIndex += TypeListSwitcher.getChangeListDir(); TooltipFactory.WriteDescription(sb, objectsType.techTypeListName); }
public static void Postfix(ref StringBuilder sb, TechType techType) { PDAScanner.EntryData entryData = PDAScanner.GetEntryData(techType); if (entryData == null || PDAScanner.ContainsCompleteEntry(techType) || CrafterLogic.IsCraftRecipeUnlocked(techType)) { return; } sb.Clear(); TooltipFactory.WriteTitle(sb, Main.config.UnKnownTitle); TooltipFactory.WriteDescription(sb, Main.config.UnKnownDescription); }
public static void Postfix(bool locked, ref string tooltipText) { var stringBuilder = new StringBuilder(); if (!locked || !GameModeUtils.RequiresBlueprints()) { return; } TooltipFactory.WriteTitle(stringBuilder, Main.Config.UnKnownTitle); TooltipFactory.WriteDescription(stringBuilder, Main.Config.UnKnownDescription); tooltipText = stringBuilder.ToString(); }
static void TooltipFactory_ItemCommons_Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (techType != TechType.MetalDetector) { return; } if (obj.GetComponent <MetalDetector>() is MetalDetector md && md.energyMixin?.charge > 0) { changeTarget(md, InputHelper.getMouseWheelDir()); TooltipFactory.WriteDescription(sb, L10n.str("ids_metalDetectorTarget") + getCurrentTarget(md)); } }
static void Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (!techType.isGravTrap()) { return; } if (Main.config.useWheelScroll && InputHelper.getMouseWheelValue() != 0f) // not exactly right to do it here, but I didn't find a better way { GravTrapObjectsType.getFrom(obj).techTypeListIndex += Math.Sign(InputHelper.getMouseWheelValue()); } TooltipFactory.WriteDescription(sb, GravTrapObjectsType.getFrom(obj).techTypeListName); }
static void TooltipFactory_ItemActions_Postfix(StringBuilder sb, InventoryItem item) { if (item.item.GetTechType() != TechType.Beacon) { return; } string btn = Main.config.renameBeaconsKey == default? Strings.Mouse.middleButton: KeyCodeUtils.KeyCodeToString(Main.config.renameBeaconsKey); TooltipFactory.WriteAction(sb, btn, L10n.str(L10n.ids_beaconRename)); if (Main.config.renameBeaconsKey != default && Input.GetKeyDown(Main.config.renameBeaconsKey)) { renameBeacon(item.item.GetComponent <Beacon>()); } }
public RicettaVisualizzation(int idRicetta) { InitializeComponent(); this.Icon = Properties.Resources.iconmain; //modifica stile schermata : pulsanti this.idRicetta = idRicetta; this.forward.BackColor = Color.Transparent; this.back.BackColor = Color.Transparent; this.forward.FlatStyle = FlatStyle.Flat; this.back.FlatStyle = FlatStyle.Flat; this.StartPosition = FormStartPosition.CenterParent; //descrizione //prendo la ricetta selezionata Ricetta ricetta = new Ricetta(); ricetta = (from r in db.Ricetta where r.idRicetta == idRicetta select r).First(); this.desc.Text = ricetta.Descrizione; this.desc.ReadOnly = true; this.descrizione.ReadOnly = true; this.back.Enabled = false; this.forward.Enabled = false; this.ricettaNome.Text = ricetta.Nome; this.immagine.SizeMode = PictureBoxSizeMode.StretchImage; List <RicettaStrumento> rsRicetta = ricetta.RicettaStrumento.ToList(); int count = 0; //Creazione tabella ricetta strumento rsData.AutoGenerateColumns = false; rsData.RowHeadersVisible = false; rsData.MultiSelect = false; rsData.SelectionMode = DataGridViewSelectionMode.FullRowSelect; rsData.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; rsData.DefaultCellStyle.WrapMode = DataGridViewTriState.True; rsRicetta.ForEach(x => { String ricettaStrumento = "Strumenti utilizzati:\n"; x.Utilizzo.ToList().ForEach(z => ricettaStrumento = ricettaStrumento + z.Strumento.Nome + "\n"); ricettaStrumento = ricettaStrumento + "Kcal = " + x.Kcal; ricettaStrumento = ricettaStrumento + "\nCaratteristiche: \n"; x.Definito.ToList().ToList().ForEach(z => ricettaStrumento = ricettaStrumento + z.Caratteristica.Nome + " ,"); ListViewItem item = new ListViewItem(ricettaStrumento); this.rsData.Rows.Add(); this.rsData.Rows[count++].Cells[0].Value = ricettaStrumento; }); this.ingrTot.View = View.List; this.rsData.RowStateChanged += (obj, args) => { this.ingrTot.Items.Clear(); if (args.StateChanged == DataGridViewElementStates.Selected && args.Row.Index != count) { rsRicetta[args.Row.Index].Presenta.ToList().ForEach(x => { String ingr = (from ing in db.Ingrediente where ing.idIngrediente == x.idIngrediente select ing.Nome).First(); ingr += " " + x.NomeUDM; ingr += " " + x.Quantità; this.ingrTot.Items.Add(ingr); }); stepToShow = rsRicetta[args.Row.Index].Step.ToList(); this.stepToShow.Sort((x, y) => x.NumOrdine - y.NumOrdine); this.indexStep = 0; this.refreshStep(); } }; this.strumStep.SelectedIndexChanged += (obj, arg) => { if (this.strumStep.SelectedItem != null) { new StrumentoVisualizzation(this.strumenti[this.strumStep.SelectedIndex]).ShowDialog(); } }; ToolTip tip = TooltipFactory.createBasicTooltip("Alternative:"); this.ingrStep.SelectedIndexChanged += (obj, arg) => { if (this.ingrStep.SelectedItem != null) { string alternative = ""; (from alt in db.Alternativo where alt.idIngrediente == idRicette[this.ingrStep.SelectedIndex] select alt.Ingrediente1).ToList().ForEach(z => alternative += z.Nome + ","); Point p = ingrStep.FindForm().PointToClient( ingrStep.Parent.PointToScreen(ingrStep.Location)); tip.Show(alternative, this, new Point(p.X, p.Y)); } }; this.ingrStep.MouseLeave += (obj, args) => tip.Hide(this); this.ingrStep.HorizontalScrollbar = true; this.strumStep.HorizontalScrollbar = true; this.forward.Click += (obj, args) => { this.indexStep++; this.refreshStep(); }; this.back.Click += (obj, args) => { this.indexStep--; this.refreshStep(); }; }