Merge branch 'master' into sdl2

This commit is contained in:
Andreas Löf 2015-09-15 20:26:37 +12:00
commit 8a86b547ce
36 changed files with 466 additions and 457 deletions

View file

@ -20,6 +20,45 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
# use our own version of FindBoost.cmake and other Find* scripts
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#
# Options
#
#Path options
set(BINDIR "bin" CACHE STRING "Where to install binaries")
set(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location")
set(DOCDIR "${DATAROOTDIR}/doc/wesnoth" CACHE STRING "Sets the doc directory to a non-default location.")
set(MANDIR "${DATAROOTDIR}/man" CACHE STRING "Where to install manpages")
set(DATADIRNAME "wesnoth" CACHE STRING "change the name of the directory for the read-only architecture-independent game data")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}" CACHE STRING "change the dir where binaries are placed right at compile time")
set(LOCALEDIR "translations" CACHE STRING "change the name of the locale data directory to a non-default name")
set(PREFERENCES_DIR "" CACHE STRING "Use a non-default preferences directory (.wesnoth on unix)")
set(DEFAULT_PREFS_FILE "" CACHE STRING "Set system wide preferences file")
#Game options
option(ENABLE_FRIBIDI "Enable FriBIDi support" ON)
#server options
set(SERVER_UID "" CACHE STRING "User id of the user who runs wesnothd")
set(SERVER_GID "" CACHE STRING "Group id of the user who runs wesnothd")
set(FIFO_DIR "/var/run/wesnothd" CACHE STRING "Directory for the wesnothd fifo socket file")
#build options
option(ENABLE_GAME "Enable compilation of the game" ON)
option(ENABLE_CAMPAIGN_SERVER "Enable compilation of campaign server")
option(ENABLE_SERVER "Enable compilation of server" ON)
option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers")
option(ENABLE_SDL2_TOOLS "Enable building and installation of tools for testing with SDL2" OFF)
option(ENABLE_SDL2 "Enable building the game with SDL2" OFF)
option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of translations" ON)
option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
option(ENABLE_PANDORA "Add support for the OpenPandora by adding support for the resolution of 800x480 and switching to a special theme" OFF)
option(ENABLE_SDL_GPU "Enable building with SDL_gpu (experimental)" OFF)
option(ENABLE_LIBPNG "Enable support for writing png files (screenshots, images)" ON)
option(ENABLE_LIBINTL "Enable using libintl for translations instead of Boost.Locale library (not recommended)" OFF)
option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)
if(ENABLE_SDL2)
find_package(SDL2 2.0.0 REQUIRED)
@ -63,46 +102,6 @@ endif(MSVC)
#check for some compiler/arch specific things and export defines accordingly...
include(SearchForStuff)
#
# Options
#
#Path options
set(BINDIR "bin" CACHE STRING "Where to install binaries")
set(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location")
set(DOCDIR "${DATAROOTDIR}/doc/wesnoth" CACHE STRING "Sets the doc directory to a non-default location.")
set(MANDIR "${DATAROOTDIR}/man" CACHE STRING "Where to install manpages")
set(DATADIRNAME "wesnoth" CACHE STRING "change the name of the directory for the read-only architecture-independent game data")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}" CACHE STRING "change the dir where binaries are placed right at compile time")
set(LOCALEDIR "translations" CACHE STRING "change the name of the locale data directory to a non-default name")
set(PREFERENCES_DIR "" CACHE STRING "Use a non-default preferences directory (.wesnoth on unix)")
set(DEFAULT_PREFS_FILE "" CACHE STRING "Set system wide preferences file")
#Game options
option(ENABLE_FRIBIDI "Enable FriBIDi support" ON)
#server options
set(SERVER_UID "" CACHE STRING "User id of the user who runs wesnothd")
set(SERVER_GID "" CACHE STRING "Group id of the user who runs wesnothd")
set(FIFO_DIR "/var/run/wesnothd" CACHE STRING "Directory for the wesnothd fifo socket file")
#build options
option(ENABLE_GAME "Enable compilation of the game" ON)
option(ENABLE_CAMPAIGN_SERVER "Enable compilation of campaign server")
option(ENABLE_SERVER "Enable compilation of server" ON)
option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers")
option(ENABLE_SDL2_TOOLS "Enable building and installation of tools for testing with SDL2" OFF)
option(ENABLE_SDL2 "Enable building the game with SDL2" OFF)
option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of translations" ON)
option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
option(ENABLE_PANDORA "Add support for the OpenPandora by adding support for the resolution of 800x480 and switching to a special theme" OFF)
option(ENABLE_SDL_GPU "Enable building with SDL_gpu (experimental)" OFF)
option(ENABLE_LIBPNG "Enable support for writing png files (screenshots, images)" ON)
option(ENABLE_LIBINTL "Enable using libintl for translations instead of Boost.Locale library (not recommended)" OFF)
option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)
# if no build type is specified, it can happen that the game is built without
# optimization (c.f. bug #23445), work around this by enforcing "release" type
# if nothing was selected

View file

@ -1,40 +1,40 @@
Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Ww, Hh, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm
Mm, Mm, Mm, Mm^Vhh, Mm, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Ww, Hh, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm
Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh, Ww, Ww, Ww, Hh, Mm, Hh, Hh^Vhh, Gs^Fp, Mm, Hh, Hh, Mm, Mm, Mm, Mm
Gs^Fp, Gs^Fp, Gs^Fp, Hh, Hh, Mm, Hh, Mm, Hh, Mm, Mm^Vhh, Mm, Mm,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gll^Fp, Hh^Fp, Gg, Gg, Gll^Fp, Gll^Fp, Gg, Gg, Gll^Fp, Re, Gg, Re, Re, Gll^Fp, Gll^Fp, Gg, Gll^Fp, Gll^Fp, Gll^Fp, Gll^Fp, Gll^Fms, Hh^Fms, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp
Gg, Gll^Fms, Gg, Hh^Fp, Gll^Fp, Gll^Fp, Gg, Gg, Gg, Gg, Gg, Gg, Gll^Fp, Re, Gg, Re, Re, Gll^Fp, Gll^Fp, Gg, Gll^Fp, Gll^Fp, Gll^Fp, Gll^Fp, Gll^Fp, Hh^Fp, Gll^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp

View file

@ -54,6 +54,8 @@
profile=portraits/Malifor.png
canrecruit=yes
facing=sw
# These two have a role for 'sighted' events
{NOTRAIT_UNIT () Draug 26 13}
@ -2499,99 +2501,128 @@
[/if]
[/event]
#define MALIFORS_LAST_BREATH TYPE X Y
[event]
name=last breath
first_time_only=no
[filter]
id=Malifor
[/filter]
[filter_second_attack]
type={TYPE}
[/filter_second_attack]
{VARIABLE malifor_died_by {TYPE}}
{VARIABLE malifor_respawn_point.x {X}}
{VARIABLE malifor_respawn_point.y {Y}}
[/event]
#enddef
{MALIFORS_LAST_BREATH pierce 5 2}
{MALIFORS_LAST_BREATH blade 14 4}
{MALIFORS_LAST_BREATH fire 38 11}
{MALIFORS_LAST_BREATH cold 38 11}
{MALIFORS_LAST_BREATH arcane 38 11}
# Need a manual event here because of the if check
# TODO: necessary?
[event]
name=last breath
first_time_only=no
[filter]
id=Malifor
[/filter]
[filter_second_attack]
type=impact
[/filter_second_attack]
[if]
[variable]
name=second_unit.race
equals=dwarf
[/variable]
[then]
{VARIABLE malifor_died_by axe}
{VARIABLE malifor_respawn_point.x 14}
{VARIABLE malifor_respawn_point.y 4}
[/then]
[else]
{VARIABLE malifor_died_by arrow}
{VARIABLE malifor_respawn_point.x 5}
{VARIABLE malifor_respawn_point.y 2}
[/else]
[/if]
[/event]
#define MALIFOR_RESPAWN
{FLASH_WHITE (
[fire_event]
name=respaw_malifor
[/fire_event]
# Don't allow anyone but Morvin and Thera to damage Malifor
{FORCE_CHANCE_TO_HIT (
side=1
[not]
id=Father Morvin,Sister Thera
[/not]
)(id=Malifor) 0 (
)}
#define NOT_WHITE_MAGES_ATTACK_MALIFOR_WITH_WEAPON_TYPE _TYPE
[filter]
side=1
[not]
id=Father Morvin,Sister Thera
[/not]
[/filter]
[filter_attack]
type={_TYPE}
[/filter_attack]
[filter_second]
id=Malifor
[/filter_second]
#enddef
[event]
name=respaw_malifor
first_time_only=no
name=attack end
{NOT_WHITE_MAGES_ATTACK_MALIFOR_WITH_WEAPON_TYPE blade}
# Kill the previous Malifor first to prevent the possibility of seeing two Malifors
[kill]
[message]
speaker=Malifor
message= _ "HAHAHAHA, DEATH HAS NO EFFECT ON ME YOU FOOLS!"
[/message]
[message]
speaker=unit
message= _ "Well, blades dont work."
[/message]
[/event]
[event]
name=attack end
{NOT_WHITE_MAGES_ATTACK_MALIFOR_WITH_WEAPON_TYPE pierce}
[message]
speaker=Malifor
message= _ "HAHAHAHA, YOUR IDIOCY AMUSES ME GREATLY!"
[/message]
[message]
speaker=Tallin
message= _ "Geez, how are we going to kill him? This weapon is ineffective!"
[/message]
[/event]
[event]
name=attack end
{NOT_WHITE_MAGES_ATTACK_MALIFOR_WITH_WEAPON_TYPE fire}
[message]
speaker=Malifor
message= _ "YOU PUNY MORTALS SHALL SOON BE SERVING ME!"
[/message]
[message]
speaker=Camerin
message= _ "That blasted skeleton! Even fire has no affect on him!"
[/message]
[message]
speaker=Tallin
message= _ "Lets try using something different on him."
[/message]
[/event]
[event]
name=attack end
[filter]
id=Father Morvin,Sister Thera
[/filter]
[filter_second]
id=Malifor
[/kill]
[/filter_second]
[unit]
type=Ancient Lich
id=Malifor
name= _ "Malifor"
profile=portraits/Malifor.png
canrecruit=yes
side=2
recruit=Skeleton,Skeleton Archer
x=$malifor_respawn_point.x
y=$malifor_respawn_point.y
placement=map_passable
[/unit]
[message]
speaker=second_unit
message= _ "AAAAAAHHHHHH!"
[/message]
[gold]
side=2
amount=300
[/gold]
[message]
speaker=Father Morvin
message= _ "I see now. It is impossible to destroy him by ordinary means."
[/message]
[redraw][/redraw]
[message]
speaker=Tallin
message= _ "Then how are we going to destroy him? Surely there must be a way."
[/message]
[message]
speaker=Father Morvin
message= _ "Yes, I think there is, but only myself or Thera have the means to do it. Come on Thera, lets destroy that old skeleton."
[/message]
[message]
speaker=Sister Thera
message= _ "Yeah, I cant wait to get my hands on that bastard!"
[/message]
[message]
speaker=Father Morvin
message= _ "That was very unladylike of you."
[/message]
[message]
speaker=Sister Thera
message= _ "(<i>Giggle</i>) Sorry."
[/message]
[/event]
# Malifor can be successfully killed only by White Mages.
# All other units only cause him to respawn somewhere on the map.
# This event handles that assumption.
[event]
name=last breath
@ -2626,6 +2657,16 @@
speaker=Malifor
message= _ "MAY THE EARTH OPEN UP AND SWALLOW YOU! MAY ALL YOUR TEETH FALL OUT! MAY YOU BECOME A WEAK SKINNY OLD MAN! MAY—"
[/message]
[/event]
[event]
name=die
[filter]
id=Malifor
[/filter]
[filter_second]
id=Father Morvin,Sister Thera
[/filter_second]
[message]
speaker=second_unit
@ -2653,214 +2694,6 @@
[/endlevel]
[/event]
# If Malifor wasn't killed by white mages, respawn him at the
# location set previously and give him some extra gold.
[event]
name=last breath
first_time_only=no
[filter]
id=Malifor
[/filter]
[filter_second]
[not]
id=Father Morvin,Sister Thera
[/not]
[/filter_second]
# Default spawn location
[if]
[variable]
name=malifor_respawn_point.x
less_than=1
[/variable]
[then]
{VARIABLE malifor_respawn_point.x 14}
{VARIABLE malifor_respawn_point.y 4}
[/then]
[/if]
[switch]
variable=malifor_died_by
[case]
value=axe
[message]
speaker=Malifor
message= _ "HAHAHA, FOOLS, YOU THINK YOU CAN KILL ME?"
[/message]
{MALIFOR_RESPAWN}
[message]
speaker=Malifor
message= _ "HAHAHAHA!"
[/message]
[message]
speaker=Tallin
message= _ "What the...!"
[/message]
[message]
speaker=second_unit
message= _ "How can it be?! Our axes and hammers are failing."
[/message]
[message]
speaker=Tallin
message= _ "Blast it! Now where did he go? Lets find him and try something else!"
[/message]
[/case]
[case]
value=blade
[message]
speaker=Malifor
message= _ "HAHAHAHA, DEATH HAS NO EFFECT ON ME YOU FOOLS!"
[/message]
{MALIFOR_RESPAWN}
[message]
speaker=Malifor
message= _ "HAHAHA, I CAN NEVER BE DESTROYED!"
[/message]
[message]
speaker=Tallin
message= _ "Oh yes you will! But... how?"
[/message]
[message]
speaker=second_unit
message= _ "Well, it sure isnt gonna be done with a blade."
[/message]
[message]
speaker=Tallin
message= _ "And look, hes gone. Now we gotta find him all over again!"
[/message]
[/case]
[case]
value=pierce
[message]
speaker=Malifor
message= _ "HAHAHAHA, YOUR IDIOCY AMUSES ME GREATLY!"
[/message]
{MALIFOR_RESPAWN}
[message]
speaker=Malifor
message= _ "COME AND GET ME!"
[/message]
[message]
speaker=Tallin
message= _ "Geez, how are we going to kill him?"
[/message]
[message]
speaker=second_unit
message= _ "Well, obviously clubs and arrows wont work."
[/message]
[message]
speaker=Tallin
message= _ "Oh darn, he disappeared. Lets find him and try a different weapon."
[/message]
[/case]
[case]
value=fire
[message]
speaker=Malifor
message= _ "HAHAHAHA, I AM IMMORTAL!"
[/message]
{MALIFOR_RESPAWN}
[message]
speaker=Malifor
message= _ "YOU PUNY MORTALS SHALL SOON BE SERVING ME!"
[/message]
[message]
speaker=Camerin
message= _ "That blasted skeleton! Even fire has no affect on him!"
[/message]
[message]
speaker=Tallin
message= _ "Look, he disappeared again. Lets find him and try using a different weapon on him."
[/message]
[/case]
[else]
[message]
speaker=Malifor
message= _ "HAHAHA, FOOLS, YOU THINK YOU CAN KILL ME?"
[/message]
{MALIFOR_RESPAWN}
[message]
speaker=Malifor
message= _ "HAHAHAHA!"
[/message]
[message]
speaker=Tallin
message= _ "What the—"
[/message]
[message]
speaker=Tallin
message= _ "Blast it! Now where did he go? Lets find him and try something else!"
[/message]
[/else]
[/switch]
[if]
[have_unit]
id=Sister Thera,Father Morvin
[/have_unit]
[then]
[message]
speaker=Father Morvin
message= _ "I see now. It is impossible to destroy him by ordinary means."
[/message]
[message]
speaker=Tallin
message= _ "Then how are we going to destroy him? Surely there must be a way."
[/message]
[message]
speaker=Father Morvin
message= _ "Yes, I think there is, but only myself or Thera have the means to do it. Come on Thera, lets destroy that old skeleton."
[/message]
[message]
speaker=Sister Thera
message= _ "Yeah, I cant wait to get my hands on that bastard!"
[/message]
[message]
speaker=Father Morvin
message= _ "That was very unladylike of you."
[/message]
[message]
speaker=Sister Thera
message= _ "(<i>Giggle</i>) Sorry."
[/message]
[/then]
[/if]
{CLEAR_VARIABLE malifor_respawn_point,malifor_died_by}
[/event]
[event]
name=victory

View file

@ -134,6 +134,7 @@
fog=yes
share_view=yes
facing=se
[/side]
# wmllint: validate-on
@ -156,42 +157,49 @@
hitpoints=1
fog=yes
share_view=yes
facing=se
# Place some combatants at various states of hp/xp
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 28 8}
[+unit]
hitpoints=12
experience=40
facing=se
[/unit]
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 24 7}
[+unit]
hitpoints=34
experience=8
facing=ne
[/unit]
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 24 4}
[+unit]
hitpoints=28
experience=18
facing=sw
[/unit]
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 23 2}
[+unit]
hitpoints=30
experience=16
facing=s
[/unit]
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 30 7}
[+unit]
hitpoints=12
experience=16
facing=nw
[/unit]
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 25 5}
{NOTRAIT_UNIT () "Dwarvish Ulfserker" 22 6}
[+unit]
hitpoints=9
experience=41
facing=sw
[/unit]
[/side]
@ -211,33 +219,39 @@
profile=portraits/Arthian.png
canrecruit=yes
facing=nw
[ai]
recruitment_ignore_bad_movement=yes
recruitment_ignore_bad_combat=yes
[/ai]
{NOTRAIT_UNIT () Troll 29 9}
{NOTRAIT_UNIT () Troll 30 9}
[+unit]
hitpoints=36
experience=14
facing=nw
[/unit]
{NOTRAIT_UNIT () "Young Ogre" 28 7}
{NOTRAIT_UNIT () "Young Ogre" 28 6}
[+unit]
hitpoints=6
experience=31
facing=se
[/unit]
{NOTRAIT_UNIT () "Young Ogre" 20 7}
[+unit]
hitpoints=12
experience=12
facing=ne
[/unit]
{NOTRAIT_UNIT () "Ogre" 23 3}
[+unit]
hitpoints=27
experience=8
facing=n
[/unit]
# Place sidekick
@ -246,7 +260,8 @@
id="Ro'Sothian"
profile=portraits/Ro_Sothian.png
name= _ "RoSothian"
x,y=26,6
x,y=26,7
facing=nw
[/unit]
[/side]
@ -263,7 +278,7 @@
[/variable]
)}
{PLACE_IMAGE items/cage.png 26 4}
{PLACE_IMAGE items/cage.png 25 6}
[event]
name=prestart
@ -301,6 +316,8 @@
id=Elenia
[/recall]
{MODIFY_UNIT side=1 facing se}
[objectives]
side=1
[objective]
@ -388,17 +405,17 @@
[message]
speaker=Tallin
message={WHISPER _"whisper^Camerin, you know him?"}
message={WHISPER (_ "whisper^Camerin, you know him?")}
[/message]
[message]
speaker=Camerin
message={WHISPER _"whisper^Duh! His brother RoArthian is the one who taught me magic!"}
message={WHISPER (_ "whisper^Duh! His brother RoArthian is the one who taught me magic!")}
[/message]
[message]
speaker=Tallin
message={WHISPER _"whisper^Oh...!"}
message={WHISPER (_ "whisper^Oh...!")}
[/message]
[/then]
[/if]
@ -589,7 +606,7 @@
message= _ "Very well."
[/message]
{PLACE_IMAGE "units/undead-necromancers/lich.png~RC(magenta>green)~BLIT(items/cage.png)" 26 4}
{PLACE_IMAGE "units/undead-necromancers/lich.png~RC(magenta>green)~BLIT(items/cage.png)" 25 6}
[message]
speaker=Tallin
@ -602,7 +619,7 @@
first_time_only=no
[filter]
side=3
x,y=26,4
x,y=25,6
[/filter]
[filter_condition]
[not]
@ -613,7 +630,7 @@
[/filter_condition]
[remove_item]
x,y=26,4
x,y=25,6
[/remove_item]
[unit]
@ -621,7 +638,7 @@
id="Ro'Sothian"
name= _ "RoSothian"
side=3
x,y=26,4
x,y=25,6
[/unit]
[message]
@ -666,7 +683,7 @@
message= _ "Back to jail, my friend."
[/message]
{PLACE_IMAGE "units/undead-necromancers/lich.png~RC(magenta>green)~BLIT(items/cage.png)" 26 4}
{PLACE_IMAGE "units/undead-necromancers/lich.png~RC(magenta>green)~BLIT(items/cage.png)" 25 6}
[/event]
[/event]

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 KiB

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -4,6 +4,7 @@
name= _ "Yeti"
race=monster
image="units/monsters/yeti.png"
profile="portraits/monsters/transparent/yeti.png"
hitpoints=142
movement_type=largefoot
movement=5

View file

@ -4,7 +4,7 @@
name= _ "Ancient Wose"
race=wose
image="units/woses/wose-ancient.png"
profile="portraits/woses/ancient-wose.png"
profile="portraits/woses/transparent/ancient-wose.png"
{MAGENTA_IS_THE_TEAM_COLOR}
hitpoints=80
movement_type=treefolk

View file

@ -4,7 +4,7 @@
name= _ "Elder Wose"
race=wose
image="units/woses/wose-elder.png"
profile="portraits/woses/ancient-wose.png"
profile="portraits/woses/wose.png"
{MAGENTA_IS_THE_TEAM_COLOR}
hitpoints=64
movement_type=treefolk

View file

@ -4,7 +4,7 @@
name= _ "Wose"
race=wose
image="units/woses/wose.png"
profile="portraits/woses/ancient-wose.png"
profile="portraits/woses/wose.png"
{MAGENTA_IS_THE_TEAM_COLOR}
hitpoints=52
movement_type=treefolk

View file

@ -1505,3 +1505,9 @@ function wml_actions.role(cfg)
-- no matching unit found, fail silently
end
function wml_actions.unsynced(cfg)
wesnoth.unsynced(function ()
wml_actions.command(cfg)
end)
end

View file

@ -138,7 +138,7 @@ def attach_select_all(widget,function):
widget.bind("<Control-KeyRelease-a>", function)
class Tooltip(Toplevel):
def __init__(self,widget,text):
def __init__(self,widget,text,tag=None):
"""A tooltip, or balloon. Displays the specified help text when the
mouse pointer stays on the widget for more than 500 ms."""
# the master attribute retrieves the window where our "parent" widget is
@ -157,8 +157,16 @@ mouse pointer stays on the widget for more than 500 ms."""
font=font.nametofont("TkTooltipFont"))
self.label.pack()
self.overrideredirect(True)
self.widget.bind("<Enter>",self.preshow)
self.widget.bind("<Leave>",self.hide)
# allow binding the tooltips to tagged elements of a widget
# only Text, Canvas and Treeview support tags
# and as such, they have a tag_bind method
# if the widget doesn't support tags, bind directly to it
if tag and hasattr(widget, "tag_bind") and callable(widget.tag_bind):
self.widget.tag_bind(tag,"<Enter>",self.preshow)
self.widget.tag_bind(tag,"<Leave>",self.hide)
else:
self.widget.bind("<Enter>",self.preshow)
self.widget.bind("<Leave>",self.hide)
self.bind_all("<Button>",self.hide)
self.withdraw()
def preshow(self,event=None):

View file

@ -73,10 +73,11 @@
# Note that this will also disable stack-based validation on the span
# of lines they enclose.
from __future__ import print_function
from __future__ import print_function, unicode_literals
from future_builtins import filter, map, zip
range = xrange
import sys, os, re, getopt, string, copy, difflib, time
import sys, os, re, getopt, string, copy, difflib, time, codecs
from wesnoth.wmltools import *
from wesnoth.wmliterator import *
@ -570,7 +571,7 @@ notepairs = (
)
trait_note = dict(notepairs)
note_trait = dict(map(lambda p: (p[1], p[0]), notepairs))
note_trait = {pair[1]: pair[0] for pair in notepairs}
def string_strip(value):
"String-strip the value"
@ -1654,7 +1655,7 @@ def is_map(filename):
if "map" in os.path.dirname(filename) or filename.endswith(".map"):
return True
try:
fp = open(filename)
fp = codecs.open(filename, "r", "utf8")
lines = fp.readlines()
fp.close()
has_map_content = False
@ -1669,6 +1670,8 @@ def is_map(filename):
break
else:
has_map_content = len(lines) > 1
except UnicodeDecodeError:
return False
except OSError:
has_map_content = False
except IndexError:
@ -1704,7 +1707,7 @@ def translator(filename, mapxforms, textxform, versions):
mfile = []
map_only = not filename.endswith(".cfg")
terminator = "\n"
for line in open(filename):
for line in codecs.open(filename, "r", "utf8"):
if line.endswith("\n"):
line = line[:-1]
if line.endswith("\r"):
@ -1727,7 +1730,7 @@ def translator(filename, mapxforms, textxform, versions):
print(line, end=terminator)
lineno += 1
# Check for one certain error condition
if line.count("{") and line.count("}"):
if "{" in line and "}" in line:
refname = line[line.find("{"):line.rfind("}")]
# Ignore all-caps macro arguments.
if refname == refname.upper():
@ -1742,8 +1745,8 @@ def translator(filename, mapxforms, textxform, versions):
# refer to map files which will be checked separately.
if map_only or (("map_data=" in line or "mask=" in line)
and line.count('"') in (1, 2)
and line.count("{") == 0
and line.count("}") == 0
and "{" not in line
and "}" not in line
and not within('time')):
outmap = []
add_border = True
@ -1861,7 +1864,7 @@ def translator(filename, mapxforms, textxform, versions):
# All lines of the map are processed, add the appropriate trailer
if not map_only:
newdata.append("\"" + terminator)
elif "map_data=" in line and (line.count("{") or line.count("}")):
elif "map_data=" in line and ("{" in line or "}" in line):
newline = line
refre = re.compile(r"\{@?([^A-Z].*)\}").search(line)
if refre:
@ -2259,8 +2262,8 @@ if __name__ == '__main__':
if os.path.exists(backup):
fromdate = time.ctime(os.stat(backup).st_mtime)
todate = time.ctime(os.stat(fn).st_mtime)
fromlines = open(backup, 'U').readlines()
tolines = open(fn, 'U').readlines()
fromlines = codecs.open(backup, 'U', "utf8").readlines()
tolines = codecs.open(fn, 'U', "utf8").readlines()
diff = difflib.unified_diff(fromlines, tolines,
backup, fn, fromdate, todate, n=3)
sys.stdout.writelines(diff)
@ -2274,7 +2277,7 @@ if __name__ == '__main__':
if sys.platform == 'win32' and os.path.exists(backup):
os.remove(backup)
os.rename(fn, backup)
ofp = open(fn, "w")
ofp = codecs.open(fn, "w", "utf8")
ofp.write(changed)
ofp.close()
except maptransform_error, e:

View file

@ -1 +1,43 @@
#include "undo_action.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "resources.hpp"
#include "variable.hpp" // vconfig
#include "game_events/pump.hpp" //game_events::queued_event
#include <cassert>
#include <boost/foreach.hpp>
namespace actions
{
void undo_action::execute_undo_umc_wml()
{
assert(resources::lua_kernel);
BOOST_FOREACH(const config& c, umc_commands_undo)
{
resources::lua_kernel->run_wml_action("command", vconfig(c), game_events::queued_event("undo", map_location(), map_location(), config()));
}
}
void undo_action::execute_redo_umc_wml()
{
assert(resources::lua_kernel);
BOOST_FOREACH(const config& c, umc_commands_redo)
{
resources::lua_kernel->run_wml_action("command", vconfig(c), game_events::queued_event("redo", map_location(), map_location(), config()));
}
}
void undo_action::read_tconfig_vector(tconfig_vector& vec, const config& cfg, const std::string& tag)
{
config::const_child_itors r = cfg.child_range(tag);
vec.insert(vec.end(), r.first, r.second);
}
void undo_action::write_tconfig_vector(const tconfig_vector& vec, config& cfg, const std::string& tag)
{
BOOST_FOREACH(const config& c, vec)
{
cfg.add_child(tag, c);
}
}
}

View file

@ -44,12 +44,22 @@ namespace actions {
: undo_action_base()
, replay_data()
, unit_id_diff(synced_context::get_unit_id_diff())
{ }
, umc_commands_undo()
, umc_commands_redo()
{
umc_commands_undo.swap(synced_context::get_undo_commands());
umc_commands_redo.swap(synced_context::get_redo_commands());
}
undo_action(const config& cfg)
: undo_action_base()
, replay_data(cfg.child_or_empty("replay_data"))
, unit_id_diff(cfg["unit_id_diff"])
{ }
, umc_commands_undo()
, umc_commands_redo()
{
read_tconfig_vector(umc_commands_undo, cfg, "undo_actions");
read_tconfig_vector(umc_commands_redo, cfg, "redo_actions");
}
// Virtual destructor to support derived classes.
virtual ~undo_action() {}
@ -58,6 +68,8 @@ namespace actions {
{
cfg.add_child("replay_data", replay_data);
cfg["unit_id_diff"] = unit_id_diff;
write_tconfig_vector(umc_commands_undo, cfg, "undo_actions");
write_tconfig_vector(umc_commands_redo, cfg, "redo_actions");
undo_action_base::write(cfg);
}
@ -71,8 +83,18 @@ namespace actions {
/// we need this because we don't recalculate the redos like they would be in real game,
/// but even undoable commands can have "dependent" (= user_input) commands, which we save here.
config replay_data;
/// the difference in the unit ids
/// TODO: does it really make sense to allow undoing if the unit id counter has changed?
int unit_id_diff;
/// actions wml (specified by wml) that should be executed when undoing this command.
typedef boost::ptr_vector<config> tconfig_vector;
tconfig_vector umc_commands_undo;
tconfig_vector umc_commands_redo;
void execute_undo_umc_wml();
void execute_redo_umc_wml();
static void read_tconfig_vector(tconfig_vector& vec, const config& cfg, const std::string& tag);
static void write_tconfig_vector(const tconfig_vector& vec, config& cfg, const std::string& tag);
};
/// entry for player actions that do not need any special code to be performed when undoing such as right-click menu items.

View file

@ -26,6 +26,7 @@ bool dismiss_action::undo(int side)
team &current_team = (*resources::teams)[side-1];
current_team.recall_list().add(dismissed_unit);
execute_undo_umc_wml();
return true;
}
@ -40,6 +41,7 @@ bool dismiss_action::redo(int side)
resources::recorder->redo(replay_data);
replay_data.clear();
current_team.recall_list().erase_if_matches_id(dismissed_unit->id());
execute_redo_umc_wml();
return true;
}

View file

@ -88,6 +88,7 @@ bool move_action::undo(int side)
u->anim_comp().set_standing();
gui.invalidate_unit_after_move(rev_route.front(), rev_route.back());
execute_undo_umc_wml();
return true;
}
@ -136,6 +137,7 @@ bool move_action::redo(int side)
gui.invalidate_unit_after_move(route.front(), route.back());
resources::recorder->redo(replay_data);
replay_data.clear();
execute_redo_umc_wml();
return true;
}

View file

@ -66,6 +66,7 @@ bool recall_action::undo(int side)
// to also do the overlapped hexes
gui.invalidate(recall_loc);
units.erase(recall_loc);
execute_undo_umc_wml();
return true;
}

View file

@ -59,6 +59,7 @@ bool recruit_action::undo(int side)
// to also do the overlapped hexes
gui.invalidate(recruit_loc);
units.erase(recruit_loc);
execute_undo_umc_wml();
return true;
}

View file

@ -665,6 +665,7 @@ void context_manager::generate_map_dialog()
} else {
editor_map new_map(game_config_, map_string);
editor_action_whole_map a(new_map);
get_map_context().set_needs_labels_reset(); // Ensure Player Start labels are updated together with newly generated map
perform_refresh(a);
}
last_map_generator_ = map_generator;

View file

@ -1792,5 +1792,15 @@ WML_HANDLER_FUNCTION(wml_message, /*event_info*/, cfg)
handle_wml_log_message( cfg.get_parsed_config() );
}
WML_HANDLER_FUNCTION(on_undo, /*event_info*/, cfg)
{
synced_context::add_undo_commands(cfg.get_parsed_config());
}
WML_HANDLER_FUNCTION(on_redo, /*event_info*/, cfg)
{
synced_context::add_redo_commands(cfg.get_parsed_config());
}
} // end namespace game_events

View file

@ -14,6 +14,7 @@
#include "game_state.hpp"
#include "actions/undo.hpp"
#include "game_board.hpp"
#include "game_data.hpp"
#include "game_events/manager.hpp"
@ -54,6 +55,7 @@ game_state::game_state(const config & level, play_controller & pc, const tdata_c
reports_(new reports()),
lua_kernel_(),
events_manager_(),
undo_stack_(new actions::undo_list(level.child("undo_stack"))),
player_number_(level["playing_team"].to_int() + 1),
init_side_done_(level["init_side_done"].to_bool(false)),
start_event_fired_(!level["playing_team"].empty()),
@ -266,6 +268,8 @@ void game_state::write(config& cfg) const
//Write the game data, including wml vars
gamedata_.write_snapshot(cfg);
// Preserve the undo stack so that fog/shroud clearing is kept accurate.
undo_stack_->write(cfg.add_child("undo_stack"));
}
namespace {

View file

@ -38,6 +38,8 @@ namespace pathfind { class manager; }
namespace wb { class manager; }
namespace actions { class undo_list; }
class game_state : public filter_context
{
private:
@ -52,6 +54,10 @@ public:
boost::scoped_ptr<reports> reports_;
boost::scoped_ptr<game_lua_kernel> lua_kernel_;
boost::scoped_ptr<game_events::manager> events_manager_;
/// undo_stack_ is never NULL. It is implemented as a pointer so that
/// undo_list can be an incomplete type at this point (which reduces the
/// number of files that depend on actions/undo.hpp).
boost::scoped_ptr<actions::undo_list> undo_stack_;
int player_number_;
bool init_side_done_;

View file

@ -167,7 +167,7 @@ void show_help(display &disp, const section &toplevel_sec,
CVideo& screen = disp.video();
const surface& scr = screen.getSurface();
const int width = std::min<int>(font::relative_size(900), scr->w - font::relative_size(20));
const int width = std::min<int>(font::relative_size(1000), scr->w - font::relative_size(20));
const int height = std::min<int>(font::relative_size(800), scr->h - font::relative_size(150));
const int left_padding = font::relative_size(10);
const int right_padding = font::relative_size(10);

View file

@ -86,11 +86,12 @@ static lg::log_domain log_enginerefac("enginerefac");
static lg::log_domain log_engine_enemies("engine/enemies");
#define DBG_EE LOG_STREAM(debug, log_engine_enemies)
/// copies [scenario] attributes/tags from src to dest that are not otherwise stored in c++ structs/clases.
static void copy_persistent(const config& src, config& dst)
{
typedef boost::container::flat_set<std::string> stringset;
static stringset attrs = boost::assign::list_of
("theme")("next_scenario")("description")("name")("defeat_music")
("id")("theme")("next_scenario")("description")("name")("defeat_music")
("victory_music")("victory_when_enemies_defeated")("remove_from_carryover_on_defeat")("disallow_recall")("experience_modifier")("require_scenario")
.convert_to_container<stringset>();
static stringset tags = boost::assign::list_of
@ -157,7 +158,6 @@ play_controller::play_controller(const config& level, saved_game& state_of_game,
, gui_()
, xp_mod_(new unit_experience_accelerator(level["experience_modifier"].to_int(100)))
, statistics_context_(new statistics::scenario_context(level["name"]))
, undo_stack_(new actions::undo_list(level.child("undo_stack")))
, replay_(new replay(state_of_game.get_replay()))
, skip_replay_(skip_replay)
, linger_(false)
@ -174,7 +174,6 @@ play_controller::play_controller(const config& level, saved_game& state_of_game,
resources::controller = this;
resources::persist = &persist_;
resources::undo_stack = undo_stack_.get();
resources::recorder = replay_.get();
resources::classification = &saved_game_.classification();
@ -231,7 +230,7 @@ void play_controller::init(CVideo& video, const config& level)
resources::tod_manager = &gamestate().tod_manager_;
resources::units = &gamestate().board_.units_;
resources::filter_con = &gamestate();
resources::undo_stack = &undo_stack();
resources::tunnels = gamestate().pathfind_manager_.get();
LOG_NG << "initializing whiteboard..." << (SDL_GetTicks() - ticks()) << std::endl;
@ -311,6 +310,7 @@ void play_controller::reset_gamestate(const config& level, int replay_pos)
resources::lua_kernel = NULL;
resources::game_events = NULL;
resources::tunnels = NULL;
resources::undo_stack = NULL;
gamestate_.reset(new game_state(level, *this, tdata_));
gamestate().bind(whiteboard_manager_.get(), gui_.get());
resources::gameboard = &gamestate().board_;
@ -322,6 +322,7 @@ void play_controller::reset_gamestate(const config& level, int replay_pos)
resources::lua_kernel = gamestate().lua_kernel_.get();
resources::game_events = gamestate().events_manager_.get();
resources::tunnels = gamestate().pathfind_manager_.get();
resources::undo_stack = &undo_stack();
gui_->reset_tod_manager(gamestate().tod_manager_);
gui_->reset_reports(*gamestate().reports_);
gui_->change_display_context(&gamestate().board_);
@ -466,7 +467,7 @@ void play_controller::do_init_side()
}
// Prepare the undo stack.
undo_stack_->new_side_turn(current_side());
undo_stack().new_side_turn(current_side());
pump().fire("turn refresh");
pump().fire("side " + side_num + " turn refresh");
@ -515,9 +516,6 @@ config play_controller::to_config() const
gui_->write(cfg.add_child("display"));
// Preserve the undo stack so that fog/shroud clearing is kept accurate.
undo_stack_->write(cfg.add_child("undo_stack"));
//Write the soundsources.
soundsources_manager_->write_sourcespecs(cfg);
@ -537,7 +535,7 @@ void play_controller::finish_side_turn()
{ //Block for set_scontext_synced
set_scontext_synced sync(1);
// Ending the turn commits all moves.
undo_stack_->clear();
undo_stack().clear();
gamestate().board_.end_turn(current_side());
const std::string turn_num = str_cast(turn());
const std::string side_num = str_cast(current_side());
@ -851,20 +849,20 @@ void play_controller::load_game() {
void play_controller::undo(){
mouse_handler_.deselect_hex();
undo_stack_->undo();
undo_stack().undo();
}
void play_controller::redo(){
mouse_handler_.deselect_hex();
undo_stack_->redo();
undo_stack().redo();
}
bool play_controller::can_undo() const {
return !linger_ && !is_browsing() && !events::commands_disabled && undo_stack_->can_undo();
return !linger_ && !is_browsing() && !events::commands_disabled && undo_stack().can_undo();
}
bool play_controller::can_redo() const {
return !linger_ && !is_browsing() && !events::commands_disabled && undo_stack_->can_redo();
return !linger_ && !is_browsing() && !events::commands_disabled && undo_stack().can_redo();
}
namespace {

View file

@ -196,7 +196,7 @@ public:
virtual plugins_context * get_plugins_context();
hotkey::command_executor * get_hotkey_command_executor();
actions::undo_list & get_undo_stack() { return *undo_stack_; }
actions::undo_list & get_undo_stack() { return undo_stack(); }
bool is_browsing() const OVERRIDE;
bool is_lingering() const { return linger_; }
@ -287,10 +287,8 @@ protected:
boost::scoped_ptr<game_display> gui_;
boost::scoped_ptr<unit_experience_accelerator> xp_mod_;
boost::scoped_ptr<const statistics::scenario_context> statistics_context_;
/// undo_stack_ is never NULL. It is implemented as a pointer so that
/// undo_list can be an incomplete type at this point (which reduces the
/// number of files that depend on actions/undo.hpp).
boost::scoped_ptr<actions::undo_list> undo_stack_;
actions::undo_list& undo_stack() { return *gamestate().undo_stack_; };
const actions::undo_list& undo_stack() const { return *gamestate().undo_stack_; };
boost::scoped_ptr<replay> replay_;
bool skip_replay_;

View file

@ -135,13 +135,13 @@ void playmp_controller::play_human_turn()
timer.reset(new countdown_clock(current_team()));
}
show_turn_dialog();
if(undo_stack_->can_undo()) {
if(undo_stack().can_undo()) {
// If we reload a networked mp game we cannot undo moves made before the save
// Becasue other players already received them
if(!current_team().auto_shroud_updates()) {
synced_context::run_and_store("update_shroud", replay_helper::get_update_shroud());
}
undo_stack_->clear();
undo_stack().clear();
}
if (!preferences::disable_auto_moves()) {
execute_gotos();
@ -154,7 +154,7 @@ void playmp_controller::play_human_turn()
if (player_type_changed_)
{
// Clean undo stack if turn has to be restarted (losing control)
if ( undo_stack_->can_undo() )
if ( undo_stack().can_undo() )
{
font::floating_label flabel(_("Undoing moves not yet transmitted to the server."));
@ -168,8 +168,8 @@ void playmp_controller::play_human_turn()
font::add_floating_label(flabel);
}
while( undo_stack_->can_undo() )
undo_stack_->undo();
while( undo_stack().can_undo() )
undo_stack().undo();
}
check_objectives();
@ -433,8 +433,8 @@ void playmp_controller::pull_remote_choice()
{
// when using a remote user choice undoing must be impossible because that network traffic cannot be undone
// Also turn_data_.sync_network() (which calls turn_data_.send_data()) won't work if the undo stack isn't empty because undoable moves won't be sended
// Also undo_stack_->clear() must be called synced so we cannot do that here.
assert(!undo_stack_->can_undo());
// Also undo_stack()clear() must be called synced so we cannot do that here.
assert(!undo_stack().can_undo());
turn_info::PROCESS_DATA_RESULT res = turn_data_.sync_network();
assert(res != turn_info::PROCESS_END_LINGER);
assert(res != turn_info::PROCESS_END_TURN);
@ -448,8 +448,8 @@ void playmp_controller::send_user_choice()
{
// when using a remote user choice undoing must be impossible because that network traffic cannot be undone
// Also turn_data_.send_data() won't work if the undo stack isn't empty because undoable moves won't be sended
// Also undo_stack_->clear() must be called synced so we cannot do that here.
assert(!undo_stack_->can_undo());
// Also undo_stack()clear() must be called synced so we cannot do that here.
assert(!undo_stack().can_undo());
turn_data_.send_data();
}

View file

@ -235,11 +235,12 @@ void playsingle_controller::play_scenario_main_loop()
catch(const reset_gamestate_exception& ex) {
/**
@TODO: The mp replay feature still doesnt work properly (casues OOS) becasue:
1) The undo stack is not reset along with the gamestate
1) The undo stack is not reset along with the gamestate (fixed).
2) The server_request_number_ is not reset along with the gamestate (fixed).
3) chat and other unsynced actions are inserted in the middle of the replay bringing the replay_pos in unorder.
4) untracked changes in side controllers are lost when resetting gamestate
5) The game shoudl have a stricter check for whether the loaded game is actually a parent of this game.
3) chat and other unsynced actions are inserted in the middle of the replay bringing the replay_pos in unorder (fixed).
4) untracked changes in side controllers are lost when resetting gamestate.
5) The game should have a stricter check for whether the loaded game is actually a parent of this game.
6) If an action was undone after a game was saved it can casue if teh undone action is in the snapshot of the saved game. (luckyli this is never the case for autosaves)
*/
reset_gamestate(*ex.level, (*ex.level)["replay_pos"]);
play_scenario_init(*ex.level);
@ -581,7 +582,7 @@ void playsingle_controller::play_ai_turn()
// to record this change for the replay though.
synced_context::run_and_store("auto_shroud", replay_helper::get_auto_shroud(true));
}
undo_stack_->clear();
undo_stack().clear();
turn_data_.send_data();
try {

View file

@ -317,14 +317,22 @@ void replay::add_log_data(const std::string &category, const std::string &key, c
cat.add_child(key,c);
}
void replay::add_chat_message_location()
bool replay::add_chat_message_location()
{
message_locations.push_back(base_->get_pos() - 1);
int pos = base_->get_pos() - 1;
if(std::find(message_locations.begin(), message_locations.end(), pos) == message_locations.end()) {
message_locations.push_back(base_->get_pos() - 1);
return true;
}
else {
return false;
}
}
void replay::speak(const config& cfg)
{
config& cmd = add_nonundoable_command();
config& cmd = base_->insert_command(base_->get_pos());
cmd["undo"] = false;
cmd.add_child("speak",cfg);
add_chat_message_location();
}
@ -354,6 +362,7 @@ static std::vector< chat_msg > message_log;
const std::vector<chat_msg>& replay::build_chat_log()
{
message_log.clear();
std::vector<int>::iterator loc_it;
int last_location = 0;
std::back_insert_iterator<std::vector < chat_msg > > chat_log_appender( back_inserter(message_log));
@ -366,7 +375,6 @@ const std::vector<chat_msg>& replay::build_chat_log()
add_chat_log_entry(speak, chat_log_appender);
}
message_locations.clear();
return message_log;
}
@ -600,13 +608,6 @@ void replay::set_to_end()
base_->set_to_end();
}
void replay::clear()
{
message_locations.clear();
message_log.clear();
//FIXME
}
bool replay::empty()
{
return ncommands() == 0;
@ -702,13 +703,15 @@ REPLAY_RETURN do_replay_handle(bool one_move)
const std::string &message = child["message"];
//if (!preferences::parse_should_show_lobby_join(speaker_name, message)) return;
bool is_whisper = (speaker_name.find("whisper: ") == 0);
resources::recorder->add_chat_message_location();
if (!resources::controller->is_skipping_replay() || is_whisper) {
int side = child["side"];
resources::screen->get_chat_manager().add_chat_message(get_time(child), speaker_name, side, message,
if(resources::recorder->add_chat_message_location()) {
DBG_REPLAY << "tried to add a chat message twice.\n";
if (!resources::controller->is_skipping_replay() || is_whisper) {
int side = child["side"];
resources::screen->get_chat_manager().add_chat_message(get_time(child), speaker_name, side, message,
(team_name.empty() ? events::chat_handler::MESSAGE_PUBLIC
: events::chat_handler::MESSAGE_PRIVATE),
preferences::message_bell());
}
}
}
else if (const config &child = cfg->child("label"))

View file

@ -78,8 +78,11 @@ public:
void add_log_data(const std::string &category, const std::string &key, const std::string &var);
void add_log_data(const std::string &category, const std::string &key, const config& c);
void add_chat_message_location();
/**
adds a chat message if it wasn't added yet.
@returns true if a message location was added
*/
bool add_chat_message_location();
void speak(const config& cfg);
const std::vector<chat_msg>& build_chat_log();
@ -112,7 +115,6 @@ public:
bool at_end() const;
void set_to_end();
void clear();
bool empty();
enum MARK_SENT { MARK_AS_UNSENT, MARK_AS_SENT };

View file

@ -2937,6 +2937,19 @@ int game_lua_kernel::intf_synchronize_choice(lua_State *L)
return 1;
}
/**
* Calls a function in an unsynced context (this specially means that all random calls used by that function will be unsynced).
* This is usualy used together with an unsynced if like 'if controller != network'
* - Arg 1: function that will be called during the unsynced context.
*/
static int intf_do_unsynced(lua_State *L)
{
set_scontext_unsynced sync;
lua_pushvalue(L, 1);
luaW_pcall(L, 0, 0, false);
return 0;
}
/**
* Gets all the locations matching a given filter.
* - Arg 1: WML table.
@ -4075,6 +4088,7 @@ game_lua_kernel::game_lua_kernel(CVideo * video, game_state & gs, play_controlle
{ "unit_defense", &intf_unit_defense },
{ "unit_movement_cost", &intf_unit_movement_cost },
{ "unit_resistance", &intf_unit_resistance },
{ "unsynced", &intf_do_unsynced },
{ "add_event_handler", &dispatch<&game_lua_kernel::intf_add_event > },
{ "add_tile_overlay", &dispatch<&game_lua_kernel::intf_add_tile_overlay > },
{ "add_time_area", &dispatch<&game_lua_kernel::intf_add_time_area > },

View file

@ -53,6 +53,8 @@ static lg::log_domain log_replay("replay");
synced_context::synced_state synced_context::state_ = synced_context::UNSYNCED;
int synced_context::last_unit_id_ = 0;
synced_context::tconfig_vector synced_context::undo_commands_ = synced_context::tconfig_vector();
synced_context::tconfig_vector synced_context::redo_commands_ = synced_context::tconfig_vector();
bool synced_context::is_simultaneously_ = false;
bool synced_context::run(const std::string& commandname, const config& data, bool use_undo, bool show, synced_command::error_handler_function error_handler)
@ -388,6 +390,16 @@ config synced_context::ask_server_choice(const server_choice& sch)
}
}
void synced_context::add_undo_commands(const config& commands)
{
undo_commands_.insert(undo_commands_.begin(), new config(commands));
}
void synced_context::add_redo_commands(const config& commands)
{
redo_commands_.insert(redo_commands_.begin(), new config(commands));
}
set_scontext_synced_base::set_scontext_synced_base()
: new_rng_(synced_context::get_rng_for_action())
, old_rng_(random_new::generator)
@ -398,6 +410,8 @@ set_scontext_synced_base::set_scontext_synced_base()
synced_context::set_synced_state(synced_context::SYNCED);
synced_context::reset_is_simultaneously();
synced_context::set_last_unit_id(resources::gameboard->unit_id_manager().get_save_id());
synced_context::reset_undo_commands();
synced_context::reset_redo_commands();
old_rng_ = random_new::generator;
random_new::generator = new_rng_.get();
}

View file

@ -24,6 +24,8 @@
#include "mouse_handler_base.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
class config;
//only static methods.
@ -144,6 +146,14 @@ public:
if we are in a mp game, ask the server, otherwise generate the answer ourselves.
*/
static config ask_server_choice(const server_choice&);
typedef boost::ptr_vector<config> tconfig_vector;
static tconfig_vector& get_undo_commands() { return undo_commands_; }
static tconfig_vector& get_redo_commands() { return redo_commands_; }
static void add_undo_commands(const config& commands);
static void add_redo_commands(const config& commands);
static void reset_undo_commands() { undo_commands_ = tconfig_vector(); }
static void reset_redo_commands() { redo_commands_ = tconfig_vector(); }
private:
/*
weather we are in a synced move, in a user_choice, or none of them
@ -154,12 +164,22 @@ private:
It's impossible to undo data that has been sended over the network.
false = we are on a local turn and haven't sended anything yet.
TODO: it would be better if the following variable were not static.
*/
static bool is_simultaneously_;
/**
Used to restore the unit id manager when undoing.
*/
static int last_unit_id_;
/**
Actions wml to be executed when the current actio is undone.
*/
static tconfig_vector undo_commands_;
/**
Actions wml to be executed when the current actio is redone.
*/
static tconfig_vector redo_commands_;
};

View file

@ -1663,9 +1663,10 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
BOOST_FOREACH(const config &effect, mod.child_range("effect"))
{
// Apply SUF.
if (const config &afilter = effect.child("filter"))
if (!unit_filter(vconfig(afilter), resources::filter_con).matches(*this, loc_)) continue;
if (const config &afilter = effect.child("filter")) {
// @FIXME: during gamesate construction resources::filter_con is not available
if (resources::filter_con && !unit_filter(vconfig(afilter), resources::filter_con).matches(*this, loc_)) continue;
}
const std::string &apply_to = effect["apply_to"];
const std::string &apply_times = effect["times"];
int times = 1;