mirror of https://github.com/bgiraudr/Adoranda.git
Draw dialog fix (lephe)
This commit is contained in:
parent
7711150484
commit
9c3e3c184a
|
@ -24,6 +24,7 @@ def convert_map(input, output, params, target):
|
|||
TILE_TALKABLE = 4
|
||||
TILE_TELEPORTER = 5
|
||||
TILE_GRASS = 6
|
||||
TILE_ICE = 7
|
||||
|
||||
DIALOG_LAYOUT = "dialog"
|
||||
TELEPORTER_LAYOUT = "teleporter"
|
||||
|
@ -46,30 +47,23 @@ def convert_map(input, output, params, target):
|
|||
tileset.close()
|
||||
|
||||
tile_value = {}
|
||||
tile_type = {
|
||||
"air":TILE_AIR,
|
||||
"solid":TILE_SOLID,
|
||||
"door_in":TILE_DOOR_IN,
|
||||
"door_out":TILE_DOOR_OUT,
|
||||
"talkable":TILE_TALKABLE,
|
||||
"bridge":TILE_BRIDGE,
|
||||
"teleporter":TILE_TELEPORTER,
|
||||
"grass":TILE_GRASS,
|
||||
"ice":TILE_ICE
|
||||
}
|
||||
#create a dictionnary {tile id:type}
|
||||
for i in data_tileset["tiles"]:
|
||||
id = i["id"]+1
|
||||
type = i["type"]
|
||||
|
||||
if type == "air":
|
||||
value = TILE_AIR
|
||||
elif type == "solid":
|
||||
value = TILE_SOLID
|
||||
elif type == "door_in":
|
||||
value = TILE_DOOR_IN
|
||||
elif type == "door_out":
|
||||
value = TILE_DOOR_OUT
|
||||
elif type == "talkable":
|
||||
value = TILE_TALKABLE
|
||||
elif type == "bridge":
|
||||
value = TILE_BRIDGE
|
||||
elif type == "teleporter":
|
||||
value = TILE_TELEPORTER
|
||||
elif type == "grass":
|
||||
value = TILE_GRASS
|
||||
else:
|
||||
value = TILE_AIR
|
||||
|
||||
value = tile_type.get(type) if type in tile_type else TILE_AIR
|
||||
tile_value[id] = value
|
||||
|
||||
#Extract from the json the width, height
|
||||
|
@ -98,7 +92,7 @@ def convert_map(input, output, params, target):
|
|||
nbZone = len(layer["objects"])
|
||||
zone = parseZone(layer)
|
||||
else:
|
||||
print("UNKNOWN LAYOUT FOUND : " + layer.get("name"))
|
||||
print("UNKNOWN LAYER FOUND : " + layer.get("name"))
|
||||
|
||||
structMap += fxconv.u32(w) + fxconv.u32(h) + fxconv.u32(nbTilelayer) + fxconv.u32(nbDialog) + fxconv.u32(nbTelep) + fxconv.u32(nbZone)
|
||||
structMap += fxconv.ref(f"img_{nameTilesetFree}")
|
||||
|
@ -116,6 +110,9 @@ def convert_map(input, output, params, target):
|
|||
for x in range(w*h):
|
||||
for i in range(nbTilelayer):
|
||||
value = tile_value.get(data["layers"][i]["data"][x])
|
||||
if value == TILE_SOLID:
|
||||
maxValue = TILE_SOLID
|
||||
break
|
||||
if value == None: value = TILE_AIR
|
||||
if value > maxValue: maxValue = value
|
||||
if value == TILE_BRIDGE:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.8" tiledversion="1.8.0" orientation="orthogonal" renderorder="right-down" width="100" height="100" tilewidth="16" tileheight="16" infinite="0" nextlayerid="13" nextobjectid="45">
|
||||
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="100" height="100" tilewidth="16" tileheight="16" infinite="0" nextlayerid="13" nextobjectid="45">
|
||||
<editorsettings>
|
||||
<export target="interior_1.json" format="json"/>
|
||||
</editorsettings>
|
||||
|
@ -63,17 +63,17 @@
|
|||
263,301,273,300,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,298,272,263,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,301,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,298,272,270,244,241,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
270,270,301,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,117,91,89,120,63,60,62,90,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,301,273,300,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,109,109,91,120,89,121,90,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,263,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,117,118,118,118,119,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,263,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,240,243,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,301,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,298,272,263,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
301,301,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,269,263,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
270,263,244,242,40,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,269,270,301,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,271,35,1,1,1,1,1,259,260,260,260,260,260,260,260,260,260,261,1,1,1,1,1,110,1,298,272,270,270,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,271,35,1,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,82,83,1,139,1,1,269,301,263,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
270,244,242,33,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,1,1,1,1,298,299,299,272,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,270,244,242,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,59,60,60,60,61,1,59,61,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
270,270,301,271,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,117,91,89,120,63,60,62,90,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,301,273,300,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,109,109,91,120,89,121,90,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,263,271,1,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,1,1,117,118,118,118,119,269,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,263,271,1,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,1,1,1,1,1,1,240,243,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
263,301,271,1,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,1,1,1,1,1,1,298,272,263,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
301,301,271,1,1,1,1,1,288,289,289,289,289,289,289,289,289,289,290,1,1,1,1,1,1,1,1,1,1,1,269,263,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
270,263,244,242,40,1,1,1,317,318,318,318,318,318,318,318,318,318,319,1,1,1,1,1,1,1,1,1,1,1,269,270,301,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
301,301,270,244,242,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,298,272,263,270,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
301,301,270,263,271,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,298,272,270,244,242,1,1,1,1,1,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||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.8" tiledversion="1.8.1" orientation="orthogonal" renderorder="right-down" width="100" height="38" tilewidth="16" tileheight="16" infinite="0" nextlayerid="14" nextobjectid="61">
|
||||
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="100" height="38" tilewidth="16" tileheight="16" infinite="0" nextlayerid="14" nextobjectid="61">
|
||||
<editorsettings>
|
||||
<export target="testCarte.json" format="json"/>
|
||||
</editorsettings>
|
||||
|
@ -73,12 +73,12 @@
|
|||
320,321,322,0,0,0,0,0,0,0,0,0,0,306,249,249,108,0,140,80,81,0,0,0,0,0,0,0,0,0,0,0,108,0,378,379,380,0,0,0,0,0,0,0,49,50,0,0,0,0,22,23,0,0,0,0,0,0,0,0,0,0,0,0,0,111,0,0,0,0,0,0,0,0,0,0,0,303,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
349,350,351,0,0,0,0,0,0,0,0,0,0,0,0,0,137,138,84,0,110,249,249,249,249,249,249,249,250,249,251,0,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,52,0,0,0,0,0,0,0,0,320,321,322,0,82,139,0,0,0,0,0,0,323,324,325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
378,379,380,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,137,138,139,0,0,0,0,0,0,0,0,0,280,0,137,138,138,138,138,138,84,0,0,0,174,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,349,350,351,0,111,0,0,0,0,0,0,0,352,353,354,0,0,0,0,0,0,0,0,0,323,324,325,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280,334,335,336,337,0,0,0,137,83,138,138,203,203,138,138,138,84,0,0,0,0,0,0,0,0,0,0,0,0,378,379,380,82,139,0,0,0,0,0,0,0,381,382,383,0,0,255,256,257,258,0,0,0,352,353,354,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,320,321,322,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280,363,364,365,366,0,0,0,0,0,0,0,232,232,0,0,0,137,138,84,0,0,0,0,0,0,0,0,0,0,0,0,82,139,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,381,382,383,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,349,350,351,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306,392,393,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,137,84,0,0,0,0,0,0,0,0,0,82,138,139,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,378,379,380,0,0,0,0,0,0,0,0,294,0,0,0,0,0,0,0,0,0,0,421,422,423,424,0,0,12,13,0,0,0,0,0,294,0,0,0,0,0,137,138,138,138,84,0,0,0,82,138,139,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,
|
||||
0,0,0,0,0,0,0,0,0,294,294,0,0,0,0,0,0,0,0,0,294,0,0,0,0,294,0,0,0,0,0,450,451,452,453,0,0,41,42,0,0,0,0,0,294,294,0,0,0,0,29,0,0,0,137,138,138,138,139,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,48,
|
||||
0,0,0,0,0,0,0,0,0,294,294,56,0,0,0,0,0,0,294,294,294,0,0,0,0,294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,294,294,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,289,289,289,289,289,0,0,280,334,335,336,337,0,0,0,137,83,138,138,203,203,138,138,138,84,0,0,0,0,0,0,0,0,0,0,0,0,378,379,380,82,139,0,0,0,0,0,0,0,381,382,383,0,0,255,256,257,258,0,0,0,352,353,354,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,320,321,322,0,0,0,0,0,0,0,0,0,0,0,289,289,289,289,289,0,0,280,363,364,365,366,0,0,0,0,0,0,0,232,232,0,0,0,137,138,84,0,0,0,0,0,0,0,0,0,0,0,0,82,139,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,381,382,383,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,349,350,351,0,0,0,0,0,0,0,0,0,0,0,289,0,0,0,0,0,0,306,392,393,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,137,84,0,0,0,0,0,0,0,0,0,82,138,139,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,378,379,380,0,0,0,0,0,0,0,0,294,0,0,289,0,0,0,0,0,0,0,421,422,423,424,0,0,12,13,0,0,0,0,0,294,0,0,0,0,0,137,138,138,138,84,0,0,0,82,138,139,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,
|
||||
0,0,0,0,0,0,0,0,0,294,294,0,0,0,0,0,0,0,0,0,294,0,0,289,0,294,0,0,0,0,0,450,451,452,453,0,0,41,42,0,0,0,0,0,294,294,0,0,0,0,29,0,0,0,137,138,138,138,139,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,48,
|
||||
0,0,0,0,0,0,0,0,0,294,294,56,0,0,0,0,0,0,294,294,294,0,0,289,0,294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,294,294,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,294,294,294,0,0,0,0,0,0,0,0,0,0,0,0,0,294,294,0,0,0,0,0,0,252,253,253,0,28,0,253,253,254,0,0,294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,285,286,287,0,0,0,0,0,0,0,0,0,12,13,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,320,321,322,294,294,0,0,0,0,0,0,0,0,0,0,0,0,0,294,294,0,239,0,0,0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,313,314,315,316,0,0,0,326,327,328,329,0,0,41,42,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,349,350,351,56,294,0,0,0,0,0,0,0,0,0,0,0,0,0,294,294,0,0,0,239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,342,343,344,345,0,0,0,355,356,357,358,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -92,7 +92,7 @@
|
|||
<object id="33" gid="267" x="592" y="528" width="16" height="16">
|
||||
<properties>
|
||||
<property name="name" value="Tituya"/>
|
||||
<property name="text" value="Bonjour !;Je ne pense pas finir ce jeu...;voici donc une sorte de preview de ce qui;ne va pas arriver.;Encore désolé pour ce projet..."/>
|
||||
<property name="text" value="Bonjour ! Je ne pense pas finir ce jeu...;voici donc une sorte de preview de ce qui ne va pas arriver. Encore désolé pour ce projet..."/>
|
||||
</properties>
|
||||
</object>
|
||||
<object id="34" gid="267" x="704" y="368" width="16" height="16">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.5" tiledversion="1.7.2" name="tileset" tilewidth="16" tileheight="16" tilecount="464" columns="29">
|
||||
<tileset version="1.8" tiledversion="1.8.2" name="tileset" tilewidth="16" tileheight="16" tilecount="464" columns="29">
|
||||
<editorsettings>
|
||||
<export target="tileset.json" format="json"/>
|
||||
</editorsettings>
|
||||
|
@ -57,6 +57,7 @@
|
|||
<tile id="223" type="solid"/>
|
||||
<tile id="224" type="solid"/>
|
||||
<tile id="225" type="solid"/>
|
||||
<tile id="229" type="solid"/>
|
||||
<tile id="231" type="bridge"/>
|
||||
<tile id="232" type="solid"/>
|
||||
<tile id="233" type="solid"/>
|
||||
|
@ -84,6 +85,9 @@
|
|||
<tile id="255" type="bridge"/>
|
||||
<tile id="256" type="bridge"/>
|
||||
<tile id="257" type="solid"/>
|
||||
<tile id="258" type="ice"/>
|
||||
<tile id="259" type="ice"/>
|
||||
<tile id="260" type="ice"/>
|
||||
<tile id="261" type="solid"/>
|
||||
<tile id="262" type="solid"/>
|
||||
<tile id="263" type="solid"/>
|
||||
|
@ -114,6 +118,9 @@
|
|||
<tile id="284" type="bridge"/>
|
||||
<tile id="285" type="bridge"/>
|
||||
<tile id="286" type="solid"/>
|
||||
<tile id="287" type="ice"/>
|
||||
<tile id="288" type="ice"/>
|
||||
<tile id="289" type="ice"/>
|
||||
<tile id="290" type="solid"/>
|
||||
<tile id="291" type="solid"/>
|
||||
<tile id="292" type="solid"/>
|
||||
|
@ -135,6 +142,9 @@
|
|||
<tile id="313" type="bridge"/>
|
||||
<tile id="314" type="bridge"/>
|
||||
<tile id="315" type="solid"/>
|
||||
<tile id="316" type="ice"/>
|
||||
<tile id="317" type="ice"/>
|
||||
<tile id="318" type="ice"/>
|
||||
<tile id="319" type="solid"/>
|
||||
<tile id="320" type="solid"/>
|
||||
<tile id="321" type="solid"/>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 55 KiB |
|
@ -40,6 +40,7 @@ enum map_state {
|
|||
TILE_TALKABLE,
|
||||
TILE_TELEPORTER,
|
||||
TILE_GRASS,
|
||||
TILE_ICE,
|
||||
};
|
||||
|
||||
/*check if a tile is walkable*/
|
||||
|
|
|
@ -14,4 +14,5 @@ struct Talkable {
|
|||
void draw_dialog(struct Talkable *character);
|
||||
/*find the talkable tile using the player's position*/
|
||||
struct Talkable* get_dialog_xy(struct Map *map, int x, int y);
|
||||
void clean(char *var);
|
||||
char *word_boundary_before(char *str, char *limit);
|
||||
char *skip_spaces(char *str);
|
15
src/engine.c
15
src/engine.c
|
@ -26,6 +26,7 @@ void engine_draw(struct Game const *game) {
|
|||
|
||||
dprint(1,1,C_WHITE,"%d:%d",game->player->pos.x, game->player->pos.y);
|
||||
dprint(1,20,C_WHITE,"%d",game->player->sprint);
|
||||
dprint(1,40,C_WHITE,"%d",map_get_player_tile(game));
|
||||
}
|
||||
|
||||
void engine_draw_map(struct Game const *game) {
|
||||
|
@ -168,6 +169,20 @@ void engine_check_position(struct Game *game) {
|
|||
if(player_curr_tile == TILE_GRASS) {
|
||||
create_battle(game);
|
||||
}
|
||||
if(player_curr_tile == TILE_ICE) {
|
||||
int direction = game->player->direction;
|
||||
int dx = (direction == DIR_RIGHT) - (direction == DIR_LEFT);
|
||||
int dy = (direction == DIR_DOWN) - (direction == DIR_UP);
|
||||
|
||||
if(player_facing(game) == TILE_ICE || map_walkable(game->map, game->player->pos.x+dx, game->player->pos.y+dy)) {
|
||||
game->player->pos.x += dx;
|
||||
game->player->pos.y += dy;
|
||||
engine_draw(game);
|
||||
engine_tick(game, ENGINE_TICK);
|
||||
dupdate();
|
||||
engine_check_position(game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void engine_center_camera(struct Game *game) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include <gint/display.h>
|
||||
#include <gint/keyboard.h>
|
||||
#include <gint/cpu.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "talkable.h"
|
||||
#include "util.h"
|
||||
|
@ -14,6 +16,26 @@ struct Talkable default_value = {
|
|||
.text = "default dialog"
|
||||
};
|
||||
|
||||
/* Find the last word boundary between [str] and [limit]. If there is no word
|
||||
boundary (ie. [limit] is in the first word of [str]), returns [limit].
|
||||
This function always return a position *after* [str] so that we always make
|
||||
progress and don't loop. */
|
||||
char *word_boundary_before(char *str, char *limit)
|
||||
{
|
||||
char *s = limit;
|
||||
while(s > str) {
|
||||
if(isspace(*s) || !*s) return s;
|
||||
s--;
|
||||
}
|
||||
return limit;
|
||||
}
|
||||
|
||||
/* Skip spaces at the start of [str] */
|
||||
char *skip_spaces(char *str)
|
||||
{
|
||||
return str + strspn(str, " \t\n");
|
||||
}
|
||||
|
||||
/*draw the dialog of a specified talkable tile*/
|
||||
void draw_dialog(struct Talkable *talkable) {
|
||||
extern bopti_image_t img_dialogue;
|
||||
|
@ -26,31 +48,16 @@ void draw_dialog(struct Talkable *talkable) {
|
|||
dimage(43,31,&img_dialogue);
|
||||
dprint(50,40, C_BLACK, "%s", talkable->name);
|
||||
|
||||
//TODO Il y a moyen de faire mieux avec seulement curr_line.
|
||||
//Cela semble globalement fonctionner, mais j'ai pu observer des petites erreurs
|
||||
if(strlen(curr_line) > LIMIT) {
|
||||
char remain[strlen(curr_line)+1];
|
||||
char split[LIMIT+1];
|
||||
char first_part[LIMIT+1];
|
||||
int const DIALOG_WIDTH = 295, LINE_HEIGHT = 13;
|
||||
int y = 45 + LINE_HEIGHT;
|
||||
|
||||
strcpy(remain, curr_line);
|
||||
int indexLine = 0;
|
||||
|
||||
while(strlen(remain) > LIMIT) {
|
||||
clean(split);
|
||||
strncpy(first_part,&remain[0],LIMIT);
|
||||
|
||||
char* find = strrchr(first_part,' ');
|
||||
int indexSpace = find != NULL ? (int)(find-first_part) : LIMIT-1;
|
||||
strncpy(split,&remain[0],indexSpace);
|
||||
strncpy(remain,&remain[indexSpace]+1,strlen(remain));
|
||||
|
||||
dprint(50,60+indexLine*15, C_BLACK, "%s", split);
|
||||
indexLine++;
|
||||
}
|
||||
dprint(50,60+indexLine*15, C_BLACK, "%s", remain);
|
||||
} else {
|
||||
dprint(50,60, C_BLACK, "%s", curr_line);
|
||||
while(*curr_line) {
|
||||
char *end = (char *)drsize(curr_line, NULL, DIALOG_WIDTH, NULL);
|
||||
char *last_word = word_boundary_before(curr_line, end);
|
||||
dtext_opt(50, y, C_BLACK, C_NONE, DTEXT_LEFT, DTEXT_TOP,
|
||||
curr_line, last_word - curr_line);
|
||||
curr_line = skip_spaces(last_word);
|
||||
y += LINE_HEIGHT;
|
||||
}
|
||||
|
||||
dupdate();
|
||||
|
@ -59,14 +66,6 @@ void draw_dialog(struct Talkable *talkable) {
|
|||
}
|
||||
}
|
||||
|
||||
void clean(char *var) {
|
||||
int i = 0;
|
||||
while(var[i] != '\0') {
|
||||
var[i] = '\0';
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/*find the talkable tile using the player's position*/
|
||||
struct Talkable* get_dialog_xy(struct Map *map, int x, int y) {
|
||||
int i = 0;
|
||||
|
|
Loading…
Reference in New Issue