aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java
blob: d73c71dcd45dede9e1a6536b48a2413427e2580c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
/*
 * Copyright (C) 2022 NotEnoughUpdates contributors
 *
 * This file is part of NotEnoughUpdates.
 *
 * NotEnoughUpdates is free software: you can redistribute it
 * and/or modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * NotEnoughUpdates is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
 */

package io.github.moulberry.notenoughupdates.overlays;

import com.google.common.collect.Lists;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay;

import java.util.ArrayList;
import java.util.List;

public class OverlayManager {
	public static Class<? extends TextOverlay> dontRenderOverlay = null;

	public static MiningOverlay miningOverlay;
	public static FarmingOverlay farmingOverlay;
	public static FishingSkillOverlay fishingSkillOverlay;
	public static MiningSkillOverlay miningSkillOverlay;
	public static CombatSkillOverlay combatSkillOverlay;
	public static PetInfoOverlay petInfoOverlay;
	public static TimersOverlay timersOverlay;
	public static BonemerangOverlay bonemerangOverlay;
	public static CrystalHollowOverlay crystalHollowOverlay;
	public static SlayerOverlay slayerOverlay;
	public static final List<TextOverlay> textOverlays = new ArrayList<>();

	static {
		List<String> todoDummy = Lists.newArrayList(
			"\u00a73Cakes: \u00a7eInactive!",
			"\u00a73Cookie Buff: \u00a7eInactive!",
			"\u00a73Godpot: \u00a7eInactive!",
			"\u00a73Puzzler: \u00a7eReady!",
			"\u00a73Fetchur: \u00a7eReady!",
			"\u00a73Commissions: \u00a7eReady!",
			"\u00a73Experiments: \u00a7eReady!",
			"\u00a73Mithril Powder: \u00a7eReady",
			"\u00a73Gemstone Powder: \u00a7eReady",
			"\u00a73Cakes: \u00a7e1d21h",
			"\u00a73Cookie Buff: \u00a7e2d23h",
			"\u00a73Godpot: \u00a7e19h",
			"\u00a73Puzzler: \u00a7e13h",
			"\u00a73Fetchur: \u00a7e3h38m",
			"\u00a73Commissions: \u00a7e3h38m",
			"\u00a73Experiments: \u00a7e3h38m",
			"\u00a73Mithril Powder: \u00a7e3h38m",
			"\u00a73Gemstone Powder: \u00a7e3h38m"
		);
		textOverlays.add(
			timersOverlay = new TimersOverlay(NotEnoughUpdates.INSTANCE.config.miscOverlays.todoPosition, () -> {
				List<String> strings = new ArrayList<>();
				for (int i : NotEnoughUpdates.INSTANCE.config.miscOverlays.todoText2) {
					if (i >= 0 && i < todoDummy.size()) strings.add(todoDummy.get(i));
				}
				return strings;
			}, () -> {
				int style = NotEnoughUpdates.INSTANCE.config.miscOverlays.todoStyle;
				if (style >= 0 && style < TextOverlayStyle.values().length) {
					return TextOverlayStyle.values()[style];
				}
				return TextOverlayStyle.BACKGROUND;
			}));

		List<String> miningDummy = Lists.newArrayList(
			"\u00a73Goblin Slayer: \u00a7626.5%\n\u00a73Lucky Raffle: \u00a7c0.0%",
			"\u00a73Mithril Powder: \u00a726,243",
			"\u00a73Forge 1) \u00a79Diamonite\u00a77: \u00a7aReady!",
			"\u00a73Forge 2) \u00a77EMPTY\n\u00a73Forge 3) \u00a77EMPTY\n\u00a73Forge 4) \u00a77EMPTY"
		);
		miningOverlay = new MiningOverlay(NotEnoughUpdates.INSTANCE.config.mining.overlayPosition, () -> {
			List<String> strings = new ArrayList<>();
			for (int i : NotEnoughUpdates.INSTANCE.config.mining.dwarvenText2) {
				if (i >= 0 && i < miningDummy.size()) strings.add(miningDummy.get(i));
			}
			return strings;
		}, () -> {
			int style = NotEnoughUpdates.INSTANCE.config.mining.overlayStyle;
			if (style >= 0 && style < TextOverlayStyle.values().length) {
				return TextOverlayStyle.values()[style];
			}
			return TextOverlayStyle.BACKGROUND;
		});

		List<String> farmingDummy = Lists.newArrayList(
			"\u00a7bCounter: \u00a7e37,547,860",
			"\u00a7bCrops/m: \u00a7e38.29",
			"\u00a7bFarm: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129",
			"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52"
		);
		farmingOverlay = new FarmingOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingPosition, () -> {
			List<String> strings = new ArrayList<>();
			for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingText) {
				if (i >= 0 && i < farmingDummy.size()) strings.add(farmingDummy.get(i));
			}
			return strings;
		}, () -> {
			int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingStyle;
			if (style >= 0 && style < TextOverlayStyle.values().length) {
				return TextOverlayStyle.values()[style];
			}
			return TextOverlayStyle.BACKGROUND;
		});
		List<String> miningSkillDummy = Lists.newArrayList(
			"\u00a7bCompact: \u00a7e547,860",
			"\u00a7bBlocks/m: \u00a7e38.29",
			"\u00a7bMine: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129",
			"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52"
		);
		miningSkillOverlay = new MiningSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.miningPosition, () -> {
			List<String> strings = new ArrayList<>();
			for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.miningText) {
				if (i >= 0 && i < miningSkillDummy.size()) strings.add(miningSkillDummy.get(i));
			}
			return strings;
		}, () -> {
			int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.miningStyle;
			if (style >= 0 && style < TextOverlayStyle.values().length) {
				return TextOverlayStyle.values()[style];
			}
			return TextOverlayStyle.BACKGROUND;
		});
		List<String> fishingDummy = Lists.newArrayList(
			"\u00a7bCatches: \u00a7e37,547,860",
			//"\u00a7bCatches/m: \u00a7e38.29",
			"\u00a7bFish: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129"
			//"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52"
		);
		fishingSkillOverlay =
			new FishingSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingPosition, () -> {
				List<String> strings = new ArrayList<>();
				for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingText) {
					if (i >= 0 && i < fishingDummy.size()) strings.add(fishingDummy.get(i));
				}
				return strings;
			}, () -> {
				int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingStyle;
				if (style >= 0 && style < TextOverlayStyle.values().length) {
					return TextOverlayStyle.values()[style];
				}
				return TextOverlayStyle.BACKGROUND;
			});
		List<String> combatSkillDummy = Lists.newArrayList(
			"\u00a7bKills: \u00a7e547,860",
			"\u00a7bCombat: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129",
			"\u00a7bETA: \u00a7e13h12m"
		);
		combatSkillOverlay = new CombatSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.combatPosition, () -> {
			List<String> strings = new ArrayList<>();
			for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.combatText) {
				if (i >= 0 && i < combatSkillDummy.size()) strings.add(combatSkillDummy.get(i));
			}
			return strings;
		}, () -> {
			int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.combatStyle;
			if (style >= 0 && style < TextOverlayStyle.values().length) {
				return TextOverlayStyle.values()[style];
			}
			return TextOverlayStyle.BACKGROUND;
		});
		List<String> petInfoDummy = Lists.newArrayList(
			"\u00a7a[Lvl 37] \u00a7fRock",
			"\u00a7b2,312.9/2,700\u00a7e (85.7%)",
			"\u00a7b2.3k/2.7k\u00a7e (85.7%)",
			"\u00a7bXP/h: \u00a7e27,209",
			"\u00a7bTotal XP: \u00a7e30,597.9",
			"\u00a7bHeld Item: \u00a7fMining Exp Boost",
			"\u00a7bUntil L38: \u00a7e5m13s",
			"\u00a7bUntil L100: \u00a7e2d13h"
		);
		petInfoOverlay = new PetInfoOverlay(NotEnoughUpdates.INSTANCE.config.petOverlay.petInfoPosition, () -> {
			List<String> strings = new ArrayList<>();
			for (int i : NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayText) {
				if (i >= 0 &&