|
@@ -91,7 +91,6 @@ public class OsdManager {
|
91
|
91
|
OsdWindow currentWindow = new OsdWindow(message, false,
|
92
|
92
|
IdentityManager.getGlobalConfig().getOptionInt(plugin.getDomain(),
|
93
|
93
|
"locationX"), getYPosition(), plugin, this);
|
94
|
|
-
|
95
|
94
|
windowList.add(currentWindow);
|
96
|
95
|
}
|
97
|
96
|
|
|
@@ -102,9 +101,27 @@ public class OsdManager {
|
102
|
101
|
* @param window The window that we are destroying.
|
103
|
102
|
*/
|
104
|
103
|
public void closeWindow(final OsdWindow window) {
|
|
104
|
+ final String policy = IdentityManager.getGlobalConfig().getOption(
|
|
105
|
+ plugin.getDomain(), "newbehaviour");
|
|
106
|
+ final int startY = IdentityManager.getGlobalConfig().getOptionInt(plugin.getDomain(),
|
|
107
|
+ "locationY");
|
|
108
|
+
|
105
|
109
|
windowList.remove(window);
|
106
|
110
|
window.dispose();
|
107
|
111
|
|
|
112
|
+ synchronized (this) {
|
|
113
|
+ for (OsdWindow otherWindow : getWindowList()) {
|
|
114
|
+ if (otherWindow.isVisible()) {
|
|
115
|
+ if ("down".equals(policy)) {
|
|
116
|
+ otherWindow.setLocation(otherWindow.getX(), Math.max(startY,
|
|
117
|
+ otherWindow.getY() - otherWindow.getHeight() - WINDOW_GAP));
|
|
118
|
+ } else if ("up".equals(policy)) {
|
|
119
|
+ otherWindow.setLocation(otherWindow.getX(), Math.min(startY,
|
|
120
|
+ otherWindow.getY() + otherWindow.getHeight() + WINDOW_GAP));
|
|
121
|
+ }
|
|
122
|
+ }
|
|
123
|
+ }
|
|
124
|
+ }
|
108
|
125
|
displayWindows();
|
109
|
126
|
}
|
110
|
127
|
|
|
@@ -141,7 +158,7 @@ public class OsdManager {
|
141
|
158
|
*
|
142
|
159
|
* @return the Y position for the next window.
|
143
|
160
|
*/
|
144
|
|
- public int getYPosition() {
|
|
161
|
+ private int getYPosition() {
|
145
|
162
|
final String policy = IdentityManager.getGlobalConfig().getOption(
|
146
|
163
|
plugin.getDomain(), "newbehaviour");
|
147
|
164
|
int y = IdentityManager.getGlobalConfig().getOptionInt(plugin.getDomain(),
|