Re: [Wesnoth-dev] Storyscreen patch
I agree that skip would be improved if it took you all the way to the game-- i think it is what most people want to do when they hit it. We might want to retitle the button if we change this behaviour, though at the moment, i can't think of a better name. Also can you move the buttons over to the right side of the screen? They have always bugged me floating where they do. -jwb On Apr 6, 2010, at 4:11 AM, jeremy rosen wrote: quick question, why didn't you use the following definition for skip : skip whatever it takes to bring me to the game itself which seems more logical since skip is mainly used when you already know the story parts... ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev
Re: [Wesnoth-dev] Storyscreen patch
ok, this sounds good could you post it at the end of the existing patch (iirc the original poster is MIA anyway) i'll have a look at it ASAP, but no promises when that will be... quick question, why didn't you use the following definition for skip : skip whatever it takes to bring me to the game itself which seems more logical since skip is mainly used when you already know the story parts... the double skip to reach game logic you currently have seems a bit complicated On Mon, Apr 5, 2010 at 4:39 AM, Ed icelus...@gmail.com wrote: There was a slight problem with this I noticed (inevitably) right after I sent this mail. The problem is if you press skip rather than next on the last page of the last story segment, it doesn't do anything. This isn't actually a trivial fix, because of the question of what skip should really mean. The definition I used is this: skip means go to the end of the story (making the fact that it contains parts hidden from the user) unless already at the end of the story, in which case go to the game. The changes accomplish this by virtue of making the controller slightly cleverer; it now knows whether its the last segment, and on that basis will either skip internally (to find the end), skip externally (to find another segment which is the end) or indicate the game should be entered (if its the last and at its own end). The underlying assumption behind this patch really is that the story screens are a single book as they appear to the naive user, grouped into parts for implementation reasons and convenience. Essentially this patch enforces that model for back and skip. There _should_ be a line using next_itor = itor+1 rather than next_itor = ++itor; ---itor; However touching config.hpp takes 2+ hours to rebuild on my machine, so I'm sending you what I have for now (operator+ is unimplemented; i found out the time requirement by implementing operator--). The more succinct next_itor = ++itor--; blows the compiler's mind (compiles but segfaults in resource tracking code). On 5 April 2010 02:52, Ed icelus...@gmail.com wrote: Here's a first attempt at a patch for the back button for story screens: http://wiki.wesnoth.org/Good_Ideas http://www.wesnoth.org/forum/viewtopic.php?t=8857 There is already a patch in the tracker for this: https://gna.org/patch/?1536 However I didn't realise someone had started when I wrote this, and this is rather further along than that one is. Problems with that patch: * Back doesn't work properly (try it on the last page of the intro where it shows you the map) - can't go back. * Doesn't wire up back button in all the situations next button is clickable. * Probably violates screen size in USE_TINY_GUI mode * There's no key shortcut for back. Features this patch has: * Handles back properly so that you can go all the way back to the start from the end. * Handles skip properly so that all segments are skipped not just per segment (but can still go back so this is ok!) * Adds functional quit button. * Adds key controls: RIGHT is added for next, LEFT and BACKSPACE for back. Improves the implementation: * no longer throws quit exception to quit (was just caught and suppressed anyway). * play story segments from either end so that back can work properly. * adds reverse direction iteration for config::const_child_iterator (was needed) ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev
Re: [Wesnoth-dev] Storyscreen patch
On 6 April 2010 10:11, jeremy rosen jeremy.ro...@enst-bretagne.fr wrote: ok, this sounds good could you post it at the end of the existing patch (iirc the original poster is MIA anyway) i'll have a look at it ASAP, but no promises when that will be... quick question, why didn't you use the following definition for skip : skip whatever it takes to bring me to the game itself which seems more logical since skip is mainly used when you already know the story parts... the double skip to reach game logic you currently have seems a bit complicated How it works before the patch is a double skip too in almost every campaign. * It wasn't my objective to alter its behaviour radically. * Your players are used to a double skip. * I thought if a single skip had been desired, it could have been done easily before now, therefore it was not desired. * I modified it as far as I did to make sure it's only ever a double skip, rather than the confusing model where there are hidden sections as at present, and you could theoretically have to press skip an arbitrary number of times [it's now two always, which for most campaigns looks identical to before]. If there's a different behaviour desired for skip, it's a trivial fix, I just need to be told what that behaviour is (which is why I defined what my model for skip is). As an aside: one weakness is that the quit button should probably throw up a are you sure type dialog, but this patch already snowballed to the point I started to doubt its inclusion, so I omitted that part. Ed On Mon, Apr 5, 2010 at 4:39 AM, Ed icelus...@gmail.com wrote: There was a slight problem with this I noticed (inevitably) right after I sent this mail. The problem is if you press skip rather than next on the last page of the last story segment, it doesn't do anything. This isn't actually a trivial fix, because of the question of what skip should really mean. The definition I used is this: skip means go to the end of the story (making the fact that it contains parts hidden from the user) unless already at the end of the story, in which case go to the game. The changes accomplish this by virtue of making the controller slightly cleverer; it now knows whether its the last segment, and on that basis will either skip internally (to find the end), skip externally (to find another segment which is the end) or indicate the game should be entered (if its the last and at its own end). The underlying assumption behind this patch really is that the story screens are a single book as they appear to the naive user, grouped into parts for implementation reasons and convenience. Essentially this patch enforces that model for back and skip. There _should_ be a line using next_itor = itor+1 rather than next_itor = ++itor; ---itor; However touching config.hpp takes 2+ hours to rebuild on my machine, so I'm sending you what I have for now (operator+ is unimplemented; i found out the time requirement by implementing operator--). The more succinct next_itor = ++itor--; blows the compiler's mind (compiles but segfaults in resource tracking code). On 5 April 2010 02:52, Ed icelus...@gmail.com wrote: Here's a first attempt at a patch for the back button for story screens: http://wiki.wesnoth.org/Good_Ideas http://www.wesnoth.org/forum/viewtopic.php?t=8857 There is already a patch in the tracker for this: https://gna.org/patch/?1536 However I didn't realise someone had started when I wrote this, and this is rather further along than that one is. Problems with that patch: * Back doesn't work properly (try it on the last page of the intro where it shows you the map) - can't go back. * Doesn't wire up back button in all the situations next button is clickable. * Probably violates screen size in USE_TINY_GUI mode * There's no key shortcut for back. Features this patch has: * Handles back properly so that you can go all the way back to the start from the end. * Handles skip properly so that all segments are skipped not just per segment (but can still go back so this is ok!) * Adds functional quit button. * Adds key controls: RIGHT is added for next, LEFT and BACKSPACE for back. Improves the implementation: * no longer throws quit exception to quit (was just caught and suppressed anyway). * play story segments from either end so that back can work properly. * adds reverse direction iteration for config::const_child_iterator (was needed) ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev ___ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev
Re: [Wesnoth-dev] Storyscreen patch
There was a slight problem with this I noticed (inevitably) right after I sent this mail. The problem is if you press skip rather than next on the last page of the last story segment, it doesn't do anything. This isn't actually a trivial fix, because of the question of what skip should really mean. The definition I used is this: skip means go to the end of the story (making the fact that it contains parts hidden from the user) unless already at the end of the story, in which case go to the game. The changes accomplish this by virtue of making the controller slightly cleverer; it now knows whether its the last segment, and on that basis will either skip internally (to find the end), skip externally (to find another segment which is the end) or indicate the game should be entered (if its the last and at its own end). The underlying assumption behind this patch really is that the story screens are a single book as they appear to the naive user, grouped into parts for implementation reasons and convenience. Essentially this patch enforces that model for back and skip. There _should_ be a line using next_itor = itor+1 rather than next_itor = ++itor; ---itor; However touching config.hpp takes 2+ hours to rebuild on my machine, so I'm sending you what I have for now (operator+ is unimplemented; i found out the time requirement by implementing operator--). The more succinct next_itor = ++itor--; blows the compiler's mind (compiles but segfaults in resource tracking code). On 5 April 2010 02:52, Ed icelus...@gmail.com wrote: Here's a first attempt at a patch for the back button for story screens: http://wiki.wesnoth.org/Good_Ideas http://www.wesnoth.org/forum/viewtopic.php?t=8857 There is already a patch in the tracker for this: https://gna.org/patch/?1536 However I didn't realise someone had started when I wrote this, and this is rather further along than that one is. Problems with that patch: * Back doesn't work properly (try it on the last page of the intro where it shows you the map) - can't go back. * Doesn't wire up back button in all the situations next button is clickable. * Probably violates screen size in USE_TINY_GUI mode * There's no key shortcut for back. Features this patch has: * Handles back properly so that you can go all the way back to the start from the end. * Handles skip properly so that all segments are skipped not just per segment (but can still go back so this is ok!) * Adds functional quit button. * Adds key controls: RIGHT is added for next, LEFT and BACKSPACE for back. Improves the implementation: * no longer throws quit exception to quit (was just caught and suppressed anyway). * play story segments from either end so that back can work properly. * adds reverse direction iteration for config::const_child_iterator (was needed) Index: src/storyscreen/render.cpp === --- src/storyscreen/render.cpp (revision 41922) +++ src/storyscreen/render.cpp (working copy) @@ -81,13 +81,17 @@ namespace storyscreen { -part_ui::part_ui(part p, display disp, gui::button next_button, gui::button skip_button) +part_ui::part_ui(part p, display disp, + gui::button next_button, gui::button back_button, + gui::button skip_button, gui::button quit_button) : p_(p) , disp_(disp) , video_(disp.video()) , keys_() , next_button_(next_button) + , back_button_(back_button) , skip_button_(skip_button) + , quit_button_(quit_button) , ret_(NEXT) , scale_factor_(1.0) , base_rect_() @@ -139,8 +143,10 @@ buttons_x_ = video_.getx() - 50; buttons_y_ = base_rect_.y + base_rect_.h - 20; - next_button_.set_location(buttons_x_, buttons_y_ - 20); - skip_button_.set_location(buttons_x_, buttons_y_); + next_button_.set_location(buttons_x_, buttons_y_ - 60); + back_button_.set_location(buttons_x_, buttons_y_ - 40); + skip_button_.set_location(buttons_x_, buttons_y_ - 20); + quit_button_.set_location(buttons_x_, buttons_y_); #else // elif !defined(USE_TINY_GUI) @@ -163,12 +169,16 @@ buttons_y_ = video_.gety() - 40; break; } - next_button_.set_location(buttons_x_, buttons_y_ - 30); - skip_button_.set_location(buttons_x_, buttons_y_); + next_button_.set_location(buttons_x_, buttons_y_ - 90); + back_button_.set_location(buttons_x_, buttons_y_ - 60); + skip_button_.set_location(buttons_x_, buttons_y_ - 30); + quit_button_.set_location(buttons_x_, buttons_y_); #endif next_button_.set_volatile(true); +back_button_.set_volatile(true); skip_button_.set_volatile(true); +quit_button_.set_volatile(true); } void part_ui::prepare_floating_images() @@ -210,10 +220,18 @@ ret_ = SKIP; return false; } +else if(quit_button_.pressed()) { + ret_ = QUIT; + return false; +} else if(next_button_.pressed()) { ret_ = NEXT; return false; } +else if(back_button_.pressed()) { + ret_ = BACK; + return false; +