bugBattle for Wesnoth - Bugs: bug #21285, Undo command fires an event

 
 
Show feedback again

bug #21285: Undo command fires an event

Submitted by:  Dan Gerhards <beetlenaut>
Submitted on:  Tue 19 Nov 2013 05:18:44 PM UTC  
 
Category: Feature RequestSeverity: 1 - Wish
Priority: 5 - NormalItem Group: WML
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: 1.11.7+devOperating System: Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 17 Feb 2014 01:51:33 AM UTC, comment #2:

I assumed that redo events actually were the same as regular actions. Apparently we would need a redo event too. (In most cases, it would just fire the original moveto event so that the same actions would occur. The redo event would have to store the unit for that to work.)

I could just disallow undo, but the case I had in mind was a unit ability. Some UMC authors have, in fact, disallowed undo for scenarios or entire campaigns in order to use an ability like that. However, from the player's standpoint, it seems like a frustrating bug. I'm not willing to do that to a user, so I gave up on my idea instead.

Dan Gerhards <beetlenaut>
Project Member
Mon 17 Feb 2014 01:11:36 AM UTC, comment #1:

Poking around in the source, it seems there's a couple places you might try to add something like this but also a couple issues.

One place is in src/playcontroller.cpp:

https://github.com/wesnoth/wesnoth-old/blob/master/src/play_controller.cpp#L510

I'm not sure if that's the best idea.

A different place is in the undo-stack code, maybe here:
https://github.com/wesnoth/wesnoth-old/blob/master/src/actions/undo.cpp#L559

However it raises some issues. What will you do if the user then "redoes" the action? As I understand this doesn't quite play out the same as performing the action. Do you also want a "redo" event? The comments in the source code in undo.cpp seem to suggest that maybe you should disallow undo in the case you have in mind.

Chris Beck <involution>
Project Member
Tue 19 Nov 2013 05:18:44 PM UTC, original submission:

Currently, there is no way to detect that a user has hit undo. That means that no ability or effect that modifies the game state with a moveto event can allow the user to undo the move. On the other hand, if the command could be detected, it would be possible for the author to reset the game state afterward.

I would like an event type named "user undo" or something similar that detects that command. In order to be more useful, it should store the unit that was un-moved and the hex it came from, but that's not entirely necessary.

Dan Gerhards <beetlenaut>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by involution (Posted a comment)
  • -unavailable- added by beetlenaut (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Nov 2013 05:23:09 PM UTCbeetlenautSeverity3 - Normal=>1 - Wish
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup