Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
ltt-mapmaker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Griefed
ltt-mapmaker
Commits
6a5a9945
Commit
6a5a9945
authored
3 years ago
by
Trungel
Browse files
Options
Downloads
Patches
Plain Diff
displaying viewCenter und viewRadius
parent
a4b2686f
No related branches found
No related tags found
1 merge request
!16
Display radius and center
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Tile.vue
+95
-5
95 additions, 5 deletions
src/components/Tile.vue
src/pages/Index.vue
+2
-5
2 additions, 5 deletions
src/pages/Index.vue
with
97 additions
and
10 deletions
src/components/Tile.vue
+
95
−
5
View file @
6a5a9945
<
template
>
<div
id=
"parent"
class=
"hexagon"
:class=
"tile.typeId"
>
<div
class=
"hexTop"
></div>
<div
class=
"hexBottom"
></div>
<div
id=
"parent"
class=
"hexagon"
:class=
"[tile.typeId, ((tile.x == store.state.centerX) && (tile.y == store.state.centerY))?'centerTile':'', isViewRadiusBorder()]"
>
<div
class=
"hexTop"
:class=
"((tile.x == store.state.centerX) && (tile.y == store.state.centerY))?'centerTop':''"
></div>
<div
class=
"hexBottom"
:class=
"((tile.x == store.state.centerX) && (tile.y == store.state.centerY))?'centerBottom':''"
></div>
<q-btn-dropdown
class=
"buttonshift without-icon custom-width"
...
...
@@ -33,16 +34,43 @@
</
template
>
<
script
>
import
{
ref
}
from
"
vue
"
;
import
{
inject
,
ref
}
from
"
vue
"
;
export
default
{
props
:{
tile
:
Object
,
typeValue
:
String
},
setup
()
{
setup
(
props
)
{
var
types
=
[
"
barren
"
,
"
clay
"
,
"
desert
"
,
"
fish
"
,
"
forest
"
,
"
grass
"
,
"
ice
"
,
"
iron
"
,
"
mountain
"
,
"
salt
"
,
"
stone
"
,
"
water
"
,
"
wheat
"
,
"
wool
"
];
const
store
=
inject
(
'
store
'
);
const
isViewRadiusBorder
=
function
()
{
var
borders
=
[];
//leftBorder
if
(
props
.
tile
.
x
==
(
this
.
store
.
state
.
centerX
-
this
.
store
.
state
.
radiusX
)
&&
((
this
.
store
.
state
.
centerY
-
this
.
store
.
state
.
radiusY
)
<=
props
.
tile
.
y
&&
props
.
tile
.
y
<=
(
this
.
store
.
state
.
centerY
+
this
.
store
.
state
.
radiusY
))){
borders
.
push
(
"
viewBorderLeft
"
);
}
if
(
props
.
tile
.
x
==
(
this
.
store
.
state
.
centerX
+
this
.
store
.
state
.
radiusX
)
&&
((
this
.
store
.
state
.
centerY
-
this
.
store
.
state
.
radiusY
)
<=
props
.
tile
.
y
&&
props
.
tile
.
y
<=
(
this
.
store
.
state
.
centerY
+
this
.
store
.
state
.
radiusY
))){
borders
.
push
(
"
viewBorderRight
"
)
}
if
(
props
.
tile
.
y
==
(
this
.
store
.
state
.
centerY
+
this
.
store
.
state
.
radiusY
)
&&
((
this
.
store
.
state
.
centerX
-
this
.
store
.
state
.
radiusX
)
<=
props
.
tile
.
x
&&
props
.
tile
.
x
<=
(
this
.
store
.
state
.
centerX
+
this
.
store
.
state
.
radiusX
))){
borders
.
push
(
"
viewBorderTop
"
)
}
if
(
props
.
tile
.
y
==
(
this
.
store
.
state
.
centerY
-
this
.
store
.
state
.
radiusY
)
&&
((
this
.
store
.
state
.
centerX
-
this
.
store
.
state
.
radiusX
)
<=
props
.
tile
.
x
&&
props
.
tile
.
x
<=
(
this
.
store
.
state
.
centerX
+
this
.
store
.
state
.
radiusX
))){
borders
.
push
(
"
viewBorderBottom
"
)
}
return
borders
;
}
return
{
isViewRadiusBorder
,
store
,
types
,
menuState
:
ref
(
false
),
label
:
'
grass
'
,
...
...
@@ -88,6 +116,12 @@ button.without-icon i {
border-right
:
solid
3px
#333333
;
}
.centerTile
{
z-index
:
1002
;
border-left
:
solid
3px
red
;
border-right
:
solid
3px
red
;
}
.hexTop
,
.hexBottom
{
position
:
absolute
;
...
...
@@ -149,6 +183,52 @@ button.without-icon i {
background
:
inherit
;
}
.viewBorderLeft
{
z-index
:
1001
;
border-left
:
dashed
3px
blue
;
}
.viewBorderRight
{
z-index
:
1001
;
border-right
:
dashed
3px
blue
;
}
.viewBorderTop
{
z-index
:
1001
;
.hexTop
{
border-top
:
dashed
3px
blue
;
border-right
:
dashed
3px
blue
;
}
}
.viewBorderBottom
{
z-index
:
1001
;
.hexBottom
{
border-bottom
:
dashed
3px
blue
;
border-left
:
dashed
3px
blue
;
}
}
.notShifted
{
.viewBorderLeft
{
.hexTop
{
border-top
:
dashed
3px
blue
;
}
.hexBottom
{
border-left
:
dashed
3px
blue
;
}
}
}
.shifted
{
.viewBorderRight
{
.hexTop
{
border-right
:
dashed
3px
blue
;
}
.hexBottom
{
border-bottom
:
dashed
3px
blue
;
}
}
}
.barren
{
background-image
:
url("../assets/tiles/barren_tile.webp")
;
button
{
...
...
@@ -249,4 +329,14 @@ button.without-icon i {
color
:
black
;
}
}
.centerTop
{
border-top
:
solid
4
.2426px
red
;
border-right
:
solid
4
.2426px
red
;
}
.centerBottom
{
border-bottom
:
solid
4
.2426px
red
;
border-left
:
solid
4
.2426px
red
;
}
</
style
>
This diff is collapsed.
Click to expand it.
src/pages/Index.vue
+
2
−
5
View file @
6a5a9945
...
...
@@ -2,11 +2,10 @@
<span
v-if=
"store.state.lttMap"
>
<span
v-for=
"(xRow, index) in store.state.lttMap"
:key=
"index"
>
<div
class=
"row no-wrap"
v-bind:class=
"
{
v-bind:class=
"
[
{
firstRow: (index == 0),
moveup: (index !=0),
shifted: (index != 0
&&
!(index%2))
}"
}, (index != 0
&&
!(index%2))?'shifted':'notShifted']"
>
<Tile
v-for=
"(tile, i) in xRow"
...
...
@@ -15,8 +14,6 @@
@
update:typeValue=
"tile.typeId = $event"
v-bind:id=
"tile.x+'_'+tile.y"
:class=
"
{tileMl: (i!=0)?1:0}"
v-bind:style="{ zIndex: 1000,
}"
v-bind:key="i">
</Tile>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment