Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 64

othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
12/08/15 01:29 PM (8 years ago)

Hangman plugin: need for more than one screen

Hi, I wanted to use the Ultimate Hangman plugin for up to 2 screens. The problem is that the words dictionary called wordlist.txt in the .m file is not designed to be customized and there are no advanced setting to do that. For my example i want to use for exemple different wordlist.txt files, but i have no idea how to do that. Thanks in advance
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/08/15 03:51 PM (8 years ago)
Well, you can always add your own modifications. In your example, the solution would be to 'add' a json key/value pair 'manually' to the plugin control panel. For instance, in hangman '1' you can add a key/value pair like: "whichList": "1" (depending on 'where' it is inserted, you may or may not need a comma) and in the code of the plugin, something similar to: if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"whichList" defaultValue:@"0"] isEqualToString:@"1"]){ myWordList = @"list1.txt" } else { myWordList = @"list2.txt" } This isn't 'exact' because I don't have the plugin, but the logic is sound. Good Luck! Cheers! -- Smug
 
othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
like
12/08/15 04:19 PM (8 years ago)
Thanks Smug, it sounds logic, I will try your solution. Cheers!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/08/15 04:23 PM (8 years ago)
Looking at the source files of the plugin. I'm guessing that where wordlist.txt is referenced is gameScene.m If this is the case Smugs way will not be very easy as gameScene.m will not be a subclass of BT_viewController so will have no access to self.screendata. The plugin will require modding Without seeing the code there is not much that can be done other than reaching out to the developer. To extend on Smugs idea so you don't have to mess about with the control panel side of things instead of making a new Jain element I would utilise an already unique property of the screen the itemId the 16 + alaphanumeric string that each unique screen gets eg SHJI12H5YUHL you will see them I would name your letters text file SHJI12H5YUHL.txt for each individual screen. That is then accessed through self.screenData.itemID
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/08/15 04:27 PM (8 years ago)
Bad typos above 10 month old screaming down my ear accompanied by sausage fingers on an iPhone keyboard
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.