mirror of
https://github.com/kwsch/NHSE.git
synced 2026-09-27 12:26:35 -05:00
Refactoring: Field Item Editor + buildings/terrain
Extracts logic from the building & terrain & field item editors for reuse / separation of concerns Have FieldItemEditor select between Items & Terrain so that you can change the popup menu mode (view set delete) Not sure how I want to show the terrain names...
This commit is contained in:
32
NHSE.WinForms/Subforms/Map/BuildingHelp.cs
Normal file
32
NHSE.WinForms/Subforms/Map/BuildingHelp.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using NHSE.Core;
|
||||
|
||||
namespace NHSE.WinForms
|
||||
{
|
||||
public partial class BuildingHelp : Form
|
||||
{
|
||||
private static readonly IReadOnlyDictionary<string, string[]> HelpDictionary = StructureUtil.GetStructureHelpList();
|
||||
|
||||
public BuildingHelp()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.TranslateInterface(GameInfo.CurrentLanguage);
|
||||
|
||||
foreach (var entry in HelpDictionary)
|
||||
CB_StructureType.Items.Add(entry.Key);
|
||||
CB_StructureType.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void CB_StructureType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var name = CB_StructureType.Text;
|
||||
var values = HelpDictionary[name];
|
||||
CB_StructureValues.Items.Clear();
|
||||
foreach (var item in values)
|
||||
CB_StructureValues.Items.Add(item);
|
||||
CB_StructureValues.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user