public void SetTech(App app, int TechID) { this._techID = TechID; string techid = app.GameDatabase.GetTechFileID(this._techID); int techId = this._techID; app.GameDatabase.GetPlayerTechInfo(app.LocalPlayer.ID, techId); Kerberos.Sots.Data.TechnologyFramework.Tech tech = app.AssetDatabase.MasterTechTree.Technologies.First <Kerberos.Sots.Data.TechnologyFramework.Tech>((Func <Kerberos.Sots.Data.TechnologyFramework.Tech, bool>)(x => x.Id == techid)); string spriteName1 = ResearchInfoPanel.IconTextureToSpriteName(tech.Icon); string spriteName2 = ResearchInfoPanel.IconTextureToSpriteName(app.AssetDatabase.MasterTechTree.TechFamilies.First <TechFamily>((Func <TechFamily, bool>)(x => x.Id == tech.Family)).Icon); app.UI.SetPropertyString("tech_title", "text", App.Localize("@TECH_NAME_" + tech.Id)); app.UI.SetPropertyString("techicon", "sprite", spriteName1); app.UI.SetPropertyString("familyicon", "sprite", spriteName2); app.UI.SetText("tech_desc", App.Localize("@TECH_DESC_" + tech.Id)); LogicalWeapon weaponUnlockedByTech = this.GetWeaponUnlockedByTech(app, tech); if (weaponUnlockedByTech != null) { app.UI.SetVisible("TechWeaponDetails", true); this._weaponinfopanel.SetWeapons(weaponUnlockedByTech, (LogicalWeapon)null); } else { app.UI.SetVisible("TechWeaponDetails", false); } }
public override void Initialize() { PlayerTechInfo pti = this._app.GameDatabase.GetPlayerTechInfo(this._app.LocalPlayer.ID, this._event.TechID); this._app.UI.SetText(this._app.UI.Path(this.ID, "feasible_title"), string.Format(App.Localize("@FEASIBILITY_RESULT"), (object)this._app.AssetDatabase.GetLocalizedTechnologyName(this._app.AssetDatabase.MasterTechTree.Technologies.First <Tech>((Func <Tech, bool>)(x => x.Id == pti.TechFileID)).Id), (object)this._event.FeasibilityPercent)); this._app.UI.SetText(this._app.UI.Path(this.ID, "feasible_details"), this._event.GetEventMessage(this._app.Game)); this._researchInfo = new ResearchInfoPanel(this._app.UI, this._app.UI.Path(this.ID, "research_details")); this._researchInfo.SetTech(this._app, this._event.TechID); }
public override void Initialize() { this._app.UI.SetVisible("navTechInfo", false); string pti = this._app.GameDatabase.GetTechFileID(this._techID); this._app.AssetDatabase.MasterTechTree.Technologies.First <Tech>((Func <Tech, bool>)(x => x.Id == pti)); this._app.UI.SetText(this._app.UI.Path(this.ID, "subheader"), "Stole intel from " + this._targetPlayer.Name); this._researchInfo = new ResearchInfoPanel(this._app.UI, this._app.UI.Path(this.ID, "research_details")); this._researchInfo.SetTech(this._app, this._techID); this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "playerAvatar"), "sprite", Path.GetFileNameWithoutExtension(this._targetPlayer.AvatarAssetPath)); this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "playerBadge"), "sprite", Path.GetFileNameWithoutExtension(this._targetPlayer.BadgeAssetPath)); }
public override void Initialize() { if (ScriptHost.AllowConsole) { this._app.UI.SetVisible("navTechInfo", true); } else { this._app.UI.SetVisible("navTechInfo", false); } PlayerTechInfo pti = this._app.GameDatabase.GetPlayerTechInfo(this._app.LocalPlayer.ID, this._techID); Tech tech = this._app.AssetDatabase.MasterTechTree.Technologies.First <Tech>((Func <Tech, bool>)(x => x.Id == pti.TechFileID)); this._app.UI.SetText(this._app.UI.Path(this.ID, "research_title"), this._app.AssetDatabase.GetLocalizedTechnologyName(tech.Id)); if (!this._app.UserProfile.ResearchedTechs.Contains(tech.Id)) { this._app.UserProfile.ResearchedTechs.Add(tech.Id); } this._researchInfo = new ResearchInfoPanel(this._app.UI, this._app.UI.Path(this.ID, "research_details")); this._researchInfo.SetTech(this._app, this._techID); }