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 {
//RES.getResByUrl spritesheet类型
//不生效
//RES.getResAsync('net_png') spritesheet类型
if (filename.indexOf('.json') != -1) {
var arr = filename.split('.json')[0].split('/');
var filename1 = arr[arr.length - 1] + '_png';
var filename2 = filename.split('.json')[0] + '.png';
if (!RES.fileSystem['fsData'][filename1])
RES.fileSystem['fsData'][filename1] =
{ name: filename1, type: 'image', url: filename2, root: '', extra: '1' };
}
// if (filename.indexOf('.json') != -1) {
// var arr = filename.split('.json')[0].split('/');
// var filename1 = arr[arr.length - 1] + '_png';
// var filename2 = filename.split('.json')[0] + '.png';
// if (!RES.fileSystem['fsData'][filename1])
// RES.fileSystem['fsData'][filename1] =
// { name: filename1, type: 'image', url: filename2, root: '', extra: '1' };
// }
var result = RES.fileSystem['getFileOld'](filename);
if (result && result.url && check_webp_feature()) {
......@@ -100,7 +100,7 @@ export default class MainBase extends eui.UILayer {
try {
await RES.loadConfig("default.res.json", getResPath() + "resource/");
await this.loadTheme();
this.injectRES();
// this.injectRES();
}
catch (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 @@
{
"keys": "ruleBtn_png,optionBtn_png",
"name": "startscene"
},
{
"keys": "line2_png,prizeBg_png,X-1_png,line_png",
"name": "option"
}
],
"resources": [
......@@ -147,6 +151,26 @@
"url": "assets/startScene/ruleBtn.png",
"type": "image",
"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 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/StartSkin.exml"
"resource/skins/StartSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"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 @@
</e:Skin>
</e:skinName>
</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:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0x333333"/>
</e:Group>
......
......@@ -16,7 +16,8 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'silverbox.png',
'woodbox.png',
'monkey.png',
'net.png'
'net.png',
'option.png',
];
if (excludes.indexOf(file.basename) != -1) {
return file;
......
import MainBase from "../libs/tl/MainBase";
import { NetManager } from "../libs/tw/manager/NetManager";
import Msg from "./alert/Msg";
import PanelCtrl from "./ctrls/panelCtrl";
import SceneCtrl from "./ctrls/sceneCtrl";
import OptionsPanel from "./optionsPanel/OptionsPanel";
import RulePanel from "./rulePanel/RulePanel";
import StartScene from "./startScene/StartScene";
import { ModuleTypes } from "./types/sceneTypes";
import { NetManager } from "../libs/tw/manager/NetManager";
class Main extends MainBase {
protected registerModules() {
PanelCtrl.instance.registerPanelClass(ModuleTypes.MSG_PANEL, Msg);
PanelCtrl.instance.registerPanelClass(ModuleTypes.RULE_PANEL, RulePanel);
PanelCtrl.instance.registerPanelClass(ModuleTypes.OPTIONS_PANEL, OptionsPanel);
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";
import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RulePanel extends Panel {
public labContent:eui.Label;
public scroller:eui.Scroller;
public labContent: eui.Label;
public scroller: eui.Scroller;
start() {
NetManager.ins.getRule(() => {
if (!DataManager.ins.getRuleData)
NetManager.ins.getRule(() => {
this.addRule();
});
else
this.addRule();
});
}
private addRule() {
// 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' }
......
......@@ -223,7 +223,7 @@ export default class StartScene extends Scene {
}
onTap_optionBtn(e:egret.Event) {
PanelCtrl.instance.show(ModuleTypes.OPTIONS_PANEL);
}
protected get layerKeys() {
......
export enum ModuleTypes {
START_SCENE,
PALY_SCENE,
ALERT_PANEL,
RULE_PANEL,
OPTIONS_PANEL,
MSG_PANEL
}
\ No newline at end of file
......@@ -6,18 +6,14 @@ export default class Panel extends ComponentBase {
}
initEvents() {
if (this.closeBtns && this.closeBtns.length > 0) {
this.closeBtns.forEach(
btn => { if (btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
this.closeBtns.forEach(
btn => { if (btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
removeEvents() {
if (this.closeBtns && this.closeBtns.length > 0) {
this.closeBtns.forEach(
btn => { if (btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
this.closeBtns.forEach(
btn => { if (btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
[
{
"autoOpen": false,
"description": "我是一个实物大奖",
"description": "实物大奖实物大奖实物大奖实物大奖物大奖实物大奖实大奖实",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/object.png",
"name": "实物大奖",
"scope": "1"
......@@ -14,17 +14,17 @@
"scope": "2-4"
},
{
"autoOpen": true,
"description": "我是一个优惠券",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png",
"name": "优惠券",
"autoOpen": false,
"description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "话费",
"scope": "2-4"
},
{
"autoOpen": true,
"description": "我是一个优惠券",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png",
"name": "优惠券",
"autoOpen": false,
"description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "话费",
"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