public override void Initialize() { //Tabs this.Tabs = new OpTab[1]; this.Tabs[0] = new OpTab("Config"); this.cycleRect = new OpRect(new Vector2(50f, 325f), new Vector2(500f, 250f), 0.3f); //Labels Vector2 rectPos = new Vector2(this.cycleRect.GetPos().x - 10f, this.cycleRect.GetPos().y - 5f); this.hunterCycles = new OpLabel(rectPos + new Vector2(23f, this.cycleRect.size.y - 25f), new Vector2(0f, 0f), "HUNTER CYCLES", FLabelAlignment.Left, true); this.startCycles = new OpLabel(new Vector2(rectPos.x + (this.cycleRect.size.x / 2 - 80f), rectPos.y + this.cycleRect.size.y - 180f), new Vector2(0f, 0f), "Starting Cycles", FLabelAlignment.Center, false); this.pebblesCycles = new OpLabel(new Vector2(rectPos.x + (this.cycleRect.size.x / 2 + 80f), rectPos.y + this.cycleRect.size.y - 180f), new Vector2(0f, 0f), "Pebbles Cycles", FLabelAlignment.Center, false); this.hunterToggle = new OpCheckBox(rectPos + new Vector2(this.cycleRect.size.x - 25f, this.cycleRect.size.y - 30f), "hunterToggle", true); this.hunterToggle.description = "Toggle custom Hunter cycles"; this.Tabs[0].AddItems(this.cycleRect, this.hunterCycles, this.startCycles, this.pebblesCycles, this.hunterToggle); //Textboxes this.startBox = new OpTextBox(startCycles.GetPos() + new Vector2(-30f, -25f), 80f, "startCycle", "19", OpTextBox.Accept.Int); this.pebblesBox = new OpTextBox(pebblesCycles.GetPos() + new Vector2(-30f, -25f), 80f, "pebblesCycle", "5", OpTextBox.Accept.Int); this.Tabs[0].AddItems(this.startBox, this.pebblesBox); //Presets Vector2 presetPos = new Vector2(rectPos.x + 55f, rectPos.y + 90f); this.presetDescription = new OpLabel(rectPos + new Vector2(this.cycleRect.size.x / 2, this.cycleRect.size.y - 74f), new Vector2(0f, 0f), "Choose a preset below or type in the desired cycle count.", FLabelAlignment.Center, false); this.presetDefault = new OpSimpleButton(presetPos + new Vector2(30f, 30f), new Vector2(80f, 30f), "default", "DEFAULT"); this.presetDefault.description = "Reset cycle numbers to their defaults"; this.presetEasy = new OpSimpleButton(presetPos + new Vector2(120f, 30f), new Vector2(80f, 30f), "easy", "EASY"); this.presetEasy.description = "Start with more cycles, and recieve more from Five Pebbles"; this.presetHard = new OpSimpleButton(presetPos + new Vector2(210f, 30f), new Vector2(80f, 30f), "hard", "HARD"); this.presetHard.description = "Start with less cycles, and recieve less from Five Pebbles"; this.presetCure = new OpSimpleButton(presetPos + new Vector2(300f, 30f), new Vector2(80f, 30f), "cure", "CURE"); this.presetCure.description = "Start with the default number of cycles, but visiting Five Pebbles will essentially cure Hunter's illness"; //Credits this.Tabs[0].AddItems(this.presetDescription, this.presetDefault, this.presetEasy, this.presetHard, this.presetCure); //Cycle Length this.lengthRect = new OpRect(new Vector2(50f, 30f), new Vector2(500f, 270f), 0.3f); Vector2 rect2Pos = new Vector2(this.lengthRect.GetPos().x - 10f, this.lengthRect.GetPos().y - 5f); this.cycleLength = new OpLabel(rect2Pos + new Vector2(23f, this.lengthRect.size.y - 25f), new Vector2(0f, 0f), "CYCLE LENGTH", FLabelAlignment.Left, true); this.minCycleSlider = new OpSlider(rect2Pos + new Vector2(50f, this.lengthRect.size.y - 170f), "minLength", new IntVector2(2, 60), 7f, false, 12); this.minCycleSlider.colorEdge = new Color(0f, 1f, 0f); this.maxCycleSlider = new OpSlider(rect2Pos + new Vector2(50f, this.lengthRect.size.y - 210f), "maxLength", new IntVector2(2, 60), 7f, false, 26); this.maxCycleSlider.colorEdge = new Color(1f, 0f, 0f); this.fixedCycleSlider = new OpSlider(rect2Pos + new Vector2(50f, this.lengthRect.size.y - 185f), "fixedLength", new IntVector2(2, 61), 7f, false, 20); this.fixedCycleSlider.colorEdge = new Color(0.1f, 0.1f, 1f); this.rangeButton = new OpSimpleButton(rect2Pos + new Vector2(50f, this.lengthRect.size.y - 115f), new Vector2(70f, 30f), "range", "RANGE"); this.fixedButton = new OpSimpleButton(rect2Pos + new Vector2(130f, this.lengthRect.size.y - 115f), new Vector2(70f, 30f), "fixed", "FIXED"); this.timeLabel = new OpLabel(rect2Pos + new Vector2(this.lengthRect.size.x / 2, this.lengthRect.size.y - 245f), new Vector2(0f, 0f), "X MINUTES", FLabelAlignment.Center, true); this.lengthToggle = new OpCheckBox(rect2Pos + new Vector2(this.lengthRect.size.x - 25f, this.lengthRect.size.y - 30f), "lengthToggle", true); this.lengthToggle.description = "Toggle custom cycle length"; this.lengthDescription = new OpLabel(rect2Pos + new Vector2(50f, this.lengthRect.size.y - 70f), new Vector2(0f, 0f), "Adjust the possible length a cycle can be or set a fixed length.", FLabelAlignment.Left, false); this.fixedLength = new OpCheckBox(new Vector2(0f, -1000f), "fixedCycle", false); this.Tabs[0].AddItems(this.lengthRect, this.cycleLength, this.fixedLength, this.minCycleSlider, this.maxCycleSlider, this.timeLabel, this.rangeButton, this.lengthToggle, this.fixedButton, this.fixedCycleSlider, this.lengthDescription); }
public override void Initialize() { //Tabs this.Tabs = new OpTab[1]; this.Tabs[0] = new OpTab("Config"); //Rect OpLabel title = new OpLabel(240f, 475f, "SCAVSOUT!", true); OpLabel author = new OpLabel(167f, 455f, "Created by: LeeMoriya | Idea by: ThreeFingerG", false); OpRect rect = new OpRect(new UnityEngine.Vector2(140f, 302f), new UnityEngine.Vector2(310f, 140f), 0.3f); //Checkboxes this.shelterAccess = new OpCheckBox(new UnityEngine.Vector2(160f, 400f), "shelter", true); OpLabel shelter = new OpLabel(190f, 402f, "Scavengers are not allowed in shelters", false); this.itemPickup = new OpCheckBox(new UnityEngine.Vector2(160f, 360f), "pickup", true); OpLabel pickup = new OpLabel(190f, 362f, "Scavengers cannot pick up items in shelters", false); this.fleeShelter = new OpCheckBox(new UnityEngine.Vector2(160f, 320f), "flee", true); OpLabel flee = new OpLabel(190f, 322f, "Scavengers flee shelters if injured", false); this.Tabs[0].AddItems(title, author, rect, this.shelterAccess, this.itemPickup, this.fleeShelter, shelter, pickup, flee); }
public override void Initialize() { regionList = RegionFinder.Generate().ToArray(); //Tabs this.Tabs = new OpTab[1]; this.Tabs[0] = new OpTab("Weather"); //Weather Type this.logo = new OpImage(new Vector2(270f, 540f), "logo"); this.logo2 = new OpImage(new Vector2(270f, 540f), "logo2"); this.weatherType = new OpRadioButtonGroup("Type", 0); this.weatherTypeLabel = new OpLabel(new Vector2(30f, 570f), new Vector2(400f, 40f), "Weather Type", FLabelAlignment.Left, true); this.rainWeather = new OpRadioButton(new Vector2(0f, 800f)); this.rainButton = new OpSimpleButton(new Vector2(30f, 540f), new Vector2(70f, 25f), "rainButton", "Rain"); this.snowWeather = new OpRadioButton(new Vector2(0f, 800f)); this.snowButton = new OpSimpleButton(new Vector2(130f, 540f), new Vector2(70f, 25f), "snowButton", "Snow"); this.weatherType.SetButtons(new OpRadioButton[] { rainWeather, snowWeather }); //this.weatherType.valueInt = 1; this.versionNumber = new OpLabel(new Vector2(10f, -5f), new Vector2(0f, 0f), "Version: " + Downpour.mod.Version, FLabelAlignment.Left, false); this.snowWarning = new OpLabel(305f, 525f, "Snow is experimental, use at your own risk!", false); this.snowWarning.color = new Color(0.85f, 0f, 0f); this.Tabs[0].AddItems(rainButton, rainWeather, snowWeather, snowButton, weatherType, weatherTypeLabel, versionNumber, snowWarning); //Weather Sliders this.rainIntensity = new OpLabel(new Vector2(topAnchor.x, topAnchor.y), new Vector2(400f, 40f), "Rain Settings", FLabelAlignment.Left, true); this.intensitySliderLabel = new OpLabel(new Vector2(topAnchor.x + 40f, topAnchor.y - 83f), new Vector2(400f, 40f), "Weather Progression", FLabelAlignment.Left, false); this.weatherIntensity = new OpSlider(new Vector2(topAnchor.x + 25, topAnchor.y - 60f), "weatherIntensity", new IntVector2(0, 3), 50f, false, 0); this.rainSettingsDescription = new OpLabel(new Vector2(topAnchor.x, topAnchor.y - 20f), new Vector2(400f, 40f), "Enable or disable rain specific settings:", FLabelAlignment.Left, false); this.directionSliderLabel = new OpLabel(new Vector2(topAnchor.x + 47f, topAnchor.y - 143f), new Vector2(400f, 40f), "Weather Direction", FLabelAlignment.Left, false); this.weatherDirection = new OpSlider(new Vector2(topAnchor.x + 25, topAnchor.y - 120f), "weatherDirection", new IntVector2(0, 3), 50f, false, 0); this.rainChanceLabel = new OpLabel(new Vector2(topAnchor.x + 47f, topAnchor.y - 203f), new Vector2(400f, 40f), "Weather Chance", FLabelAlignment.Left, false); this.rainChanceSlider = new OpSlider(new Vector2(topAnchor.x + 25, topAnchor.y - 180f), "weatherChance", new IntVector2(0, 100), 1.5f, false, 100); this.weatherIntensity.description = "Configure whether the intensity of the chosen weather increases as the cycle progresses or fix it to a certain intensity."; this.weatherDirection.description = "Configure whether rain should fall towards a random or chosen direction."; this.rainChanceSlider.description = "Configure whether the chosen weather will occur during a cycle."; this.topRect = new OpRect(new Vector2(15f, 250f), new Vector2(570f, 270f), 0.1f); this.Tabs[0].AddItems(rainIntensity, weatherIntensity, intensitySliderLabel, directionSliderLabel, weatherDirection, topRect, logo, logo2, rainChanceSlider, rainChanceLabel); //Checkboxes this.lightningCheck = new OpCheckBox(new Vector2(checkAnchor.x, checkAnchor.y - 30f), "Lightning", false); this.lightningLabel = new OpLabel(new Vector2(checkAnchor.x + 30f, checkAnchor.y - 36f), new Vector2(400f, 40f), "Lightning", FLabelAlignment.Left, false); this.paletteCheck = new OpCheckBox(new Vector2(checkAnchor.x, checkAnchor.y + 10), "Palette", true); this.paletteLabel = new OpLabel(new Vector2(checkAnchor.x + 30f, checkAnchor.y + 4f), new Vector2(400f, 40f), "Palette changes", FLabelAlignment.Left, false); this.muteCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y + 10), "Mute", false); this.muteLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y + 4f), new Vector2(400f, 40f), "Mute interiors", FLabelAlignment.Left, false); this.waterCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y - 30f), "Water", false); this.waterLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y - 36f), new Vector2(400f, 40f), "Water ripples", FLabelAlignment.Left, false); this.strikeCheck = new OpCheckBox(new Vector2(checkAnchor.x, checkAnchor.y - 70f), "Strike", true); this.strikeLabel = new OpLabel(new Vector2(checkAnchor.x + 30f, checkAnchor.y - 76f), new Vector2(400f, 40f), "Lightning Strikes", FLabelAlignment.Left, false); this.strikeDamage = new OpSliderSubtle(new Vector2(checkAnchor.x + 10f, checkAnchor.y - 105f), "Damage", new IntVector2(0, 2), 110, false, 1); this.damageLabel = new OpLabel(new Vector2(checkAnchor.x + 10f, checkAnchor.y - 123f), new Vector2(), "Damage Type: ", FLabelAlignment.Left, false); this.bgOn = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y - 70f), "Background", true); this.bgLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y - 76f), new Vector2(400f, 40f), "Background", FLabelAlignment.Left, false); this.decalCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y - 30f), "Decals", true); this.decalLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y - 36f), new Vector2(400f, 40f), "Surface decals", FLabelAlignment.Left, false); this.dustCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y - 70f), "Dust", true); this.dustLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y - 76f), new Vector2(400f, 40f), "Snow dust", FLabelAlignment.Left, false); this.blizzardCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y - 110f), "Blizzard", true); this.blizzardLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y - 116f), new Vector2(400f, 40f), "Blizzard", FLabelAlignment.Left, false); this.effectCheck = new OpCheckBox(new Vector2(checkAnchor.x + 150f, checkAnchor.y + 10), "Effect", true); this.effectLabel = new OpLabel(new Vector2(checkAnchor.x + 180f, checkAnchor.y + 4f), new Vector2(400f, 40f), "Effect Colors", FLabelAlignment.Left, false); this.dustCheck.description = "Puffs of snow appear when landing on the ground."; this.decalCheck.description = "Adds snowy decals to surfaces."; this.lightningCheck.description = "Lightning will appear at higher weather intensities."; this.paletteCheck.description = "The region will become darker with higher rain intensity."; this.muteCheck.description = "Mute the sound effect added to interiors when its raining outside."; this.waterCheck.description = "Rain drops can interact with water surfaces and cause ripples, may impact performance."; this.bgOn.description = "Enable or disable collision with background elements, may impact performance."; this.strikeDamage.description = "Adjust the damage type of Lightning Strikes"; this.strikeCheck.description = "When weather intensity is high enough, lightning strikes can occur."; this.effectCheck.description = "Whitens things like plants and signs so they better match the snowy palette, can ruin some custom props"; this.blizzardCheck.description = "Replaces the end-of-cycle rain with a roaring blizzard and affects normal gameplay"; this.Tabs[0].AddItems(lightningLabel, lightningCheck, strikeCheck, strikeLabel, strikeDamage, damageLabel, rainSettingsDescription, paletteCheck, muteCheck, waterCheck, bgOn, paletteLabel, muteLabel, waterLabel, bgLabel, dustCheck, dustLabel, decalCheck, decalLabel, effectCheck, effectLabel, blizzardCheck, blizzardLabel); //Particle Limit this.rainOption = new OpLabel(new Vector2(topAnchor.x + 366f, topAnchor.y - 223f), new Vector2(400f, 40f), "Particle Limit", FLabelAlignment.Left, false); this.rainSlider = new OpSlider(new Vector2(topAnchor.x + 275f, topAnchor.y - 200f), "rainAmount", new IntVector2(10, 80), 3.3f, false, 50); this.Tabs[0].AddItems(rainSlider, rainOption); //Regions if (regionList != null) { this.regionLabelList = new OpLabel[regionList.Length]; this.regionChecks = new OpCheckBox[regionList.Length]; this.regionLabel = new OpLabel(new Vector2(30f, 200f), new Vector2(400f, 40f), "Region Settings", FLabelAlignment.Left, true); this.regionDescription = new OpLabel(new Vector2(30f, 175f), new Vector2(400f, 40f), "Enable and Disable weather on a per-region basis.", FLabelAlignment.Left, false); this.Tabs[0].AddItems(regionLabel, regionDescription); for (int i = 0; i < regionList.Length; i++) { if (i < 10) { regionChecks[i] = new OpCheckBox(new Vector2(30f + (55f * i), 150f), regionList[i], true); regionLabelList[i] = new OpLabel(new Vector2(60f + (55f * i), 142f), new Vector2(400f, 40f), regionList[i], FLabelAlignment.Left, false); } else if (i >= 10 && i < 20) { regionChecks[i] = new OpCheckBox(new Vector2(-520f + (55f * i), 105f), regionList[i], true); regionLabelList[i] = new OpLabel(new Vector2(-490f + (55f * i), 97f), new Vector2(400f, 40f), regionList[i], FLabelAlignment.Left, false); } else if (i >= 20 && i < 30) { regionChecks[i] = new OpCheckBox(new Vector2(-1070f + (55f * i), 60f), regionList[i], true); regionLabelList[i] = new OpLabel(new Vector2(-1040f + (55f * i), 52f), new Vector2(400f, 40f), regionList[i], FLabelAlignment.Left, false); } else if (i >= 30) { regionChecks[i] = new OpCheckBox(new Vector2(-1650f + (55f * i), 15f), regionList[i], true); regionLabelList[i] = new OpLabel(new Vector2(-1620f + (55f * i), 7f), new Vector2(400f, 40f), regionList[i], FLabelAlignment.Left, false); } this.Tabs[0].AddItems(regionLabelList[i], regionChecks[i]); if (regionList[i] == "SS") { regionChecks[i].valueBool = false; } } } Downpour.configLoaded = true; }
public override void Initialize() { //Create a copy of the creature color dictionary that will be modified by the config screen this.configColors = new Dictionary <string, Color>(BloodMod.creatureColors); this.Tabs = new OpTab[1]; int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; this.Tabs[0] = new OpTab("Options"); this.creatureLabel = new OpLabel(new Vector2(490f, 375f), new Vector2(0f, 0f), "None Selected", FLabelAlignment.Center, true); this.colorPicker = new OpColorPicker(new Vector2(250f, 250f), "bloodColor"); this.previewOld = new OpImage(new Vector2(250f, 150f), "Futile_White"); this.previewOld.sprite.scaleX = 10f; this.previewOld.sprite.scaleY = 4f; this.oldLabel = new OpLabel(new Vector2(250f, 220f), new Vector2(0f, 0f), "Default", FLabelAlignment.Left, true); this.previewNew = new OpImage(new Vector2(420f, 150f), "Futile_White"); this.previewNew.sprite.scaleX = 10f; this.previewNew.sprite.scaleY = 4f; this.newLabel = new OpLabel(new Vector2(420f, 220f), new Vector2(0f, 0f), "Modified", FLabelAlignment.Left, true); this.resetButton = new OpSimpleButton(new Vector2(425f, 305f), new Vector2(150f, 45f), "reset", "Reset to Default"); this.resetButton.description = "Reset this creature's blood color to the mod's default."; this.modName = new OpLabel(new Vector2(400f, 552f), new Vector2(0f, 0f), "BLOOD MOD", FLabelAlignment.Center, true); this.modCredit = new OpLabel(new Vector2(400f, 532f), new Vector2(0f, 0f), "Created by LeeMoriya", FLabelAlignment.Center, false); this.modVersion = new OpLabel(new Vector2(400f, 518f), new Vector2(0f, 0f), "Version: 1.01", FLabelAlignment.Center, false); this.rect = new OpRect(new Vector2(230f, 130f), new Vector2(370f, 360f), 0f); this.guide = new OpLabel(new Vector2(405f, 462f), new Vector2(0f, 0f), "Select creatures on the left and adjust their blood color using", FLabelAlignment.Center, false); this.guide2 = new OpLabel(new Vector2(405f, 442f), new Vector2(0f, 0f), "the color picker below. Finalize changes by clicking 'Apply'", FLabelAlignment.Center, false); this.bloodPreview = new OpCheckBox(new Vector2(30f, 2f), "_prev", false); this.bloodPreviewLabel = new OpLabel(new Vector2(66f, 5f), new Vector2(0f, 0f), "Preview all blood colors", FLabelAlignment.Left, false); this.selectedSprite = new OpImage(new Vector2(0f, 0f), "Futile_White"); this.selectedSprite.sprite.scale = 17f; this.selectedSprite.sprite.alpha = 0.05f; this.selectedSprite.description = "?"; this.selectedSprite.sprite.SetAnchor(new Vector2(0.5f, 0.5f)); this.realisticPreset = new OpSimpleButton(new Vector2(265f, 85f), new Vector2(130f, 31f), "real", "Realistic Preset"); this.vibrantPreset = new OpSimpleButton(new Vector2(435f, 85f), new Vector2(130f, 31f), "vibrant", "Vibrant Preset"); this.realisticPreset.description = "Blood colors will be more realistic."; this.vibrantPreset.description = "Blood colors will more closely match the creature's color."; this.bloodlust = new OpCheckBox(new Vector2(265f, 45f), "gore", false); this.bloodlust.description = "Blood effects are increased dramatically"; this.bloodlustLabel = new OpLabel(new Vector2(295f, 48f), new Vector2(), "Bloodlust Mode", FLabelAlignment.Left, false); this.compat = new OpCheckBox(new Vector2(265f, 12f), "wash", false); this.compat.description = "Rainfall from the mod Downpour will wash away blood."; this.compatLabel = new OpLabel(new Vector2(295f, 15f), new Vector2(), "Downpour Compatibility", FLabelAlignment.Left, false); this.preset = new OpCheckBox(new Vector2(), "preset", false); foreach (PartialityMod mod in PartialityManager.Instance.modManager.loadedMods) { if (mod.ModID == "Downpour") { this.Tabs[0].AddItems(this.compat, this.compatLabel); } } this.Tabs[0].AddItems(this.selectedSprite, this.colorPicker, this.creatureLabel, this.previewOld, this.previewNew, this.oldLabel, this.newLabel, this.resetButton, this.bloodPreviewLabel, this.modName, this.modCredit, this.rect, this.guide, this.guide2, this.modVersion, this.bloodPreview, this.realisticPreset, this.vibrantPreset, this.bloodlust, this.bloodlustLabel, this.preset); //Create individual buttons/sprites/color pickers for each creature foreach (KeyValuePair <string, Color> creature in this.configColors) { if (creature.Key != "Overseer") { if (num < 11) { OpColorPicker picker = new OpColorPicker(new Vector2(250f, 270f), creature.Key, OpColorPicker.ColorToHex(BloodMod.defaultColors[creature.Key])); OpSimpleButton button = new OpSimpleButton(new Vector2(21f, 548f) + (buttonOffset * num), new Vector2(40f, 40f), creature.Key + "but", ""); OpImage sprite = new OpImage(new Vector2(21f, 548f) + (buttonOffset * num) + spriteOffset, BloodColor.GetCreatureSprite(creature.Key)); sprite.color = BloodColor.GetCreatureSpriteColor(creature.Key); sprite.sprite.SetAnchor(new Vector2(0.5f, 0.5f)); sprite.description = creature.Key; button.description = creature.Key; this.Tabs[0].AddItems(button, sprite, picker); num++; } else if (num2 < 11) { OpColorPicker picker = new OpColorPicker(new Vector2(250f, 270f), creature.Key, OpColorPicker.ColorToHex(BloodMod.defaultColors[creature.Key])); OpSimpleButton button = new OpSimpleButton(new Vector2(21f, 548f) + (buttonOffset * num2) + buttonOffset2, new Vector2(40f, 40f), creature.Key + "but", ""); OpImage sprite = new OpImage(new Vector2(21f, 548f) + (buttonOffset * num2) + buttonOffset2 + spriteOffset, BloodColor.GetCreatureSprite(creature.Key)); sprite.color = BloodColor.GetCreatureSpriteColor(creature.Key); sprite.sprite.SetAnchor(new Vector2(0.5f, 0.5f)); sprite.description = creature.Key; button.description = creature.Key; this.Tabs[0].AddItems(button, sprite, picker); num2++; } else if (num3 < 11) { OpColorPicker picker = new OpColorPicker(new Vector2(250f, 270f), creature.Key, OpColorPicker.ColorToHex(BloodMod.defaultColors[creature.Key])); OpSimpleButton button = new OpSimpleButton(new Vector2(21f, 548f) + (buttonOffset * num3) + (buttonOffset2 * 2), new Vector2(40f, 40f), creature.Key + "but", ""); OpImage sprite = new OpImage(new Vector2(21f, 548f) + (buttonOffset * num3) + (buttonOffset2 * 2) + spriteOffset, BloodColor.GetCreatureSprite(creature.Key)); sprite.color = BloodColor.GetCreatureSpriteColor(creature.Key); sprite.sprite.SetAnchor(new Vector2(0.5f, 0.5f)); sprite.description = creature.Key; button.description = creature.Key; this.Tabs[0].AddItems(button, sprite, picker); num3++; } else { OpColorPicker picker = new OpColorPicker(new Vector2(250f, 270f), creature.Key, OpColorPicker.ColorToHex(BloodMod.defaultColors[creature.Key])); OpSimpleButton button = new OpSimpleButton(new Vector2(21f, 548f) + (buttonOffset * num4) + (buttonOffset2 * 3), new Vector2(40f, 40f), creature.Key + "but", ""); OpImage sprite = new OpImage(new Vector2(21f, 548f) + (buttonOffset * num4) + (buttonOffset2 * 3) + spriteOffset, BloodColor.GetCreatureSprite(creature.Key)); sprite.color = BloodColor.GetCreatureSpriteColor(creature.Key); sprite.sprite.SetAnchor(new Vector2(0.5f, 0.5f)); sprite.description = creature.Key; button.description = creature.Key; this.Tabs[0].AddItems(button, sprite, picker); num4++; } } this.selected = "Slugcat"; } }
public override void Initialize() { #region init base.Initialize(); this.Tabs = new OpTab[3]; this.Tabs[0] = new OpTab("TEST0"); this.Tabs[1] = new OpTab("TEST1"); this.Tabs[2] = new OpTab("TESTSCROLL"); Tabs[0].AddItems(new OpLabel(new Vector2(100f, 540f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true), new OpLabel(new Vector2(420f, 510f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right)); Tabs[1].AddItems(new OpLabel(new Vector2(100f, 540f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true), new OpLabel(new Vector2(420f, 510f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right)); #endregion init //OpColorPicker cpk = new OpColorPicker(new Vector2(100f, 100f), "_TEST", "CCCCCC") { colorEdge = Color.yellow }; //Tabs[0].AddItems(cpk, new OpLabel(new Vector2(100f, 260f), new Vector2(150f, 20f), "OpColorPicker Test") { bumpBehav = cpk.bumpBehav }); Texture2D t = new Texture2D(64, 64); Color[] n = new Color[64 * 64]; int y = 0; while (y < 64) { int x = 0; while (x < 64) { float s = Mathf.PerlinNoise(x * 0.1f, y * 0.1f); //float s = UnityEngine.Random.value; n[y * 64 + x] = s > 0.5f ? Color.white : Color.clear; x++; } y++; } t.SetPixels(n); t.Apply(); //Tabs[0].AddItems(new OpSpriteEditor(new Vector2(300f, 100f), new Vector2(100f, 100f), "_TEST", t)); OpScrollBox scb = new OpScrollBox(new Vector2(100f, 100f), new Vector2(240f, 150f), 400f); Tabs[0].AddItems(scb); scb.AddItems(new OpLabelLong(new Vector2(20f, 20f), new Vector2(120f, 200f)), new OpSlider(new Vector2(160f, 30f), "_", new IntVector2(-20, 20), length: 180, true, 10)); OpCheckBox chk = new OpCheckBox(new Vector2(100f, 420f), "_", true); Tabs[1].AddItems(chk, new OpLabel(new Vector2(100f, 470f), new Vector2(50f, 15f), "CheckBox") { bumpBehav = chk.bumpBehav }); OpUpdown ud = new OpUpdown(new Vector2(20f, 220f), 150f, "_", 10); ud.SetRange(-10000000, 10000000); Tabs[1].AddItems(ud); ud = new OpUpdown(new Vector2(220f, 220f), 150f, "_", 20.5f, 2); ud.SetRange(-10000f, 10000f); Tabs[1].AddItems(ud); Tabs[1].AddItems(new OpTextBox(new Vector2(420f, 220f), 150f, "_", "30", OpTextBox.Accept.Int)); // For canvas-sized ScrollBox OpScrollBox sb = new OpScrollBox(Tabs[2], 2400f, false); // Use OpScrollBox.AddItems instead of OpTab.AddItems. sb.AddItems(new OpLabel(new Vector2(100f, 540f + 1800f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true), new OpLabel(new Vector2(420f, 510f + 1800f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right)); sb.AddItems(new OpImage(new Vector2(420f, 50f), t)); //sb.AddItems(new OpImage(new Vector2(420f, 120f), "gateSymbol0")); //Tabs[2].AddItems(new OpImage(new Vector2(420f, 120f), "gateSymbol0")); OpColorPicker cpk0 = new OpColorPicker(new Vector2(100f, 100f), "_TEST", "CCCCCC") { colorEdge = Color.red }; sb.AddItems(cpk0, new OpLabel(new Vector2(300f, 100f), new Vector2(100f, 20f), "Red Colorpicker") { bumpBehav = cpk0.bumpBehav, color = Color.red }); OpColorPicker cpk1 = new OpColorPicker(new Vector2(100f, 2000f), "_TEST", "AAAAAA") { colorEdge = Color.blue }; sb.AddItems(cpk1, new OpLabel(new Vector2(300f, 2000f), new Vector2(100f, 20f), "Blue Colorpicker") { bumpBehav = cpk1.bumpBehav, color = Color.blue }); sb.AddItems(new OpSlider(new Vector2(100f, 1800f), "", new IntVector2(0, 100), 300)); sb.AddItems(new OpSlider(new Vector2(500f, 1700f), "", new IntVector2(0, 100), 300, true)); sb.AddItems(new OpSliderSubtle(new Vector2(100f, 1400f), "", new IntVector2(0, 20), 200)); sb.AddItems(new OpSliderSubtle(new Vector2(500f, 1300f), "", new IntVector2(0, 20), 200, true)); /* * sb.AddItems(new OpRect(new Vector2(25f, 1000f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(225f, 1000f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(425f, 1000f), new Vector2(150f, 150f))); * sb.AddItems(new OpLabel(new Vector2(25f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Top }); * sb.AddItems(new OpLabel(new Vector2(225f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Center }); * sb.AddItems(new OpLabel(new Vector2(425f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Bottom }); * sb.AddItems(new OpRect(new Vector2(25f, 800f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(225f, 800f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(425f, 800f), new Vector2(150f, 150f))); * sb.AddItems(new OpLabel(new Vector2(25f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Top }); * sb.AddItems(new OpLabel(new Vector2(225f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Center }); * sb.AddItems(new OpLabel(new Vector2(425f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Bottom }); * sb.AddItems(new OpRect(new Vector2(25f, 600f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(225f, 600f), new Vector2(150f, 150f))); * sb.AddItems(new OpRect(new Vector2(425f, 600f), new Vector2(150f, 150f))); * sb.AddItems(new OpLabelLong(new Vector2(25f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Top }); * sb.AddItems(new OpLabelLong(new Vector2(225f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Center }); * sb.AddItems(new OpLabelLong(new Vector2(425f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Bottom }); */ OpComboBox cb = new OpComboBox(new Vector2(100f, 1000f), 150f, "", new List <ListItem>() { new ListItem("Slugcat"), new ListItem("Is"), new ListItem("HalfSlug"), new ListItem("And"), new ListItem("HalfBunny"), new ListItem("Creature") }, "Slugcat"); sb.AddItems(cb, new OpLabel(100f, 1050f, "AutoSort") { bumpBehav = cb.bumpBehav }); cb = new OpComboBox(new Vector2(350f, 1000f), 150f, "", new List <ListItem>() { new ListItem("The0", 0), new ListItem("quick1", 1), new ListItem("brown2", 2), new ListItem("fox3", 3), new ListItem("jumps4", 4), new ListItem("over5", 5), new ListItem("the6", 6), new ListItem("lazy7", 7), new ListItem("dog8", 8) }, "brown2"); sb.AddItems(cb, new OpLabel(350f, 1050f, "DefinedOrder") { bumpBehav = cb.bumpBehav }); sb.AddItems(new OpResourceList(new Vector2(70f, 600f), 200f, "", typeof(CreatureTemplate.Type), OpListBox.GetLineCountFromHeight(300f))); // sb.AddItems(new OpResourceList(new Vector2(330f, 600f), 200f, "", typeof(AbstractPhysicalObject.AbstractObjectType), 10, downward: false)); sb.AddItems(new OpListBox(new Vector2(330f, 600f), 200f, "", new List <ListItem>() { new ListItem("The Survivor", 0), new ListItem("The Monk", 1), new ListItem("The Hunter", 2), new ListItem("The Sporecat", 3), new ListItem("The Electric Cat", 4), new ListItem("The Programmer Cat", 5) }, OpListBox.GetLineCountFromHeight(200f))); sb.AddItems(new OpLabel(330f, 780f, "Player 2 plays as", true)); // Use OpScrollBox.AddItems instead of OpTab.AddItems. /* * OpResourceSelector rs = new OpResourceSelector(new Vector2(100f, 1600f), new Vector2(200f, 30f), "", typeof(CreatureTemplate.Type)); * sb.AddItems(rs, new OpLabel(100f, 1630f, "CreatureTemplate.Type") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1500f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Decals); * sb.AddItems(rs, new OpLabel(100f, 1530f, "Decals") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1400f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Illustrations); * sb.AddItems(rs, new OpLabel(100f, 1430f, "Illustrations") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1300f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Palettes); * sb.AddItems(rs, new OpLabel(100f, 1330f, "Palettes") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1200f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Regions); * sb.AddItems(rs, new OpLabel(100f, 1230f, "Regions") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1100f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Shaders); * sb.AddItems(rs, new OpLabel(100f, 1130f, "Shaders") { bumpBehav = rs.bumpBehav }); * rs = new OpResourceSelector(new Vector2(100f, 1000f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Songs); * sb.AddItems(rs, new OpLabel(100f, 1030f, "Songs") { bumpBehav = rs.bumpBehav });*/ }