public void AddModInfo(SRModInfo info) { var newobj = Instantiate(infoButtonPrefab); newobj.GetComponent <Button>().onClick.AddListener(() => OnModSelect(info)); newobj.transform.GetChild(0).GetComponent <Text>().text = info.Name; newobj.transform.GetChild(1).GetComponent <Text>().text = $"Version: {info.Version}"; newobj.transform.SetParent(modScrollbarContent.transform, false); }
public override void PreLoad() { SlimeTraitRegistry.Register(new DietTraitProcessor(SRModInfo.GetCurrentInfo().Id, "diet")); SlimeTraitRegistry.Register(new TemperamentTraitProcessor(SRModInfo.GetCurrentInfo().Id, "temperament")); SRCallbacks.OnActorSpawn += SRCallbacks_OnActorSpawn; SRCallbacks.OnSaveGameLoaded += (s) => s.Player.AddComponent <GenomeViewer>(); SaveRegistry.RegisterDataParticipant <GenomeHolder>(); SaveRegistry.RegisterDataParticipant <SlimeGeneticsHandler>(); BindingRegistry.RegisterActions(typeof(ModActions)); TranslationPatcher.AddUITranslation("key.probegenetics", "Probe Genetic Data"); GeneticUI.SetupGeneticUI(); }
public void OnModSelect(SRModInfo info) { modNamePanelText.text = info.Name; authorNameText.gameObject.SetActive(false); descriptionText.gameObject.SetActive(false); if (info.Author != null) { authorNameText.text = "Author: " + info.Author; authorNameText.gameObject.SetActive(true); } if (info.Description != null) { descriptionText.text = "Description: " + info.Description; descriptionText.gameObject.SetActive(true); } }
public void OnModSelect(SRModInfo info) { modNamePanelText.text = info.Name; }