Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicFilter.java

38 lines
1.7 KiB
Java
Raw Normal View History

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;
public class NavigatorPublicFilter extends NavigatorFilter
{
public final static String name = "official_view";
public NavigatorPublicFilter()
{
super(name);
}
@Override
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-07-06 15:30:00 +02:00
List<SearchResultList> resultLists = new ArrayList<SearchResultList>();
int i = 0;
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().getRoomManager().getPublicRooms(), false, showInvisible));
i++;
for (NavigatorPublicCategory category : Emulator.getGameEnvironment().getNavigatorManager().publicCategories.values())
{
if (!category.rooms.isEmpty())
{
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));
i++;
}
}
return resultLists;
}
}