config manager: add support for WorldPoint
This commit is contained in:
@@ -59,6 +59,7 @@ import java.util.stream.Collectors;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.account.AccountSession;
|
import net.runelite.client.account.AccountSession;
|
||||||
@@ -588,6 +589,14 @@ public class ConfigManager
|
|||||||
}
|
}
|
||||||
return new Keybind(code, mods);
|
return new Keybind(code, mods);
|
||||||
}
|
}
|
||||||
|
if (type == WorldPoint.class)
|
||||||
|
{
|
||||||
|
String[] splitStr = str.split(":");
|
||||||
|
int x = Integer.parseInt(splitStr[0]);
|
||||||
|
int y = Integer.parseInt(splitStr[1]);
|
||||||
|
int plane = Integer.parseInt(splitStr[2]);
|
||||||
|
return new WorldPoint(x, y, plane);
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,6 +634,11 @@ public class ConfigManager
|
|||||||
Keybind k = (Keybind) object;
|
Keybind k = (Keybind) object;
|
||||||
return k.getKeyCode() + ":" + k.getModifiers();
|
return k.getKeyCode() + ":" + k.getModifiers();
|
||||||
}
|
}
|
||||||
|
if (object instanceof WorldPoint)
|
||||||
|
{
|
||||||
|
WorldPoint wp = (WorldPoint) object;
|
||||||
|
return wp.getX() + ":" + wp.getY() + ":" + wp.getPlane();
|
||||||
|
}
|
||||||
return object.toString();
|
return object.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user