Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 588c5c3

Browse files
authored
Leveling Mode (#7)
1 parent d2f42e0 commit 588c5c3

File tree

10 files changed

+332
-272
lines changed

10 files changed

+332
-272
lines changed

Manager/Sources/RDMUICManager/BuildController.swift

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Created by Florian Kostenzer on 28.11.18.
66
//
7-
// swiftlint:disable type_body_length function_body_length cyclomatic_complexity
7+
// swiftlint:disable type_body_length function_body_length
88
//
99

1010
import Foundation
@@ -243,37 +243,20 @@ class BuildController {
243243
outputPipe.fileHandleForReading.readabilityHandler = { fileHandle in
244244
let string = String(data: fileHandle.availableData, encoding: .utf8)
245245
if string != nil && string!.trimmingCharacters(in: .whitespacesAndNewlines) != "" {
246-
if string!.contains(string: "[STATUS] Started") && locked {
247-
Log.debug(message: "[\(device.name)] Done building")
248-
self.setStatus(uuid: device.uuid, status: "Running: Starting")
249-
locked = false
250-
self.buildLock.lock()
251-
self.buildingCount -= 1
252-
self.buildLock.unlock()
253-
}
254-
if string!.contains(string: "[STATUS] Startup") {
255-
self.setStatus(uuid: device.uuid, status: "Running: Startup")
256-
}
257-
if string!.contains(string: "[STATUS] Logout") {
258-
self.setStatus(uuid: device.uuid, status: "Running: Logout")
259-
}
260-
if string!.contains(string: "[STATUS] Login") {
261-
self.setStatus(uuid: device.uuid, status: "Running: Login")
262-
}
263-
if string!.contains(string: "[STATUS] Tutorial") {
264-
self.setStatus(uuid: device.uuid, status: "Running: Tutorial")
265-
}
266-
if string!.contains(string: "[STATUS] Pokemon") {
267-
self.setStatus(uuid: device.uuid, status: "Running: Pokemon")
268-
}
269-
if string!.contains(string: "[STATUS] Raid") {
270-
self.setStatus(uuid: device.uuid, status: "Running: Raid")
271-
}
272-
if string!.contains(string: "[STATUS] Quest") {
273-
self.setStatus(uuid: device.uuid, status: "Running: Quest")
274-
}
275-
if string!.contains(string: "[STATUS] IV") {
276-
self.setStatus(uuid: device.uuid, status: "Running: IV")
246+
for line in string!.components(separatedBy: .newlines) {
247+
if line.contains(string: "[STATUS] Started") && locked {
248+
Log.debug(message: "[\(device.name)] Done building")
249+
self.setStatus(uuid: device.uuid, status: "Running: Starting")
250+
locked = false
251+
self.buildLock.lock()
252+
self.buildingCount -= 1
253+
self.buildLock.unlock()
254+
} else if line.starts(with: "[STATUS]") {
255+
self.setStatus(
256+
uuid: device.uuid,
257+
status: line.replacingOccurrences(of: "[STATUS] ", with: "")
258+
)
259+
}
277260
}
278261

279262
fullLog.uic(message: string!, all: true)

RealDeviceMap-UIControl/.idea/RealDeviceMap-UIControl.iml

Lines changed: 0 additions & 11 deletions
This file was deleted.

RealDeviceMap-UIControl/.idea/misc.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

RealDeviceMap-UIControl/.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

RealDeviceMap-UIControl/.idea/workspace.xml

Lines changed: 0 additions & 105 deletions
This file was deleted.

RealDeviceMap-UIControl/DeviceConfig/DeviceConfigProtocol.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ protocol DeviceConfigProtocol {
117117
var openQuest: DeviceCoordinate { get }
118118
/** First delete quests button. */
119119
var questDelete: DeviceCoordinate { get }
120-
/** Color of the top quest rectangle. */
121-
var questFilledColor1: DeviceCoordinate { get }
122120
/** First delete Quest Button if stacked Encounter is present */
123121
var questDeleteWithStack: DeviceCoordinate { get }
124-
/** Color of the top quest rectangle if stacked Encounter is present. */
125-
var questFilledColorWithStack1: DeviceCoordinate { get }
126122
/** Green confirm quest deletion button */
127123
var questDeleteConfirm: DeviceCoordinate { get }
124+
/** Check for the pokeball on Willow's desk. */
125+
var questWillow: DeviceCoordinate { get }
126+
/** Third delete Quest Button if stacked Encounter is present */
127+
var questDeleteThirdSlot: DeviceCoordinate { get }
128128

129129
// MARK: - Item Clearing
130130

@@ -146,6 +146,12 @@ protocol DeviceConfigProtocol {
146146
var itemEggMenuItem: DeviceCoordinate { get }
147147
/** Tap Location for Egg Deployment */
148148
var itemEggDeploy: DeviceCoordinate { get }
149+
/** The Y values for all item delete buttons. */
150+
var itemIncenseYs: [Int] { get }
151+
/** Free Pass OK button. */
152+
var itemFreePass: DeviceCoordinate { get }
153+
/** Gift info OK button. */
154+
var itemGiftInfo: DeviceCoordinate { get }
149155

150156
// MARK: - Login
151157

RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1333.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,21 +186,21 @@ class DeviceRatio1333: DeviceConfigProtocol {
186186
var questDelete: DeviceCoordinate {
187187
return DeviceCoordinate(x: 1434, y: 1272, scaler: scaler)
188188
}
189-
var questFilledColor1: DeviceCoordinate {
190-
return DeviceCoordinate(x: 108, y: 1258, scaler: scaler)
191-
}
192189
var questDeleteWithStack: DeviceCoordinate {
193190
return DeviceCoordinate(x: 1445, y: 1677, scaler: scaler)
194191
}
195-
var questFilledColorWithStack1: DeviceCoordinate {
196-
return DeviceCoordinate(x: 108, y: 1665, scaler: scaler)
197-
}
198192
var questDeleteConfirm: DeviceCoordinate {
199193
return DeviceCoordinate(x: 768, y: 1143, scaler: scaler)
200194
}
201195
var openItems: DeviceCoordinate {
202196
return DeviceCoordinate(x: 1165, y: 1620, scaler: scaler)
203197
}
198+
var questWillow: DeviceCoordinate {
199+
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
200+
}
201+
var questDeleteThirdSlot: DeviceCoordinate {
202+
return DeviceCoordinate(x: 1445, y: 2030, scaler: scaler) //not accurate
203+
}
204204

205205
// MARK: - Item Clearing
206206

@@ -235,6 +235,21 @@ class DeviceRatio1333: DeviceConfigProtocol {
235235
scaler.scaleY(y: 2010)
236236
]
237237
}
238+
var itemIncenseYs: [Int] {
239+
return [
240+
scaler.scaleY(y: 0),
241+
scaler.scaleY(y: 0),
242+
scaler.scaleY(y: 0),
243+
scaler.scaleY(y: 0),
244+
scaler.scaleY(y: 0)
245+
]
246+
}
247+
var itemFreePass: DeviceCoordinate {
248+
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
249+
}
250+
var itemGiftInfo: DeviceCoordinate {
251+
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
252+
}
238253

239254
// MARK: - Login
240255

RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1775.swift

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ class DeviceRatio1775: DeviceConfigProtocol {
169169
return DeviceCoordinate(x: 320, y: 585, scaler: scaler)
170170
}
171171
var rocketLogoGirl: DeviceCoordinate {
172-
return DeviceCoordinate(x: 390, y: 468, scaler: scaler)
172+
return DeviceCoordinate(x: 350, y: 500, scaler: scaler)
173173
}
174174
var rocketLogoGuy: DeviceCoordinate {
175-
return DeviceCoordinate(x: 302, y: 463, scaler: scaler)
175+
return DeviceCoordinate(x: 254, y: 484, scaler: scaler)
176176
}
177177
var closeInvasion: DeviceCoordinate {
178178
return DeviceCoordinate(x: 320, y: 1000, scaler: scaler)
@@ -186,21 +186,21 @@ class DeviceRatio1775: DeviceConfigProtocol {
186186
var questDelete: DeviceCoordinate {
187187
return DeviceCoordinate(x: 596, y: 570, scaler: scaler)
188188
}
189-
var questFilledColor1: DeviceCoordinate {
190-
return DeviceCoordinate(x: 44, y: 567, scaler: scaler)
191-
}
192189
var questDeleteWithStack: DeviceCoordinate {
193190
return DeviceCoordinate(x: 596, y: 739, scaler: scaler)
194191
}
195-
var questFilledColorWithStack1: DeviceCoordinate {
196-
return DeviceCoordinate(x: 44, y: 736, scaler: scaler)
197-
}
198192
var questDeleteConfirm: DeviceCoordinate {
199193
return DeviceCoordinate(x: 320, y: 620, scaler: scaler)
200194
}
201195
var openItems: DeviceCoordinate {
202196
return DeviceCoordinate(x: 500, y: 950, scaler: scaler)
203197
}
198+
var questWillow: DeviceCoordinate {
199+
return DeviceCoordinate(x: 50, y: 1125, scaler: scaler)
200+
}
201+
var questDeleteThirdSlot: DeviceCoordinate {
202+
return DeviceCoordinate(x: 600, y: 860, scaler: scaler)
203+
}
204204

205205
// MARK: - Item Clearing
206206

@@ -234,6 +234,21 @@ class DeviceRatio1775: DeviceConfigProtocol {
234234
scaler.scaleY(y: 1124)
235235
]
236236
}
237+
var itemIncenseYs: [Int] {
238+
return [
239+
scaler.scaleY(y: 232),
240+
scaler.scaleY(y: 460),
241+
scaler.scaleY(y: 687),
242+
scaler.scaleY(y: 914),
243+
scaler.scaleY(y: 1141)
244+
]
245+
}
246+
var itemFreePass: DeviceCoordinate {
247+
return DeviceCoordinate(x: 320, y: 930, scaler: scaler)
248+
}
249+
var itemGiftInfo: DeviceCoordinate {
250+
return DeviceCoordinate(x: 320, y: 850, scaler: scaler)
251+
}
237252

238253
// MARK: - Login
239254

0 commit comments

Comments
 (0)