Lint and format
This commit is contained in:
@@ -1,35 +1,55 @@
|
||||
const CDRAGON_BASE = "https://raw.communitydragon.org/latest/"
|
||||
const CDRAGON_BASE = 'https://raw.communitydragon.org/latest/'
|
||||
|
||||
/* Lanes */
|
||||
const POSITIONS = ["top", "jungle", "middle", "bottom", "utility"]
|
||||
const POSITIONS_STR = ["top", "jungle", "mid", "bot", "support"]
|
||||
const LANE_IMAGES = Array(5).fill("").map((_, index) => "/img/lanes/icon-position-" + POSITIONS[index] + ".png")
|
||||
const LANE_IMAGES_HOVER = Array(5).fill("").map((_, index) => "/img/lanes/icon-position-" + POSITIONS[index] + "-hover.png")
|
||||
const LANE_IMAGES_SELECTED = Array(5).fill("").map((_, index) => "/img/lanes/icon-position-" + POSITIONS[index] + "-blue.png")
|
||||
function laneIndexToPosition(index : number) {
|
||||
switch(index) {
|
||||
case 0: return "top"
|
||||
case 1: return "jungle"
|
||||
case 2: return "middle"
|
||||
case 3: return "bottom"
|
||||
case 4: return "utility"
|
||||
}
|
||||
return null
|
||||
const POSITIONS = ['top', 'jungle', 'middle', 'bottom', 'utility']
|
||||
const POSITIONS_STR = ['top', 'jungle', 'mid', 'bot', 'support']
|
||||
const LANE_IMAGES = Array(5)
|
||||
.fill('')
|
||||
.map((_, index) => '/img/lanes/icon-position-' + POSITIONS[index] + '.png')
|
||||
const LANE_IMAGES_HOVER = Array(5)
|
||||
.fill('')
|
||||
.map((_, index) => '/img/lanes/icon-position-' + POSITIONS[index] + '-hover.png')
|
||||
const LANE_IMAGES_SELECTED = Array(5)
|
||||
.fill('')
|
||||
.map((_, index) => '/img/lanes/icon-position-' + POSITIONS[index] + '-blue.png')
|
||||
function laneIndexToPosition(index: number) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return 'top'
|
||||
case 1:
|
||||
return 'jungle'
|
||||
case 2:
|
||||
return 'middle'
|
||||
case 3:
|
||||
return 'bottom'
|
||||
case 4:
|
||||
return 'utility'
|
||||
}
|
||||
return null
|
||||
}
|
||||
function lanePositionToIndex(position : string) {
|
||||
const p = position.toLowerCase()
|
||||
for(let i = 0; i < POSITIONS.length; i++) {
|
||||
if(p == POSITIONS[i]) return i;
|
||||
}
|
||||
return -1;
|
||||
function lanePositionToIndex(position: string) {
|
||||
const p = position.toLowerCase()
|
||||
for (let i = 0; i < POSITIONS.length; i++) {
|
||||
if (p == POSITIONS[i]) return i
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
function mapPath(assetPath : string) {
|
||||
if(assetPath === undefined || assetPath === null) return ""
|
||||
return assetPath.toLowerCase().replace("/lol-game-data/assets/", "plugins/rcp-be-lol-game-data/global/default/")
|
||||
function mapPath(assetPath: string) {
|
||||
if (assetPath === undefined || assetPath === null) return ''
|
||||
return assetPath
|
||||
.toLowerCase()
|
||||
.replace('/lol-game-data/assets/', 'plugins/rcp-be-lol-game-data/global/default/')
|
||||
}
|
||||
|
||||
export {
|
||||
mapPath, CDRAGON_BASE, laneIndexToPosition, lanePositionToIndex,
|
||||
POSITIONS, LANE_IMAGES, LANE_IMAGES_HOVER, LANE_IMAGES_SELECTED, POSITIONS_STR
|
||||
}
|
||||
export {
|
||||
mapPath,
|
||||
CDRAGON_BASE,
|
||||
laneIndexToPosition,
|
||||
lanePositionToIndex,
|
||||
POSITIONS,
|
||||
LANE_IMAGES,
|
||||
LANE_IMAGES_HOVER,
|
||||
LANE_IMAGES_SELECTED,
|
||||
POSITIONS_STR
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user