Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
NullData

TUT How to add a Header Image to your PreferenceBundle

Recommended Posts

fv71UUh.jpg

 

 

So I'm going to assume you already have a patcher already made.

 

Now lets get started shall we...

 

 

Step 1: Download the PFHeaderCell.mm and PFHeaderCell.h  

Hidden Content
You'll be able to see the hidden content once you reply to this topic.

 

Step 2: Send the PFHeaderCell.mm and PFHeaderCell.h to your /ProjectFolder/ProjectFolderPreferences/ (in my case it's /var/mobile/magicpiano/MagicPiano/)

 

7zhSufp.jpg

 

 

Step 3: Now we need to include the file inside you're Makefile so edit your Makefile with any text editor.

(NOTE we will edit the makefile where you placed the 2 PHHeader files in)

ProjectName_FILES = ProjectName.mm PFHeaderCell.mm

 

 

ARCHS = armv7 arm64
include theos/makefiles/common.mk

BUNDLE_NAME = MagicPiano
MagicPiano_FILES = MagicPiano.mm PFHeaderCell.mm <----- ADD -----
MagicPiano_INSTALL_PATH = /Library/PreferenceBundles
MagicPiano_FRAMEWORKS = UIKit
MagicPiano_PRIVATE_FRAMEWORKS = Preferences

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/MagicPiano.plist$(ECHO_END)
 

 

 

 

Step 4: Save the Makefile and enter the "Resources" folder so we can edit the ProjectName.plist.

 

Step 5: Edit the ProjectName.plist inside /ProjectFolder/ProjectPreferences/Resources/ and add this XML code at the top right under the <array> tag opens.

<dict>
    <key>cell</key>
    <string>PSStaticTextCell</string>
    <key>cellClass</key>
    <string>PFHeaderCell</string>
    <key>background</key>
    <string>#EFEFF4</string>
    <key>image</key>
    <string>/Library/PreferenceBundles/ProjectNamePreferences.bundle/header.png</string>
    <key>height</key>
    <integer>100</integer>
</dict>

Example:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>items</key>
	<array>
		<dict>
			<key>background</key>
			<string>#EFEFF4</string>
			<key>cell</key>
			<string>PSStaticTextCell</string>
			<key>cellClass</key>
			<string>PFHeaderCell</string>
			<key>height</key>
			<integer>100</integer>
			<key>image</key>
			<string>/Library/PreferenceBundles/MagicPiano.bundle/header.png</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSGroupCell</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.iOSMods.magicpiano</string>
			<key>icon</key>
			<string>Vip.png</string>
			<key>key</key>
			<string>kVip</string>
			<key>label</key>
			<string>Free VIP</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSGroupCell</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSTextCell</string>
			<key>label</key>
			<string>©ReBoot 2015</string>
		</dict>
		<dict>
			<key>action</key>
			<string>link2</string>
			<key>cell</key>
			<string>PSButtonCell</string>
			<key>icon</key>
			<string>Twitter.png</string>
			<key>label</key>
			<string>Twitter</string>
		</dict>
		<dict>
			<key>action</key>
			<string>link</string>
			<key>cell</key>
			<string>PSButtonCell</string>
			<key>icon</key>
			<string>Link.png</string>
			<key>label</key>
			<string>Visit iOSMods</string>
		</dict>
	</array>
	<key>title</key>
	<string>Magic Piano Hack</string>
</dict>
</plist>
 

 

 

 

(NOTE when you place the code in the .plist make sure you edit the ProjectNamePreferences and replace it with your Bundle Name /Library/PreferenceBundles/MagicPiano.bundle/header.png)

 

Step 6: Save the plist you just modified and now we will need the Header Images.

 

Headers have to be scaled in 320x100 pixels and 640x200 for @2x resolution. For best results, make the header image with a transparent background so open up Photoshop and get to work.

 

Once you have your images, place them in the /Resources/ folder and make sure their names are header.png & header@2x.png otherwise the header image won't appear.

 

OWo6NrH.jpg

 

 

Step 7: Now compile and install your package then check your iDevice settings.

ReBoot:/var/mobile root# cd /var/mobile/magicpiano
ReBoot:/var/mobile/magicpiano root# make package install

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...