Detalhes do pacote

mudlet-map-binary-reader

Delwing159MIT0.5.3

Reads Mudlet's map binary file (v20 only!). Can output .js files needed for Mudlet Map Reader. Mudlet map JSON format is yet unsupported.

mudlet, map, mud

readme (leia-me)

Mudlet Map Binary Reader

NPM

Reads Mudlet's map binary file (v20 only!). Can output .js/.json files needed for Mudlet Map Reader. Mudlet map JSON format export is also available.

API until version 1.0.0 is subject to change! Use with caution.

I am no Node developer, so any hints and suggestions are more then welcome.

TODOs and plans

  • [ ] Convert to .ts
  • [X] Document map model
  • [ ] Document classes
  • [X] Add Mudlet's JSON exporter
  • [X] Correct QFont read
  • [ ] Add test
  • [ ] Add linting

    Usage example

const { MudletMapReader } = require("mudlet-map-binary-reader");

const inputFile = "map.dat"
const outputDirectory = "output";

let mapModel = MudletMapReader.read(inputFile);

// Export to map renderer format and save to .js and .json files https://github.com/Delwing/js-mudlet-map-renderer
let { mudletMap, colors } = MudletMapReader.export(mapModel, outputDirectory);

// Export as Mudlet Json map
const outputFile = 'file.json'
let mudletJsonFormat = MudletMapReader.exportJson(mapModel, outputFile)

//Modify and save binary
mapModel.rooms[1].name = "Funny name!"
MudletMapReader.write(mapModel, inputFile)

changelog (log de mudanças)

0.5.2

  • correct exports (so they will not break backward compatibility)

0.5.1

  • correct docs picking up

0.5.0

  • add room hash to reader export

0.4.0

  • fix errors when pixmap is empty

0.2.1

  • fix typo in .ts definition

0.2.0

  • export for reader will export model and colors
  • document export function
  • package.json - switch "export" to "main"

0.1.2

  • furhter exporting fixes

0.1.1

  • fix json export

0.1.0

  • code reorganization
  • reading will now be based directly on qtdatastream user type
  • added write method - it is now possible to write Mudlet map into binary from its model
  • model map definition

0.0.5

  • clone map model before doing export to prevent any changes to original model so it can be reused

0.0.4

  • export map to Mudlet JSON map file

0.0.3

  • adjust colors generation to adjust for envColors

0.0.2

  • fix reading mEnvColors
  • correct colors to match updated values

0.0.1

  • initial relese