Skip to content

Commit

Permalink
Leveling Mode (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
123FLO321 authored Apr 30, 2020
1 parent d2f42e0 commit 588c5c3
Show file tree
Hide file tree
Showing 10 changed files with 332 additions and 272 deletions.
47 changes: 15 additions & 32 deletions Manager/Sources/RDMUICManager/BuildController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Created by Florian Kostenzer on 28.11.18.
//
// swiftlint:disable type_body_length function_body_length cyclomatic_complexity
// swiftlint:disable type_body_length function_body_length
//

import Foundation
Expand Down Expand Up @@ -243,37 +243,20 @@ class BuildController {
outputPipe.fileHandleForReading.readabilityHandler = { fileHandle in
let string = String(data: fileHandle.availableData, encoding: .utf8)
if string != nil && string!.trimmingCharacters(in: .whitespacesAndNewlines) != "" {
if string!.contains(string: "[STATUS] Started") && locked {
Log.debug(message: "[\(device.name)] Done building")
self.setStatus(uuid: device.uuid, status: "Running: Starting")
locked = false
self.buildLock.lock()
self.buildingCount -= 1
self.buildLock.unlock()
}
if string!.contains(string: "[STATUS] Startup") {
self.setStatus(uuid: device.uuid, status: "Running: Startup")
}
if string!.contains(string: "[STATUS] Logout") {
self.setStatus(uuid: device.uuid, status: "Running: Logout")
}
if string!.contains(string: "[STATUS] Login") {
self.setStatus(uuid: device.uuid, status: "Running: Login")
}
if string!.contains(string: "[STATUS] Tutorial") {
self.setStatus(uuid: device.uuid, status: "Running: Tutorial")
}
if string!.contains(string: "[STATUS] Pokemon") {
self.setStatus(uuid: device.uuid, status: "Running: Pokemon")
}
if string!.contains(string: "[STATUS] Raid") {
self.setStatus(uuid: device.uuid, status: "Running: Raid")
}
if string!.contains(string: "[STATUS] Quest") {
self.setStatus(uuid: device.uuid, status: "Running: Quest")
}
if string!.contains(string: "[STATUS] IV") {
self.setStatus(uuid: device.uuid, status: "Running: IV")
for line in string!.components(separatedBy: .newlines) {
if line.contains(string: "[STATUS] Started") && locked {
Log.debug(message: "[\(device.name)] Done building")
self.setStatus(uuid: device.uuid, status: "Running: Starting")
locked = false
self.buildLock.lock()
self.buildingCount -= 1
self.buildLock.unlock()
} else if line.starts(with: "[STATUS]") {
self.setStatus(
uuid: device.uuid,
status: line.replacingOccurrences(of: "[STATUS] ", with: "")
)
}
}

fullLog.uic(message: string!, all: true)
Expand Down
11 changes: 0 additions & 11 deletions RealDeviceMap-UIControl/.idea/RealDeviceMap-UIControl.iml

This file was deleted.

7 changes: 0 additions & 7 deletions RealDeviceMap-UIControl/.idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions RealDeviceMap-UIControl/.idea/modules.xml

This file was deleted.

105 changes: 0 additions & 105 deletions RealDeviceMap-UIControl/.idea/workspace.xml

This file was deleted.

14 changes: 10 additions & 4 deletions RealDeviceMap-UIControl/DeviceConfig/DeviceConfigProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ protocol DeviceConfigProtocol {
var openQuest: DeviceCoordinate { get }
/** First delete quests button. */
var questDelete: DeviceCoordinate { get }
/** Color of the top quest rectangle. */
var questFilledColor1: DeviceCoordinate { get }
/** First delete Quest Button if stacked Encounter is present */
var questDeleteWithStack: DeviceCoordinate { get }
/** Color of the top quest rectangle if stacked Encounter is present. */
var questFilledColorWithStack1: DeviceCoordinate { get }
/** Green confirm quest deletion button */
var questDeleteConfirm: DeviceCoordinate { get }
/** Check for the pokeball on Willow's desk. */
var questWillow: DeviceCoordinate { get }
/** Third delete Quest Button if stacked Encounter is present */
var questDeleteThirdSlot: DeviceCoordinate { get }

// MARK: - Item Clearing

Expand All @@ -146,6 +146,12 @@ protocol DeviceConfigProtocol {
var itemEggMenuItem: DeviceCoordinate { get }
/** Tap Location for Egg Deployment */
var itemEggDeploy: DeviceCoordinate { get }
/** The Y values for all item delete buttons. */
var itemIncenseYs: [Int] { get }
/** Free Pass OK button. */
var itemFreePass: DeviceCoordinate { get }
/** Gift info OK button. */
var itemGiftInfo: DeviceCoordinate { get }

// MARK: - Login

Expand Down
27 changes: 21 additions & 6 deletions RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1333.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@ class DeviceRatio1333: DeviceConfigProtocol {
var questDelete: DeviceCoordinate {
return DeviceCoordinate(x: 1434, y: 1272, scaler: scaler)
}
var questFilledColor1: DeviceCoordinate {
return DeviceCoordinate(x: 108, y: 1258, scaler: scaler)
}
var questDeleteWithStack: DeviceCoordinate {
return DeviceCoordinate(x: 1445, y: 1677, scaler: scaler)
}
var questFilledColorWithStack1: DeviceCoordinate {
return DeviceCoordinate(x: 108, y: 1665, scaler: scaler)
}
var questDeleteConfirm: DeviceCoordinate {
return DeviceCoordinate(x: 768, y: 1143, scaler: scaler)
}
var openItems: DeviceCoordinate {
return DeviceCoordinate(x: 1165, y: 1620, scaler: scaler)
}
var questWillow: DeviceCoordinate {
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
}
var questDeleteThirdSlot: DeviceCoordinate {
return DeviceCoordinate(x: 1445, y: 2030, scaler: scaler) //not accurate
}

// MARK: - Item Clearing

Expand Down Expand Up @@ -235,6 +235,21 @@ class DeviceRatio1333: DeviceConfigProtocol {
scaler.scaleY(y: 2010)
]
}
var itemIncenseYs: [Int] {
return [
scaler.scaleY(y: 0),
scaler.scaleY(y: 0),
scaler.scaleY(y: 0),
scaler.scaleY(y: 0),
scaler.scaleY(y: 0)
]
}
var itemFreePass: DeviceCoordinate {
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
}
var itemGiftInfo: DeviceCoordinate {
return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
}

// MARK: - Login

Expand Down
31 changes: 23 additions & 8 deletions RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1775.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class DeviceRatio1775: DeviceConfigProtocol {
return DeviceCoordinate(x: 320, y: 585, scaler: scaler)
}
var rocketLogoGirl: DeviceCoordinate {
return DeviceCoordinate(x: 390, y: 468, scaler: scaler)
return DeviceCoordinate(x: 350, y: 500, scaler: scaler)
}
var rocketLogoGuy: DeviceCoordinate {
return DeviceCoordinate(x: 302, y: 463, scaler: scaler)
return DeviceCoordinate(x: 254, y: 484, scaler: scaler)
}
var closeInvasion: DeviceCoordinate {
return DeviceCoordinate(x: 320, y: 1000, scaler: scaler)
Expand All @@ -186,21 +186,21 @@ class DeviceRatio1775: DeviceConfigProtocol {
var questDelete: DeviceCoordinate {
return DeviceCoordinate(x: 596, y: 570, scaler: scaler)
}
var questFilledColor1: DeviceCoordinate {
return DeviceCoordinate(x: 44, y: 567, scaler: scaler)
}
var questDeleteWithStack: DeviceCoordinate {
return DeviceCoordinate(x: 596, y: 739, scaler: scaler)
}
var questFilledColorWithStack1: DeviceCoordinate {
return DeviceCoordinate(x: 44, y: 736, scaler: scaler)
}
var questDeleteConfirm: DeviceCoordinate {
return DeviceCoordinate(x: 320, y: 620, scaler: scaler)
}
var openItems: DeviceCoordinate {
return DeviceCoordinate(x: 500, y: 950, scaler: scaler)
}
var questWillow: DeviceCoordinate {
return DeviceCoordinate(x: 50, y: 1125, scaler: scaler)
}
var questDeleteThirdSlot: DeviceCoordinate {
return DeviceCoordinate(x: 600, y: 860, scaler: scaler)
}

// MARK: - Item Clearing

Expand Down Expand Up @@ -234,6 +234,21 @@ class DeviceRatio1775: DeviceConfigProtocol {
scaler.scaleY(y: 1124)
]
}
var itemIncenseYs: [Int] {
return [
scaler.scaleY(y: 232),
scaler.scaleY(y: 460),
scaler.scaleY(y: 687),
scaler.scaleY(y: 914),
scaler.scaleY(y: 1141)
]
}
var itemFreePass: DeviceCoordinate {
return DeviceCoordinate(x: 320, y: 930, scaler: scaler)
}
var itemGiftInfo: DeviceCoordinate {
return DeviceCoordinate(x: 320, y: 850, scaler: scaler)
}

// MARK: - Login

Expand Down
Loading

0 comments on commit 588c5c3

Please sign in to comment.