Merge remote-tracking branch 'origin/lephe-art' into dev
Before Width: | Height: | Size: 6 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 650 B |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -1,44 +1,18 @@
|
|||
demo_player.png:
|
||||
type: bopti-image
|
||||
name: demo_player_img
|
||||
*.png:
|
||||
custom-type: custom-image
|
||||
name_regex: (.*)\.png \1_img
|
||||
profile: p8
|
||||
scale: 2
|
||||
|
||||
demo_PNJ.png:
|
||||
type: bopti-image
|
||||
name: demo_PNJ_img
|
||||
profile: p8
|
||||
|
||||
player_face.png:
|
||||
type: bopti-image
|
||||
name: player_face_img
|
||||
profile: p8
|
||||
|
||||
SignAction.png:
|
||||
type: bopti-image
|
||||
name: SignAction_img
|
||||
profile: p8
|
||||
|
||||
INFO_Icon.png:
|
||||
type: bopti-image
|
||||
name: INFO_Icon_img
|
||||
profile: p8
|
||||
|
||||
NPC_Icon.png:
|
||||
type: bopti-image
|
||||
name: NPC_Icon_img
|
||||
profile: p8
|
||||
|
||||
SGN_Icon.png:
|
||||
type: bopti-image
|
||||
name: SGN_Icon_img
|
||||
profile: p8
|
||||
demo_PNG.png:
|
||||
scale: 1
|
||||
|
||||
font.png:
|
||||
name: fontRPG
|
||||
type: font
|
||||
custom-type: font
|
||||
charset: print
|
||||
grid.size: 10x10
|
||||
grid.padding: 2
|
||||
grid.border: 0
|
||||
proportional: true
|
||||
height: 10
|
||||
height: 10
|
||||
|
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
@ -1,4 +1,5 @@
|
|||
from random import randint
|
||||
from PIL import Image
|
||||
import fxconv
|
||||
import json
|
||||
import pathlib
|
||||
|
@ -12,6 +13,12 @@ def convert(input, output, params, target):
|
|||
elif params["custom-type"] == "world":
|
||||
convert_world(input, output, params, target)
|
||||
return 0
|
||||
elif params["custom-type"] == "custom-image":
|
||||
convert_custom_image(input, output, params, target)
|
||||
return 0
|
||||
elif params["custom-type"] == "font":
|
||||
convert_font(input, output, params, target)
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
||||
|
@ -339,3 +346,18 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
|
|||
break
|
||||
|
||||
return nbExtraData, structData
|
||||
|
||||
def convert_custom_image(input, output, params, target):
|
||||
scale = int(params.get("scale", 1))
|
||||
|
||||
# Upscale image before converting
|
||||
im = Image.open(input)
|
||||
im = im.resize((im.width * scale, im.height * scale),
|
||||
resample=Image.NEAREST)
|
||||
|
||||
o = fxconv.convert_image_cg(im, params)
|
||||
fxconv.elf(o, output, "_" + params["name"], **target)
|
||||
|
||||
def convert_font(input, output, params, target):
|
||||
o = fxconv.convert_topti(input, params)
|
||||
fxconv.elf(o, output, "_" + params["name"], **target)
|
||||
|
|