// v1.0.0.0
// *********************************************************************************
// *
// * .htmlFile
// * by nel (NELMVN)
// *
// * A lightweight library that allows you to create, write, and design your own
// * HTML file. It is more faster than .bat to .txt conversion and compatible in
// * Internet Explorer, Google Chrome, Avast Secure Browser, Mozilla Firefox,
// * etc.
// *
// *********************************************************************************
// *
// * Functions
// *
// * function HTML_new takes string directory, real fontSize returns integer
// * - Create a new .html file.
// *
// * function HTML_print takes string str returns nothing
// * function HTML_println takes string str returns nothing
// *
// * function HTML_end takes nothing returns nothing
// * - Close the generated .html file.
// *
// *********************************************************************************
// *
// * Issues:
// *
// * - print() may handle up to 252 characters.
// * - println() may handle up to 248 characters.
// * - Use '<br>' instead of '\r\n' in print() and println().
// *
// *********************************************************************************
// *
// * Note:
// *
// * Put this on your map's custom script code.
// *
// *********************************************************************************
function HTML_new takes string directory, real fontSize returns nothing
call PreloadGenClear()
call PreloadGenStart()
call Preload("<html><body class=\"x\"><style>.x { font-size: 0; }.y { font-size: " + R2S(fontSize) + "; }</style><div class=\"y\"><!--")
set udg_HTML_Directory = directory
endfunction
function HTML_print takes string str returns nothing
call Preload("-->" + str + "<!--")
endfunction
function HTML_println takes string str returns nothing
call Preload("-->" + str + "<br><!--")
endfunction
function HTML_end takes nothing returns nothing
call Preload("--></div></body></html><!--\r\n\r\n\r\nMade by github.com/NELMVN\r\n\r\n\r\n")
call PreloadGenEnd(udg_HTML_Directory + ".html")
set udg_HTML_Directory = null
endfunction
Name | Type | is_array | initial_value |
HTML_Directory | string | No | |
HTML_fontSize | real | No |
//! zinc
library htmlFile { /* v1.0.0.0
*************************************************************************************
*
* .htmlFile
* by nel (NELMVN)
*
* A lightweight library that allows you to create, write, and design your own
* HTML file. It is more faster than .bat to .txt conversion and compatible in
* Internet Explorer, Google Chrome, Avast Secure Browser, Mozilla Firefox,
* etc.
*
************************************************************************************
*
* struct HTML extends array
*
* static method new takes string directory, real fontSize returns nothing
* - Create a new .html file.
*
* static method print takes string str returns nothing
* static method println takes string str returns nothing
*
* static method end takes nothing returns nothing
* - Close the generated .html file.
*
************************************************************************************
*
* Issues:
*
* - print() may handle up to 252 characters.
* - println() may handle up to 248 characters.
* - Use '<br>' instead of '\r\n' in print() and println().
*
***********************************************************************************/
public struct HTML[] {
private static string Directory;
public {
static method new( string directory, real fontSize ) {
PreloadGenClear();
PreloadGenStart();
debug if( directory == null ) {
debug BJDebugMsg("[HTML Error new()] directory is a null.");
}
Preload(
"<html><body class=\"x\">" +
"<style>.x { font-size: 0; }" +
".y { font-size: " + R2S(fontSize) + "; }</style>" +
"<div class=\"y\"><!--"
);
thistype.Directory = directory;
}
static method print( string str ) {
Preload("-->" + str +"<!--");
debug if( StringLength(str) > 252 ) {
debug BJDebugMsg("[HTML Error print()] str reached the limit.");
}
}
static method println( string str ) {
Preload("-->" + str +"<br><!--");
debug if( StringLength(str) > 248 ) {
debug BJDebugMsg("[HTML Error println()] str reached the limit.");
}
}
static method end() {
Preload("--></div></body></html><!--" +
"\r\n\r\n\r\nMade by github.com/NELMVN\r\n\r\n\r\n"
);
PreloadGenEnd(Directory + ".html");
thistype.Directory = null;
}
}
}
}
//! endzinc
scope Test initializer Initialization
private function Initialization takes nothing returns nothing
call HTML.new("HTML\\Sample", 30)
call HTML.print("aaaa")
call HTML.print("dddd")
call HTML.println("bbbb")
call HTML.println("cccc")
call HTML.print("eeee")
call HTML.end()
endfunction
endscope
scope Test initializer Initialization
private function Initialization takes nothing returns nothing
call HTML.new("HTML\\Design\\Sample1", 13)
call HTML.print("<center><h1>Save Code</h1>")
call HTML.print("<br><br><br>")
call HTML.println("Character")
call HTML.println("-load ABCD-EFGH-IJKL-MNOP-QRST-UVWX-YZ")
call HTML.println("<br>Achievements")
call HTML.println("-load XXXX-XXXX-TTTT-TTTT-QQQQ-WWWS-WW")
call HTML.print("</center>")
call HTML.end()
endfunction
endscope
// v1.0.0.0
// *********************************************************************************
// *
// * .htmlFile
// * by nel (NELMVN)
// *
// * A lightweight library that allows you to create, write, and design your own
// * HTML file. It is more faster than .bat to .txt conversion and compatible in
// * Internet Explorer, Google Chrome, Avast Secure Browser, Mozilla Firefox,
// * etc.
// *
// *********************************************************************************
// *
// * Functions
// *
// * function HTML_new takes string directory, real fontSize returns integer
// * - Create a new .html file.
// *
// * function HTML_print takes string str returns nothing
// * function HTML_println takes string str returns nothing
// *
// * function HTML_end takes nothing returns nothing
// * - Close the generated .html file.
// *
// *********************************************************************************
// *
// * Issues:
// *
// * - print() may handle up to 252 characters.
// * - println() may handle up to 248 characters.
// * - Use '<br>' instead of '\r\n' in print() and println().
// *
// *********************************************************************************
// *
// * Note:
// *
// * Put this on your map's custom script code.
// *
// *********************************************************************************
function HTML_new takes string directory, real fontSize returns nothing
call PreloadGenClear()
call PreloadGenStart()
call Preload("<html><body class=\"x\"><style>.x { font-size: 0; }.y { font-size: " + R2S(fontSize) + "; }</style><div class=\"y\"><!--")
set udg_HTML_Directory = directory
endfunction
function HTML_print takes string str returns nothing
call Preload("-->" + str + "<!--")
endfunction
function HTML_println takes string str returns nothing
call Preload("-->" + str + "<br><!--")
endfunction
function HTML_end takes nothing returns nothing
call Preload("--></div></body></html><!--\r\n\r\n\r\nMade by github.com/NELMVN\r\n\r\n\r\n")
call PreloadGenEnd(udg_HTML_Directory + ".html")
set udg_HTML_Directory = null
endfunction