LackeyCCG

LackeyCCG Forum => Bug Report Forum => Topic started by: Ascent on September 30, 2011, 04:10:29 AM

Title: Request: Rulebook Button
Post by: Ascent on September 30, 2011, 04:10:29 AM
I would like to be able to provide a rulebook with the starwars plugin hosted from the IDC website that players could click a button within lackey and it would launch the PDF. Of course, the PDF would launch independently of Lackey. There's no need to get fancy. Maybe if the button could be accessible during play would be great.

What do you think? It's just a button and a Rulebook PDF within a folder in the plugin from the IDC website rather than the Lackey website. So it's minimally invasive to Lackey.
Title: Re: Request: Rulebook Button
Post by: Trevor on September 30, 2011, 06:42:34 AM
Why not just open the pdf with any number of designated pdf readers which people already have anyway?

If I were to do something, I would probably just make a button that opens the pdf with your computer's default pdf reader program. I'm not sure that's more convenient than just people opening the pdf file in their lackey folder.
Title: Re: Request: Rulebook Button
Post by: Ascent on September 30, 2011, 11:27:24 AM
I'm not sure why you thought I was saying to launch it in Lackey. I'm saying simply launch it, like a simple shortcut command in Lackey. That's all. No major programming. Just a button. You're saying exactly what I was. And it is more convenient, because they don't have to go opening file folders. This way, just click and launch. What's not convenient about that? Again, the button should be located in the game playing area somewhere where it's visible during play.

There would obviously have to be an entry somewhere in the Lackey files that lets the plugin designer assign the location from where the rulebook would be downloaded.
Title: Re: Request: Rulebook Button
Post by: Ascent on September 30, 2011, 11:32:43 AM
There's another reason why this should be done. I can't find the rules for dbzccg or most of the other games. If the plugin designer knows to include the rulebook location, then I don't have to go hunting down the rulebook that probably can't be located through a search engine anymore anyway. It simply comes with the plugin.

Also, the download request would be coming from the person's computer, so there would be no "hot linking" blocks associated with it (that I'm aware of).
Title: Re: Request: Rulebook Button
Post by: Trevor on September 30, 2011, 11:53:33 AM
Remember we are talking about a small convenience of not opening the file directly, or doing a net search.
Compare that with the minor inconveniences of having a button somewhere taking up space and one more complexity (albeit optional) to plugin creation. Also, I am sure people will complain to me about how it isn't opening properly because they don't have a PDF opening program.

Where do you suggest this button go in the interface?

How about a nice simple "/rulebook" command in the log that opens it?
Title: Re: Request: Rulebook Button
Post by: Ascent on September 30, 2011, 12:54:09 PM
"/Rulebook" or "/rules" works too. That would allow it to be added to the command buttons. That's fine with me.

As for the other problem, anyone that doesn't have a PDF reader, well ... wow. Besides, a programmer's job is to deal with "problems".  :P The player simply makes the request.

As for the problem, perhaps you could have Lackey check first to see if they have a program associated with the PDF file extension. (I believe that's just a single command line.) If they don't have one, then a link would be provided in the log window to a free PDF reader. (Adobe most likely.) I believe that, too, would fit on the same command line in the programming. It seems like a simple If>Then proposition to me. Problem solved.
Title: Re: Request: Rulebook Button
Post by: Cyrus on September 30, 2011, 07:00:20 PM
Its a thankless job, working for nerds

What rulebook can't be found on boardgamegeek?
Title: Re: Request: Rulebook Button
Post by: Ascent on September 30, 2011, 09:05:12 PM
Allow me to put you to task on that. How about, at boardgame geek you look up:

1) Latest SWTCG IDC Rulebook
2) SWTCG Rulebook (WOTC)
4) Dragonball Z Rulebook
5) Dr. Who CCG Rulebook

In fact, most rulebooks of retired games can't be found online that I've seen. You have to already know where to find them, and boargamegeek ain't it.

But my point is avoiding having to go through the searching, but to have the rulebook at your fingertips. It's certainly better to have the plugin designer provide a rulebook than for a bunch of potential players scratching their heads about where they go to learn how to play.
Title: Re: Request: Rulebook Button
Post by: Cyrus on October 03, 2011, 11:41:46 AM
I agree that plugin creators should include a rulebook with the plugin, no question there.
/rules seems like a good idea too, to go along with that
Title: Re: Request: Rulebook Button
Post by: Trevor on October 04, 2011, 12:38:48 PM
Ok, this is all done, and will be public as soon as I post the next version. Here is how it works.

By default, the rulebook is assumed to be adjacent to plugininfo.txt in the plugin's folder, and named "rulebook.pdf". If you do not want to name your rulebook that exactly, you can include a line like this in your plugininfo.txt.

<definition><kind>RULEBOOKFILE</kind><value>MyRuleBook.pdf</value></definition>

Remember, if you name your rulebook "rulebook.pdf", you don't have to modify plugininfo.txt at all.

Users will be able to type "/rule" or "/rules" or "/rulebook" (they all do the same thing) in the chat log. This will both open up the file with your computer's default handler of that file type, and it will also add in the log a message like:
QuoteTrevor looks at the rulebook. (plugins/chess/rulebook.pdf)
The underlined text is clickable by all players, and all players will be able to open the rulebook by clicking it.

Similarly, you will be able to use "/file X" where X is the file path of any file relative to your active plugin's path. So typing "/file rulebook.pdf" is going to do the same thing as "/rulebook". You might want to do something like "/file readme.txt" or "/file changes.txt" or "/file howtoplay.txt".

Remember, these functions will NOT transfer any files. So if your opponent clicks the underlined linked text, and there is no corresponding file on their computer, they will just get an error messaging explaining they don't have a file there to open.

You can transfer files, but that's done with other commands, namely "/send" and "/get".

And plugin makers need to add the rulebook.pdf file to their updatelist.txt file in order for people to actually get one, obviously.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 02:41:40 PM
Spectacular. Much appreciated, Trevor. This will really help a lot toward helping plugin makers spread their games.
Title: Re: Request: Rulebook Button
Post by: Picks-at-Flies on October 04, 2011, 05:46:42 PM
Out of curiosity, could you set RULEBOOKFILE to be a URL?
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 05:54:16 PM
He addressed that. No, you can't. You can only make it part of the plugin. Thus, you put the URL in the updatelist.txt file, but the /rulebook command will only launch it if it's in the same folder as the plugininfo.txt file.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 05:55:36 PM
By the way, putting the link to the Lackey file in the window for all players was a thoughtful edition. I like it.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 05:59:28 PM
Trevor:

When updating the Rulebook, will we need to list it in the file that deletes old files? Or will a plugin update automatically replace it?
Title: Re: Request: Rulebook Button
Post by: Picks-at-Flies on October 04, 2011, 06:12:25 PM
If it has a checksum, Lackey should update it.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 06:47:00 PM
Oh, okay. I never have understood checksums. At least now I know how to generate them, and thanks to you, what they're for.
Title: Re: Request: Rulebook Button
Post by: Trevor on October 04, 2011, 07:24:01 PM
Quote from: Picks-at-Flies on October 04, 2011, 05:46:42 PM
Out of curiosity, could you set RULEBOOKFILE to be a URL?
Yes. Instead of a path to a rulebook file in your plugin's folder, you can put a URL.

/file doesn't need that function since just saying a URL in the game chat will make that URL clickable.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 08:11:32 PM
I thought you said you couldn't link directly to the URL with the /rule command. I guess I misunderstood.
Title: Re: Request: Rulebook Button
Post by: innuendo on October 04, 2011, 08:14:13 PM
so if have my plugin info set RULEBOOKFILE to "http://www.domain.com/rules" it will launch a web browser when i type "/rules"?
Title: Re: Request: Rulebook Button
Post by: Trevor on October 04, 2011, 08:33:06 PM
Quote from: innuendo on October 04, 2011, 08:14:13 PM
so if have my plugin info set RULEBOOKFILE to "http://www.domain.com/rules" it will launch a web browser when i type "/rules"?
Yes.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 09:09:02 PM
That's cool.

Though I like it going into the plugin so that it's always in the same place.

Now I remember, you said it wouldn't download it to the plubin folder by using the /rule command. My bad.
Title: Re: Request: Rulebook Button
Post by: Trevor on October 04, 2011, 09:27:04 PM
Quote from: Ascent on October 04, 2011, 09:09:02 PM
That's cool.

Though I like it going into the plugin so that it's always in the same place.

Now I remember, you said it wouldn't download it to the plubin folder by using the /rule command. My bad.
What I said was clicking on your friend's linked rulebook wouldn't download that to you if you didn't already have it. But if they have a rulebook.pdf, you should also if the plugin maker didn't do something dumb.
Title: Re: Request: Rulebook Button
Post by: Ascent on October 04, 2011, 09:30:57 PM
Ahhh.

I'm allergic to rereading long post.  :P
Title: Re: Request: Rulebook Button
Post by: fr0sch on February 14, 2012, 07:35:24 AM
Sorry that I dig out this thing.
I just included a rulebook.pdf for my plugin, but it doesn't work.
Typing "/rules" or "/rulebook" in the command returns the message "SecretCaveman looks at the rulebook. (plugins/EUDS/rulebook.pdf)", but the .pdf won't open.
The pdf is at the right place (the one mentioned in the message) and if I open it manually it opens up just fine. Is there anything I have to change in the plugininfo.txt or anything?
Title: Re: Request: Rulebook Button
Post by: Trevor on February 14, 2012, 10:41:52 AM
You computer may have some sort of "security" system in place that prevents Lackey from opening a file. "/rules" should open it, or you can also try clicking the link that appears in the log.

In any case, this isn't a huge problem because you can always just open the rulebook in your operating system.