Help with buttons


#1

I’ve been having some trouble with adding an additional button at the top, like the ‘Show Stats’ one.

After editing the index and ui.js files it shows up and links to the right scene. When in that scene I would like the button to say ‘Return to game’ (like with the stats screen), however I can’t seem to get it right without messing up the ‘Show Stats’ button.
Also there’s no ‘Next’ bar at the bottom.

I’ve been going through the wiki but the codes there seem to be from outdated versions. Any help would be appreciated.


#2

Im honestly not 100% myself but I code for alot of people and I have a source to my friend’s and in hers she has that yet nothing I have has that but I looked into it and I found this… not sure if its it though



function printFooter() {
  // var footer = document.getElementById('footer');
  // We could put anything we want in the footer here, but perhaps we should avoid it.
  var statsButton = document.getElementById("statsButton");
  if (statsButton) {
    if (window.stats.sceneName == "choicescript_stats") {
      statsButton.innerHTML = "Return to the Game";
    } else {
      statsButton.innerHTML = "Show Stats";
    }
  }
  setTimeout(function() {callIos("curl");}, 0);
}

#3

Yah, I think its working for me try replacing this code in your ui.js with the one above



function printFooter() {
  // var footer = document.getElementById('footer');
  // We could put anything we want in the footer here, but perhaps we should avoid it.
  setTimeout(function() {callIos("curl");}, 0);
}

#4

XD im in the same boat as you now


#5

I need help with this too haha


#6

Thanks for the reply 2Ton, I have the exact same code as in your first post and the stat
screen isn’t the issue. What I want is for my extra button to do the same thing as the stats button.

I tried copy-paste the code and adjust it to my extra button but that messes up the stats button.

Lol I hope you can make sense out of my ramblings, I’m sleepy.


#7

I got it!!! hold on I didnt find specifically the problem but I can fix it I have an updated js for some stuff hold on im just trying to figure out how to post it so you guys can download it… hmmm… Try this?

https://dl.dropbox.com/u/134916500/All%20you%20need.zip

all you have to do is delete the obsolete js and replace it with the new ones


#8

I hope it works for you guys :3


#9

That doesn’t do anything for me. I think you misunderstood my problem. How the hell do you upload pictures…

What I want is this:

On this:

And the bar at the bottom is missing for some reason.

*Edit
Damn links,

1st: http://s11.postimg.org/4fp34b06r/statscreen.png
2nd:http://s4.postimg.org/sh6yfli8d/helpscreen.png


#10

Wait… hmmm

Edited: yah actually what I showed you should fix those problems it should make it so the return game shows up when your viewing stats and also the next button should pop up at the bottom, weird its not


#11

Oh… wait yes I think I did misunderstand alot… so you want it on the help X_X omg I feel dumb

let me go look into it ill go look through the source and read through it, and see if you can do that with an additional button, I know you can but im not sure if im capable of doing it, but ill give it a shot


#12

In the meanwhile, there is a easier way to do it… since there is already a return to game stat in the main panel you can actually do a choice within the state screen like


*choice
  #Help
    [whatever you want on help screen]
    *choice
       #go back
         *goto display

That would make it easier but ill keep looking to see if I can remedy the problem so that there is a return to game when you click help WITH the next button


#13

Thanks I appreciate it :smiley: I’ll use your choice idea as a temporary solution


#14

Have you tried this method?


#15

I’ve decided to omit the extra buttons, but I tried out the link in your post @CJW and that
that solved the issue with the ‘Next’ bar. So whenever I do want additional buttons I’ll use that, cheers!


#16

@Dima No problem, good luck with your game :slight_smile:


#17

@Dima Same, wish you the best of luck. sorry, I wasn’t much help.