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
996e04ec
Commit
996e04ec
authored
Dec 21, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exception/error handling
parent
8909655c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
17 deletions
+31
-17
src/gui/control/card_list.cpp
src/gui/control/card_list.cpp
+3
-3
src/gui/control/image_card_list.cpp
src/gui/control/image_card_list.cpp
+13
-9
src/gui/thumbnail_thread.cpp
src/gui/thumbnail_thread.cpp
+7
-5
src/script/script_manager.cpp
src/script/script_manager.cpp
+8
-0
No files found.
src/gui/control/card_list.cpp
View file @
996e04ec
...
@@ -269,9 +269,9 @@ void CardListBase::rebuild() {
...
@@ -269,9 +269,9 @@ void CardListBase::rebuild() {
FOR_EACH
(
f
,
new_column_fields
)
{
FOR_EACH
(
f
,
new_column_fields
)
{
ColumnSettings
&
cs
=
settings
.
columnSettingsFor
(
*
set
->
game
,
*
f
.
second
);
ColumnSettings
&
cs
=
settings
.
columnSettingsFor
(
*
set
->
game
,
*
f
.
second
);
int
align
;
int
align
;
if
(
f
.
second
->
card_list_align
==
ALIGN_RIGHT
)
align
=
wxLIST_FORMAT_RIGHT
;
if
(
f
.
second
->
card_list_align
&
ALIGN_RIGHT
)
align
=
wxLIST_FORMAT_RIGHT
;
else
if
(
f
.
second
->
card_list_align
==
ALIGN_CENTER
)
align
=
wxLIST_FORMAT_CENTRE
;
else
if
(
f
.
second
->
card_list_align
&
ALIGN_CENTER
)
align
=
wxLIST_FORMAT_CENTRE
;
else
align
=
wxLIST_FORMAT_LEFT
;
else
align
=
wxLIST_FORMAT_LEFT
;
InsertColumn
((
long
)
column_fields
.
size
(),
capitalize
(
f
.
second
->
card_list_name
),
align
,
cs
.
width
);
InsertColumn
((
long
)
column_fields
.
size
(),
capitalize
(
f
.
second
->
card_list_name
),
align
,
cs
.
width
);
column_fields
.
push_back
(
f
.
second
);
column_fields
.
push_back
(
f
.
second
);
}
}
...
...
src/gui/control/image_card_list.cpp
View file @
996e04ec
...
@@ -57,15 +57,19 @@ class CardThumbnailRequest : public ThumbnailRequest {
...
@@ -57,15 +57,19 @@ class CardThumbnailRequest : public ThumbnailRequest {
,
filename
(
filename
)
,
filename
(
filename
)
{}
{}
virtual
Image
generate
()
{
virtual
Image
generate
()
{
ImageCardList
*
parent
=
(
ImageCardList
*
)
owner
;
try
{
Image
image
;
ImageCardList
*
parent
=
(
ImageCardList
*
)
owner
;
if
(
image
.
LoadFile
(
*
parent
->
set
->
openIn
(
filename
)))
{
Image
image
;
// two step anti aliased resampling
if
(
image
.
LoadFile
(
*
parent
->
set
->
openIn
(
filename
)))
{
image
.
Rescale
(
36
,
28
);
// step 1: no anti aliassing
// two step anti aliased resampling
Image
image2
(
18
,
14
,
false
);
// step 2: with anti aliassing
image
.
Rescale
(
36
,
28
);
// step 1: no anti aliassing
resample
(
image
,
image2
);
Image
image2
(
18
,
14
,
false
);
// step 2: with anti aliassing
return
image2
;
resample
(
image
,
image2
);
}
else
{
return
image2
;
}
else
{
return
Image
();
}
}
catch
(...)
{
return
Image
();
return
Image
();
}
}
}
}
...
...
src/gui/thumbnail_thread.cpp
View file @
996e04ec
...
@@ -153,11 +153,13 @@ bool ThumbnailThread::done(void* owner) {
...
@@ -153,11 +153,13 @@ bool ThumbnailThread::done(void* owner) {
// store image
// store image
r
.
first
->
store
(
r
.
second
);
r
.
first
->
store
(
r
.
second
);
// store in cache
// store in cache
String
filename
=
image_cache_dir
()
+
safeFilename
(
r
.
first
->
cache_name
)
+
_
(
".png"
);
if
(
r
.
second
.
Ok
())
{
r
.
second
.
SaveFile
(
filename
,
wxBITMAP_TYPE_PNG
);
String
filename
=
image_cache_dir
()
+
safeFilename
(
r
.
first
->
cache_name
)
+
_
(
".png"
);
// set modification time
r
.
second
.
SaveFile
(
filename
,
wxBITMAP_TYPE_PNG
);
wxFileName
fn
(
filename
);
// set modification time
fn
.
SetTimes
(
0
,
&
r
.
first
->
modified
,
0
);
wxFileName
fn
(
filename
);
fn
.
SetTimes
(
0
,
&
r
.
first
->
modified
,
0
);
}
// remove from name list
// remove from name list
request_names
.
erase
(
r
.
first
);
request_names
.
erase
(
r
.
first
);
}
}
...
...
src/script/script_manager.cpp
View file @
996e04ec
...
@@ -142,6 +142,14 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
...
@@ -142,6 +142,14 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
TYPE_CASE_
(
action
,
ScriptValueEvent
)
{
TYPE_CASE_
(
action
,
ScriptValueEvent
)
{
return
;
// Don't go into an infinite loop because of our own events
return
;
// Don't go into an infinite loop because of our own events
}
}
TYPE_CASE
(
action
,
AddCardAction
)
{
// update the added card specificly
Context
&
ctx
=
getContext
(
action
.
card
);
FOR_EACH
(
v
,
action
.
card
->
data
)
{
v
->
update
(
ctx
);
}
// note: fallthrough
}
TYPE_CASE_
(
action
,
CardListAction
)
{
TYPE_CASE_
(
action
,
CardListAction
)
{
updateAllDependend
(
set
.
game
->
dependent_scripts_cards
);
updateAllDependend
(
set
.
game
->
dependent_scripts_cards
);
}
}
...
...
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