Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Forge
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
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
Walter Adolph
Forge
Commits
11f9520c
Commit
11f9520c
authored
Jan 17, 2019
by
Peter Patel-Schneider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Highlight sa targets in Desktop GUI
parent
c7d9646f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
[Help
[Help
+0
-0
forge-gui/src/main/java/forge/match/input/InputSelectEntitiesFromList.java
...n/java/forge/match/input/InputSelectEntitiesFromList.java
+9
-8
forge-gui/src/main/java/forge/match/input/InputSelectTargets.java
...i/src/main/java/forge/match/input/InputSelectTargets.java
+21
-0
No files found.
[Help
deleted
100644 → 0
View file @
c7d9646f
forge-gui/src/main/java/forge/match/input/InputSelectEntitiesFromList.java
View file @
11f9520c
...
...
@@ -33,8 +33,16 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
public
InputSelectEntitiesFromList
(
final
PlayerControllerHuman
controller
,
final
int
min
,
final
int
max
,
final
FCollectionView
<
T
>
validChoices0
,
final
SpellAbility
sa0
)
{
super
(
controller
,
Math
.
min
(
min
,
validChoices0
.
size
()),
Math
.
min
(
max
,
validChoices0
.
size
()),
sa0
);
validChoices
=
validChoices0
;
if
(
min
>
validChoices
.
size
())
{
if
(
min
>
validChoices
.
size
())
{
// pfps does this really do anything useful??
System
.
out
.
println
(
String
.
format
(
"Trying to choose at least %d things from a list with only %d things!"
,
min
,
validChoices
.
size
()));
}
ArrayList
<
CardView
>
vCards
=
new
ArrayList
<
CardView
>();
for
(
T
c
:
validChoices0
)
{
if
(
c
instanceof
Card
)
{
vCards
.
add
(((
Card
)
c
).
getView
())
;
}
}
controller
.
getGui
().
setSelectables
(
vCards
);
final
PlayerZoneUpdates
zonesToUpdate
=
new
PlayerZoneUpdates
();
for
(
final
GameEntity
c
:
validChoices
)
{
final
Zone
cz
=
(
c
instanceof
Card
)
?
((
Card
)
c
).
getZone
()
:
null
;
...
...
@@ -46,13 +54,6 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
zonesShown
=
controller
.
getGui
().
tempShowZones
(
controller
.
getPlayer
().
getView
(),
zonesToUpdate
);
}
});
ArrayList
<
CardView
>
vCards
=
new
ArrayList
<
CardView
>();
for
(
T
c
:
validChoices0
)
{
if
(
c
instanceof
Card
)
{
vCards
.
add
(((
Card
)
c
).
getView
())
;
}
}
controller
.
getGui
().
setSelectables
(
vCards
);
}
@Override
...
...
forge-gui/src/main/java/forge/match/input/InputSelectTargets.java
View file @
11f9520c
...
...
@@ -22,6 +22,9 @@ import forge.properties.ForgeConstants;
import
forge.properties.ForgePreferences
;
import
forge.util.ITriggerEvent
;
import
forge.util.TextUtil
;
import
forge.player.PlayerZoneUpdate
;
import
forge.player.PlayerZoneUpdates
;
import
forge.FThreads
;
public
final
class
InputSelectTargets
extends
InputSyncronizedBase
{
private
final
List
<
Card
>
choices
;
...
...
@@ -44,6 +47,16 @@ public final class InputSelectTargets extends InputSyncronizedBase {
this
.
tgt
=
sa
.
getTargetRestrictions
();
this
.
sa
=
sa
;
this
.
mandatory
=
mandatory
;
controller
.
getGui
().
setSelectables
(
CardView
.
getCollection
(
choices
));
final
PlayerZoneUpdates
zonesToUpdate
=
new
PlayerZoneUpdates
();
for
(
final
Card
c
:
choices
)
{
zonesToUpdate
.
add
(
new
PlayerZoneUpdate
(
c
.
getZone
().
getPlayer
().
getView
(),
c
.
getZone
().
getZoneType
()));
}
FThreads
.
invokeInEdtNowOrLater
(
new
Runnable
()
{
@Override
public
void
run
()
{
controller
.
getGui
().
updateZones
(
zonesToUpdate
);
}
});
}
@Override
...
...
@@ -297,4 +310,12 @@ public final class InputSelectTargets extends InputSyncronizedBase {
private
boolean
hasAllTargets
()
{
return
tgt
.
isMaxTargetsChosen
(
sa
.
getHostCard
(),
sa
)
||
(
tgt
.
getStillToDivide
()
==
0
&&
tgt
.
isDividedAsYouChoose
());
}
@Override
protected
void
onStop
()
{
getController
().
getGui
().
clearSelectables
();
super
.
onStop
();
}
}
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