protected virtual void HeaderClicked(Rect headerRect, PawnTable table) { if (!def.sortable || Event.current.shift) { return; } if (Event.current.button == 0) { if (table.SortingBy != def) { table.SortBy(def, descending: true); SoundDefOf.Tick_High.PlayOneShotOnCamera(); } else if (table.SortingDescending) { table.SortBy(def, descending: false); SoundDefOf.Tick_High.PlayOneShotOnCamera(); } else { table.SortBy(null, descending: false); SoundDefOf.Tick_Low.PlayOneShotOnCamera(); } } else if (Event.current.button == 1) { if (table.SortingBy != def) { table.SortBy(def, descending: false); SoundDefOf.Tick_High.PlayOneShotOnCamera(); } else if (table.SortingDescending) { table.SortBy(null, descending: false); SoundDefOf.Tick_Low.PlayOneShotOnCamera(); } else { table.SortBy(def, descending: true); SoundDefOf.Tick_High.PlayOneShotOnCamera(); } } }
protected virtual void HeaderClicked(Rect headerRect, PawnTable table) { if (this.def.sortable && !Event.current.shift) { if (Event.current.button == 0) { if (table.SortingBy != this.def) { table.SortBy(this.def, true); SoundDefOf.Tick_High.PlayOneShotOnCamera(null); } else if (table.SortingDescending) { table.SortBy(this.def, false); SoundDefOf.Tick_High.PlayOneShotOnCamera(null); } else { table.SortBy(null, false); SoundDefOf.Tick_Low.PlayOneShotOnCamera(null); } } else if (Event.current.button == 1) { if (table.SortingBy != this.def) { table.SortBy(this.def, false); SoundDefOf.Tick_High.PlayOneShotOnCamera(null); } else if (table.SortingDescending) { table.SortBy(null, false); SoundDefOf.Tick_Low.PlayOneShotOnCamera(null); } else { table.SortBy(this.def, true); SoundDefOf.Tick_High.PlayOneShotOnCamera(null); } } } }