Commit 3740ffce authored by wildfirecode's avatar wildfirecode

update

parent a4599ff1
No preview for this file type
{
"global": {
"globalBindingDataTestObj": []
},
"1667fb18fa6": {
"bindingDataTestObj": [
{
"key": "list",
"value": "[1,2]"
}
]
}
}
\ No newline at end of file
...@@ -23,14 +23,14 @@ export default class MainBase extends eui.UILayer { ...@@ -23,14 +23,14 @@ export default class MainBase extends eui.UILayer {
//RES.getResByUrl spritesheet类型 //RES.getResByUrl spritesheet类型
//不生效 //不生效
//RES.getResAsync('net_png') spritesheet类型 //RES.getResAsync('net_png') spritesheet类型
if (filename.indexOf('.json') != -1) { // if (filename.indexOf('.json') != -1) {
var arr = filename.split('.json')[0].split('/'); // var arr = filename.split('.json')[0].split('/');
var filename1 = arr[arr.length - 1] + '_png'; // var filename1 = arr[arr.length - 1] + '_png';
var filename2 = filename.split('.json')[0] + '.png'; // var filename2 = filename.split('.json')[0] + '.png';
if (!RES.fileSystem['fsData'][filename1]) // if (!RES.fileSystem['fsData'][filename1])
RES.fileSystem['fsData'][filename1] = // RES.fileSystem['fsData'][filename1] =
{ name: filename1, type: 'image', url: filename2, root: '', extra: '1' }; // { name: filename1, type: 'image', url: filename2, root: '', extra: '1' };
} // }
var result = RES.fileSystem['getFileOld'](filename); var result = RES.fileSystem['getFileOld'](filename);
if (result && result.url && check_webp_feature()) { if (result && result.url && check_webp_feature()) {
...@@ -100,7 +100,7 @@ export default class MainBase extends eui.UILayer { ...@@ -100,7 +100,7 @@ export default class MainBase extends eui.UILayer {
try { try {
await RES.loadConfig("default.res.json", getResPath() + "resource/"); await RES.loadConfig("default.res.json", getResPath() + "resource/");
await this.loadTheme(); await this.loadTheme();
this.injectRES(); // this.injectRES();
} }
catch (e) { catch (e) {
console.error(e); console.error(e);
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert_2","version":5,"files":["../assets/alert/Bitmap-4.png","../assets/alert/Bitmap-2.png","../assets/alert/Bitmap-1.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"guide_4","version":5,"files":["../assets/startScene/guide/guide_tips.png","../assets/startScene/guide/guide_hand.png","../assets/startScene/guide/guide_dialog.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"loading_1","version":5,"files":["../assets/loading/bg.png","../assets/loading/progress.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"msg_0","version":5,"files":["../assets/msg/msgBg.png","../assets/msg/x.png","../assets/msg/sureBtn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"option_6","version":5,"files":["../assets/option/line2.png","../assets/option/prizeBg.png","../assets/option/X-1.png","../assets/option/line.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_3","version":5,"files":["../assets/rule/ruleBg.png","../assets/rule/X.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"startscene_5","version":5,"files":["../assets/startScene/ruleBtn.png","../assets/startScene/optionBtn.png"]}
\ No newline at end of file
egret/resource/assets/rule/X.png

5.36 KB | W: | H:

egret/resource/assets/rule/X.png

3.92 KB | W: | H:

egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
{ {
"keys": "ruleBtn_png,optionBtn_png", "keys": "ruleBtn_png,optionBtn_png",
"name": "startscene" "name": "startscene"
},
{
"keys": "line2_png,prizeBg_png,X-1_png,line_png",
"name": "option"
} }
], ],
"resources": [ "resources": [
...@@ -147,6 +151,26 @@ ...@@ -147,6 +151,26 @@
"url": "assets/startScene/ruleBtn.png", "url": "assets/startScene/ruleBtn.png",
"type": "image", "type": "image",
"name": "ruleBtn_png" "name": "ruleBtn_png"
},
{
"url": "assets/option/line2.png",
"type": "image",
"name": "line2_png"
},
{
"url": "assets/option/prizeBg.png",
"type": "image",
"name": "prizeBg_png"
},
{
"url": "assets/option/X-1.png",
"type": "image",
"name": "X-1_png"
},
{
"url": "assets/option/line.png",
"type": "image",
"name": "line_png"
} }
] ]
} }
\ No newline at end of file
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
"skins": {}, "skins": {},
"autoGenerateExmlsList": true, "autoGenerateExmlsList": true,
"exmls": [ "exmls": [
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/RuleSkin.exml", "resource/skins/RuleSkin.exml",
"resource/skins/StartSkin.exml" "resource/skins/StartSkin.exml",
"resource/skins/VScrollBarSkin.exml"
], ],
"path": "resource/default.thm.json" "path": "resource/default.thm.json"
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="OptionItemSkin" width="525" xmlns:e="http://ns.egret.com/eui" height="200">
<e:Label x="145" y="0" width="190" textAlign="center" textColor="0x000000" size="24" height="30" verticalAlign="middle" text="{data.scope}"/>
<e:Label text="{data.name}" x="173.55" y="43.5" textAlign="left" textColor="0x000000" />
<e:Label x="173.55" y="92" textAlign="left" width="296.5" textColor="0x000000" text="{data.description}" size="24" />
<e:Image width="120" height="120" x="0" y="46" source="{data.logo}" />
<e:Image x="0" y="14" source="line_png"/>
<e:Image x="344" y="14" source="line2_png"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="OptionsSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<w:Config id="1667fb18fa6"/>
<e:Image y="126" horizontalCenter="0" source="prizeBg_png"/>
<e:Button id="closeBtn" label="" x="687" y="157">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="X-1_png" source.down="X-1_png" source.disabled="X-1_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Scroller id="scroll" width="500" height="638" y="302" horizontalCenter="0" scrollPolicyH="off" scrollPolicyV="on">
<e:Group id="group" y="-2">
<e:List id="list" width="100%">
</e:List>
</e:Group>
</e:Scroller>
</e:Skin>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Scroller id="scroller" width="526" x="112" height="597" y="331"> <e:Scroller id="scroller" width="528" x="112" height="641" y="351">
<e:Group width="100%"> <e:Group width="100%">
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0x333333"/> <e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0x333333"/>
</e:Group> </e:Group>
......
...@@ -16,7 +16,8 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command { ...@@ -16,7 +16,8 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'silverbox.png', 'silverbox.png',
'woodbox.png', 'woodbox.png',
'monkey.png', 'monkey.png',
'net.png' 'net.png',
'option.png',
]; ];
if (excludes.indexOf(file.basename) != -1) { if (excludes.indexOf(file.basename) != -1) {
return file; return file;
......
import MainBase from "../libs/tl/MainBase"; import MainBase from "../libs/tl/MainBase";
import { NetManager } from "../libs/tw/manager/NetManager";
import Msg from "./alert/Msg"; import Msg from "./alert/Msg";
import PanelCtrl from "./ctrls/panelCtrl"; import PanelCtrl from "./ctrls/panelCtrl";
import SceneCtrl from "./ctrls/sceneCtrl"; import SceneCtrl from "./ctrls/sceneCtrl";
import OptionsPanel from "./optionsPanel/OptionsPanel";
import RulePanel from "./rulePanel/RulePanel"; import RulePanel from "./rulePanel/RulePanel";
import StartScene from "./startScene/StartScene"; import StartScene from "./startScene/StartScene";
import { ModuleTypes } from "./types/sceneTypes"; import { ModuleTypes } from "./types/sceneTypes";
import { NetManager } from "../libs/tw/manager/NetManager";
class Main extends MainBase { class Main extends MainBase {
protected registerModules() { protected registerModules() {
PanelCtrl.instance.registerPanelClass(ModuleTypes.MSG_PANEL, Msg); PanelCtrl.instance.registerPanelClass(ModuleTypes.MSG_PANEL, Msg);
PanelCtrl.instance.registerPanelClass(ModuleTypes.RULE_PANEL, RulePanel); PanelCtrl.instance.registerPanelClass(ModuleTypes.RULE_PANEL, RulePanel);
PanelCtrl.instance.registerPanelClass(ModuleTypes.OPTIONS_PANEL, OptionsPanel);
SceneCtrl.instance.registerSceneClass(ModuleTypes.START_SCENE, StartScene); SceneCtrl.instance.registerSceneClass(ModuleTypes.START_SCENE, StartScene);
} }
......
import { IGameOptionData } from "../../libs/tw/data/game/getOptions/IGameOptionData";
import { getSkinPath } from "../utils";
export default class ItemRenderder extends eui.ItemRenderer {
constructor() {
super();
this.skinName = getSkinPath('OptionItem');
}
}
\ No newline at end of file
import { DataManager } from '../../libs/tw/manager/DataManager';
import { NetManager } from '../../libs/tw/manager/NetManager';
import Panel from "../views/Panel";
import ItemRenderder from './ItemRenderder';
import { IGameOptionData } from '../../libs/tw/data/game/getOptions/IGameOptionData';
export default class OptionsPanel extends Panel {
start() {
if (!DataManager.ins.getOptionsData)
NetManager.ins.getOptions(() => {
this.updatePanel();
});
else
this.updatePanel();
}
group: eui.Group;
list: eui.List;
updatePanel() {
DataManager.ins.getOptionsData.optionList.forEach(item => {
item.scope = this.getScope(item);
});
this.list.useVirtualLayout = false;
this.list.itemRenderer = ItemRenderder;
const ac = new eui.ArrayCollection(DataManager.ins.getOptionsData.optionList);
this.list.dataProvider = ac;
}
getScope(data: IGameOptionData) {
if (data.autoOpen) {
return '阳光普照';
}
return `第${data.scope}名`;
}
protected get skinKey() { return 'Options' }
}
\ No newline at end of file
...@@ -2,17 +2,20 @@ import Panel from "../views/Panel"; ...@@ -2,17 +2,20 @@ import Panel from "../views/Panel";
import { NetManager } from '../../libs/tw/manager/NetManager'; import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RulePanel extends Panel { export default class RulePanel extends Panel {
public labContent:eui.Label; public labContent: eui.Label;
public scroller:eui.Scroller; public scroller: eui.Scroller;
start() { start() {
NetManager.ins.getRule(() => { if (!DataManager.ins.getRuleData)
NetManager.ins.getRule(() => {
this.addRule();
});
else
this.addRule(); this.addRule();
});
} }
private addRule() { private addRule() {
// this.labContent.textFlow = alien.Utils.parseHtmlText(content); // this.labContent.textFlow = alien.Utils.parseHtmlText(content);
this.labContent.textFlow = (new egret.HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText); this.labContent.textFlow = (new egret.HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
} }
protected get skinKey() { return 'Rule' } protected get skinKey() { return 'Rule' }
......
...@@ -223,7 +223,7 @@ export default class StartScene extends Scene { ...@@ -223,7 +223,7 @@ export default class StartScene extends Scene {
} }
onTap_optionBtn(e:egret.Event) { onTap_optionBtn(e:egret.Event) {
PanelCtrl.instance.show(ModuleTypes.OPTIONS_PANEL);
} }
protected get layerKeys() { protected get layerKeys() {
......
export enum ModuleTypes { export enum ModuleTypes {
START_SCENE, START_SCENE,
PALY_SCENE, PALY_SCENE,
ALERT_PANEL, ALERT_PANEL,
RULE_PANEL, RULE_PANEL,
OPTIONS_PANEL,
MSG_PANEL MSG_PANEL
} }
\ No newline at end of file
...@@ -6,18 +6,14 @@ export default class Panel extends ComponentBase { ...@@ -6,18 +6,14 @@ export default class Panel extends ComponentBase {
} }
initEvents() { initEvents() {
if (this.closeBtns && this.closeBtns.length > 0) { this.closeBtns.forEach(
this.closeBtns.forEach( btn => { if (btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
btn => { if (btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) } )
)
}
} }
removeEvents() { removeEvents() {
if (this.closeBtns && this.closeBtns.length > 0) { this.closeBtns.forEach(
this.closeBtns.forEach( btn => { if (btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
btn => { if (btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) } )
)
}
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
[ [
{ {
"autoOpen": false, "autoOpen": false,
"description": "我是一个实物大奖", "description": "实物大奖实物大奖实物大奖实物大奖物大奖实物大奖实大奖实",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/object.png", "logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/object.png",
"name": "实物大奖", "name": "实物大奖",
"scope": "1" "scope": "1"
...@@ -14,17 +14,17 @@ ...@@ -14,17 +14,17 @@
"scope": "2-4" "scope": "2-4"
}, },
{ {
"autoOpen": true, "autoOpen": false,
"description": "我是一个优惠券", "description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png", "logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "优惠券", "name": "话费",
"scope": "2-4" "scope": "2-4"
}, },
{ {
"autoOpen": true, "autoOpen": false,
"description": "我是一个优惠券", "description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png", "logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "优惠券", "name": "话费",
"scope": "2-4" "scope": "2-4"
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment