Forum

Hanahira!

はなひらっ!/ SonoHana spinoff VN

Författare Svar
markingdude Monday 2 December 2013 at 0:25
markingdude

Due to the popularity of the VN series, the developers decided to create a spin-off VN for female readers. This was tested using Mac OS X 10.6-10.9 and needed nothing else.

[code language=playonlinux]
#!/bin/bash
# Date : (2013-03-01)
# Last revision : (2013-10-05)
# Wine version used : 1.3.4
# Distribution used to test : Mac OS X 10.8.4
# Author : Marking

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

# Setup some needed variables
TITLE="Hanahira!"
PREFIX="Hanahira"
WINEVERSION="1.3.4"
EDITOR="Fuguriya"
GAME_URL="http://fuguriya.sakura.ne.jp"
AUTHOR="Marking"

INSTALL_JP='インストール'
END_JP='終了'
YES_JP='はい'

# Download images for installation script
POL_GetSetupImages "images.markinglifestyle.com/sonohana_mac/script_icons/Hanahira-64x64.png" "http://images.markinglifestyle.com/sonohana_mac/script_banners/SH_HH.jpg" "$TITLE"

# Initialize the script, debugging, and set required version
POL_SetupWindow_Init
POL_RequiredVersion "4.1.6" || POL_Debug_Fatal "$APPLICATION_TITLE 4.1.6 is required to install $TITLE"
POL_Debug_Init
 
# Setup presentation window
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Begin setting up the Wine Prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"
SONOHANA="$WINEPREFIX/drive_c/$PROGRAMFILES/ふぐり屋/はなひらっ!/"

# Installs Japanese fonts in order for visual novel to work
JP_FONTS="sazanami-20040629.zip"
cd "$WINEPREFIX/drive_c/windows/Fonts/"
POL_Download "http://files.markinglifestyle.com/sh_files/sazanami-20040629.zip"
POL_System_unzip $JP_FONTS

# Ask user for either DVD or Local installation
POL_SetupWindow_InstallMethod "LOCAL,DVD"

if [ "$INSTALL_METHOD" = "LOCAL" ]
then
    # Ask user to find "Setup.exe"
    cd "$HOME"
    POL_SetupWindow_browse "$(eval_gettext 'Please locate installation program (Setup.exe)')" "$TITLE"
    # Tell user what to do while the installation program is running
    POL_SetupWindow_message "$(eval_gettext 'When the install program starts, click on ${INSTALL_JP}. When a new window opens, click on ${INSTALL_JP}. When installation finishes, click on ${END_JP} and then on ${YES_JP} (Y). Click Next to begin installation.')" "Installation instructions"   
    LANG="ja_JP.UTF-8" POL_Wine "$APP_ANSWER"       
elif [ "$INSTALL_METHOD" = "DVD" ]
then
    # Launches the installation program from CD/DVD
    POL_SetupWindow_cdrom
    POL_SetupWindow_check_cdrom
    # Tell user what to do while the installation program is running
    POL_SetupWindow_message "$(eval_gettext 'When the install program starts, click on ${INSTALL_JP}. When a new window opens, click on ${INSTALL_JP}. When installation finishes, click on ${END_JP} and then on ${YES_JP} (Y). Click Next to begin installation.')" "Installation instructions"   
    LANG="ja_JP.UTF-8" POL_Wine "$CDROM/Setup.exe"
fi

# Apply fjfix to fix the visual novel
FJFIX_PATCH="fjfix.zip"
cd "$SONOHANA"
POL_Download "http://files.markinglifestyle.com/sh_files/fjfix.zip" "789634f517003c1619eca669a83306a0"
POL_System_unzip $FJFIX_PATCH
POL_Wine_WaitBefore "the fjfix patch"
POL_Wine "fjfix.exe" -f MGD
   
# Create a shortcut for easy access
POL_Shortcut "HANA9.EXE" "はなひらっ!"
# Insert a command to run as a Japanese application
POL_Shortcut_InsertBeforeWine "はなひらっ!" "LANG=ja_JP.UTF-8"
POL_SetupWindow_Close
exit
[/code]

The images:
Screenshot
22x22 icon
48x48 icon
Top right icon
Left banner
petch Monday 2 December 2013 at 22:13
petch
Developer

Looks ok.
A small description of the changes I made while validating the previous script though:
- I added a POL_SetupWindow_SetID right after POL_SetupWindow_Init, the script ID is known since script edition (it appears in the URL)
- I update the POL_GetSetupImages URL arguments to use PlayOnLinux servers (not difficult to do though, it's always the same arguments)
- I added a third argument "shortcut name.png" to POL_Shortcut to use the provided 48x48 icon. To avoid repeating the shortcut name a third time in the script, I put it into a variable $SHORTCUT_NAME
markingdude Tuesday 3 December 2013 at 5:43
markingdude

Thanks for the info about the changes. I take it these are done for all other scripts as well. I understand that the images are eventually hosted via PoL/PoM, but I host them on my site first for testing purposes.

I take it the $SHORTCUT_NAME variable is done because the name is in Japanese, correct? I'll probably start using this for the remaining scripts. As always, thanks for validating and giving me the scoop on some code.

Ändrat av markingdude

petch Tuesday 3 December 2013 at 21:38
petch
Developer

I take it the $SHORTCUT_NAME variable is done because the name is in Japanese, correct?

Quote from markingdude


Nope, it's always a good idea to try to keep redundancy at a low level; Using a variable make it obvious what values need to be the same, and simplifies modifications.

markingdude Tuesday 3 December 2013 at 21:52
markingdude

Ah OK. I was just making sure since I remember some new variables being added a while back was due to Japanese characters in setup messages. Nonetheless, script has been sent for validation.

Ändrat av markingdude

petch Tuesday 3 December 2013 at 22:34
petch
Developer

Variables have lots of uses
There's one programmer saying that goes like: any problem can be solved by adding a level of indirection (all but performance problems, that are solved by removing a level of indirection).

Anyway, script validated :)
Du är här: Index > Your creations. > Hanahira!