Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
4f492f06
Commit
4f492f06
authored
Aug 26, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented auto replace, including GUI
parent
5257a369
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
742 additions
and
541 deletions
+742
-541
data/en.mse-locale/locale
data/en.mse-locale/locale
+21
-0
src/data/game.cpp
src/data/game.cpp
+2
-1
src/data/game.hpp
src/data/game.hpp
+4
-2
src/data/settings.cpp
src/data/settings.cpp
+34
-4
src/data/settings.hpp
src/data/settings.hpp
+8
-0
src/data/symbol.cpp
src/data/symbol.cpp
+7
-0
src/data/word_list.cpp
src/data/word_list.cpp
+15
-0
src/data/word_list.hpp
src/data/word_list.hpp
+18
-0
src/gui/set/window.cpp
src/gui/set/window.cpp
+10
-3
src/gui/set/window.hpp
src/gui/set/window.hpp
+1
-0
src/gui/value/text.cpp
src/gui/value/text.cpp
+85
-26
src/gui/value/text.hpp
src/gui/value/text.hpp
+8
-5
src/mse.vcproj
src/mse.vcproj
+6
-0
src/resource/common/expected_locale_keys
src/resource/common/expected_locale_keys
+511
-495
src/util/io/writer.cpp
src/util/io/writer.cpp
+2
-2
src/util/window_id.hpp
src/util/window_id.hpp
+9
-2
tools/gen.pl
tools/gen.pl
+1
-1
No files found.
data/en.mse-locale/locale
View file @
4f492f06
...
@@ -29,6 +29,7 @@ menu:
...
@@ -29,6 +29,7 @@ menu:
find
:
&
Find
Ctrl
+
F
find
:
&
Find
Ctrl
+
F
find
next
:
Find
&
Next
F3
find
next
:
Find
&
Next
F3
replace
:
R
&
eplace
Ctrl
+
H
replace
:
R
&
eplace
Ctrl
+
H
auto
replace
:
Auto
Rep
&
lace
...
preferences
:
&
Preferences
...
preferences
:
&
Preferences
...
cards
:
&
Cards
cards
:
&
Cards
...
@@ -125,6 +126,10 @@ help:
...
@@ -125,6 +126,10 @@ help:
paste
:
Inserts
the
text
from
the
clipboard
paste
:
Inserts
the
text
from
the
clipboard
paste
card
:
Inserts
the
card
from
the
clipboard
paste
card
:
Inserts
the
card
from
the
clipboard
paste
keyword
:
Inserts
the
keyword
from
the
clipboard
paste
keyword
:
Inserts
the
keyword
from
the
clipboard
find
:
Search
the
card
texts
find
next
:
Find
the
next
match
replace
:
Replace
in
the
card
texts
auto
replace
:
What
text
should
automatically
be
replaced
?
preferences
:
Change
the
configuration
of
Magic
Set
Editor
preferences
:
Change
the
configuration
of
Magic
Set
Editor
cards
:
cards
:
...
@@ -435,6 +440,10 @@ label:
...
@@ -435,6 +440,10 @@ label:
zoom
:
Zoom
zoom
:
Zoom
filter
:
Filter
filter
:
Filter
#
Auto
replace
auto
match
:
Match
auto
replace
:
Replace
#
Symbol
editor
#
Symbol
editor
sides
:
sides
sides
:
sides
...
@@ -484,6 +493,14 @@ button:
...
@@ -484,6 +493,14 @@ button:
#
Update
checker
#
Update
checker
close
:
&
Close
close
:
&
Close
#
Auto
replace
use
auto
replace
:
Use
auto
replace
add
item
:
&
Add
remove
item
:
&
Remove
defaults
:
Reset
to
&
Defaults
enabled
:
Enabled
whole
word
:
Match
whole
word
only
##############################################################
Titles
in
the
GUI
##############################################################
Titles
in
the
GUI
title
:
title
:
...
@@ -519,6 +536,8 @@ title:
...
@@ -519,6 +536,8 @@ title:
export
cancelled
:
Export
Cancelled
export
cancelled
:
Export
Cancelled
export
html
:
Export
to
HTML
export
html
:
Export
to
HTML
save
html
:
Export
to
HTML
save
html
:
Export
to
HTML
#
auto
replace
auto
replaces
:
Auto
Replace
#
Package
Update
Window
#
Package
Update
Window
package
list
:
Package
Updates
package
list
:
Package
Updates
...
@@ -537,6 +556,7 @@ action:
...
@@ -537,6 +556,7 @@ action:
delete
:
Delete
delete
:
Delete
cut
:
Cut
cut
:
Cut
paste
:
Paste
paste
:
Paste
auto
replace
:
Auto
Replace
#
Choice
/
color
editors
#
Choice
/
color
editors
change
:
Change
%
s
change
:
Change
%
s
...
@@ -623,6 +643,7 @@ error:
...
@@ -623,6 +643,7 @@ error:
When
you
open
it
,
some
aspects
of
the
file
may
be
lost
.
When
you
open
it
,
some
aspects
of
the
file
may
be
lost
.
It
is
recommended
that
you
upgrade
to
the
latest
version
.
It
is
recommended
that
you
upgrade
to
the
latest
version
.
Visit
http
:://
magicseteditor
.
sourceforge
.
net
/
Visit
http
:://
magicseteditor
.
sourceforge
.
net
/
word
list
type
not
found
:
The
word
list
type
%
s
was
not
found
(
from
a
<
word
-
list
>
tag
)
#
Update
checking
#
Update
checking
checking
updates
failed
:
Checking
updates
failed
.
checking
updates
failed
:
Checking
updates
failed
.
...
...
src/data/game.cpp
View file @
4f492f06
...
@@ -57,7 +57,8 @@ IMPLEMENT_REFLECTION(Game) {
...
@@ -57,7 +57,8 @@ IMPLEMENT_REFLECTION(Game) {
REFLECT
(
keyword_modes
);
REFLECT
(
keyword_modes
);
REFLECT
(
keyword_parameter_types
);
REFLECT
(
keyword_parameter_types
);
REFLECT_NO_SCRIPT
(
keywords
);
REFLECT_NO_SCRIPT
(
keywords
);
REFLECT
(
word_lists
);
REFLECT_NO_SCRIPT
(
word_lists
);
REFLECT_NO_SCRIPT
(
auto_replaces
);
}
}
void
Game
::
validate
(
Version
v
)
{
void
Game
::
validate
(
Version
v
)
{
...
...
src/data/game.hpp
View file @
4f492f06
...
@@ -25,6 +25,7 @@ DECLARE_POINTER_TYPE(KeywordParam);
...
@@ -25,6 +25,7 @@ DECLARE_POINTER_TYPE(KeywordParam);
DECLARE_POINTER_TYPE
(
KeywordMode
);
DECLARE_POINTER_TYPE
(
KeywordMode
);
DECLARE_POINTER_TYPE
(
Keyword
);
DECLARE_POINTER_TYPE
(
Keyword
);
DECLARE_POINTER_TYPE
(
WordList
);
DECLARE_POINTER_TYPE
(
WordList
);
DECLARE_POINTER_TYPE
(
AutoReplace
);
// ----------------------------------------------------------------------------- : Game
// ----------------------------------------------------------------------------- : Game
...
@@ -45,13 +46,14 @@ class Game : public Packaged {
...
@@ -45,13 +46,14 @@ class Game : public Packaged {
vector
<
StatsCategoryP
>
statistics_categories
;
///< (Additional) statistics categories
vector
<
StatsCategoryP
>
statistics_categories
;
///< (Additional) statistics categories
vector
<
PackTypeP
>
pack_types
;
///< Types of random card packs to generate
vector
<
PackTypeP
>
pack_types
;
///< Types of random card packs to generate
vector
<
WordListP
>
word_lists
;
///< Word lists for editing with a drop down list
vector
<
WordListP
>
word_lists
;
///< Word lists for editing with a drop down list
vector
<
AutoReplaceP
>
auto_replaces
;
///< Things to autoreplace in textboxes
bool
has_keywords
;
///< Does this game use keywords?
bool
has_keywords
;
///< Does this game use keywords?
OptionalScript
keyword_match_script
;
///< For the keyword editor
OptionalScript
keyword_match_script
;
///< For the keyword editor
vector
<
KeywordParamP
>
keyword_parameter_types
;
///< Types of keyword parameters
vector
<
KeywordParamP
>
keyword_parameter_types
;
///< Types of keyword parameters
vector
<
KeywordModeP
>
keyword_modes
;
///< Modes of keywords
vector
<
KeywordModeP
>
keyword_modes
;
///< Modes of keywords
vector
<
KeywordP
>
keywords
;
///< Keywords for use in text
vector
<
KeywordP
>
keywords
;
///< Keywords for use in text
Dependencies
dependent_scripts_cards
;
///< scripts that depend on the card list
Dependencies
dependent_scripts_cards
;
///< scripts that depend on the card list
Dependencies
dependent_scripts_keywords
;
///< scripts that depend on the keywords
Dependencies
dependent_scripts_keywords
;
///< scripts that depend on the keywords
bool
dependencies_initialized
;
///< are the script dependencies comming from this game all initialized?
bool
dependencies_initialized
;
///< are the script dependencies comming from this game all initialized?
...
...
src/data/settings.cpp
View file @
4f492f06
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <data/stylesheet.hpp>
#include <data/stylesheet.hpp>
#include <data/field.hpp>
#include <data/field.hpp>
#include <data/export_template.hpp>
#include <data/export_template.hpp>
#include <data/word_list.hpp>
#include <util/reflect.hpp>
#include <util/reflect.hpp>
#include <util/platform.hpp>
#include <util/platform.hpp>
#include <util/io/reader.hpp>
#include <util/io/reader.hpp>
...
@@ -19,6 +20,8 @@
...
@@ -19,6 +20,8 @@
#include <wx/wfstream.h>
#include <wx/wfstream.h>
#include <wx/stdpaths.h>
#include <wx/stdpaths.h>
DECLARE_TYPEOF_COLLECTION
(
AutoReplaceP
);
// ----------------------------------------------------------------------------- : Extra types
// ----------------------------------------------------------------------------- : Extra types
IMPLEMENT_REFLECTION_ENUM
(
CheckUpdates
)
{
IMPLEMENT_REFLECTION_ENUM
(
CheckUpdates
)
{
...
@@ -43,7 +46,7 @@ ColumnSettings::ColumnSettings()
...
@@ -43,7 +46,7 @@ ColumnSettings::ColumnSettings()
// dummy for ColumnSettings reflection
// dummy for ColumnSettings reflection
ScriptValueP
to_script
(
const
ColumnSettings
&
)
{
return
script_nil
;
}
ScriptValueP
to_script
(
const
ColumnSettings
&
)
{
return
script_nil
;
}
IMPLEMENT_REFLECTION
(
ColumnSettings
)
{
IMPLEMENT_REFLECTION
_NO_SCRIPT
(
ColumnSettings
)
{
REFLECT
(
width
);
REFLECT
(
width
);
REFLECT
(
position
);
REFLECT
(
position
);
REFLECT
(
visible
);
REFLECT
(
visible
);
...
@@ -53,9 +56,33 @@ GameSettings::GameSettings()
...
@@ -53,9 +56,33 @@ GameSettings::GameSettings()
:
sort_cards_ascending
(
true
)
:
sort_cards_ascending
(
true
)
,
images_export_filename
(
_
(
"{card.name}.jpg"
))
,
images_export_filename
(
_
(
"{card.name}.jpg"
))
,
images_export_conflicts
(
CONFLICT_NUMBER_OVERWRITE
)
,
images_export_conflicts
(
CONFLICT_NUMBER_OVERWRITE
)
,
use_auto_replace
(
true
)
,
initialized
(
false
)
{}
{}
IMPLEMENT_REFLECTION
(
GameSettings
)
{
void
GameSettings
::
initDefaults
(
const
Game
&
game
)
{
if
(
initialized
)
return
;
initialized
=
true
;
// init auto_replaces, copy from game file
FOR_EACH_CONST
(
ar
,
game
.
auto_replaces
)
{
// do we have this one?
bool
already_have
=
false
;
FOR_EACH
(
ar2
,
auto_replaces
)
{
if
(
ar
->
match
==
ar2
->
match
)
{
ar2
->
custom
=
false
;
already_have
=
true
;
break
;
}
}
if
(
!
already_have
)
{
// TODO: when we start saving games, clone here
ar
->
custom
=
false
;
auto_replaces
.
push_back
(
ar
);
}
}
}
IMPLEMENT_REFLECTION_NO_SCRIPT
(
GameSettings
)
{
REFLECT
(
default_stylesheet
);
REFLECT
(
default_stylesheet
);
REFLECT
(
default_export
);
REFLECT
(
default_export
);
REFLECT_N
(
"cardlist columns"
,
columns
);
REFLECT_N
(
"cardlist columns"
,
columns
);
...
@@ -63,6 +90,8 @@ IMPLEMENT_REFLECTION(GameSettings) {
...
@@ -63,6 +90,8 @@ IMPLEMENT_REFLECTION(GameSettings) {
REFLECT
(
sort_cards_ascending
);
REFLECT
(
sort_cards_ascending
);
REFLECT
(
images_export_filename
);
REFLECT
(
images_export_filename
);
REFLECT
(
images_export_conflicts
);
REFLECT
(
images_export_conflicts
);
REFLECT
(
use_auto_replace
);
REFLECT
(
auto_replaces
);
}
}
...
@@ -82,7 +111,7 @@ void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) {
...
@@ -82,7 +111,7 @@ void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) {
if
(
card_normal_export
.
isDefault
())
card_normal_export
.
assignDefault
(
ss
.
card_normal_export
);
if
(
card_normal_export
.
isDefault
())
card_normal_export
.
assignDefault
(
ss
.
card_normal_export
);
}
}
IMPLEMENT_REFLECTION
(
StyleSheetSettings
)
{
IMPLEMENT_REFLECTION
_NO_SCRIPT
(
StyleSheetSettings
)
{
REFLECT
(
card_zoom
);
REFLECT
(
card_zoom
);
REFLECT
(
card_angle
);
REFLECT
(
card_angle
);
REFLECT
(
card_anti_alias
);
REFLECT
(
card_anti_alias
);
...
@@ -127,6 +156,7 @@ void Settings::addRecentFile(const String& filename) {
...
@@ -127,6 +156,7 @@ void Settings::addRecentFile(const String& filename) {
GameSettings
&
Settings
::
gameSettingsFor
(
const
Game
&
game
)
{
GameSettings
&
Settings
::
gameSettingsFor
(
const
Game
&
game
)
{
GameSettingsP
&
gs
=
game_settings
[
game
.
name
()];
GameSettingsP
&
gs
=
game_settings
[
game
.
name
()];
if
(
!
gs
)
gs
=
new_intrusive
<
GameSettings
>
();
if
(
!
gs
)
gs
=
new_intrusive
<
GameSettings
>
();
gs
->
initDefaults
(
game
);
return
*
gs
;
return
*
gs
;
}
}
ColumnSettings
&
Settings
::
columnSettingsFor
(
const
Game
&
game
,
const
Field
&
field
)
{
ColumnSettings
&
Settings
::
columnSettingsFor
(
const
Game
&
game
,
const
Field
&
field
)
{
...
@@ -165,7 +195,7 @@ String Settings::settingsFile() {
...
@@ -165,7 +195,7 @@ String Settings::settingsFile() {
return
user_settings_dir
()
+
_
(
"mse8.config"
);
// use different file during development of C++ port
return
user_settings_dir
()
+
_
(
"mse8.config"
);
// use different file during development of C++ port
}
}
IMPLEMENT_REFLECTION
(
Settings
)
{
IMPLEMENT_REFLECTION
_NO_SCRIPT
(
Settings
)
{
REFLECT_ALIAS
(
300
,
"style settings"
,
"stylesheet settings"
);
REFLECT_ALIAS
(
300
,
"style settings"
,
"stylesheet settings"
);
REFLECT_ALIAS
(
300
,
"default style settings"
,
"default stylesheet settings"
);
REFLECT_ALIAS
(
300
,
"default style settings"
,
"default stylesheet settings"
);
REFLECT
(
locale
);
REFLECT
(
locale
);
...
...
src/data/settings.hpp
View file @
4f492f06
...
@@ -22,6 +22,7 @@ DECLARE_POINTER_TYPE(GameSettings);
...
@@ -22,6 +22,7 @@ DECLARE_POINTER_TYPE(GameSettings);
DECLARE_POINTER_TYPE
(
StyleSheetSettings
);
DECLARE_POINTER_TYPE
(
StyleSheetSettings
);
DECLARE_POINTER_TYPE
(
Field
);
DECLARE_POINTER_TYPE
(
Field
);
DECLARE_POINTER_TYPE
(
Value
);
DECLARE_POINTER_TYPE
(
Value
);
DECLARE_POINTER_TYPE
(
AutoReplace
);
// ----------------------------------------------------------------------------- : Extra data structures
// ----------------------------------------------------------------------------- : Extra data structures
...
@@ -56,6 +57,9 @@ class GameSettings : public IntrusivePtrBase<GameSettings> {
...
@@ -56,6 +57,9 @@ class GameSettings : public IntrusivePtrBase<GameSettings> {
public:
public:
GameSettings
();
GameSettings
();
/// Where the settings have defaults, initialize with the values from the game
void
initDefaults
(
const
Game
&
g
);
String
default_stylesheet
;
String
default_stylesheet
;
String
default_export
;
String
default_export
;
map
<
String
,
ColumnSettings
>
columns
;
map
<
String
,
ColumnSettings
>
columns
;
...
@@ -63,8 +67,12 @@ class GameSettings : public IntrusivePtrBase<GameSettings> {
...
@@ -63,8 +67,12 @@ class GameSettings : public IntrusivePtrBase<GameSettings> {
bool
sort_cards_ascending
;
bool
sort_cards_ascending
;
String
images_export_filename
;
String
images_export_filename
;
FilenameConflicts
images_export_conflicts
;
FilenameConflicts
images_export_conflicts
;
bool
use_auto_replace
;
vector
<
AutoReplaceP
>
auto_replaces
;
///< Things to autoreplace in textboxes
DECLARE_REFLECTION
();
DECLARE_REFLECTION
();
private:
bool
initialized
;
};
};
/// Settings for a StyleSheet
/// Settings for a StyleSheet
...
...
src/data/symbol.cpp
View file @
4f492f06
...
@@ -281,9 +281,16 @@ IMPLEMENT_REFLECTION(Symbol) {
...
@@ -281,9 +281,16 @@ IMPLEMENT_REFLECTION(Symbol) {
}
}
double
Symbol
::
aspectRatio
()
const
{
double
Symbol
::
aspectRatio
()
const
{
// Margin between the edges and the symbol.
// In each direction take the lowest one
// This is at most 0.5 (if the symbol is just a line in the middle)
// Multiply by 2 (below) to give something in the range [0...1] i.e. [touches the edge...only in the middle]
double
margin_x
=
min
(
0.4999
,
max
(
0.
,
min
(
min_pos
.
x
,
1
-
max_pos
.
x
)));
double
margin_x
=
min
(
0.4999
,
max
(
0.
,
min
(
min_pos
.
x
,
1
-
max_pos
.
x
)));
double
margin_y
=
min
(
0.4999
,
max
(
0.
,
min
(
min_pos
.
y
,
1
-
max_pos
.
y
)));
double
margin_y
=
min
(
0.4999
,
max
(
0.
,
min
(
min_pos
.
y
,
1
-
max_pos
.
y
)));
// The difference between these two,
// e.g. if the vertical margin is more then the horizontal one, the symbol is 'flat'
double
delta
=
2
*
(
margin_y
-
margin_x
);
double
delta
=
2
*
(
margin_y
-
margin_x
);
// The aspect ratio, i.e. width/height
if
(
delta
>
0
)
{
if
(
delta
>
0
)
{
return
1
/
(
1
-
delta
);
return
1
/
(
1
-
delta
);
}
else
{
}
else
{
...
...
src/data/word_list.cpp
View file @
4f492f06
...
@@ -32,3 +32,18 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(WordList) {
...
@@ -32,3 +32,18 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(WordList) {
REFLECT
(
words
);
REFLECT
(
words
);
}
}
// ----------------------------------------------------------------------------- : Auto replace words
AutoReplace
::
AutoReplace
()
:
enabled
(
true
)
,
whole_word
(
true
)
,
custom
(
true
)
{}
IMPLEMENT_REFLECTION_NO_SCRIPT
(
AutoReplace
)
{
REFLECT
(
enabled
);
REFLECT
(
whole_word
);
REFLECT
(
match
);
REFLECT
(
replace
);
}
src/data/word_list.hpp
View file @
4f492f06
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
DECLARE_POINTER_TYPE
(
WordListWord
);
DECLARE_POINTER_TYPE
(
WordListWord
);
DECLARE_POINTER_TYPE
(
WordList
);
DECLARE_POINTER_TYPE
(
WordList
);
DECLARE_POINTER_TYPE
(
AutoReplace
);
// ----------------------------------------------------------------------------- : WordList
// ----------------------------------------------------------------------------- : WordList
...
@@ -38,6 +39,23 @@ class WordList : public WordListWord {
...
@@ -38,6 +39,23 @@ class WordList : public WordListWord {
DECLARE_REFLECTION
();
DECLARE_REFLECTION
();
};
};
// ----------------------------------------------------------------------------- : Auto replace words
/// Autoreplace specific shortcut words
class
AutoReplace
:
public
IntrusivePtrVirtualBase
{
public:
AutoReplace
();
bool
enabled
;
bool
whole_word
;
bool
custom
;
///< Is this a custom auto replace?
String
match
;
String
replace
;
inline
AutoReplaceP
clone
()
const
{
return
new_intrusive1
<
AutoReplace
>
(
*
this
);
}
DECLARE_REFLECTION
();
};
// ----------------------------------------------------------------------------- : EOF
// ----------------------------------------------------------------------------- : EOF
#endif
#endif
src/gui/set/window.cpp
View file @
4f492f06
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <gui/print_window.hpp>
#include <gui/print_window.hpp>
#include <gui/images_export_window.hpp>
#include <gui/images_export_window.hpp>
#include <gui/html_export_window.hpp>
#include <gui/html_export_window.hpp>
#include <gui/auto_replace_window.hpp>
#include <gui/icon_menu.hpp>
#include <gui/icon_menu.hpp>
#include <gui/util.hpp>
#include <gui/util.hpp>
#include <util/io/package_manager.hpp>
#include <util/io/package_manager.hpp>
...
@@ -86,9 +87,10 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
...
@@ -86,9 +87,10 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
menuEdit
->
Append
(
ID_EDIT_COPY
,
_
(
"copy"
),
_MENU_
(
"copy"
),
_HELP_
(
"copy"
));
menuEdit
->
Append
(
ID_EDIT_COPY
,
_
(
"copy"
),
_MENU_
(
"copy"
),
_HELP_
(
"copy"
));
menuEdit
->
Append
(
ID_EDIT_PASTE
,
_
(
"paste"
),
_MENU_
(
"paste"
),
_HELP_
(
"paste"
));
menuEdit
->
Append
(
ID_EDIT_PASTE
,
_
(
"paste"
),
_MENU_
(
"paste"
),
_HELP_
(
"paste"
));
menuEdit
->
AppendSeparator
();
menuEdit
->
AppendSeparator
();
menuEdit
->
Append
(
ID_EDIT_FIND
,
_
(
"find"
),
_MENU_
(
"find"
),
_
(
""
));
menuEdit
->
Append
(
ID_EDIT_FIND
,
_
(
"find"
),
_MENU_
(
"find"
),
_HELP_
(
"find"
));
menuEdit
->
Append
(
ID_EDIT_FIND_NEXT
,
_MENU_
(
"find next"
),
_
(
""
));
menuEdit
->
Append
(
ID_EDIT_FIND_NEXT
,
_MENU_
(
"find next"
),
_HELP_
(
"find next"
));
menuEdit
->
Append
(
ID_EDIT_REPLACE
,
_MENU_
(
"replace"
),
_
(
""
));
menuEdit
->
Append
(
ID_EDIT_REPLACE
,
_MENU_
(
"replace"
),
_HELP_
(
"replace"
));
menuEdit
->
Append
(
ID_EDIT_AUTO_REPLACE
,
_MENU_
(
"auto replace"
),
_HELP_
(
"auto replace"
));
menuEdit
->
AppendSeparator
();
menuEdit
->
AppendSeparator
();
menuEdit
->
Append
(
ID_EDIT_PREFERENCES
,
_MENU_
(
"preferences"
),
_HELP_
(
"preferences"
));
menuEdit
->
Append
(
ID_EDIT_PREFERENCES
,
_MENU_
(
"preferences"
),
_HELP_
(
"preferences"
));
menuBar
->
Append
(
menuEdit
,
_MENU_
(
"edit"
));
menuBar
->
Append
(
menuEdit
,
_MENU_
(
"edit"
));
...
@@ -619,6 +621,10 @@ void SetWindow::onReplaceAll(wxFindDialogEvent&) {
...
@@ -619,6 +621,10 @@ void SetWindow::onReplaceAll(wxFindDialogEvent&) {
current_panel
->
doReplaceAll
(
find_data
);
current_panel
->
doReplaceAll
(
find_data
);
}
}
void
SetWindow
::
onEditAutoReplace
(
wxCommandEvent
&
)
{
(
new
AutoReplaceWindow
(
this
,
*
set
->
game
))
->
Show
();
}
void
SetWindow
::
onEditPreferences
(
wxCommandEvent
&
)
{
void
SetWindow
::
onEditPreferences
(
wxCommandEvent
&
)
{
PreferencesWindow
wnd
(
this
);
PreferencesWindow
wnd
(
this
);
if
(
wnd
.
ShowModal
()
==
wxID_OK
)
{
if
(
wnd
.
ShowModal
()
==
wxID_OK
)
{
...
@@ -697,6 +703,7 @@ BEGIN_EVENT_TABLE(SetWindow, wxFrame)
...
@@ -697,6 +703,7 @@ BEGIN_EVENT_TABLE(SetWindow, wxFrame)
EVT_MENU
(
ID_EDIT_FIND
,
SetWindow
::
onEditFind
)
EVT_MENU
(
ID_EDIT_FIND
,
SetWindow
::
onEditFind
)
EVT_MENU
(
ID_EDIT_FIND_NEXT
,
SetWindow
::
onEditFindNext
)
EVT_MENU
(
ID_EDIT_FIND_NEXT
,
SetWindow
::
onEditFindNext
)
EVT_MENU
(
ID_EDIT_REPLACE
,
SetWindow
::
onEditReplace
)
EVT_MENU
(
ID_EDIT_REPLACE
,
SetWindow
::
onEditReplace
)
EVT_MENU
(
ID_EDIT_AUTO_REPLACE
,
SetWindow
::
onEditAutoReplace
)
EVT_MENU
(
ID_EDIT_PREFERENCES
,
SetWindow
::
onEditPreferences
)
EVT_MENU
(
ID_EDIT_PREFERENCES
,
SetWindow
::
onEditPreferences
)
EVT_MENU
(
ID_WINDOW_NEW
,
SetWindow
::
onWindowNewWindow
)
EVT_MENU
(
ID_WINDOW_NEW
,
SetWindow
::
onWindowNewWindow
)
EVT_TOOL_RANGE
(
ID_WINDOW_MIN
,
ID_WINDOW_MAX
,
SetWindow
::
onWindowSelect
)
EVT_TOOL_RANGE
(
ID_WINDOW_MIN
,
ID_WINDOW_MAX
,
SetWindow
::
onWindowSelect
)
...
...
src/gui/set/window.hpp
View file @
4f492f06
...
@@ -131,6 +131,7 @@ class SetWindow : public wxFrame, public SetView {
...
@@ -131,6 +131,7 @@ class SetWindow : public wxFrame, public SetView {
void
onEditFind
(
wxCommandEvent
&
);
void
onEditFind
(
wxCommandEvent
&
);
void
onEditFindNext
(
wxCommandEvent
&
);
void
onEditFindNext
(
wxCommandEvent
&
);
void
onEditReplace
(
wxCommandEvent
&
);
void
onEditReplace
(
wxCommandEvent
&
);
void
onEditAutoReplace
(
wxCommandEvent
&
);
void
onEditPreferences
(
wxCommandEvent
&
);
void
onEditPreferences
(
wxCommandEvent
&
);
void
onFind
(
wxFindDialogEvent
&
);
void
onFind
(
wxFindDialogEvent
&
);
...
...
src/gui/value/text.cpp
View file @
4f492f06
This diff is collapsed.
Click to expand it.
src/gui/value/text.hpp
View file @
4f492f06
...
@@ -116,7 +116,9 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
...
@@ -116,7 +116,9 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
/// Replace the current selection with 'replacement', name the action
/// Replace the current selection with 'replacement', name the action
/** replacement should be a tagged string (i.e. already escaped) */
/** replacement should be a tagged string (i.e. already escaped) */
void
replaceSelection
(
const
String
&
replacement
,
const
String
&
name
);
void
replaceSelection
(
const
String
&
replacement
,
const
String
&
name
,
bool
allow_auto_replace
=
false
,
bool
select_on_undo
=
true
);
/// Try to autoreplace at the position before the cursor
void
tryAutoReplace
();
/// Make sure the selection satisfies its constraints
/// Make sure the selection satisfies its constraints
/** - selection_start and selection_end are inside the text
/** - selection_start and selection_end are inside the text
...
@@ -135,12 +137,13 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
...
@@ -135,12 +137,13 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
/// Position of previous visible & selectable character
/// Position of previous visible & selectable character
/** Uses cursor positions */
/** Uses cursor positions */
size_t
prevCharBoundry
(
size_t
pos
)
const
;
size_t
prevCharBound
a
ry
(
size_t
pos
)
const
;
size_t
nextCharBoundry
(
size_t
pos
)
const
;
size_t
nextCharBound
a
ry
(
size_t
pos
)
const
;
/// Front of previous word, used witch Ctrl+Left/right
/// Front of previous word, used witch Ctrl+Left/right
/** Uses character indices */
/** Uses character indices */
size_t
prevWordBoundry
(
size_t
pos_i
)
const
;
size_t
prevWordBoundary
(
size_t
pos_i
)
const
;
size_t
nextWordBoundry
(
size_t
pos_i
)
const
;
size_t
nextWordBoundary
(
size_t
pos_i
)
const
;
bool
isWordBoundary
(
size_t
pos_i
)
const
;
// --------------------------------------------------- : Scrolling
// --------------------------------------------------- : Scrolling
...
...
src/mse.vcproj
View file @
4f492f06
...
@@ -947,6 +947,12 @@
...
@@ -947,6 +947,12 @@
<File
<File
RelativePath=
".\gui\about_window.hpp"
>
RelativePath=
".\gui\about_window.hpp"
>
</File>
</File>
<File
RelativePath=
".\gui\auto_replace_window.cpp"
>
</File>
<File
RelativePath=
".\gui\auto_replace_window.hpp"
>
</File>
<File
<File
RelativePath=
".\gui\card_select_window.cpp"
>
RelativePath=
".\gui\card_select_window.cpp"
>
</File>
</File>
...
...
src/resource/common/expected_locale_keys
View file @
4f492f06
This diff is collapsed.
Click to expand it.
src/util/io/writer.cpp
View file @
4f492f06
...
@@ -64,8 +64,8 @@ void Writer::handle(const String& value) {
...
@@ -64,8 +64,8 @@ void Writer::handle(const String& value) {
// write indentation and key
// write indentation and key
writeKey
();
writeKey
();
writeUTF8
(
stream
,
_
(
": "
));
writeUTF8
(
stream
,
_
(
": "
));
if
(
value
.
find_first_of
(
_
(
'\n'
))
!=
String
::
npos
)
{
if
(
value
.
find_first_of
(
_
(
'\n'
))
!=
String
::
npos
||
(
!
value
.
empty
()
&&
isSpace
(
value
.
GetChar
(
0
)))
)
{
// multiline string
// multiline string
, or contains leading whitespace
stream
.
PutChar
(
_
(
'\n'
));
stream
.
PutChar
(
_
(
'\n'
));
indentation
+=
1
;
indentation
+=
1
;
// split lines, and write each line
// split lines, and write each line
...
...
src/util/window_id.hpp
View file @
4f492f06
...
@@ -53,7 +53,8 @@ enum MenuID {
...
@@ -53,7 +53,8 @@ enum MenuID {
,
ID_EDIT_FIND
=
wxID_FIND
,
ID_EDIT_FIND
=
wxID_FIND
,
ID_EDIT_FIND_NEXT
=
103
,
ID_EDIT_FIND_NEXT
=
103
,
ID_EDIT_REPLACE
=
wxID_REPLACE
,
ID_EDIT_REPLACE
=
wxID_REPLACE
,
ID_EDIT_PREFERENCES
=
104
,
ID_EDIT_AUTO_REPLACE
=
104
,
ID_EDIT_PREFERENCES
=
105
// Window menu (MainWindow)
// Window menu (MainWindow)
,
ID_WINDOW_NEW
=
201
,
ID_WINDOW_NEW
=
201
...
@@ -242,7 +243,13 @@ enum ControlID {
...
@@ -242,7 +243,13 @@ enum ControlID {
,
ID_INSTALL
,
ID_INSTALL
,
ID_UPGRADE
,
ID_UPGRADE
,
ID_REMOVE
,
ID_REMOVE
,
ID_CANCEL
,
ID_CANCEL
=
wxID_CANCEL
// Auto replace window
,
ID_USE_AUTO_REPLACE
,
ID_ITEM_VALUE
,
ID_ADD_ITEM
,
ID_REMOVE_ITEM
,
ID_DEFAULTS
};
};
// ----------------------------------------------------------------------------- : EOF
// ----------------------------------------------------------------------------- : EOF
...
...
tools/gen.pl
View file @
4f492f06
...
@@ -16,7 +16,7 @@ close F;
...
@@ -16,7 +16,7 @@ close F;
# insert stuff
# insert stuff
$hpp
=~
s/_\n/_$macro\n/g
;
$hpp
=~
s/_\
r?\
n/_$macro\n/g
;
$cpp
=~
s@<util/prec.hpp>@<$file.hpp>@g
;
$cpp
=~
s@<util/prec.hpp>@<$file.hpp>@g
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment