[go: up one dir, main page]

modifaxe

A tool for modifying hardcoded values after compiling.
https://github.com/SomeRanDev/modifaxe

To install, run:

haxelib install modifaxe 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

WOOO been a while since I made a logo.

Test Workflow License: MIT Modifaxe Thread

A tool for modifying hardcoded values in your post-build Haxe application.

Change a value -> recompile -> test -> repeat. Every programmer has experienced this loop before; it's very tempting to "guess and check" when it comes to visually designing something with code. This library seeks to aliviate the tedious "recompile" step by allowing hardcoded values from your code to be modified AFTER compiling.

   

Table of Contents

TopicDescription
InstallationHow to install this library into your project.
.modhx FormatAn explanation of the .modhx format.

     

Installation

First install Modifaxe using one of the commands below:

# install haxelib release (may not exist atm!!)
haxelib install modifaxe

# install nightly (recommended!)
haxelib git modifaxe https://github.com/SomeRanDev/modifaxe.git

Next add the library to your .hxml or compile command:

-lib modifaxe

Add the @:modifaxe metadata to a class or function:

@:modifaxe
function getWindowSize() {
	return 800;
}

Compile your Haxe project to a sys target with file-system access.

Modify the value(s) in the generated values.modhx file:

Main.getWindowSize:
	i.return=800

     

.modhx Format

The .modhx is a text-based file format designed specifically for this project. It is designed to be both human-readable and easily parsable.

 

Comments

Content after a pound sign (#) is a comment and is ignored during parsing:

# This is a comment.
	# This is also a comment.
Something # Comment after content

 

Sections and Values

Entries are separated into sections. A section is a unique identifier followed by a colon.

A list of values should follow with the \t<type>.<name>=<value> format:

[My.Unique.ID]
b.trueOrFalse=true
i.myNum=123
f.floatNum=6.9
s.string="Insert valid Haxe string here.
They can be multiline."

Please note the order of value entries MATTERS. The Haxe code for parsing the custom-made .modhx is hardcoded to expect the values in their generated order. The section and value identifiers exist to help humans locate values to modify.

 

Value Declaration Options

There are four types supported: b is a boolean. i is an integer. f is a float. s is a string.

The name must be a valid Haxe variable name.

The value must be a valid constant Haxe expression of the specified type.

Contributors
SomeRanDev
Version
1.0.0
Published
2 years ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub