aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java
blob: 7cc02885cb4f7da981bc02cf711679bc642faf49 (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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
/*
 * 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 io.github.moulberry.notenoughupdates.miscgui.customtodos.CustomTodo;
import io.github.moulberry.notenoughupdates.miscgui.customtodos.CustomTodoHud;

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

public class OverlayManager {
	public static ArrayList<Class<? extends TextOverlay>> dontRenderOverlay = new ArrayList<>();

	public static MiningOverlay miningOverlay;
	public static PowderGrindingOverlay powderGrindingOverlay;
	public static FarmingSkillOverlay 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 FuelBarDummy fuelBar;
	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",
			"\u00a73Crimson Isle Quests: \u00a7e3h38m",
			"\u00a73NPC Buy Daily Limit: \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));
				}
				for (CustomTodo customTodo : NotEnoughUpdates.INSTANCE.config.hidden.customTodos) {
					if (customTodo.isEnabledOnCurrentProfile()) {
						strings.add(CustomTodoHud.INSTANCE.encodeCustomItem(customTodo.getIcon()) + ":§3" + customTodo.getLabel() + ":§a Ready!");
					}
				}
				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(
			"§3Goblin Slayer: §626.5%\n§3Lucky Raffle: §c0.0%",
			"§3Mithril: §26,243\n§3Gemstone: §d37,354",
			"§3Forge 1) §9Diamonite§7: §aReady!",
			"§3Forge 2) §7EMPTY",
			"§3Pickaxe CD: §a43s",
			"§3Star Cult: §a1h14m48s",
			"§3Sky Mall: §a5x §9Titanium drops §a(14m2s)"
		);
		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> powderGrindingDummy = Lists.newArrayList(
			"\u00a73Chests Found: \u00a7a13",
			"\u00a73Opened Chests: \u00a7a11",
			"\u00a73Unopened Chests: \u00a7c2",
			"\u00a73Mithril Powder Found: \u00a726,243",
			"\u00a73Average Mithril Powder/Chest: \u00a72568",
			"\u00a73Gemstone Powder Found: \u00a7d6,243",
			"\u00a73Average Gemstone Powder/Chest: \u00a7d568"
		);
		powderGrindingOverlay =
			new PowderGrindingOverlay(NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerPosition, () -> {
				List<String> strings = new ArrayList<>();
				for (int i : NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerText) {
					if (i >= 0 && i < powderGrindingDummy.size()) strings.add(powderGrindingDummy.get(i));
				}
				return strings;
			}, () -> {
				int style = NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerOverlayStyle;
				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",
			"\u00a7bFarming: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129",
			"\u00a7bYaw: \u00a7e68.25\u00a7l\u00b0"
		);
		farmingOverlay = new FarmingSkillOverlay(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",
			"\u00a7bMining: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
			"\u00a7bCurrent XP: \u00a7e6,734",
			"\u00a7bRemaining XP: \u00a7e3,265",
			"\u00a7bXP/h: \u00a7e238,129",
			"\u00a7bYaw: \u00a7e68.25\u00a7l\u00b0"
		);
		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\u00b0"
		);
		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 >=