@@ -120,11 +120,18 @@ private static void BuildRowMarker(ImGui gui, RecipeRow row) {
120120 private class RecipeColumn ( ProductionTableView view ) : ProductionTableDataColumn ( view , LSs . ProductionTableHeaderRecipe , 13f , 13f , 30f , widthStorage : nameof ( Preferences . recipeColumnWidth ) ) {
121121 public override void BuildElement ( ImGui gui , RecipeRow recipe ) {
122122 gui . spacing = 0.5f ;
123- switch ( gui . BuildFactorioObjectButton ( recipe . recipe , ButtonDisplayStyle . ProductionTableUnscaled ) ) {
124- case Click . Left when recipe . recipe != null :
123+ IFactorioObjectWrapper ? display = ( IFactorioObjectWrapper ? ) recipe . recipe ?? recipe . icon ;
124+ ObjectTooltipOptions tooltip = new ( ) { Hide = recipe . recipe == null } ;
125+
126+ switch ( gui . BuildFactorioObjectButton ( display , ButtonDisplayStyle . ProductionTableUnscaled , tooltip ) ) {
127+ case Click . Left :
125128 gui . ShowDropDown ( delegate ( ImGui imgui ) {
126129 DrawRecipeTagSelect ( imgui , recipe ) ;
127130
131+ if ( recipe . recipe == null && imgui . BuildButton ( LSs . EditPageProperties ) && imgui . CloseDropdown ( ) ) {
132+ HeaderRowSettingsPanel . Show ( recipe ) ;
133+ }
134+
128135 if ( recipe . subgroup == null && imgui . BuildButton ( LSs . ProductionTableCreateNested ) && imgui . CloseDropdown ( ) ) {
129136 recipe . RecordUndo ( ) . subgroup = new ProductionTable ( recipe ) ;
130137 }
@@ -134,7 +141,7 @@ public override void BuildElement(ImGui gui, RecipeRow recipe) {
134141 }
135142
136143 if ( recipe . subgroup != null ) {
137- BuildRecipeButton ( imgui , recipe . subgroup ) ;
144+ BuildRecipeButtons ( imgui , recipe . subgroup ) ;
138145 }
139146
140147 if ( recipe . subgroup != null && imgui . BuildButton ( LSs . ProductionTableUnpackNested ) . WithTooltip ( imgui , recipe . subgroup . expanded ? LSs . ProductionTableShortcutRightClick : LSs . ProductionTableShortcutExpandAndRightClick ) && imgui . CloseDropdown ( ) ) {
@@ -145,15 +152,17 @@ public override void BuildElement(ImGui gui, RecipeRow recipe) {
145152 view . BuildShoppingList ( recipe ) ;
146153 }
147154
148- if ( imgui . BuildCheckBox ( LSs . ProductionTableShowTotalIo , recipe . showTotalIO , out bool newShowTotalIO ) ) {
155+ if ( recipe . recipe != null && imgui . BuildCheckBox ( LSs . ProductionTableShowTotalIo , recipe . showTotalIO , out bool newShowTotalIO ) ) {
149156 recipe . RecordUndo ( ) . showTotalIO = newShowTotalIO ;
150157 }
151158
152159 if ( imgui . BuildCheckBox ( LSs . Enabled , recipe . enabled , out bool newEnabled ) ) {
153160 recipe . RecordUndo ( ) . enabled = newEnabled ;
154161 }
155162
156- BuildFavorites ( imgui , recipe . recipe . target , LSs . AddRecipeToFavorites ) ;
163+ if ( recipe . recipe != null ) {
164+ BuildFavorites ( imgui , recipe . recipe . target , LSs . AddRecipeToFavorites ) ;
165+ }
157166
158167 if ( recipe . subgroup != null && imgui . BuildRedButton ( LSs . ProductionTableDeleteNested ) . WithTooltip ( imgui , recipe . subgroup . expanded ? LSs . ProductionTableShortcutCollapseAndRightClick : LSs . ProductionTableShortcutRightClick ) && imgui . CloseDropdown ( ) ) {
159168 _ = recipe . owner . RecordUndo ( ) . recipes . Remove ( recipe ) ;
@@ -182,7 +191,7 @@ public override void BuildElement(ImGui gui, RecipeRow recipe) {
182191 gui . textColor = recipe . hierarchyEnabled ? SchemeColor . BackgroundText : SchemeColor . BackgroundTextFaint ;
183192 }
184193
185- gui . BuildText ( recipe . recipe ? . target . locName , TextBlockDisplayStyle . WrappedText ) ;
194+ gui . BuildText ( recipe . recipe ? . target . locName ?? recipe . description , recipe . recipe != null || recipe . isOverviewMode ? TextBlockDisplayStyle . WrappedText : TextBlockDisplayStyle . Default ( ) ) ;
186195
187196 void unpackNestedTable ( ) {
188197 var evacuate = recipe . subgroup . recipes ;
@@ -209,7 +218,7 @@ private static void RemoveZeroRecipes(ProductionTable productionTable) {
209218 }
210219
211220 public override void BuildMenu ( ImGui gui ) {
212- BuildRecipeButton ( gui , view . model ) ;
221+ BuildRecipeButtons ( gui , view . model ) ;
213222
214223 gui . BuildText ( LSs . ProductionTableExportToBlueprint , TextBlockDisplayStyle . WrappedText ) ;
215224 using ( gui . EnterRow ( ) ) {
@@ -263,10 +272,10 @@ public override void BuildMenu(ImGui gui) {
263272 }
264273
265274 /// <summary>
266- /// Build the "Add raw recipe" button and handle its clicks.
275+ /// Build the "Add raw recipe" and "Add table header" buttons and handle their clicks.
267276 /// </summary>
268277 /// <param name="table">The table that will receive the new recipes or technologies, if any are selected</param>
269- private static void BuildRecipeButton ( ImGui gui , ProductionTable table ) {
278+ private static void BuildRecipeButtons ( ImGui gui , ProductionTable table ) {
270279 if ( gui . BuildButton ( LSs . ProductionTableAddRawRecipe ) . WithTooltip ( gui , LSs . ProductionTableAddTechnologyHint ) && gui . CloseDropdown ( ) ) {
271280 if ( InputSystem . Instance . control ) {
272281 SelectMultiObjectPanel . Select ( Database . technologies . all , new ( LSs . ProductionTableAddTechnology , Multiple : true ,
@@ -279,6 +288,17 @@ private static void BuildRecipeButton(ImGui gui, ProductionTable table) {
279288 r => table . AddRecipe ( r , DefaultVariantOrdering ) ) ;
280289 }
281290 }
291+
292+ if ( gui . BuildButton ( LSs . ProductionTableAddTableHeader ) && gui . CloseDropdown ( ) ) {
293+ HeaderRowSettingsPanel . Show ( null , ( description , icon ) => {
294+ RecipeRow newRow = new ( table , null ) {
295+ description = description ,
296+ icon = icon ,
297+ } ;
298+ newRow . subgroup = new ( newRow ) ;
299+ table . RecordUndo ( ) . recipes . Add ( newRow ) ;
300+ } ) ;
301+ }
282302 }
283303
284304 private void ExportIo ( float multiplier ) {
0 commit comments