This is the third entry of the Bmax help, here we are going to explain two new functions (help and echoFile). Besides we have done a few fixes here and there to improve the code and the understanding of the project files.
First of all, we need the txt files on the vpk package, so we are adding those to the project, in the CMakeLists.txt
adding txt files to the project in CMakeLists.txt |
Next,
we have change the name of main.h to common.h because it is a more
adecuate name. After that, we have added declarations for the new
functions we are going to create and use this time.
new functions in common.h |
Now
to the coding part: for the help function we need the language (which
we have previously got), and the help printing, but the printing will be
used with more texts so we will better have an specific function for
that.
We have name the printing funcion, echoFile, as it is going to echo the file on screen.
Any specific explanation of the code is in its comments as a good programming practice.
echoFile function |
Note: In the future should be desirable to upgrade it, and make here the font size bigger to make the text easier to read (this is because, on the contrary with the debug log and other normal prints it is specific for user in-app reading).
Note 2: there is a known bug in japanese text files, caused by the codification. This bug affects to other languages too.
Having done the echoFile
function, we need the help function to choose the right txt file
(remember that we have one with each language).
Last but not
least, we want the help to print the file, it is time to use the
echoFile function with the datapath obtained for the language.
help function |
Moving
forward. We have the basics of an app, it is time to create a github to
upload all the code and files of this project. In addition, a re-read
and update of some of the previous entries with some fixes will be made.
When this is done, we will add the github link on https://homebrew-psvita.blogspot.com/2020/08/bmax-part-0.html to have a quick access to it.
No comments:
Post a Comment