2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.habbohotel.navigation;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
2018-09-12 18:45:00 +02:00
|
|
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
2018-07-06 15:30:00 +02:00
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public class NavigatorPublicFilter extends NavigatorFilter {
|
2018-07-06 15:30:00 +02:00
|
|
|
public final static String name = "official_view";
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public NavigatorPublicFilter() {
|
2018-07-06 15:30:00 +02:00
|
|
|
super(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 20:14:53 +02:00
|
|
|
public List<SearchResultList> getResult(Habbo habbo) {
|
2018-09-12 18:45:00 +02:00
|
|
|
boolean showInvisible = habbo.hasPermission("acc_enter_anyroom") || habbo.hasPermission(Permission.ACC_ANYROOMOWNER);
|
2018-09-28 21:25:00 +02:00
|
|
|
List<SearchResultList> resultLists = new ArrayList<>();
|
2019-05-27 21:28:30 +02:00
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
int i = 0;
|
2019-05-27 21:28:30 +02:00
|
|
|
resultLists.add(new SearchResultList(i, "official-root", "", SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory("official-root", ListMode.THUMBNAILS), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory("official-root"), Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("official-root", habbo), false, showInvisible, DisplayOrder.ORDER_NUM, -1));
|
2018-07-06 15:30:00 +02:00
|
|
|
i++;
|
2019-05-27 21:28:30 +02:00
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
for (NavigatorPublicCategory category : Emulator.getGameEnvironment().getNavigatorManager().publicCategories.values()) {
|
|
|
|
if (!category.rooms.isEmpty()) {
|
2018-11-17 14:28:00 +01:00
|
|
|
resultLists.add(new SearchResultList(i, "", category.name, SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory(category.name, category.image), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory(category.name), category.rooms, true, showInvisible, DisplayOrder.ACTIVITY, category.order));
|
2018-07-06 15:30:00 +02:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return resultLists;
|
|
|
|
}
|
|
|
|
}
|