aboutsummaryrefslogtreecommitdiff
path: root/features/dungeonMap/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-04 18:32:53 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-04 18:32:53 +0800
commite607c0fa13a6738f5015b1891c7a9079cc76b694 (patch)
treee415191f609f4c251ac4fd3a6d0f78a9eb869e8d /features/dungeonMap/index.js
parent4784af7103fb0bd45aad28a662ed44297ac7e0b8 (diff)
downloadSoopyV2-e607c0fa13a6738f5015b1891c7a9079cc76b694.tar.gz
SoopyV2-e607c0fa13a6738f5015b1891c7a9079cc76b694.tar.bz2
SoopyV2-e607c0fa13a6738f5015b1891c7a9079cc76b694.zip
map location editing + update meta
Diffstat (limited to 'features/dungeonMap/index.js')
-rw-r--r--features/dungeonMap/index.js31
1 files changed, 24 insertions, 7 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js
index 2f82022..984392d 100644
--- a/features/dungeonMap/index.js
+++ b/features/dungeonMap/index.js
@@ -12,7 +12,9 @@ import { SoopyGui, SoopyRenderEvent } from "../../../guimanager";
import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement";
import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent";
import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
+import ImageLocationSetting from "../settings/settingThings/imageLocation";
const BufferedImage = Java.type("java.awt.image.BufferedImage")
+const AlphaComposite = Java.type("java.awt.AlphaComposite")
class DungeonMap extends Feature {
constructor() {
@@ -27,6 +29,8 @@ class DungeonMap extends Feature {
this.initVariables()
this.renderMap = new ToggleSetting("Render Map", "Toggles Rendering the map on the hud (scuffed)", false, "dmap_render", this)
+ this.mapLocation = new ImageLocationSetting("Map Location", "Sets the location of the map on the hud","dmap_location", this, [10,10, 1], new Image(javax.imageio.ImageIO.read(new java.io.File("./config/ChatTriggers/modules/SoopyV2/features/dungeonMap/map.png"))),100,100)
+ this.mapBackground = new ToggleSetting("Map Background", "Puts a white background begind the map", false, "dmap_background", this)
this.brBox = new ToggleSetting("Box around doors in br", "In map category because it uses map to find location (no esp)", true, "dmap_door", this)
this.spiritLeapOverlay = new ToggleSetting("Spirit leap overlay", "Cool overlay for the spirit leap menu", true, "spirit_leap_overlay", this)
@@ -64,9 +68,6 @@ class DungeonMap extends Feature {
"Ice Path": new Item("minecraft:mob_spawner")
}
- this.mapLocation = [10,10]
- this.mapRenderScale = 128/this.IMAGE_SIZE
-
this.spiritLeapOverlayGui = new SpiritLeapOverlay(this)
// this.registerEvent("tick", this.tick)
@@ -127,7 +128,7 @@ class DungeonMap extends Feature {
renderOverlay(){
if(this.isInDungeon() && this.renderMap.getValue()){
- this.drawMap(...this.mapLocation, this.mapRenderScale*this.IMAGE_SIZE, this.mapRenderScale)
+ this.drawMap(this.mapLocation.getValue()[0], this.mapLocation.getValue()[1],100*this.mapLocation.getValue()[2], 0.5*this.mapLocation.getValue()[2])
}
}
@@ -145,8 +146,8 @@ class DungeonMap extends Feature {
Object.keys(this.puzzles).forEach(loc=>{
if(!this.puzzles[loc]) return
if(this.puzzles[loc][1]) return
- let y = loc%128
- let x = Math.floor(loc/128)
+ let y = (loc%128)/128*100
+ let x = (Math.floor(loc/128))/128*100
let item = this.puzzleItems[this.puzzles[loc][0]] || this.barrier_block_item
@@ -211,8 +212,23 @@ class DungeonMap extends Feature {
// console.log(name)
})
let puzzlesTab2 = this.puzzlesTab.map(a=>a)
+
// console.log(this.puzzlesTab.length)
Object.keys(this.puzzles).forEach(key=>{
+ let y = (key%128)
+ let x = (Math.floor(key/128))
+
+ if(x>100&&y>100){
+ this.puzzles[key] = puzzlesTab2.shift()
+ }
+ })
+ Object.keys(this.puzzles).forEach(key=>{
+ let y = (key%128)
+ let x = (Math.floor(key/128))
+
+ if(x>100&&y>100){
+ return
+ }
this.puzzles[key] = puzzlesTab2.shift()
// console.log(key, this.puzzles[key], this.puzzlesTab.length)
})
@@ -247,8 +263,9 @@ class DungeonMap extends Feature {
let graphics = this.renderImage.getGraphics()
- // graphics.setColor(new Color(Renderer.color(255, 255, 255, 255)))
+ if(!this.mapBackground.getValue())graphics.setComposite(AlphaComposite.Clear);
graphics.fillRect(0,0,this.IMAGE_SIZE,this.IMAGE_SIZE)
+ if(!this.mapBackground.getValue())graphics.setComposite(AlphaComposite.SrcOver);
let mapData
try {