Difference between revisions of "Development"

From RocketLauncher Wiki
Jump to navigation Jump to search
(Created page with "'''Development'''")
 
Line 1: Line 1:
'''Development'''
+
{| class="wikitable" style="background: transparent;"
 +
 
 +
|'''Contents'''
 +
<br />
 +
1 Creating your own functions<br />
 +
:1.1 Lib\User Functions Init.ahk<br />
 +
:1.2 Lib\User Functions.ahk<br />
 +
:1.2.1 StartGlobalUserFeatures()<br />
 +
:1.2.2 StopGlobalUserFeatures()<br />
 +
:1.3 Don't Repeat Yourself<br />
 +
2 HyperLaunch.dll<br />
 +
:2.1 checkModuleCRC<br />
 +
:2.2 set7zdllPath<br />
 +
:2.3 findFileInZip<br />
 +
:2.4 findByExtension<br />
 +
:2.5 getZipExtractedSize<br />
 +
:2.6 getExtractionSize<br />
 +
:2.7 getExtractionProgress<br />
 +
:2.8 getFolderSize<br />
 +
:2.9 getLongestPathSize<br />
 +
:2.10 getZipFileList<br />
 +
:2.11 getZipFileCount<br />
 +
:2.12 checkInvalidCharacters<br />
 +
:2.13 getConnectedJoysticks<br />
 +
:2.14 getPdfPageCount<br />
 +
:2.15 generatePngFromPdf<br />
 +
:2.16 setLogMode
 +
 
 +
|}
 +
 
 +
----
 +
<br />
 +
<br />
 +
----
 +
<span style="font-size:140%">'''Creating Your Own Functions'''</span>
 +
<br />
 +
*'''You can add your own functions and code to affect every module'''
 +
*You have 2 functions in your \Lib folder called '''User Functions Init.ahk''' and '''User Functions.ahk'''
 +
<br />
 +
'''<span style="font-size:115%">Lib\</span>User Functions Init.ahk'''
 +
<br />
 +
*This should contain any code you want to "Run" with the modules. This is where you place code you might need to setup or initialize something you want to run later. Take a look at and of the other Init ahks to see how these files are used.
 +
*'''DO NOT''' place any Functions or Labels in this file, it will lock up the thread and give the appearance it froze when it's actually stuck in your function not knowing what to do.
 +
*This file will "Run" before StartModule() found in each module. For example, if you place this script in this file: "MsgBox test", it will show a msgbox on launch of every emulator.
 +
*So you can see why it's important you place only script you feel is required for every module.
 +
<br />
 +
'''<span style="font-size:115%">Lib\</span>User Functions.ahk'''
 +
<br />
 +
*This should contain any Functions and Labels that are called within the module itself. Take a look at and of the other non-Init ahks to see how these files are used.
 +
*If you create a function that looks like this:
 +
<pre style="color: green">MyFunc(text){
 +
MsgBox, %text%
 +
}</pre>
 +
<br />
 +
*Then in the module place this line anywhere you want: "MyFunc("Hello World")", it will show you the msgbox at that specific spot.
 +
<br />
 +
StartGlobalUserFeatures()
 +
<br />
 +
*This function has already been created for you in Lib\User Functions.ahk.
 +
*Place any ahk code in the space provided and it will be launched at the beginning of every module, before the emulator runs.
 +
<br />
 +
StopGlobalUserFeatures()
 +
<br />
 +
*This function has already been created for you in Lib\User Functions.ahk.
 +
*Place any ahk code in the space provided and it will be launched at the end of every module, after the emulator is closed, but before the module thread exits.
 +
<br />
 +
<br />
 +
'''<span style="font-size:115%">Don't Repeat Yourself</span>'''
 +
<br />
 +
*A very good rule of thumb to follow is something called DRY: http://en.wikipedia.org/wiki/Don't_repeat_yourself
 +
*When you create your own code, and you need to go back and change something, if you did not follow the above principles, you might not remember to change all instances of something.
 +
<br />
 +
----
 +
<br />
 +
'''<span style="font-size:140%">HyperLaunch.dll</span>
 +
<br />
 +
<br />
 +
This dll provides some critical functions to get many of the features working. To utilize it, we have to first create a com object, then pass that along with what we want the dll to do.

Revision as of 12:35, 31 January 2015

Contents


1 Creating your own functions

1.1 Lib\User Functions Init.ahk
1.2 Lib\User Functions.ahk
1.2.1 StartGlobalUserFeatures()
1.2.2 StopGlobalUserFeatures()
1.3 Don't Repeat Yourself

2 HyperLaunch.dll

2.1 checkModuleCRC
2.2 set7zdllPath
2.3 findFileInZip
2.4 findByExtension
2.5 getZipExtractedSize
2.6 getExtractionSize
2.7 getExtractionProgress
2.8 getFolderSize
2.9 getLongestPathSize
2.10 getZipFileList
2.11 getZipFileCount
2.12 checkInvalidCharacters
2.13 getConnectedJoysticks
2.14 getPdfPageCount
2.15 generatePngFromPdf
2.16 setLogMode




Creating Your Own Functions

  • You can add your own functions and code to affect every module
  • You have 2 functions in your \Lib folder called User Functions Init.ahk and User Functions.ahk


Lib\User Functions Init.ahk

  • This should contain any code you want to "Run" with the modules. This is where you place code you might need to setup or initialize something you want to run later. Take a look at and of the other Init ahks to see how these files are used.
  • DO NOT place any Functions or Labels in this file, it will lock up the thread and give the appearance it froze when it's actually stuck in your function not knowing what to do.
  • This file will "Run" before StartModule() found in each module. For example, if you place this script in this file: "MsgBox test", it will show a msgbox on launch of every emulator.
  • So you can see why it's important you place only script you feel is required for every module.


Lib\User Functions.ahk

  • This should contain any Functions and Labels that are called within the module itself. Take a look at and of the other non-Init ahks to see how these files are used.
  • If you create a function that looks like this:
MyFunc(text){
 MsgBox, %text%
}


  • Then in the module place this line anywhere you want: "MyFunc("Hello World")", it will show you the msgbox at that specific spot.


StartGlobalUserFeatures()

  • This function has already been created for you in Lib\User Functions.ahk.
  • Place any ahk code in the space provided and it will be launched at the beginning of every module, before the emulator runs.


StopGlobalUserFeatures()

  • This function has already been created for you in Lib\User Functions.ahk.
  • Place any ahk code in the space provided and it will be launched at the end of every module, after the emulator is closed, but before the module thread exits.



Don't Repeat Yourself

  • A very good rule of thumb to follow is something called DRY: http://en.wikipedia.org/wiki/Don't_repeat_yourself
  • When you create your own code, and you need to go back and change something, if you did not follow the above principles, you might not remember to change all instances of something.




HyperLaunch.dll

This dll provides some critical functions to get many of the features working. To utilize it, we have to first create a com object, then pass that along with what we want the dll to do.