Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wesnoth/wesnoth
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Sep 16, 2014
2 parents e1d07fb + 971fb07 commit 63bb1c4
Show file tree
Hide file tree
Showing 39 changed files with 83 additions and 27 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -77,6 +77,7 @@ Version 1.13.0-dev:
when wesnoth is running in debug mode (--debug command line flag).
* Added new function wesnoth.get_all_vars().
* Graphics:
* New stand animations (NE and SE) for the Revenant
* Smooth unit movement over terrain with elevation (e.g. keeps/bridges)
* Fixed bug #22045: Only blit neutral surfaces.
* [item] images are now subject to local ToD lighting effects instead of
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions data/core/units/undead/Skele_Revenant.cfg
Expand Up @@ -4,7 +4,7 @@
name= _ "Revenant"
# wmllint: general spelling revenants
race=undead
image="units/undead-skeletal/revenant.png"
image="units/undead-skeletal/revenant/revenant.png"
profile="portraits/undead/revenant.png"
{MAGENTA_IS_THE_TEAM_COLOR}
hitpoints=47
Expand All @@ -18,6 +18,7 @@
usage=fighter
description= _ "Given false life to do battle once more, the creatures known as Revenants were clearly great warriors in their time, though the memory of that time is almost wholly lost to their undead selves. Even the sorcerers who raised them can only speculate on their past. Such questions aside, a Revenant is a powerful tool in combat: a fearless warrior that feels no pain and will fight to the bitter end."+{SPECIAL_NOTES}+{SPECIAL_NOTES_SUBMERGE}
die_sound=skeleton-big-die.ogg
{STANDING_ANIM_DIRECTIONAL_8_FRAME "units/undead-skeletal/revenant/revenant"}
[portrait]
size=400
side="left"
Expand Down Expand Up @@ -50,28 +51,28 @@
[recruit_anim]
start_time=-200
[frame]
image="units/undead-skeletal/revenant-dying-7.png:300"
image="units/undead-skeletal/revenant/revenant-dying-7.png:300"
alpha="0~1:300"
[/frame]
[frame]
image="units/undead-skeletal/revenant-dying-[6~1].png:100"
image="units/undead-skeletal/revenant/revenant-dying-[6~1].png:100"
[/frame]
[/recruit_anim]
[death]
start_time=0
[frame]
image="units/undead-skeletal/revenant-dying-[1~7].png:100"
image="units/undead-skeletal/revenant/revenant-dying-[1~7].png:100"
[/frame]
[/death]
{DEFENSE_ANIM "units/undead-skeletal/revenant-defend-2.png" "units/undead-skeletal/revenant-defend-1.png" {SOUND_LIST:SKELETON_BIG_HIT} }
{DEFENSE_ANIM "units/undead-skeletal/revenant/revenant-defend-2.png" "units/undead-skeletal/revenant/revenant-defend-1.png" {SOUND_LIST:SKELETON_BIG_HIT} }
[attack_anim]
[filter_attack]
name=axe
[/filter_attack]
offset=0.0~0.35,0.35~0.55,0.55~0.35,0.35~0.0
start_time=-300
[frame]
image="units/undead-skeletal/revenant-attack-[1~10].png:[50*5,75*4,50]"
image="units/undead-skeletal/revenant/revenant-attack-[1~10].png:[50*5,75*4,50]"
[/frame]
{SOUND:HIT_AND_MISS axe.ogg {SOUND_LIST:MISS} -100}
[/attack_anim]
Expand Down
96 changes: 75 additions & 21 deletions data/tools/GUI.pyw
Expand Up @@ -176,8 +176,18 @@ If the widget isn't active, some options do not appear"""
image=ICONS['select_all'],
compound=LEFT,
accelerator='Ctrl+A',
command=lambda: self.widget.event_generate("<<SelectAll>>"))
command=self.on_select_all)
self.tk_popup(x,y) # self.post does not destroy the menu when clicking out of it
def on_select_all(self):
# disabled Text widgets have a different way to handle selection
if isinstance(self.widget,Text):
# adding a SEL tag to a chunk of text causes it to be selected
self.widget.tag_add(SEL,"1.0",END)
elif isinstance(self.widget,Entry) or \
isinstance(self.widget,Spinbox) or \
isinstance(self.widget,Combobox):
# if the widget is active or readonly, just fire the correct event
self.widget.event_generate("<<SelectAll>>")

class EntryContext(Entry):
def __init__(self,parent,**kwargs):
Expand All @@ -191,12 +201,26 @@ Use like any other Entry widget"""
# some mice don't even have two buttons, so the user is forced
# to use Control + the only button
# bear in mind that I don't have a Mac, so this point may be bugged
if sys.platform=="darwin":
self.bind("<Button-2>",self.on_right_click)
self.bind("<Control-Button-1>",self.on_right_click)
else:
self.bind("<Button-3>",self.on_right_click)
def on_right_click(self,event):
# bind also the context menu key, for those keyboards that have it
# that is, most of the Windows and Linux ones (however, in Win it's
# called App, while on Linux is called Menu)
# Mac doesn't have a context menu key on its keyboards, so no binding
# finally, bind also the Shift+F10 shortcut (same as Menu/App key)
# the call to tk windowingsystem is justified by the fact
# that it is possible to install X11 over Darwin
windowingsystem = self.tk.call('tk', 'windowingsystem')
if windowingsystem == "win32": # Windows, both 32 and 64 bit
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-App>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
elif windowingsystem == "aqua": # MacOS with Aqua
self.bind("<Button-2>",self.on_context_menu)
self.bind("<Control-Button-1>",self.on_context_menu)
elif windowingsystem == "x11": # Linux, FreeBSD, Darwin with X11
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-Menu>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
def on_context_menu(self,event):
if str(self.cget('state')) != DISABLED:
ContextMenu(event.x_root,event.y_root,event.widget)

Expand All @@ -208,19 +232,49 @@ Use like any other Spinbox widget"""
super().__init__(parent,**kwargs)
else:
Spinbox.__init__(self,parent,**kwargs)
# on Mac the right button fires a Button-2 event, or so I'm told
# some mice don't even have two buttons, so the user is forced
# to use Control + the only button
# bear in mind that I don't have a Mac, so this point may be bugged
if sys.platform=="darwin":
self.bind("<Button-2>",self.on_right_click)
self.bind("<Control-Button-1>",self.on_right_click)
else:
self.bind("<Button-3>",self.on_right_click)
def on_right_click(self,event):
# see the above widget for an explanation of this block
windowingsystem = self.tk.call('tk', 'windowingsystem')
if windowingsystem == "win32":
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-App>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
elif windowingsystem == "aqua":
self.bind("<Button-2>",self.on_context_menu)
self.bind("<Control-Button-1>",self.on_context_menu)
elif windowingsystem == "x11":
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-Menu>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
def on_context_menu(self,event):
if str(self.cget('state')) != DISABLED:
ContextMenu(event.x_root,event.y_root,event.widget)

class EnhancedText(Text):
def __init__(self,*args,**kwargs):
"""A subclass of Text with a context menu
Use it like any other Text widget"""
if sys.version_info.major>=3:
super().__init__(*args,**kwargs)
else:
Text.__init__(self,*args,**kwargs)
# see descriptions of above widgets
windowingsystem = self.tk.call('tk', 'windowingsystem')
if windowingsystem == "win32": # Windows, both 32 and 64 bit
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-App>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
elif windowingsystem == "aqua": # MacOS with Aqua
self.bind("<Button-2>",self.on_context_menu)
self.bind("<Control-Button-1>",self.on_context_menu)
elif windowingsystem == "x11": # Linux, FreeBSD, Darwin with X11
self.bind("<Button-3>",self.on_context_menu)
self.bind("<KeyPress-Menu>",self.on_context_menu)
self.bind("<Shift-KeyPress-F10>",self.on_context_menu)
def on_context_menu(self,event):
# the disabled state in a Text widget is pretty much
# like the readonly state in Entry, hence no state check
ContextMenu(event.x_root,event.y_root,event.widget)

class SelectDirectory(LabelFrame):
def __init__(self,parent,textvariable=None,**kwargs):
"""A subclass of LabelFrame sporting a readonly Entry and a Button with a folder icon.
Expand Down Expand Up @@ -794,10 +848,10 @@ class MainFrame(Frame):
self.output_frame.grid(row=3,
column=0,
sticky=N+E+S+W)
self.text=Text(self.output_frame,
wrap=WORD,
state=DISABLED,
takefocus=True)
self.text=EnhancedText(self.output_frame,
wrap=WORD,
state=DISABLED,
takefocus=True)
self.text.grid(row=0,
column=0,
sticky=N+E+S+W)
Expand Down

0 comments on commit 63bb1c4

Please sign in to comment.