Skip to content

Commit

Permalink
Cleaning up mode type
Browse files Browse the repository at this point in the history
  • Loading branch information
acorbin3 committed Jan 10, 2020
1 parent ccf2cb5 commit 63a5fe2
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions src/com/p3achb0t/api/wrappers/ClientMode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,10 @@ class ClientMode(val ctx: Context) {
var modeType: ModeType = ModeType.ResizeMode

fun getMode(): ModeType {

if (modeInit) return modeType
return try {
val resizeModeWidget = ctx.widgets.find(261, 34)
// For tutorial island we might not have any children yet, then it means we are in resize mode
if (resizeModeWidget?.getChildren() == null) {
modeInit = true
modeType = Companion.ModeType.ResizeMode
return modeType
}
if (resizeModeWidget.getChildren()[0].getSpriteId2() == 1150) {
modeInit = true
modeType = Companion.ModeType.ResizeMode
modeType
} else {
modeInit = true
modeType = Companion.ModeType.FixedMode
modeType
}
} catch (e: Exception) {
modeType
return if(ctx.client.getClientPreferences().getWindowMode() == 1){
ModeType.FixedMode
}else{
ModeType.ResizeMode
}
}
}

0 comments on commit 63a5fe2

Please sign in to comment.