private void show_colors(bool show, components_species species) { item_separator_pirate_color.Visible = show; item_color.Visible = show; if (show) { components_colors colors; int index; if ("0002" == species.type) { colors = face; index = 2; } else { colors = hair; index = 3; } item_color.Items.AddRange(colors.ToArray()); item_color.SelectedIndex = (null == scenes[index] ? colors.index : int.Parse(scenes[index].id.Substring(species.etc, 1))); item_color.Tag = colors; } else { item_color.Tag = null; } }
private void generate_objects(ListViewItem item) { components_genus genus = item.Group.Tag as components_genus; components_species species = item.Tag as components_species; if ("host" == genus.type) { if ("0001" == species.type) { generate_objects(true, true, true, true, true, true, true, true, true, true, true, true, null, species); } else if ("0002" == species.type || "0003" == species.type || "0004" == species.type) { show_genders(true); show_colors(true, species); generate_objects(true, true, genders[item_female.Tag], genders[item_male.Tag], genders[item_neutral.Tag], true, true, true, true, true, true, true, null, species); } } else if ("install" == genus.type) { generate_objects(true, true, true, true, true, true, true, true, true, true, true, true, null, species); } else if ("pet" == genus.type) { string pet = ("0180" == species.type && "pet" == scenes.type) ? scenes[0].id : null; show_genders(true); generate_objects(expenses[item_cash.Tag], expenses[item_standard.Tag], genders[item_female.Tag], genders[item_male.Tag], genders[item_neutral.Tag], true, true, true, true, true, true, true, pet, species); } else { show_genders(true); show_occupations(true); generate_objects(expenses[item_cash.Tag], expenses[item_standard.Tag], genders[item_female.Tag], genders[item_male.Tag], genders[item_neutral.Tag], occupations[item_unlimited.Tag], occupations[item_beginner.Tag], occupations[item_warrior.Tag], occupations[item_magician.Tag], occupations[item_bowman.Tag], occupations[item_thief.Tag], occupations[item_pirate.Tag], null, species); } }
private void generate_objects(bool cash, bool standard, bool female, bool male, bool neutral, bool unlimited, bool beginner, bool warrior, bool magician, bool bowman, bool thief, bool pirate, string pet, components_species species) { components_list list = new components_list(species.type, species.location); foreach (components_object component in species.objects.Values) { if ((1 == component.cash && cash) || (0 == component.cash && standard)) { if (((1 == component.gender && female) || (0 == component.gender && male) || (2 == component.gender && neutral))) { if ("0170" == component.type) { if (!component.etc.Contains(species.type.Substring(2))) { continue; } } if ("0180" == component.type) { if (!component.etc.Contains(pet)) { continue; } } if (0 == component.job) { if (!unlimited) { continue; } } else if (-1 == component.job) { if (!beginner) { continue; } } else if ((1 == (component.job & 1) && !warrior) || (2 == (component.job & 2) && !magician) || (4 == (component.job & 4) && !bowman) || (8 == (component.job & 8) && !thief) || (16 == (component.job) && !pirate)) { continue; } list.Add(component.id, component); } } } if (0 < list.Count) { int ipp = momiji_preferences.advance_display_items; int index, pages = list.Count / ipp; for (index = 0; index < pages; ++index) { tabcontrol.TabPages.Add((ipp * index + 1) + " - " + (ipp * (index + 1))); } pages = list.Count % ipp; if (0 < pages) { tabcontrol.TabPages.Add((ipp * index + 1) + " - " + (ipp * index + pages)); } objects.Tag = list; turn_page(); } }