Page 44 of 121

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 05, 2016 9:02 pm
by philo
desertfox wrote:Sorry to keep asking endless questions, but is there anyway from javascript to set a button that was added via override's hotkey and sortOrder attributes?
Are you asking if you can add buttons using over ride that adds all the new options then yes
addButton(String target, String text, String set, String unSet, String jScript, String image, String hotKey, String sortOrder, boolean disabled, String id)

* @param target the page to go to
* @param text the text displayed on the button
* @param set the flags to set if the button is pressed
* @param unSet the flags to clear if the button is pressed
* @param jScript the Java Script function to run if the button is pressed
* @param image the background image for the button
* @param hotKey the hot key assigned to the button
* @param sortOrder the sort order value (used to sort the buttons)
* @param disabled the disabled state of the button (true to disable it)
* @param id the id to use to manipulate the button from Java Script

I need to update the documentation on override still for 0.1.4

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Wed Jan 06, 2016 6:07 am
by desertfox
Awesome, thank you!

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Wed Jan 06, 2016 9:53 pm
by philo
desertfox wrote:I had a javascript question, really a curiosity so no big deal, but basically I was just getting a random list of files back and was unable to pop() or shift() them out. If the array had 7 items in it, and the last item was 'cool_file.txt' and I would run shift() on it, the last two items would be 'cool_file.txt', on the next shift the last 3 items would be like that, until the whole array was renamed to 'cool_file.txt'. So I would shift out the files but the array never emptied. Really weird.

I fixed it by just copying the list items to a new array like this:

Code: Select all

var ordered_encs =  guide.listFiles( guide.fixPath("Scripts/random_encounters") );
var encs = ordered_encs.split(",");
var non_fucked = []; //encs wont push/pop right for some reason
for( var i = 0; i<encs.length; i++ )
	non_fucked[i] = encs[i];
		
//shuffle order
parent.random_encounters = shuffle( non_fucked );

//later on was where i was doing the shifts and pops. Code worked when I added the 'non_fucked[]' array :)
Having had a look at this, I think it is because a Java string and a Javascript string are two different objects.
listFiles returns a java string so I think what is happening is encs is an array of Java strings but non_fucked is an array of Javascript strings.
So you probably do need the code you wrote to do the conversion.

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Wed Jan 06, 2016 11:41 pm
by desertfox
philo wrote: Having had a look at this, I think it is because a Java string and a Javascript string are two different objects.
listFiles returns a java string so I think what is happening is encs is an array of Java strings but non_fucked is an array of Javascript strings.
So you probably do need the code you wrote to do the conversion.
Ahh ok, I can probably even try to drop the list files into a new var or call new String() on it before doing the split and that may work too. Strongly typed languages ftw ;) Thank you for the answer!

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Wed Jan 06, 2016 11:59 pm
by guardianx
philo wrote:
desertfox wrote:I had a javascript question, really a curiosity so no big deal, but basically I was just getting a random list of files back and was unable to pop() or shift() them out. If the array had 7 items in it, and the last item was 'cool_file.txt' and I would run shift() on it, the last two items would be 'cool_file.txt', on the next shift the last 3 items would be like that, until the whole array was renamed to 'cool_file.txt'. So I would shift out the files but the array never emptied. Really weird.

I fixed it by just copying the list items to a new array like this:

Code: Select all

var ordered_encs =  guide.listFiles( guide.fixPath("Scripts/random_encounters") );
var encs = ordered_encs.split(",");
var non_fucked = []; //encs wont push/pop right for some reason
for( var i = 0; i<encs.length; i++ )
	non_fucked[i] = encs[i];
		
//shuffle order
parent.random_encounters = shuffle( non_fucked );

//later on was where i was doing the shifts and pops. Code worked when I added the 'non_fucked[]' array :)
Having had a look at this, I think it is because a Java string and a Javascript string are two different objects.
listFiles returns a java string so I think what is happening is encs is an array of Java strings but non_fucked is an array of Javascript strings.
So you probably do need the code you wrote to do the conversion.
Philo is right about Java String object vs Javascript. What you're seeing is the array.pop() array.shift() methods being unable to free the element properly. What you can do is force a string conversion by doing the following:

Code: Select all

var ordered_encs = "" + guide.listFiles( guide.fixPath("Scripts/random_encounters") );
//ordered_encs is now a true javascript string

var encs = ordered_encs.split(",");
encs.pop() 
//encs will push/pop just fine now

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Thu Jan 07, 2016 3:47 am
by desertfox
guardianx wrote:
philo wrote:
desertfox wrote:I had a javascript question, really a curiosity so no big deal, but basically I was just getting a random list of files back and was unable to pop() or shift() them out. If the array had 7 items in it, and the last item was 'cool_file.txt' and I would run shift() on it, the last two items would be 'cool_file.txt', on the next shift the last 3 items would be like that, until the whole array was renamed to 'cool_file.txt'. So I would shift out the files but the array never emptied. Really weird.

I fixed it by just copying the list items to a new array like this:

Code: Select all

var ordered_encs =  guide.listFiles( guide.fixPath("Scripts/random_encounters") );
var encs = ordered_encs.split(",");
var non_fucked = []; //encs wont push/pop right for some reason
for( var i = 0; i<encs.length; i++ )
	non_fucked[i] = encs[i];
		
//shuffle order
parent.random_encounters = shuffle( non_fucked );

//later on was where i was doing the shifts and pops. Code worked when I added the 'non_fucked[]' array :)
Having had a look at this, I think it is because a Java string and a Javascript string are two different objects.
listFiles returns a java string so I think what is happening is encs is an array of Java strings but non_fucked is an array of Javascript strings.
So you probably do need the code you wrote to do the conversion.
Philo is right about Java String object vs Javascript. What you're seeing is the array.pop() array.shift() methods being unable to free the element properly. What you can do is force a string conversion by doing the following:

Code: Select all

var ordered_encs = "" + guide.listFiles( guide.fixPath("Scripts/random_encounters") );
//ordered_encs is now a true javascript string

var encs = ordered_encs.split(",");
encs.pop() 
//encs will push/pop just fine now
Oh awesome, little bit of trickery there, nice, thank you.

Version 0.1.5 (minor fixes)

Posted: Sun Jan 10, 2016 4:54 pm
by philo
Bug fix release of Guide Me.

64 Bit Windows
https://mega.nz/#!JFZmiTJb!A-U7sxw05qF5 ... jq3cwOqTo4
32 Bit Windows
https://mega.nz/#!NB4TWRzS!243tfn6qJtZC ... FgF8gfrGh8

Documentation
OverRide updated
https://github.com/philormand/TeaseMeV2/wiki/Override

Issues addressed in this version
  • Spurious scroll bar.
  • Issue with reading files in java script and audio on the same page
  • Issue with re sizing images in certain situations

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Sun Jan 10, 2016 4:59 pm
by philo
desertfox wrote:Hello, I think I have found an odd bug having to do with playing audio in the 32 big version (might also do it in the 64).

Basically when playing an audio file on a page and in the pageLoad of the same page trying to call the guide.jsReadFileArray() it will always return null. Attached is a really short guide which tests it out, but is basically this:

Code: Select all

<Page id="start">
      <javascript>
      <![CDATA[
          function pageLoad()
          {
             
              overRide.setAudio("Audio/Ding.mp3", "", "", "", "", "", "", "");


            var lines = guide.jsReadFileArray( "test.txt");
            jscriptLog("Lines: " +lines +" Length: " +lines.length);
          }
      ]]>
      </javascript>
      <Text>
        <p>Try it!</p>
      </Text>
    </Page>
The behavior to reproduce:
1. Start guideme from start.bat
2. Open tease
3. Checking jscriptlog it works correctly, see the array and the length

4. File -> Open, pick the guide
5. Crash, checking the log, lines is returned null.

Any successive file-> opens will keep producing null. If you restart guideme by shutting down, it keeps working that first time.

If you remove the audio call, the restart guideme, it works every time.

The behavior was present if I was using the override function or the standard XML audio tag.
This has now been fixed in 0.1.5
(It was badly written threading code in the audio, which should now be fixed)

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Mon Jan 11, 2016 5:31 am
by desertfox
Thank you for the update!

Just tried out the 32 bit version and noticed that there are scroll bars permanetly on both frames now where the last 32 version and version before that did not have them. Is there an option to get them back to only appearing when they are needed or was it supposed to be like that?

Also here is the java version just in case that factors in somehow.
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

Double checked the audio bug and image scaling and they are working perfect now!

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Mon Jan 11, 2016 7:06 pm
by philo
desertfox wrote:Thank you for the update!

Just tried out the 32 bit version and noticed that there are scroll bars permanetly on both frames now where the last 32 version and version before that did not have them. Is there an option to get them back to only appearing when they are needed or was it supposed to be like that?

Also here is the java version just in case that factors in somehow.
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

Double checked the audio bug and image scaling and they are working perfect now!
Try editing the defaultcss.txt and removing the last line something like html{ autoflow:both} I think, I added it to resolve another issue.

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 12, 2016 1:47 am
by desertfox
philo wrote: Try editing the defaultcss.txt and removing the last line something like html{ autoflow:both} I think, I added it to resolve another issue.
Thank you, that did it! Well not just the overflow, it looked like the only thing different was html was on top of the default css and you added the overflow:auto's...but those should probably hide the scroll bars so says w3schools at least hehe. Anyway I just took the previous defaultcss and put it in the 1.5 guide me and it's back to 'normal'. Thank you again!

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 12, 2016 4:36 am
by guardianx
desertfox wrote:
philo wrote: Try editing the defaultcss.txt and removing the last line something like html{ autoflow:both} I think, I added it to resolve another issue.
Thank you, that did it! Well not just the overflow, it looked like the only thing different was html was on top of the default css and you added the overflow:auto's...but those should probably hide the scroll bars so says w3schools at least hehe. Anyway I just took the previous defaultcss and put it in the 1.5 guide me and it's back to 'normal'. Thank you again!
Actually the problem is that the css is malformed. It probably should look like this:

Code: Select all

html {overflow: auto;}

body { 
	color: white; 
	background-color: black; 
	font-family: Tahoma; 
	font-size:MintHtmlFontSizepx;
	overflow-y: auto; 
} 

html, body, #wrapper { 
	height:100%; 
	width: 100%; 
	margin: 0; 
	padding: 0; 
	border: 0; 
} 

#wrapper td { 
	vertical-align: middle; 
	text-align: center; 
}
Also, not sure if it's intended, but the font-size value looks curious.

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 12, 2016 5:03 am
by desertfox
Going to take a wild stab that the font value is just a flag to replace with whatever you've set in your guideme pref.

Tried the fixed format and is working.

Also, just discovered alt +d. I'm an asshole, that screen is so nice. Have been refreshing the javascript log in the text editor and I have to say that has sort of been sucking. This screen is freaken nice. Wish I saw that two weeks ago :)

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 12, 2016 5:25 pm
by Kongming
philo wrote:
Kongming wrote:Could someone reupload the Tease Downloader please? All the links I found in this thread are dead :\'-(
32bit version
https://mega.nz/#!dYIRySqK!Iqc_D3FWkct4 ... QHzBi9hvWw
64bit version
https://mega.nz/#!UQwQCCiS!-nE5YbKWD5Ug ... 3QuP8vzh1U
Thank you! :-)

Re: GuideMe (TeaseMe v2.0): BETA Thread

Posted: Tue Jan 12, 2016 7:56 pm
by philo
desertfox wrote:Going to take a wild stab that the font value is just a flag to replace with whatever you've set in your guideme pref.

Tried the fixed format and is working.

Also, just discovered alt +d. I'm an asshole, that screen is so nice. Have been refreshing the javascript log in the text editor and I have to say that has sort of been sucking. This screen is freaken nice. Wish I saw that two weeks ago :)
I added alt m as well which toggles the menu bar on and off

I will corect the css file in the next release, I edited it in a hurry, and yes the strange font value is substituted for the default font size.
the css and html were hard coded in the program but I have moved them to text files so they can be updated without having to release a new version. Also it allows people to change them on their local copy if they wish.