Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qiaqia_qx
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邱旭
qiaqia_qx
Commits
fd82aa6b
Commit
fd82aa6b
authored
Jun 08, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panels
parent
74afba80
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
43 deletions
+107
-43
workspace.xml
.idea/workspace.xml
+35
-25
ExRecordPanel.ts
src/panels/ExRecordPanel.ts
+53
-3
ExchangePanel.ts
src/panels/ExchangePanel.ts
+1
-1
ShopPanel.ts
src/panels/ShopPanel.ts
+4
-3
TaskPanel.ts
src/panels/TaskPanel.ts
+3
-2
WareHousePanel.ts
src/panels/WareHousePanel.ts
+1
-1
Land.ts
src/parts/Game/Land.ts
+9
-7
UILayer.ts
src/parts/UI/UILayer.ts
+1
-1
No files found.
.idea/workspace.xml
View file @
fd82aa6b
This diff is collapsed.
Click to expand it.
src/panels/ExRecordPanel.ts
View file @
fd82aa6b
...
...
@@ -6,6 +6,10 @@ import Tween = FYGE.Tween;
import
ScrollList
=
FYGE
.
ScrollList
;
import
Container
=
FYGE
.
Container
;
import
IScrollListItem
=
FYGE
.
IScrollListItem
;
import
Texture
=
FYGE
.
Texture
;
import
Graphics
=
FYGE
.
Graphics
;
import
TextField
=
FYGE
.
TextField
;
import
{
Ease
}
from
"fyge"
;
export
default
class
ExRecordPanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -29,7 +33,32 @@ export default class ExRecordPanel extends Panel {
this
.
scroll
.
position
.
set
((
this
.
width
-
this
.
scroll
.
width
)
/
2
,
210
);
this
.
scroll
.
updateData
([
1
,
2
,
3
,
4
,
5
,
6
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰10元抵扣卷'
,
prizeDate
:
'1010.01.01'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰20元抵扣卷'
,
prizeDate
:
'2020.02.02'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰30元抵扣卷'
,
prizeDate
:
'3030.03.03'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰40元抵扣卷'
,
prizeDate
:
'4040.04.04'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰50元抵扣卷'
,
prizeDate
:
'5050.05.05'
,
},
]);
...
...
@@ -39,9 +68,9 @@ export default class ExRecordPanel extends Panel {
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
;
const
_y
=
layers
.
height
-
this
.
height
+
3
0
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
5
0
;
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
FYGE
.
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
call
(()
=>
{
this
.
isShowing
=
false
;
});
...
...
@@ -65,8 +94,15 @@ class RecordItem extends Container implements IScrollListItem {
public
data
:
number
;
public
id
:
number
;
private
prizeImg
:
Sprite
;
private
prizeName
:
TextField
;
private
prizeDate
:
TextField
;
public
initData
(
id
:
number
,
data
:
any
):
void
{
if
(
!
data
)
return
;
this
.
prizeImg
.
texture
=
Texture
.
fromUrl
(
data
.
prizeImg
);
this
.
prizeName
.
text
=
data
.
prizeName
;
this
.
prizeDate
.
text
=
`
${
data
.
prizeDate
}
兑换`
;
}
constructor
()
{
...
...
@@ -74,6 +110,20 @@ class RecordItem extends Container implements IScrollListItem {
this
.
addChild
(
Tool
.
getSprite
(
'record_item_bg.png'
));
this
.
prizeImg
=
this
.
addChild
(
new
Sprite
());
this
.
prizeImg
.
position
.
set
(
34
,
25
);
const
mask
=
this
.
addChild
(
new
Graphics
());
mask
.
drawCircle
(
92
,
83
,
58
);
this
.
prizeImg
.
mask
=
mask
;
this
.
prizeName
=
this
.
addChild
(
Tool
.
getText
(
''
,
26
,
'#4a4a4a'
));
this
.
prizeName
.
position
.
set
(
176
,
50
);
this
.
prizeDate
=
this
.
addChild
(
Tool
.
getText
(
''
,
22
,
'#999999'
));
this
.
prizeDate
.
position
.
set
(
176
,
91
);
}
}
src/panels/Ex
a
hangePanel.ts
→
src/panels/Ex
c
hangePanel.ts
View file @
fd82aa6b
...
...
@@ -2,7 +2,7 @@ import { Panel } from "../../module/views/Panel";
import
{
Tool
}
from
"../Tools"
;
import
Sprite
=
FYGE
.
Sprite
;
export
class
Ex
a
hangePanel
extends
Panel
{
export
class
Ex
c
hangePanel
extends
Panel
{
get
groupNames
()
{
return
[
"exchangePanel"
];
}
...
...
src/panels/ShopPanel.ts
View file @
fd82aa6b
...
...
@@ -9,6 +9,7 @@ import ScrollList = FYGE.ScrollList;
import
Texture
=
FYGE
.
Texture
;
import
Graphics
=
FYGE
.
Graphics
;
import
TextField
=
FYGE
.
TextField
;
import
{
Ease
}
from
"fyge"
;
export
default
class
ShopPanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -40,9 +41,9 @@ export default class ShopPanel extends Panel {
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
;
const
_y
=
layers
.
height
-
this
.
height
+
3
0
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
5
0
;
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
FYGE
.
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
call
(()
=>
{
this
.
isShowing
=
false
;
});
...
...
@@ -82,7 +83,7 @@ class ShopItem extends Container implements IScrollListItem {
this
.
itemImg
=
this
.
addChild
(
new
Sprite
());
this
.
itemImg
.
position
.
set
(
35
,
26
);
this
.
itemImg
.
texture
=
Texture
.
fromUrl
(
'https://source.unsplash.com/
collection/collectionid
/116x116'
);
this
.
itemImg
.
texture
=
Texture
.
fromUrl
(
'https://source.unsplash.com/
user/erondu
/116x116'
);
const
mask
=
this
.
addChild
(
new
Graphics
());
mask
.
drawCircle
(
92
,
83
,
58
);
...
...
src/panels/TaskPanel.ts
View file @
fd82aa6b
...
...
@@ -9,6 +9,7 @@ import Tween = FYGE.Tween;
import
TextField
=
FYGE
.
TextField
;
import
{
RES
}
from
"../../module/RES"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
{
Ease
}
from
"fyge"
;
export
default
class
TaskPanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -81,9 +82,9 @@ export default class TaskPanel extends Panel {
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
;
const
_y
=
layers
.
height
-
this
.
height
+
3
0
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
5
0
;
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
FYGE
.
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
call
(()
=>
{
this
.
isShowing
=
false
;
});
...
...
src/panels/WareHousePanel.ts
View file @
fd82aa6b
...
...
@@ -27,7 +27,7 @@ export default class WareHousePanel extends Panel {
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
;
const
_y
=
layers
.
height
-
this
.
height
+
3
0
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
5
0
;
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
call
(()
=>
{
...
...
src/parts/Game/Land.ts
View file @
fd82aa6b
...
...
@@ -148,15 +148,17 @@ export class Land extends Container {
/**
* 浇水
*/
public
water
()
{
public
water
(
e
)
{
console
.
log
(
"浇水"
);
e
.
stopPropagation
();
}
/**
* 收获
*/
public
get
()
{
public
get
(
e
:
MouseEvent
)
{
console
.
log
(
"收获"
);
e
.
stopPropagation
();
}
/**
...
...
@@ -187,7 +189,7 @@ export class Land extends Container {
}
}
private
clickThis
()
{
private
clickThis
(
e
)
{
console
.
log
(
`点到了土地:
${
this
.
id
}
, state:
${
this
.
state
}
`
);
if
(
this
.
state
==
LAND_STATE
.
PLANT
)
{
this
.
progressBar
.
show
();
...
...
@@ -202,12 +204,12 @@ export class Land extends Container {
*/
private
addEvent
()
{
// 加个监听
this
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickThis
,
this
);
this
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickThis
,
this
,
false
);
this
.
progressBar
.
addEventListener
(
'endTime'
,
this
.
endTime
,
this
);
}
private
removeEvent
()
{
this
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
clickThis
,
this
);
this
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
clickThis
,
this
,
false
);
this
.
progressBar
.
removeEventListener
(
'endTime'
,
this
.
endTime
,
this
);
}
...
...
@@ -244,9 +246,9 @@ export class Land extends Container {
this
.
removeOption
();
this
.
option
=
this
.
addChild
(
OptionPool
.
ins
.
takeOut
(
type
));
if
(
type
==
OPTION_TYPE
.
WATER
)
{
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
water
,
this
);
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
water
,
this
,
false
);
}
else
if
(
type
==
OPTION_TYPE
.
GET
)
{
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
get
,
this
);
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
get
,
this
,
false
);
}
this
.
option
.
x
=
160
;
this
.
option
.
y
=
-
50
;
...
...
src/parts/UI/UILayer.ts
View file @
fd82aa6b
...
...
@@ -94,7 +94,7 @@ export class UILayer extends Container {
// 顶部
let
topGroup
=
this
.
addChild
(
new
Container
());
this
.
userInfoGroup
=
topGroup
.
addChild
(
new
UserInfoGroup
({
avatar
:
'https://source.unsplash.com/
collection/collectionid
/100x100'
,
avatar
:
'https://source.unsplash.com/
user/erondu
/100x100'
,
nickName
:
'哈哈哈哈'
,
waterNum
:
'666'
}));
...
...
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