本文整理匯總了Java中net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractListDialogBuilder類的具體用法?Java AbstractListDialogBuilder怎麽用?Java AbstractListDialogBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractListDialogBuilder類屬於net.gtaun.shoebill.common.dialog.ListDialog包,在下文中一共展示了AbstractListDialogBuilder類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1:
import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //導入依賴的package包/類
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, VehicleComponentSlot slot)
{
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
int modelId = vehicle.getModelId();
String name = VehicleModel.getName(modelId);
Set<Integer> components = VehicleComponentModel.getSlotSupportedComponents(modelId, slot);
String slotName = VehicleTextUtils.getComponentSlotName(stringSet, slot);
return WlListDialog.create(player, eventManager)
.parentDialog(parent)
.caption(stringSet.format("Dialog.VehicleComponentAddDialog.Caption", name, slotName))
.execute((b) ->
{
for (int cid : components)
{
String componentName = VehicleComponentModel.getName(cid);
String itemText = stringSet.format("Dialog.VehicleComponentAddDialog.Item", slotName, componentName);
// XXX: Buggy Eclipse JDT Compiler
((AbstractListDialogBuilder<?,?>) b).item(itemText, (i) ->
{
stringSet.sendMessage(Color.LIGHTBLUE, "Dialog.VehicleComponentAddDialog.AddMessage", name, slotName, componentName);
vehicle.getComponent().add(cid);
});
}
})
.onClickOk((d, i) ->
{
player.playSound(1133);
d.showParentDialog();
})
.build();
}
示例2: NullPointerException
import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //導入依賴的package包/類
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, int color1)
{
if (vehicle == null) throw new NullPointerException();
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
String type = stringSet.get("Component.Color.Primary");
if (color1 != -1) type = stringSet.get("Component.Color.Secondary");
int modelId = vehicle.getModelId();
String name = VehicleModel.getName(modelId);
String colorBlock = stringSet.get("Dialog.VehicleResprayGroupDialog.ColorBlockText");
return WlListDialog.create(player, eventManager)
.parentDialog(parent)
.caption(stringSet.format("Dialog.VehicleResprayGroupDialog.Caption", name, type, modelId, vehicle.getHealth()/10))
.execute((b) ->
{
for (int i=0; i<VEHICLE_COLOR_TABLE_RGBA.length; i+=10)
{
int index = i;
int max = i+10 > VEHICLE_COLOR_TABLE_RGBA.length ? VEHICLE_COLOR_TABLE_RGBA.length : i+10;
String item = stringSet.get("Dialog.VehicleResprayGroupDialog.Item");
for (int j=i; j<max; j++)
{
item += new Color(VEHICLE_COLOR_TABLE_RGBA[j]).toEmbeddingString() + colorBlock;
if (j != max-1) item += " ";
}
// XXX: Buggy Eclipse JDT Compiler
((AbstractListDialogBuilder<?, ?>) b).item(item, (listItem) -> VehicleResprayDialog.create(player, eventManager, listItem.getCurrentDialog(), vehicle, service, index, max, color1).show());
}
})
.onClickOk((d, i) -> player.playSound(1083))
.build();
}
示例3: Color
import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //導入依賴的package包/類
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, int start, int end, int color1)
{
if (vehicle == null) return null;
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
int modelId = vehicle.getModelId();
String name = VehicleModel.getName(modelId);
String type = stringSet.get("Component.Color.Primary");
if (color1 != -1) type = stringSet.get("Component.Color.Secondary");
return WlListDialog.create(player, eventManager)
.parentDialog(parent)
.caption(stringSet.format("Dialog.VehicleResprayDialog.Caption", name, type, modelId, vehicle.getHealth()/10))
.execute((b) ->
{
for (int i=start; i<end; i++)
{
final int idx = i;
String item = stringSet.format("Dialog.VehicleResprayDialog.Item", new Color(VehicleResprayGroupDialog.VEHICLE_COLOR_TABLE_RGBA[idx]).toEmbeddingString(), idx);
// XXX: Buggy Eclipse JDT Compiler
((AbstractListDialogBuilder<?, ?>) b).item(item, (listItem) ->
{
if (color1 == -1) VehicleResprayGroupDialog.create(player, eventManager, listItem.getCurrentDialog(), vehicle, service, idx).show();
else player.getVehicle().setColor(color1, idx);
});
}
})
.onClickOk((d, i) -> player.playSound(1083))
.build();
}
示例4: create
import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //導入依賴的package包/類
public static WlListDialog create(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service)
{
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
int modelId = vehicle.getModelId();
String name = VehicleModel.getName(modelId);
return WlListDialog.create(player, eventManager)
.parentDialog(parent)
.caption((d) -> stringSet.format("Dialog.VehicleComponentDialog.Caption", name, modelId, vehicle.getHealth()/10))
.execute((b) ->
{
String paintjobItem = stringSet.get("Component.Paintjob");
// XXX: Buggy Eclipse JDT Compiler
if (VehicleModel.isPaintjobSupported(modelId)) ((AbstractListDialogBuilder<?, ?>) b).item(paintjobItem, (i) ->
{
new VehicleComponentPaintjobDialog(player, eventManager, i.getCurrentDialog(), vehicle, service).show();
});
for (VehicleComponentSlot slot : VehicleComponentModel.getVehicleSupportedSlots(modelId))
{
Set<Integer> components = VehicleComponentModel.getSlotSupportedComponents(modelId, slot);
String slotName = VehicleTextUtils.getComponentSlotName(stringSet, slot);
String curName = VehicleComponentModel.getName(vehicle.getComponent().get(slot));
String itemText = stringSet.format("Dialog.VehicleComponentDialog.Item", slotName, curName, components.size());
// XXX: Buggy Eclipse JDT Compiler
((AbstractListDialogBuilder<?, ?>) b).item(itemText, (i) ->
{
VehicleComponentAddDialog.create(player, eventManager, i.getCurrentDialog(), vehicle, service, slot).show();
});
}
})
.onClickOk((d, i) ->
{
player.playSound(1083);
})
.onShow((d) ->
{
if (player.getVehicle() == vehicle) return;
Location loc = vehicle.getLocation();
player.setCameraLookAt(loc);
loc.setZ(loc.getZ() + 10.0f);
player.setCameraPosition(loc);
})
.onClose((d, t) ->
{
if (player.getVehicle() == vehicle) return;
player.setCameraBehind();
})
.build();
}