static void ButtonHelper(Listing_Standard listing, Dialog_ManageAreas dialog) { FieldInfo mapField = AccessTools.Field(typeof(Dialog_ManageAreas), "map"); Map map = (Map)mapField.GetValue(dialog); if (listing.ButtonText("ManageWorkAreaPriorities".Translate(), null)) { map.GetComponent <AreaPriorityManager> ().LaunchDialog_ManageWorkAreaPriorities(); dialog.Close(false); } }