private static void updateValue(Sleek sleek, object state) { int index = MenuPlayConfigUI.configBox.search(sleek.parent); object obj = MenuPlayConfigUI.configGroups[index]; Type type = obj.GetType(); FieldInfo[] fields = type.GetFields(); int num = sleek.parent.search(sleek); FieldInfo fieldInfo = fields[num]; fieldInfo.SetValue(obj, state); }
public void remove(Sleek sleek) { sleek._parent = null; sleek.destroy(); this.children.Remove(sleek); }
public int search(Sleek sleek) { return(this.children.IndexOf(sleek)); }
public void add(Sleek sleek) { this.children.Add(sleek); sleek._parent = this; sleek.build(); }
private static void refresh() { MenuWorkshopSpawnsUI.rawField.isVisible = false; MenuWorkshopSpawnsUI.rootsBox.isVisible = true; MenuWorkshopSpawnsUI.tablesBox.isVisible = true; MenuWorkshopSpawnsUI.rootsBox.remove(); MenuWorkshopSpawnsUI.tablesBox.remove(); MenuWorkshopSpawnsUI.asset = (SpawnAsset)Assets.find(EAssetType.SPAWN, MenuWorkshopSpawnsUI.viewIDField.state); switch (MenuWorkshopSpawnsUI.typeButton.state) { case 0: MenuWorkshopSpawnsUI.type = EAssetType.ITEM; break; case 1: MenuWorkshopSpawnsUI.type = EAssetType.VEHICLE; break; case 2: MenuWorkshopSpawnsUI.type = EAssetType.ANIMAL; break; default: MenuWorkshopSpawnsUI.type = EAssetType.NONE; return; } int num = 120; MenuWorkshopSpawnsUI.rootsBox.positionOffset_Y = num; num += 40; if (MenuWorkshopSpawnsUI.asset != null) { MenuWorkshopSpawnsUI.rootsBox.text = MenuWorkshopSpawnsUI.localization.format("Roots_Box", new object[] { MenuWorkshopSpawnsUI.viewIDField.state + " " + MenuWorkshopSpawnsUI.asset.name }); for (int i = 0; i < MenuWorkshopSpawnsUI.asset.roots.Count; i++) { SpawnTable spawnTable = MenuWorkshopSpawnsUI.asset.roots[i]; if (spawnTable.spawnID != 0) { SleekButton sleekButton = new SleekButton(); sleekButton.positionOffset_Y = 40 + i * 40; sleekButton.sizeOffset_X = -260; sleekButton.sizeScale_X = 1f; sleekButton.sizeOffset_Y = 30; SleekButton sleekButton2 = sleekButton; if (MenuWorkshopSpawnsUI.< > f__mg$cache0 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache0 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRootButton); } sleekButton2.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache0; MenuWorkshopSpawnsUI.rootsBox.add(sleekButton); num += 40; SpawnAsset spawnAsset = (SpawnAsset)Assets.find(EAssetType.SPAWN, spawnTable.spawnID); if (spawnAsset != null) { sleekButton.text = spawnTable.spawnID + " " + spawnAsset.name; } else { sleekButton.text = spawnTable.spawnID + " ?"; } SleekInt32Field sleekInt32Field = new SleekInt32Field(); sleekInt32Field.positionOffset_X = 10; sleekInt32Field.positionScale_X = 1f; sleekInt32Field.sizeOffset_X = 55; sleekInt32Field.sizeOffset_Y = 30; sleekInt32Field.state = spawnTable.weight; sleekInt32Field.tooltip = MenuWorkshopSpawnsUI.localization.format("Weight_Tooltip"); SleekInt32Field sleekInt32Field2 = sleekInt32Field; Delegate onTypedInt = sleekInt32Field2.onTypedInt; if (MenuWorkshopSpawnsUI.< > f__mg$cache1 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache1 = new TypedInt32(MenuWorkshopSpawnsUI.onTypedRootWeightField); } sleekInt32Field2.onTypedInt = (TypedInt32)Delegate.Combine(onTypedInt, MenuWorkshopSpawnsUI.< > f__mg$cache1); sleekButton.add(sleekInt32Field); sleekButton.add(new SleekBox { positionOffset_X = 75, positionScale_X = 1f, sizeOffset_X = 55, sizeOffset_Y = 30, text = (Math.Round((double)(spawnTable.chance * 1000f)) / 10.0).ToString() + "%", tooltip = MenuWorkshopSpawnsUI.localization.format("Chance_Tooltip") }); SleekButtonIcon sleekButtonIcon = new SleekButtonIcon((Texture2D)MenuWorkshopEditorUI.icons.load("Remove")); sleekButtonIcon.positionOffset_X = 140; sleekButtonIcon.positionScale_X = 1f; sleekButtonIcon.sizeOffset_X = 120; sleekButtonIcon.sizeOffset_Y = 30; sleekButtonIcon.text = MenuWorkshopSpawnsUI.localization.format("Remove_Root_Button"); sleekButtonIcon.tooltip = MenuWorkshopSpawnsUI.localization.format("Remove_Root_Button_Tooltip"); SleekButton sleekButton3 = sleekButtonIcon; if (MenuWorkshopSpawnsUI.< > f__mg$cache2 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache2 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRemoveRootButton); } sleekButton3.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache2; sleekButton.add(sleekButtonIcon); } } MenuWorkshopSpawnsUI.addRootIDField.positionOffset_Y = num; MenuWorkshopSpawnsUI.addRootSpawnButton.positionOffset_Y = num; num += 40; MenuWorkshopSpawnsUI.addRootIDField.isVisible = true; MenuWorkshopSpawnsUI.addRootSpawnButton.isVisible = true; } else { MenuWorkshopSpawnsUI.rootsBox.text = MenuWorkshopSpawnsUI.localization.format("Roots_Box", new object[] { MenuWorkshopSpawnsUI.viewIDField.state + " ?" }); MenuWorkshopSpawnsUI.addRootIDField.isVisible = false; MenuWorkshopSpawnsUI.addRootSpawnButton.isVisible = false; } num += 40; MenuWorkshopSpawnsUI.tablesBox.positionOffset_Y = num; num += 40; if (MenuWorkshopSpawnsUI.asset != null) { MenuWorkshopSpawnsUI.tablesBox.text = MenuWorkshopSpawnsUI.localization.format("Tables_Box", new object[] { MenuWorkshopSpawnsUI.viewIDField.state + " " + MenuWorkshopSpawnsUI.asset.name }); for (int j = 0; j < MenuWorkshopSpawnsUI.asset.tables.Count; j++) { SpawnTable spawnTable2 = MenuWorkshopSpawnsUI.asset.tables[j]; Sleek sleek = null; if (spawnTable2.spawnID != 0) { SleekButton sleekButton4 = new SleekButton(); sleekButton4.positionOffset_Y = 40 + j * 40; sleekButton4.sizeOffset_X = -260; sleekButton4.sizeScale_X = 1f; sleekButton4.sizeOffset_Y = 30; SleekButton sleekButton5 = sleekButton4; if (MenuWorkshopSpawnsUI.< > f__mg$cache3 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache3 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedTableButton); } sleekButton5.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache3; MenuWorkshopSpawnsUI.tablesBox.add(sleekButton4); sleek = sleekButton4; num += 40; SpawnAsset spawnAsset2 = (SpawnAsset)Assets.find(EAssetType.SPAWN, spawnTable2.spawnID); if (spawnAsset2 != null) { sleekButton4.text = spawnTable2.spawnID + " " + spawnAsset2.name; } else { sleekButton4.text = spawnTable2.spawnID + " ?"; } } else if (spawnTable2.assetID != 0) { SleekBox sleekBox = new SleekBox(); sleekBox.positionOffset_Y = 40 + j * 40; sleekBox.sizeOffset_X = -260; sleekBox.sizeScale_X = 1f; sleekBox.sizeOffset_Y = 30; MenuWorkshopSpawnsUI.tablesBox.add(sleekBox); sleek = sleekBox; num += 40; Asset asset = Assets.find(MenuWorkshopSpawnsUI.type, spawnTable2.assetID); if (asset != null) { sleekBox.text = spawnTable2.assetID + " " + asset.name; if (MenuWorkshopSpawnsUI.type == EAssetType.ITEM) { ItemAsset itemAsset = asset as ItemAsset; if (MenuWorkshopSpawnsUI.asset != null) { sleekBox.foregroundTint = ESleekTint.NONE; sleekBox.foregroundColor = ItemTool.getRarityColorUI(itemAsset.rarity); } } else if (MenuWorkshopSpawnsUI.type == EAssetType.VEHICLE) { VehicleAsset vehicleAsset = asset as VehicleAsset; if (MenuWorkshopSpawnsUI.asset != null) { sleekBox.foregroundTint = ESleekTint.NONE; sleekBox.foregroundColor = ItemTool.getRarityColorUI(vehicleAsset.rarity); } } } else { sleekBox.text = spawnTable2.assetID + " ?"; } } if (sleek != null) { SleekInt32Field sleekInt32Field3 = new SleekInt32Field(); sleekInt32Field3.positionOffset_X = 10; sleekInt32Field3.positionScale_X = 1f; sleekInt32Field3.sizeOffset_X = 55; sleekInt32Field3.sizeOffset_Y = 30; sleekInt32Field3.state = spawnTable2.weight; sleekInt32Field3.tooltip = MenuWorkshopSpawnsUI.localization.format("Weight_Tooltip"); SleekInt32Field sleekInt32Field4 = sleekInt32Field3; Delegate onTypedInt2 = sleekInt32Field4.onTypedInt; if (MenuWorkshopSpawnsUI.< > f__mg$cache4 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache4 = new TypedInt32(MenuWorkshopSpawnsUI.onTypedTableWeightField); } sleekInt32Field4.onTypedInt = (TypedInt32)Delegate.Combine(onTypedInt2, MenuWorkshopSpawnsUI.< > f__mg$cache4); sleek.add(sleekInt32Field3); float num2 = spawnTable2.chance; if (j > 0) { num2 -= MenuWorkshopSpawnsUI.asset.tables[j - 1].chance; } sleek.add(new SleekBox { positionOffset_X = 75, positionScale_X = 1f, sizeOffset_X = 55, sizeOffset_Y = 30, text = (Math.Round((double)(num2 * 1000f)) / 10.0).ToString() + "%", tooltip = MenuWorkshopSpawnsUI.localization.format("Chance_Tooltip") }); SleekButtonIcon sleekButtonIcon2 = new SleekButtonIcon((Texture2D)MenuWorkshopEditorUI.icons.load("Remove")); sleekButtonIcon2.positionOffset_X = 140; sleekButtonIcon2.positionScale_X = 1f; sleekButtonIcon2.sizeOffset_X = 120; sleekButtonIcon2.sizeOffset_Y = 30; sleekButtonIcon2.text = MenuWorkshopSpawnsUI.localization.format("Remove_Table_Button"); sleekButtonIcon2.tooltip = MenuWorkshopSpawnsUI.localization.format("Remove_Table_Button_Tooltip"); SleekButton sleekButton6 = sleekButtonIcon2; if (MenuWorkshopSpawnsUI.< > f__mg$cache5 == null) { MenuWorkshopSpawnsUI.< > f__mg$cache5 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRemoveTableButton); } sleekButton6.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache5; sleek.add(sleekButtonIcon2); } } MenuWorkshopSpawnsUI.addTableIDField.positionOffset_Y = num; MenuWorkshopSpawnsUI.addTableAssetButton.positionOffset_Y = num; MenuWorkshopSpawnsUI.addTableSpawnButton.positionOffset_Y = num; num += 40; MenuWorkshopSpawnsUI.addTableIDField.isVisible = true; MenuWorkshopSpawnsUI.addTableAssetButton.isVisible = true; MenuWorkshopSpawnsUI.addTableSpawnButton.isVisible = true; } else { MenuWorkshopSpawnsUI.tablesBox.text = MenuWorkshopSpawnsUI.localization.format("Tables_Box", new object[] { MenuWorkshopSpawnsUI.viewIDField.state + " ?" }); MenuWorkshopSpawnsUI.addTableIDField.isVisible = false; MenuWorkshopSpawnsUI.addTableAssetButton.isVisible = false; MenuWorkshopSpawnsUI.addTableSpawnButton.isVisible = false; } if (MenuWorkshopSpawnsUI.asset != null) { MenuWorkshopSpawnsUI.applyWeightsButton.positionOffset_Y = num; num += 40; MenuWorkshopSpawnsUI.applyWeightsButton.isVisible = true; } else { MenuWorkshopSpawnsUI.applyWeightsButton.isVisible = false; } MenuWorkshopSpawnsUI.spawnsBox.area = new Rect(0f, 0f, 5f, (float)(num - 10)); }
private static void onDraggedNoiseSlider(Sleek field, float state) { EditorTerrainMaterials.brushNoise = state; }
private static void onDraggedSizeSlider(Sleek field, float state) { EditorTerrainMaterials.brushSize = (byte)((float)EditorTerrainMaterials.MIN_BRUSH_SIZE + state * (float)EditorTerrainMaterials.MAX_BRUSH_SIZE); }
public SleekBlueprint(Blueprint newBlueprint) { this._blueprint = newBlueprint; base.init(); this.fontStyle = 1; this.fontAlignment = 4; this.fontSize = SleekRender.FONT_SIZE; this.calculateContent(); SleekLabel sleekLabel = new SleekLabel(); sleekLabel.positionOffset_X = 5; sleekLabel.positionOffset_Y = 5; sleekLabel.sizeOffset_X = -10; sleekLabel.sizeOffset_Y = 30; sleekLabel.sizeScale_X = 1f; sleekLabel.foregroundColor = ((!this.blueprint.hasSupplies || !this.blueprint.hasTool || !this.blueprint.hasItem || !this.blueprint.hasSkills) ? Palette.COLOR_R : Palette.COLOR_G); sleekLabel.foregroundTint = ESleekTint.NONE; sleekLabel.fontSize = 14; base.add(sleekLabel); if (this.blueprint.skill != EBlueprintSkill.NONE) { base.add(new SleekLabel { positionOffset_X = 5, positionOffset_Y = -35, positionScale_Y = 1f, sizeOffset_X = -10, sizeOffset_Y = 30, sizeScale_X = 1f, text = PlayerDashboardCraftingUI.localization.format("Skill_" + (int)this.blueprint.skill, new object[] { PlayerDashboardSkillsUI.localization.format("Level_" + this.blueprint.level) }), foregroundColor = ((!this.blueprint.hasSkills) ? Palette.COLOR_R : Palette.COLOR_G), foregroundTint = ESleekTint.NONE, fontSize = 14 }); } Sleek sleek = new Sleek(); sleek.positionOffset_Y = 40; sleek.positionScale_X = 0.5f; sleek.sizeOffset_Y = -45; sleek.sizeScale_Y = 1f; base.add(sleek); int num = 0; for (int i = 0; i < this.blueprint.supplies.Length; i++) { BlueprintSupply blueprintSupply = this.blueprint.supplies[i]; ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintSupply.id); if (itemAsset != null) { SleekLabel sleekLabel2 = sleekLabel; sleekLabel2.text += itemAsset.itemName; SleekImageTexture sleekImageTexture = new SleekImageTexture(); sleekImageTexture.positionOffset_X = num; sleekImageTexture.positionOffset_Y = (int)(-itemAsset.size_y * 25); sleekImageTexture.positionScale_Y = 0.5f; sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 50); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 50); sleek.add(sleekImageTexture); ItemTool.getIcon(blueprintSupply.id, 100, itemAsset.getState(false), itemAsset, new ItemIconReady(sleekImageTexture.updateTexture)); SleekLabel sleekLabel3 = new SleekLabel(); sleekLabel3.positionOffset_X = -100; sleekLabel3.positionOffset_Y = -30; sleekLabel3.positionScale_Y = 1f; sleekLabel3.sizeOffset_X = 100; sleekLabel3.sizeOffset_Y = 30; sleekLabel3.sizeScale_X = 1f; sleekLabel3.foregroundTint = ESleekTint.NONE; sleekLabel3.fontAlignment = 5; sleekLabel3.text = blueprintSupply.hasAmount + "/" + blueprintSupply.amount; sleekImageTexture.add(sleekLabel3); SleekLabel sleekLabel4 = sleekLabel; string text = sleekLabel4.text; sleekLabel4.text = string.Concat(new object[] { text, " ", blueprintSupply.hasAmount, "/", blueprintSupply.amount }); if (this.blueprint.type == EBlueprintType.AMMO) { if (blueprintSupply.hasAmount == 0 || blueprintSupply.amount == 0) { sleekLabel3.backgroundColor = Palette.COLOR_R; sleekLabel3.foregroundColor = Palette.COLOR_R; } } else if (blueprintSupply.hasAmount < blueprintSupply.amount) { sleekLabel3.backgroundColor = Palette.COLOR_R; sleekLabel3.foregroundColor = Palette.COLOR_R; } num += (int)(itemAsset.size_x * 50 + 25); if (i < this.blueprint.supplies.Length - 1 || this.blueprint.tool != 0 || this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel5 = sleekLabel; sleekLabel5.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } if (this.blueprint.tool != 0) { ItemAsset itemAsset2 = (ItemAsset)Assets.find(EAssetType.ITEM, this.blueprint.tool); if (itemAsset2 != null) { SleekLabel sleekLabel6 = sleekLabel; sleekLabel6.text += itemAsset2.itemName; SleekImageTexture sleekImageTexture2 = new SleekImageTexture(); sleekImageTexture2.positionOffset_X = num; sleekImageTexture2.positionOffset_Y = (int)(-itemAsset2.size_y * 25); sleekImageTexture2.positionScale_Y = 0.5f; sleekImageTexture2.sizeOffset_X = (int)(itemAsset2.size_x * 50); sleekImageTexture2.sizeOffset_Y = (int)(itemAsset2.size_y * 50); sleek.add(sleekImageTexture2); ItemTool.getIcon(this.blueprint.tool, 100, itemAsset2.getState(), itemAsset2, new ItemIconReady(sleekImageTexture2.updateTexture)); SleekLabel sleekLabel7 = new SleekLabel(); sleekLabel7.positionOffset_X = -100; sleekLabel7.positionOffset_Y = -30; sleekLabel7.positionScale_Y = 1f; sleekLabel7.sizeOffset_X = 100; sleekLabel7.sizeOffset_Y = 30; sleekLabel7.sizeScale_X = 1f; sleekLabel7.foregroundTint = ESleekTint.NONE; sleekLabel7.fontAlignment = 5; sleekLabel7.text = this.blueprint.tools + "/1"; sleekImageTexture2.add(sleekLabel7); SleekLabel sleekLabel8 = sleekLabel; string text = sleekLabel8.text; sleekLabel8.text = string.Concat(new object[] { text, " ", this.blueprint.tools, "/1" }); if (!this.blueprint.hasTool) { sleekLabel7.backgroundColor = Palette.COLOR_R; sleekLabel7.foregroundColor = Palette.COLOR_R; } num += (int)(itemAsset2.size_x * 50 + 25); if (this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel9 = sleekLabel; sleekLabel9.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } if (this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { ItemAsset itemAsset3 = (ItemAsset)Assets.find(EAssetType.ITEM, this.blueprint.outputs[0].id); if (itemAsset3 != null) { SleekLabel sleekLabel10 = sleekLabel; sleekLabel10.text += itemAsset3.itemName; SleekImageTexture sleekImageTexture3 = new SleekImageTexture(); sleekImageTexture3.positionOffset_X = num; sleekImageTexture3.positionOffset_Y = (int)(-itemAsset3.size_y * 25); sleekImageTexture3.positionScale_Y = 0.5f; sleekImageTexture3.sizeOffset_X = (int)(itemAsset3.size_x * 50); sleekImageTexture3.sizeOffset_Y = (int)(itemAsset3.size_y * 50); sleek.add(sleekImageTexture3); ItemTool.getIcon(this.blueprint.outputs[0].id, 100, itemAsset3.getState(), itemAsset3, new ItemIconReady(sleekImageTexture3.updateTexture)); SleekLabel sleekLabel11 = new SleekLabel(); sleekLabel11.positionOffset_X = -100; sleekLabel11.positionOffset_Y = -30; sleekLabel11.positionScale_Y = 1f; sleekLabel11.sizeOffset_X = 100; sleekLabel11.sizeOffset_Y = 30; sleekLabel11.sizeScale_X = 1f; sleekLabel11.foregroundTint = ESleekTint.NONE; sleekLabel11.fontAlignment = 5; if (this.blueprint.type == EBlueprintType.REPAIR) { SleekLabel sleekLabel12 = sleekLabel; string text = sleekLabel12.text; sleekLabel12.text = string.Concat(new object[] { text, " ", this.blueprint.items, "%" }); sleekLabel11.text = this.blueprint.items + "%"; sleekLabel11.backgroundColor = ItemTool.getQualityColor((float)this.blueprint.items / 100f); sleekLabel11.foregroundColor = sleekLabel11.backgroundColor; } else if (this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel13 = sleekLabel; string text = sleekLabel13.text; sleekLabel13.text = string.Concat(new object[] { text, " ", this.blueprint.items, "/", this.blueprint.products }); sleekLabel11.text = this.blueprint.items + "/" + itemAsset3.amount; } if (!this.blueprint.hasItem) { sleekLabel11.backgroundColor = Palette.COLOR_R; sleekLabel11.foregroundColor = Palette.COLOR_R; } sleekImageTexture3.add(sleekLabel11); num += (int)(itemAsset3.size_x * 50 + 25); } } SleekLabel sleekLabel14 = sleekLabel; sleekLabel14.text += " = "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Equals")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; for (int j = 0; j < this.blueprint.outputs.Length; j++) { BlueprintOutput blueprintOutput = this.blueprint.outputs[j]; ItemAsset itemAsset4 = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintOutput.id); if (itemAsset4 != null) { SleekLabel sleekLabel15 = sleekLabel; sleekLabel15.text += itemAsset4.itemName; SleekImageTexture sleekImageTexture4 = new SleekImageTexture(); sleekImageTexture4.positionOffset_X = num; sleekImageTexture4.positionOffset_Y = (int)(-itemAsset4.size_y * 25); sleekImageTexture4.positionScale_Y = 0.5f; sleekImageTexture4.sizeOffset_X = (int)(itemAsset4.size_x * 50); sleekImageTexture4.sizeOffset_Y = (int)(itemAsset4.size_y * 50); sleek.add(sleekImageTexture4); ItemTool.getIcon(blueprintOutput.id, 100, itemAsset4.getState(), itemAsset4, new ItemIconReady(sleekImageTexture4.updateTexture)); SleekLabel sleekLabel16 = new SleekLabel(); sleekLabel16.positionOffset_X = -100; sleekLabel16.positionOffset_Y = -30; sleekLabel16.positionScale_Y = 1f; sleekLabel16.sizeOffset_X = 100; sleekLabel16.sizeOffset_Y = 30; sleekLabel16.sizeScale_X = 1f; sleekLabel16.foregroundTint = ESleekTint.NONE; sleekLabel16.fontAlignment = 5; if (this.blueprint.type == EBlueprintType.REPAIR) { SleekLabel sleekLabel17 = sleekLabel; sleekLabel17.text += " 100%"; sleekLabel16.text = "100%"; sleekLabel16.backgroundColor = Palette.COLOR_G; sleekLabel16.foregroundColor = Palette.COLOR_G; } else if (this.blueprint.type == EBlueprintType.AMMO) { ItemAsset itemAsset5 = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintOutput.id); if (itemAsset5 != null) { SleekLabel sleekLabel18 = sleekLabel; string text = sleekLabel18.text; sleekLabel18.text = string.Concat(new object[] { text, " ", this.blueprint.products, "/", itemAsset5.amount }); sleekLabel16.text = this.blueprint.products + "/" + itemAsset5.amount; } } else { SleekLabel sleekLabel19 = sleekLabel; sleekLabel19.text = sleekLabel19.text + " x" + blueprintOutput.amount; sleekLabel16.text = "x" + blueprintOutput.amount.ToString(); } sleekImageTexture4.add(sleekLabel16); num += (int)(itemAsset4.size_x * 50); if (j < this.blueprint.outputs.Length - 1) { num += 25; SleekLabel sleekLabel20 = sleekLabel; sleekLabel20.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } sleek.positionOffset_X = -num / 2; sleek.sizeOffset_X = num; base.tooltip = sleekLabel.text; this.foregroundTint = ESleekTint.NONE; base.foregroundColor = sleekLabel.foregroundColor; }
// Token: 0x060038D8 RID: 14552 RVA: 0x001A088C File Offset: 0x0019EC8C private static void updateQuest(QuestAsset newQuest, DialogueResponse newResponse, DialogueAsset newAcceptDialogue, DialogueAsset newDeclineDialogue, EQuestViewMode newMode) { PlayerNPCQuestUI.quest = newQuest; PlayerNPCQuestUI.response = newResponse; PlayerNPCQuestUI.acceptDialogue = newAcceptDialogue; PlayerNPCQuestUI.declineDialogue = newDeclineDialogue; PlayerNPCQuestUI.mode = newMode; if (PlayerNPCQuestUI.quest == null) { return; } PlayerNPCQuestUI.beginContainer.isVisible = (PlayerNPCQuestUI.mode == EQuestViewMode.BEGIN); PlayerNPCQuestUI.endContainer.isVisible = (PlayerNPCQuestUI.mode == EQuestViewMode.END); PlayerNPCQuestUI.detailsContainer.isVisible = (PlayerNPCQuestUI.mode == EQuestViewMode.DETAILS); if (PlayerNPCQuestUI.mode == EQuestViewMode.DETAILS) { if (Player.player.quests.TrackedQuestID == PlayerNPCQuestUI.quest.id) { PlayerNPCQuestUI.trackButton.text = PlayerNPCQuestUI.localization.format("Track_Off"); } else { PlayerNPCQuestUI.trackButton.text = PlayerNPCQuestUI.localization.format("Track_On"); } } PlayerNPCQuestUI.nameLabel.text = PlayerNPCQuestUI.quest.questName; string text = PlayerNPCQuestUI.quest.questDescription; text = text.Replace("<br>", "\n"); PlayerNPCQuestUI.descriptionLabel.text = text; int num = Screen.height - 80; int num2 = 0; if (PlayerNPCQuestUI.quest.conditions != null && PlayerNPCQuestUI.quest.conditions.Length > 0) { PlayerNPCQuestUI.conditionsLabel.isVisible = true; PlayerNPCQuestUI.conditionsContainer.isVisible = true; PlayerNPCQuestUI.conditionsContainer.remove(); int num3 = 0; for (int i = 0; i < PlayerNPCQuestUI.quest.conditions.Length; i++) { INPCCondition inpccondition = PlayerNPCQuestUI.quest.conditions[i]; bool flag = inpccondition.isConditionMet(Player.player); Texture2D icon = null; if (PlayerNPCQuestUI.mode != EQuestViewMode.BEGIN) { if (flag) { icon = (Texture2D)PlayerNPCQuestUI.icons.load("Complete"); } else { icon = (Texture2D)PlayerNPCQuestUI.icons.load("Incomplete"); } } Sleek sleek = inpccondition.createUI(Player.player, icon); if (sleek != null) { sleek.positionOffset_Y = num3; PlayerNPCQuestUI.conditionsContainer.add(sleek); num3 += sleek.sizeOffset_Y; } } PlayerNPCQuestUI.conditionsContainer.sizeOffset_Y = num3; num2 += 30; num2 += num3; } else { PlayerNPCQuestUI.conditionsLabel.isVisible = false; PlayerNPCQuestUI.conditionsContainer.isVisible = false; } if (PlayerNPCQuestUI.quest.rewards != null && PlayerNPCQuestUI.quest.rewards.Length > 0) { PlayerNPCQuestUI.rewardsLabel.isVisible = true; PlayerNPCQuestUI.rewardsContainer.isVisible = true; PlayerNPCQuestUI.rewardsContainer.remove(); int num4 = 0; for (int j = 0; j < PlayerNPCQuestUI.quest.rewards.Length; j++) { INPCReward inpcreward = PlayerNPCQuestUI.quest.rewards[j]; Sleek sleek2 = inpcreward.createUI(Player.player); if (sleek2 != null) { sleek2.positionOffset_Y = num4; PlayerNPCQuestUI.rewardsContainer.add(sleek2); num4 += sleek2.sizeOffset_Y; } } PlayerNPCQuestUI.rewardsLabel.positionOffset_Y = num2; PlayerNPCQuestUI.rewardsContainer.positionOffset_Y = num2 + 30; PlayerNPCQuestUI.rewardsContainer.sizeOffset_Y = num4; num2 += 30; num2 += num4; } else { PlayerNPCQuestUI.rewardsLabel.isVisible = false; PlayerNPCQuestUI.rewardsContainer.isVisible = false; } PlayerNPCQuestUI.detailsBox.area = new Rect(0f, 0f, 5f, (float)num2); if (num2 + 105 > num) { PlayerNPCQuestUI.questBox.positionOffset_Y = 0; PlayerNPCQuestUI.questBox.positionScale_Y = 0f; PlayerNPCQuestUI.questBox.sizeOffset_Y = num; PlayerNPCQuestUI.detailsBox.positionOffset_Y = -num + 100; PlayerNPCQuestUI.detailsBox.sizeOffset_Y = num - 105; PlayerNPCQuestUI.detailsBox.sizeOffset_X = -10; } else { PlayerNPCQuestUI.questBox.positionOffset_Y = -num2 / 2 - 80; PlayerNPCQuestUI.questBox.positionScale_Y = 0.5f; PlayerNPCQuestUI.questBox.sizeOffset_Y = num2 + 100; PlayerNPCQuestUI.detailsBox.positionOffset_Y = -5 - num2; PlayerNPCQuestUI.detailsBox.sizeOffset_Y = num2; PlayerNPCQuestUI.detailsBox.sizeOffset_X = 20; } }