Added greater coverage for CUI for region adjustments.

This commit is contained in:
sk89q
2011-03-12 02:27:43 -08:00
parent 9151f8b6bf
commit 94ab610da7
7 changed files with 129 additions and 81 deletions

View File

@@ -530,21 +530,34 @@ public class LocalSession {
}
if (selector != null) {
player.dispatchCUIEvent(
new SelectionShapeEvent(selector.getTypeId()));
dispatchCUISelection(player);
}
}
/**
* Send the selection information.
*
* @param player
*/
public void dispatchCUISelection(LocalPlayer player) {
if (!hasCUISupport) {
return;
}
player.dispatchCUIEvent(
new SelectionShapeEvent(selector.getTypeId()));
if (selector instanceof CUIPointBasedRegion) {
Vector[] points = ((CUIPointBasedRegion) selector).getCUIPoints();
int size = selector.getArea();
if (selector instanceof CUIPointBasedRegion) {
Vector[] points = ((CUIPointBasedRegion) selector).getCUIPoints();
int size = selector.getArea();
int i = 0;
for (Vector pt : points) {
if (pt != null) {
player.dispatchCUIEvent(
new SelectionPointEvent(i, pt, size));
}
i++;
int i = 0;
for (Vector pt : points) {
if (pt != null) {
player.dispatchCUIEvent(
new SelectionPointEvent(i, pt, size));
}
i++;
}
}
}