Initial commit: UI-Quellcode (root + uiscript)
Enthaelt die editierbaren Python-UI-Skripte (root/, uiscript/) des EterNexus-Clients, u.a. die Aenderungen fuer aktivierbare Items (constinfo.py: IS_ACTIVATABLE_ITEM/IS_MOUNT_SEAL, uiinventory.py: RefreshBagSlotWindow). Kompilierte Pack-Dateien (.epk/.eix) sowie Binaries/DLLs/Locale-Assets sind bewusst nicht Teil dieses Repos.
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
|||||||
|
# Alles ignorieren...
|
||||||
|
/*
|
||||||
|
|
||||||
|
# ...außer diesen beiden Ordnern (editierbarer UI-Quellcode: root + uiscript) und sich selbst
|
||||||
|
!/root
|
||||||
|
!/uiscript
|
||||||
|
!/.gitignore
|
||||||
|
|
||||||
|
# Kompilierte Python-Bytecode-Artefakte trotzdem ausschließen
|
||||||
|
*.pyc
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,66 @@
|
|||||||
|
1 WARRIOR 三连斩 快风斩 虎啸风声 以闪电般的速度连续攻击多次,对前方敌人造成巨大伤害 前方范围攻击三次 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION SWORD|TWO_HANDED samyeon 4 34 64 总攻击力 %.0f-%.0f (1.1*MinATK + (0.3*MinATK + 0.5*STR + MinWEP)*SkillPoint) * 3 (1.1*MaxATK + (0.3*MaxATK + 0.5*STR + MaxWEP)*SkillPoint) * 3
|
||||||
|
2 WARRIOR 火焰旋 真炎斩 龙吟裂天 将力量贯注在剑身上,以旋转的方式攻击周围的敌人,产生伤害 前进范围攻击 ATTACK_SKILL|CAN_CHANGE_DIRECTION|WEAPON_LIMITATION SWORD|TWO_HANDED palbang 16 46 76 攻击力 %.0f-%.0f 3*MinATK + (0.8*MinATK + 2*STR + 2*DEX + 3*MinWEP) * SkillPoint 3*MaxATK + (0.8*MaxATK + 2*STR + 2*DEX + 3*MaxWEP) * SkillPoint
|
||||||
|
3 WARRIOR 战魂 金刚怒 破釜沉舟 做为勇士将以牺牲防御为代价来提升可怕的攻击力 提高攻击速度 增加移动速度 受攻击伤害 STANDING_SKILL jeongwi 12 42 72 攻击速度 +%.0f%% 50 * SkillPoint 移动速度 +%.0f%% 20 * SkillPoint 受攻击伤害 %.0f%% 80 * SkillPoint
|
||||||
|
4 WARRIOR 剑气 藏心剑 身剑合一 将真气灌注于武器之上发挥极致威力,产生可怕的伤害 只适用于近身攻击 STANDING_SKILL|WEAPON_LIMITATION SWORD|TWO_HANDED geomgyeong 7 37 67 攻击力 +%.0f (100 + STR) * SkillPoint
|
||||||
|
5 WARRIOR 猛杀 岩碎 石破天惊 使用坚实的身体,快速靠近敌人并猛击对方,产生巨大伤害 突击范围攻击 ATTACK_SKILL|CHARGE_ATTACK|NEED_TARGET|WEAPON_LIMITATION SWORD|TWO_HANDED tanhwan 11 41 71 攻击力 %.0f-%.0f 2*MinATK + (MinATK + 2*DEX + 4*STR + 3*MinWEP)*SkillPoint 2*MaxATK + (MaxATK + 2*DEX + 4*STR + 3*MaxWEP)*SkillPoint
|
||||||
|
16 WARRIOR 飘叶斩 断月波 八风夜雨 飘曳一般快速划出一道弧光,将敌人撕裂 前方范围攻击 ATTACK_SKILL|CAN_CHANGE_DIRECTION|NEED_TARGET|WEAPON_LIMITATION SWORD|TWO_HANDED gigongcham 5 35 65 攻击力 %.0f-%.0f 2.3*MinATK + (MinATK*4 + STR + 3*MinWEP + CON)*SkillPoint 2.3*MaxATK + (MaxATK*4 + STR + 3*MaxWEP + CON)*SkillPoint
|
||||||
|
17 WARRIOR 跳斩 虎跃 龙翔九天 集全身之量于兵刃上,高高跃起,劈向前方,使敌人受到猛烈的攻击 直线范围攻击 ATTACK_SKILL|CAN_CHANGE_DIRECTION|WEAPON_LIMITATION SWORD|TWO_HANDED gyeoksan 3 33 63 攻击力 %.0f-%.0f 2.3*MinATK + (3*MinATK + 2*STR + 2*MinWEP + 3*CON)*SkillPoint 2.3*MaxATK + (3*MaxATK + 2*STR + 2*MaxWEP + 3*CON)*SkillPoint
|
||||||
|
18 WARRIOR 震撼 狮吼 盘古镇天 运起周身真气,产生巨大气流,对周围敌人造成伤害的同时将他们震飞 原地范围攻击 一定概率产生击晕的效果 ATTACK_SKILL|STANDING_SKILL daejin 1 31 61 攻击力 %.0f-%.0f 2*MinATK + (2*MinATK + DEX + CON + 2*STR + 3*MinWEP)*SkillPoint 2*MaxATK + (2*MaxATK + DEX + CON + 2*STR + 3*MaxWEP)*SkillPoint 晕击概率 %.0f%% (100 + 1000*SkillPoint/6)/10
|
||||||
|
19 WARRIOR 千斤坠 铁布衫 固若金汤 瞬间提升防御力,到达一定等级后将稳如泰山,任何猛烈的攻击都无法被打倒。 提升防御力 降低移动速度 STANDING_SKILL cheongeun 10 40 70 防御力 : +%.0f 7+(40 + 0.2*str + 0.5*con)*k 移动速度 : -%.0f 1 + 9*SkillPoint
|
||||||
|
20 WARRIOR 剑风 斩气诀 剑气冲霄 快速挥动手中武器产生强大的气流,以迅雷不及掩耳之势打击敌人 远程攻击 周边范围攻击 击晕效果 击飞敌人 ATTACK_SKILL|CAN_CHANGE_DIRECTION|WEAPON_LIMITATION SWORD|TWO_HANDED geompung 17 47 77 攻击力 %.0f-%.0f 2*minatk + (minatk + 3*(dex + str + MinWEP))*k 2*maxatk + (maxatk + 3*(dex + str + MaxWEP))*k 晕击概率 %.0f (100+k*1000/6)/10
|
||||||
|
31 ASSASSIN 暗袭 隐击 流光诛仙 隐藏自己的行踪,靠近敌人背后,给予致命一击,产生伤害 后方偷袭时提升攻击力 隐身时增加 ATTACK_SKILL|MELEE_ATTACK|NEED_TARGET|WEAPON_LIMITATION DAGGER|DOUBLE_SWORD|SWORD amseup 2 32 62 攻击力 : %.0f-%.0f minatk + (minatk + 500 + 2*(dex + str + 1.5*MinWEP))*k maxatk + (maxatk + 700 + 2*(dex + str + 1.5*MaxWEP))*k
|
||||||
|
32 ASSASSIN 魅影 无影剑 乱影降魔 凭借灵敏的身手,快速接近敌人并给对方以致命一击,防不胜防 瞬间移动攻击 隐身时增加 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION DAGGER|DOUBLE_SWORD|SWORD gungsin 0 30 60 攻击力 %.0f-%.0f (minatk + (1.6*minatk + 200 + 3*(dex + str + 1.5*MinWEP))*k) (maxatk + (1.6*maxatk + 200 + 3*(dex + str + 1.5*MaxWEP))*k)
|
||||||
|
33 ASSASSIN 乾坤旋 舞轮斩 覆雨翻云 倒转身形,以快速旋转的攻击方式攻击敌人,同时得以逃脱。 逃脱时范围攻击 持续毒攻击 ATTACK_SKILL|CAN_CHANGE_DIRECTION|WEAPON_LIMITATION DAGGER|DOUBLE_SWORD|SWORD charyun 6 36 66 攻击力 %.0f-%.0f 2*minatk + (0.5*minatk + dex*7 + str*5 + MinWEP*3)*k 2*maxatk + (0.5*maxatk + dex*7 + str*5 + MaxWEP*3)*k 中毒概率 %.0f%% 1 + 4*k
|
||||||
|
34 ASSASSIN 隐身 千变术 遮天避日 隐藏自己的身形,令敌人无法察觉,更加发挥背后攻击的威力 攻击时解除 STANDING_SKILL eunhyeong 8 38 68 追加伤害值 : +%.0f%% 50 * SkillPoint
|
||||||
|
35 ASSASSIN 毒雾 碧磷烟 含沙射影 在自己周围制造一片浓密的毒雾,任何靠近它的敌人都难免受到毒的侵袭 远程攻击 周边范围攻击 持续毒攻击 ATTACK_SKILL|NEED_TARGET sangong 13 43 73 攻击力 %.0f-%.0f lv*2+(2*minatk + str*3 + dex*14)*k lv*2+(2*maxatk + str*3 + dex*14)*k 中毒概率 %.0f%% 40*k 中毒时间 %.0f秒 5+25*k
|
||||||
|
46 ASSASSIN 连射 贯日箭 气贯长虹 聚集自身的力量,对同一个敌人连续发出多支威力巨大的弩箭,持续造成伤害 远程攻击 多次攻击 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION BOW yeonsa 1 31 61 2 + floor(6 * SkillPoint) 总攻击力 %.0f-%.0f minatk + 0.2*minatk*floor(1+k*6)+ (0.8*minatk+(dex*4 + MinWEP)*ar) *k maxatk + 0.2*maxatk*floor(1+k*6)+ (0.8*maxatk+(dex*4 + MaxWEP)*ar) *k 射%.0f支箭 2 + floor(6 * SkillPoint)
|
||||||
|
47 ASSASSIN 乱箭 雨针箭 千蜂锐刺 一次射出多支弩箭,对前方敌人产生多处伤害,令敌人无法躲避 远程攻击 同时攻击多个对象 ATTACK_SKILL|FAN_RANGE|NEED_TARGET|WEAPON_LIMITATION BOW gwangyeok 5 35 65 2 + floor(6 * SkillPoint) 攻击力 %.0f-%0.f minatk + (minatk + dex + str + 0.5*MinWEP)*k maxatk + (maxatk + dex + str + 0.5*MaxWEP)*k 最大可以攻击%.0f名 2 + floor(6 * SkillPoint)
|
||||||
|
48 ASSASSIN 怒箭 武力箭 神武镇天 箭矢上带有火焰,并贯以强大的力量,灼烧敌人的同时给予伤害 远程攻击 周边范围攻击 火焰攻击 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION BOW hwajo 10 40 70 攻击力 %.0f-%.0f 1.5*minatk + (2.3*minatk)*k 1.5*maxatk + (2.3*maxatk + 100)*k
|
||||||
|
49 ASSASSIN 轻功 神行 踏雪无痕 身轻如燕,可快速的行走,远离敌人的攻击。 提高移动速度 STANDING_SKILL|TOGGLE gyeonggong 3 33 63 移动速度 : +%.0f 60*SkillPoint
|
||||||
|
50 ASSASSIN 毒箭 蚀骨箭 追魂夺命 箭矢上涂有剧毒,无人能解,使敌人中箭的同时受到毒的侵蚀 远程攻击 周边范围攻击 击飞敌人 持续毒攻击 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION BOW gigung 15 45 75 攻击力 %.0f-%.0f minatk + (1.2*minatk + dex*2 + str + MinWEP)*k maxatk + (1.2*maxatk + 100 + dex*2 + str + MaxWEP)*k 中毒概率 %.0f%% 80*k 中毒时间 %.0f秒 15+30*k
|
||||||
|
61 SURA 碎灵指 裂仙爪 天崩地裂 发挥魔指的强大力量,有碎岩切山之力,引起强烈的爆炸,攻击敌人 前方范围攻击 无视对方防御效果 随智力增加伤害 ATTACK_SKILL|MELEE_ATTACK|NEED_TARGET swaeryeong 11 41 71 攻击力 %.0f-%.0f minatk + 2*lv + iq*2 + (2*minatk + str*3 + iq*9 + 5*MinWEP) * k maxatk + 2*lv + iq*2 + (2*maxatk + str*3 + iq*9 + 5*MaxWEP) * k 忽视对方防御概率 %.0f%% 1 + 9*SkillPoint
|
||||||
|
62 SURA 龙卷波 旋风阵 狂神诛仙 借助魔王的力量,召唤猛烈的龙卷风,给周围造成巨大伤害 原地范围攻击 无视对方闪避效果 随智力增加伤害 ATTACK_SKILL|STANDING_SKILL yonggwon 16 46 76 攻击力 %.0f-%.0f 1.1*minatk + 2*lv + 2*iq + (1.5*minatk + 3*MinWEP + iq*6) * k 1.1*maxatk + 2*lv + 2*iq + (1.5*maxatk + 3*MaxWEP + iq*6) * k 忽视对方闪避概率 %.0f%% 1 + 9*SkillPoint
|
||||||
|
63 SURA 剑魔 斩灵剑 屠龙在天 将黑暗的力量贯注于武器中,使它发挥灵气,以增强伤害 近身物理攻击发挥作用 随智力增加伤害 吸血攻击 STANDING_SKILL|TOGGLE|WEAPON_LIMITATION SWORD gwigeom 5 35 65 攻击力 +%.1f 7 + (5*iq+13) * k 把 %.0f%% 伤害值转换成吸收生命力 10*k
|
||||||
|
64 SURA 恐惧 血祭 叱炼狂魔 让敌人感到极度的恐惧,丧失各项能力,变得更加脆弱 降低对方攻击力 对方攻击失败概率增加 受伤害的时候适用 STANDING_SKILL|TOGGLE gongpo 3 33 63 相对攻击力 -%.0f%% 1 + 29*SkillPoint 使对方攻击失败概率 %.0f%% 1 + 29*SkillPoint
|
||||||
|
65 SURA 噬体 魂盾 天魔附体 呼唤魔王的黑暗盔甲,围绕周身保护自己不受侵害 受到伤害时反射一部分伤害 提高防御力 随智力增加伤害 STANDING_SKILL|TOGGLE jumagap 6 36 66 防御力 +%.0f (iq+30)*k 物理攻击反射概率 %.0f%% (iq/4+10)*k
|
||||||
|
66 SURA 驱散 散元术 腐骨销魂 用邪恶的咒语来诅咒敌人,驱散敌人身上的辅助性魔法 远程攻击 周边范围攻击 驱除对方辅助法术 ATTACK_SKILL|NEED_TARGET pabeop 10 40 70 魔法攻击力 %.0f-%.0f 40 + 5*lv + 2*iq + (18*iq + 7*minmtk + 50)*ar*k 40 + 5*lv + 2*iq + (18*iq + 7*maxmtk + 100)*ar*k 消除辅助效果概率 %.0f%% 50*k
|
||||||
|
76 SURA 魔灵 鬼怨 夺魂摄魄 从地狱中吸取怨气,集结成黑暗力量给对方造成伤害 远程攻击 对方周边攻击 ATTACK_SKILL|NEED_TARGET maryeong 1 31 61 魔法攻击力 : %.0f-%.0f 40 + 5*lv + 2*iq + (10*iq + 8*minmtk + 50)*ar*k 40 + 5*lv + 2*iq + (10*iq + 8*maxmtk + 100)*ar*k
|
||||||
|
77 SURA 黑龙咒 狱龙魄 魔龙噬天 从邪恶守护者黑龙体内爆发强烈的火焰,焚烧周围的敌人 原地范围攻击 火焰攻击 ATTACK_SKILL|STANDING_SKILL hwayeom 17 47 77 魔法攻击力 : %.0f-%.0f 5*lv + 2*iq + (7*iq + 8*mtk + str*4 + con*2 + 180)*k 5*lv + 2*iq + (7*iq + 8*mtk + str*4 + con*2 + 200)*k
|
||||||
|
78 SURA 魂灵 魔焰 狱火焚烧 忠诚而邪恶的魔灵,守护着主人,将攻击所有靠近主人的敌人 远程攻击 任意选择攻击对象 周边范围攻击 ATTACK_SKILL|STANDING_SKILL|TOGGLE muyeong 15 45 75 魔法攻击力 : %.0f-%.0f 30 + 2*lv + 2*iq + (9*iq + 7*minmtk + 200)*ar*k 30 + 2*lv + 2*iq + (9*iq + 7*maxmtk + 500)*ar*k
|
||||||
|
79 SURA 黑魔咒 御魂术 天哭地泣 瞬间爆发黑暗力量,产生阻挡一切的气流,在消耗大量精力的同时保护自己 精力值代替生命值受到的伤害 提高防御力 STANDING_SKILL|TOGGLE heuksin 2 32 62 伤害值衰减率 %.0f%% (15 + iq*0.5)*k 防御力 +%.0f (0.5*iq+15)*k
|
||||||
|
80 SURA 束缚 困身 寸步难行 运用恶魔的力量控制丛生的荆棘,对敌人造成影响,降低对方的移动速度 远程攻击 对方周边攻击 移动速度减慢 ATTACK_SKILL|NEED_TARGET tusok 9 39 69 魔法攻击力 : %.0f-%.0f 40 + 2*lv + 2*iq + (2*con + 2*dex + 10*iq + 8*minmtk+ 180)*ar*k 40 + 2 * lv + 2*iq + (2*con + 2*dex + 10*iq + 8*maxmtk + 200)*ar*k 缓慢概率 : %.1f%% (333 + (300 * k))/10 缓慢时间 : %.0f 10 + (10 * SkillPoint)
|
||||||
|
81 SURA 旋魔 血玲珑 乾坤黯然 凌空跃起,将手中的邪恶力量聚集成一道黑色漩涡丢出,攻击远处的敌人 远程攻击 对方周边攻击 ATTACK_SKILL|NEED_TARGET geomhwan 7 37 67 魔法攻击力 %.0f-%.0f 120 + 6*lv + (5*con + 5*dex + 25*iq + 12*minmtk)*ar*k 120 + 6*lv + (5*con + 5*dex + 25*iq + 12*maxmtk)*ar*k
|
||||||
|
91 SHAMAN 灵光 归元波 五彩云霞 聚集天地间的灵气形成五彩光球,给周围的敌人造成巨大的冲击 远程攻击 周边范围攻击 ATTACK_SKILL|FAN_RANGE|NEED_TARGET bipabu 0 30 60 魔法攻击力 : %.0f-%.0f 70 + 4*lv + (15*iq+5*minmtk+50)*ar*k 70 + 4*lv + (15*iq+5*maxmtk+50)*ar*k
|
||||||
|
92 SHAMAN 龙影 龙吟 潜龙傲天 祈祷神龙的保护,在身边浮现出多只龙神的影子,保护自己的同时攻击敌人 直线范围攻击 持续火焰效果 ATTACK_SKILL|NEED_TARGET yongpa 5 35 65 魔法攻击力 : %.0f-%.0f 60 + 5*lv + (15*iq + 6*minmtk + 120)*ar*k 60 + 5*lv + (15*iq + 6*maxmtk + 120)*ar*k 持续火焰概率 %.0f%% iq*0.2*k 持续火焰攻击力 %.0f lv+5*iq *k
|
||||||
|
93 SHAMAN 龙咒 龙啸 千龙摆尾 听到召唤的神龙,借助元神的强大力量,吞噬所有敌人 原地范围攻击 持续火焰效果 ATTACK_SKILL|STANDING_SKILL paeryong 6 36 66 魔法攻击力 %.0f-%.0f 70 + 2*lv + (10*iq+15*minmtk+100)*ar*k 70 + 2*lv + (10*iq+15*maxmtk+100)*ar*k 持续火焰概率 %.0f%% iq*0.2*k 持续火焰攻击力 %.0f lv+5*iq *k
|
||||||
|
94 SHAMAN 结界 天壁 真龙护体 使用龙鳞组成的护甲带有极强的防御力,使得受护者更加安全 抵抗物理攻击 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE hosin 4 34 64 物理攻击抵抗 : %.1f%% (iq*0.3+5)*(2*k+0.5)/(k+1.5)
|
||||||
|
95 SHAMAN 倒影阵 水镜阵 天罡正气 如镜一般的护盾保护着使用者,将反弹敌人的攻击,不受伤害 反射物理攻击 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE boho 14 44 74 物理攻击反射概率 %.1f%% 5+(iq*0.3 + 5)*k
|
||||||
|
96 SHAMAN 凝神 天龙魂 龙神圣威 借助龙神的力量与斗志,增强自身的攻击力 致命攻击 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE gicheon 12 42 72 致命打击概率 : %.1f%% (iq*0.3+5)*(2*k+0.5)/(k+1.5)
|
||||||
|
106 SHAMAN 落雷 惊天雷 电闪雷鸣 神女借助天神的威力,给予敌人强大的电击伤害 远程攻击 周边范围攻击 电属性伤害 ATTACK_SKILL|NEED_TARGET noejeon 23 53 83 魔法攻击力 : %.0f-%.0f 60 + 4*lv + (3*iq+8*minmtk+iq*5)*ar*k 60 + 4*lv + (3*iq+8*maxmtk+iq*15)*ar*k
|
||||||
|
107 SHAMAN 劈雷 燎闪 晴天霹雳 雷神的守护给予神女强大的支配能力,使其具有强大的雷电攻击能力 远程攻击 周边范围攻击 电属性伤害 击晕效果 ATTACK_SKILL|NEED_TARGET byeorak 17 47 77 魔法攻击力 %.0f-%.0f 40 + 3*lv + (3*iq+12*mtk+iq*5)*ar*k 40 + 4*lv + (3*iq+12*maxmtk+iq*16)*ar*k 晕击概率 %.0f%% (50+1000*k/6)/10
|
||||||
|
108 SHAMAN 暴雷 怒天雷 五雷轰顶 飞箭一般的雷电,不断穿梭于敌人之中,由此产生持久的的伤害 远程攻击 电属性 连续攻击周边敌人 ATTACK_SKILL|NEED_TARGET pokroe 7 37 67 魔法攻击力 : %.0f-%.0f (50 + 5*lv + (6*iq+6*minmtk+1)*ar*k) (50 + 5*lv + (6*iq+6*maxmtk+800)*ar*k)
|
||||||
|
109 SHAMAN 光浴 光神 佛光普照 大地之母给予使用者更多的精力来帮助恢复生命,免除死亡的威胁 恢复生命力 恢复异常状态 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE jeongeop 2 32 62 生命力恢复 %.0f-%.0f 200+4*lv+(10*iq+6*minmtk+600)*k 200+4*lv+(10*iq+6*maxmtk+800)*k 恢复异常状态概率 %.0f%% 20+80*k
|
||||||
|
110 SHAMAN 飘仙 轻衣 飘渺踏云 乘风而飘,如同仙履,增加移动速度 提高移动速度 减少诅咒时间 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE kwaesok 9 39 69 移动速度 +%.0f%% 5 + (35 * k) 释放速度 +%.0f%% 3+33*k
|
||||||
|
111 SHAMAN 神曲 强魄术 魂雷圣体 犹如神韵,激发潜能,产生更大的爆发力,提高对敌人的伤害 提高基本攻击力 对同伴使用可能 CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE jeungryeok 29 59 89 攻击力 : +%.1f 5+(iq*0.2 + 15)*k
|
||||||
|
121 SUPPORT 统帅 提升领导能力,提高组队效率 PASSIVE tongsol
|
||||||
|
122 SUPPORT 招式 增加招式变化,增加攻击次数 CANNOT_LEVEL_UP|TOGGLE combo
|
||||||
|
123 SUPPORT 钓鱼 提高钓鱼能力,更容易捕捉到鱼 CANNOT_LEVEL_UP fishing
|
||||||
|
124 SUPPORT 采矿 提升采矿能力,更容易采集到高级矿石 CANNOT_LEVEL_UP|PASSIVE mining
|
||||||
|
125 SUPPORT 锻造 提升锻造能力,制作更多的物品 CANNOT_LEVEL_UP|PASSIVE making
|
||||||
|
126 SUPPORT 唐文宝典 提升盛唐国语言的理解力. CANNOT_LEVEL_UP|PASSIVE language1
|
||||||
|
127 SUPPORT 秦文宝典 提升秦皇国语言的理解力. CANNOT_LEVEL_UP|PASSIVE language2
|
||||||
|
128 SUPPORT 汉文宝典 提升汉武国语言的理解力. CANNOT_LEVEL_UP|PASSIVE language3
|
||||||
|
129 SUPPORT 幻化 角色将随机变幻成怪物的形态,并拥有一些额外的属性. CANNOT_LEVEL_UP|PASSIVE polymorph
|
||||||
|
130 SUPPORT 骑乘 骑马的能力 CANNOT_LEVEL_UP|PASSIVE riding
|
||||||
|
131 SUPPORT 召唤 召唤马匹 summon 10
|
||||||
|
137 HORSE 追风斩 骑马奔跑并攻击周围的敌人 马背技能 HORSE_SKILL|MOVING_SKILL|WEAPON_LIMITATION SWORD|TWO_HANDED|DAGGER|DOUBLE_SWORD|FAN|BELL wildattack 121 121 121 50
|
||||||
|
138 HORSE 摧敌讨 击倒前方拦截的敌人 马背技能 HORSE_SKILL|SEARCH_TARGET|CHARGE_ATTACK charge 122 122 122 52
|
||||||
|
139 HORSE 威陵破 攻击周围的敌人 马背技能 HORSE_SKILL|WEAPON_LIMITATION SWORD|TWO_HANDED|DAGGER|DOUBLE_SWORD|BOW|FAN|BELL splash 123 123 123 55
|
||||||
|
140 HORSE 秋叶乱箭 射向拦截的前方敌人 马背技能 ATTACK_SKILL|FAN_RANGE|NEED_TARGET|HORSE_SKILL|WEAPON_LIMITATION BOW wildattack 121 121 121 5 50
|
||||||
|
151 GUILD 龙魂 增加最大龙神力,能够更好的使用帮会技能 PASSIVE yongan 最大龙神力 +%.0f k * 1400
|
||||||
|
152 GUILD 龙血 暂时提升帮会成员的最大生命值 帮会战专用 ONLY_FOR_GUILD_WAR gaho 101 最大生命值上升 +%.0f%% k * 20
|
||||||
|
153 GUILD 龙神 暂时提升帮会成员的最大精力值 帮会战专用 ONLY_FOR_GUILD_WAR chukbok 102 最大精力值上升 +%.0f%% k * 20
|
||||||
|
154 GUILD 龙铠 暂时提升帮会成员的防御力 帮会战专用 ONLY_FOR_GUILD_WAR seonghwi 103 防御力上升 +%.1f%% k * 10
|
||||||
|
155 GUILD 龙腾 暂时提升帮会成员的攻击速度和移动速度 帮会战专用 ONLY_FOR_GUILD_WAR gasok 104 攻击,移动速度上升 +%.1f%% k * 15
|
||||||
|
156 GUILD 龙怒 暂时提升帮会成员的双倍伤害的概率 帮会战专用 ONLY_FOR_GUILD_WAR bunno 105 双倍伤害概率 +%.0f%% k * 50
|
||||||
|
157 GUILD 龙佑 暂时缩短帮会成员的技能释放时间 帮会战专用 ONLY_FOR_GUILD_WAR jumunsul 106 释放速度上升 +%.0f%% k * 50
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
1 삼연참 1 1 1 0 HP -(1.1*atk + (0.3*atk + 0.5 *str + wep)*k) 40+100*k 15 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 5 1 0 0
|
||||||
|
2 팔방풍우 1 1 1 0 HP -(3*atk + (0.8*atk + str*2 + dex*2 + wep*3)*k) 50+130*k 20 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 12 0.8 0 0
|
||||||
|
3 전귀혼 1 1 1 0 ATT_SPEED 50*k 50+140*k 60+90*k 60+20*k SELFONLY 14 MOV_SPEED 20*k 60+90*k 0 0 NORMAL 1 1 0 0
|
||||||
|
4 검경 1 1 1 0 ATT_GRADE (100+str)*k 100+200*k 30+50*k 40+20*k SELFONLY 15 NONE 0 0 NORMAL 1 1 0 0
|
||||||
|
16 기공참 1 1 1 0 HP -(2.3*atk + (4*atk + str + wep*3 + con)*k) 60+120*k 15 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 4 0.8 0 0
|
||||||
|
17 격산타우 1 1 1 0 HP -(2.3*atk + (3*atk + str*2 + wep*2 + con*3)*k) 60+150*k 15 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 8 0.8 0 0
|
||||||
|
18 대진각 1 1 1 0 HP -(2*atk + (2*atk + dex + con + str*2 + wep*3)*k) 50+140*k 25 ATTACK,USE_MELEE_DAMAGE,SELFONLY,SPLASH,ATTACK_STUN NONE 100+k*1000/6 2 0 0 MELEE 10 0.8 0 400
|
||||||
|
19 천근추 1 1 1 0 DEF_GRADE 7+(40 + str*0.2 + con*0.5) *k 80+220*k 60+90*k 40+40*k SELFONLY 16 MOV_SPEED -(1+9*k) 60+90*k 0 0 NORMAL 1 1 0 0
|
||||||
|
47 관격술 2 1 1 0 HP -(atk + (atk + dex + str + 0.5*wep)*k) 30+130*k 12 ATTACK,USE_ARROW_DAMAGE NONE 0 0 RANGE 8 1 2500 0
|
||||||
|
48 화조파 2 1 1 0 HP -(1.5*atk + (2.3*atk + number(0, 100))*k) 50+130*k 25 ATTACK,SPLASH,USE_ARROW_DAMAGE NONE 0 0 RANGE 12 0.6 2500 300
|
||||||
|
46 연사 2 1 1 0 HP -(atk + 0.2*atk*floor(1+k*6) + (0.8*atk+(dex*4+wep)*ar) * k) 40+130*k 15 ATTACK,USE_ARROW_DAMAGE NONE 0 0 RANGE 1 1 2500 0
|
||||||
|
49 경공술 2 1 1 0 MOV_SPEED 60*k 30+40*k 15+30*k 30+30*k SELFONLY 17 NONE 0 0 NORMAL 1 1 0 0
|
||||||
|
31 암습 2 1 1 0 HP -(atk + (atk + number(500, 700) + 2*(dex + str + 1.5*wep))*k) 40+160*k 15 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 6 0.8 0 0
|
||||||
|
32 궁신탄영 2 1 1 0 HP -(atk + (1.6*atk + number(200,300) + 3*(dex + str + 1.5*wep))*k) 40+160*k 20 ATTACK,USE_MELEE_DAMAGE NONE 0 0 MELEE 6 0.8 800 0
|
||||||
|
33 차륜살 2 1 1 0 HP -(2*atk + (0.5*atk + dex*7 + str*5 + wep*3)*k) 50+140*k 25 ATTACK,USE_MELEE_DAMAGE,ATTACK_POISON NONE 40*k 0 0 MELEE 12 0.8 0 0
|
||||||
|
34 은형법 2 1 1 0 NONE 30+60*k 15+30*k 60 SELFONLY 18 NONE 0 0 NORMAL 1 1 0 0
|
||||||
|
76 마령 3 1 1 0 HP -(40 +5*lv + 2*iq +(10*iq + 8*mtk + number(50,100))*ar*k) 30+140*k 7 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH NONE 0 0 MAGIC 5 0.6 1500 200
|
||||||
|
77 화염폭 3 1 1 0 HP -(5*lv + 2*iq+(7*iq + 8*mtk + str*4 + con*2 + number(180,200))*k) 60+140*k 12 ATTACK,SELFONLY,COMPUTE_MAGIC_DAMAGE,SPLASH NONE 0 0 MAGIC 15 0.8 0 500
|
||||||
|
78 무영진 3 1 1 0 HP -(30 + 2*lv + iq + (3*iq + 8*mtk + number(iq*2,iq*6))*ar*k) 20+30*k 40+30*k 5+40*k 0 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH,TOGGLE NONE 0 0 MAGIC 1 1 800 0
|
||||||
|
80 투속마령 3 1 1 0 HP -(40 + 2*lv + 2*iq + (2 * con + 2 * dex + 10*iq + 8*mtk + number(180, 200))*ar*k) 40+120*k 12 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH,ATTACK_SLOW NONE 333+300*k 10+10*k 0 0 MAGIC 9 0.8 1200 400
|
||||||
|
61 쇄령지 3 1 1 0 HP -(atk + 2*lv + iq*2 + (2*atk + 3*str + 9*iq + 5*wep) * k) 30+140*k 10 ATTACK,USE_MELEE_DAMAGE,PENETRATE NONE 1+k*9 0 0 MELEE 4 1 0 0
|
||||||
|
62 용권파 3 1 1 0 HP -(1.1 * atk + 2*lv + iq*2+(1.5*atk + 3*wep + iq*6) * k) 50+150*k 15 ATTACK,USE_MELEE_DAMAGE,SELFONLY,SPLASH,IGNORE_TARGET_RATING NONE 1+k*9 0 0 MELEE 12 1 0 500
|
||||||
|
63 귀검 3 1 1 0 ATT_GRADE 7+(5*iq+13) * k 20+220*k 50+100*k 2+23*k 0 SELFONLY,TOGGLE 19 HIT_HP_RECOVER 10*k 50+80*k 0 0 NORMAL 1 1 0 0
|
||||||
|
64 공포 3 1 1 0 DODGE 1 + 29 * k 60+120*k 60+100*k 100 SELFONLY 20 NONE 0 0 NORMAL 1 1 0 0
|
||||||
|
65 주마갑 3 1 1 0 DEF_GRADE (iq+30)*k 70+170*k 30+120*k 40+140*k SELFONLY 21 REFLECT_MELEE (iq/4+10)*k 30+120*k 0 0 NORMAL 1 1 0 0
|
||||||
|
92 용파산 4 1 1 0 HP -(60 + 5*lv + (16*iq + 8*mtk + 120)*ar*k) 50+160*k 8 ATTACK,ATTACK_FIRE_CONT NONE lv+5*iq *k iq*0.2*k 0 0 MAGIC 10 0.8 0 0
|
||||||
|
93 패룡폭 4 1 1 0 HP -(70 + 2*lv + (12*iq+20*mtk+100)*ar*k) 50+160*k 20 ATTACK,SELFONLY,SPLASH,ATTACK_FIRE_CONT NONE lv+5*iq *k iq*0.2*k 0 0 MAGIC 15 0.8 0 500
|
||||||
|
94 호신 4 1 1 0 RESIST_NORMAL (iq*0.3+5)*(2*k+0.5)/(k+1.5) 40+160*k 60+200*k 10 22 NONE 0 0 NORMAL 1 1 800 0
|
||||||
|
95 반사 4 1 1 0 REFLECT_MELEE 5+(iq*0.3 + 5)*k 40+160*k 60+200*k 10 23 NONE 0 0 NORMAL 1 1 0 0
|
||||||
|
106 뇌전령 4 1 1 0 HP -(60 + 4*lv + (4*iq+11*mtk+number(iq*5,iq*15))*ar*k) 30+150*k 7 ATTACK,SPLASH NONE 0 0 MAGIC 5 0.6 1800 200
|
||||||
|
107 벼락 4 1 1 0 HP -(40 + 4*lv + (6*iq+12*mtk+number(iq*5,iq*16))*ar*k) 50+150*k 15 ATTACK,SPLASH,ATTACK_STUN NONE 50+1000*k/6 5 0 0 MAGIC 15 0.8 1500 400
|
||||||
|
108 폭뢰격 4 1 1 0 HP -(50 + 5*lv + (6*iq+6*mtk+number(1,800))*ar*k * (1-chain*0.2) * (1-sign(chain)*0.4)) 40+180*k 10 ATTACK NONE 0 0 MAGIC 7 0.8 2500 0
|
||||||
|
109 정업인 4 1 1 0 HP 200+4*lv+(10*iq+6*mtk+number(600,800))*k 40+200*k 10 REMOVE_BAD_AFFECT NONE 20+80*k 0 0 0 NORMAL 1 1 1000 0
|
||||||
|
110 쾌속 4 1 1 0 MOV_SPEED 5 + 35*k 60+120*k 60+100*k 10 24 CASTING_SPEED 3+33*k 60+100*k 0 0 NORMAL 1 1 1000 0
|
||||||
|
79 흑신수호 3 1 1 0 DEF_GRADE (0.5*iq+15)*k 20+30*k 60+120*k 5+10*k 0 SELFONLY,TOGGLE 25 MANASHIELD 100-((iq*0.84)*k) 60+120*k 0 0 MAGIC 1 0.8 0 0
|
||||||
|
151 용안 0 1 7 0 NONE NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
152 용신의피 0 1 7 0 MAX_HP maxhp*0.2*k 150+150*k 300 600 NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
153 용신의축복 0 1 7 0 MAX_SP maxsp*0.2*k 150+150*k 300 600 NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
154 성휘갑 0 1 7 0 DEF_GRADE odef*0.1*k 150+150*k 180 480 NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
155 가속화 0 1 7 0 MOV_SPEED 15*k 150+150*k 180 480 ATT_SPEED 15*k 180 0 0 NORMAL 0 1 0 0
|
||||||
|
156 용신의분노 0 1 7 0 CRITICAL 50*k 150+150*k 180 480 SELFONLY NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
157 주문술 0 1 7 0 CASTING_SPEED 50*k 150+150*k 180 480 SELFONLY NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
158 길드이동 0 1 3 0 NONE SELFONLY NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
159 공간의문 0 1 5 0 NONE SELFONLY NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
160 가속화 0 1 5 0 NONE 3*k 80-12*k 300 SELFONLY NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
161 공간의문 0 1 2 0 NONE 50 NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
162 공간이동 0 1 2 0 NONE 20 NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
91 비파부 4 1 1 0 HP -(70 + 4*lv + (11*iq+12*mtk+50)*ar*k) 30+160*k 7 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH NONE 0 0 MAGIC 5 0.5 1800 0
|
||||||
|
5 탄환격 1 1 1 0 HP -(2*atk + (atk + dex*2 + str*4 + wep*3)*k) 60+120*k 20 ATTACK,USE_MELEE_DAMAGE,SPLASH,CRUSH MOV_SPEED 150 3 0 0 MELEE 4 1 0 200
|
||||||
|
20 검풍 1 1 1 0 HP -(2*atk + (atk + 3*(dex+str+wep))*k) 40+120*k 20 ATTACK,USE_MELEE_DAMAGE,SPLASH,CRUSH NONE 0 0 MELEE 10 0.5 1200 200
|
||||||
|
35 산공분 2 1 1 0 HP -(lv*2+(2*atk + str*3 + dex*14)*k) 40+130*k 25 ATTACK,USE_MELEE_DAMAGE,SPLASH,ATTACK_POISON NONE 60*k 5+25*k 0 0 MAGIC 0 0.5 800 200
|
||||||
|
50 독기궁 2 1 1 0 HP -(atk + (1.2*atk + number(0, 100)+dex*2+str+wep)*k) 40+160*k 25 ATTACK,SPLASH,USE_ARROW_DAMAGE,CRUSH,ATTACK_POISON NONE 80*k 15+30*k 0 0 RANGE 12 0.5 2500 300
|
||||||
|
66 파법술 3 1 1 0 HP -(40 +5*lv + 2*iq+(18*iq + 7*mtk + number(50,100) )*ar*k) 30+120*k 12 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH,REMOVE_GOOD_AFFECT NONE 10+40*k 7+23*k 0 0 NORMAL 5 0.6 1800 200
|
||||||
|
81 마환격 3 1 1 0 HP -(120 + 6*lv + (5*con + 5*dex + 25*iq + 12*mtk)*ar*k) 80+220*k 24 ATTACK,COMPUTE_MAGIC_DAMAGE,SPLASH NONE 0 0 MAGIC 9 0.4 1500 200
|
||||||
|
96 기천대공 4 1 1 0 CRITICAL (iq*0.3+5)*(2*k+0.5)/(k+1.5) 40+160*k 60+100*k 10 29 NONE 0 0 NORMAL 1 1 1000 0
|
||||||
|
111 증력술 4 1 1 0 ATT_GRADE 5+(iq*0.2 +15)*k 60+120*k 60+100*k 10 30 NONE 0 0 NORMAL 1 1 1000 0
|
||||||
|
121 통솔력 0 1 40 0 NONE NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
122 연계기 0 1 2 0 NONE DISABLE_BY_POINT_UP NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
126 신수어 0 1 1 0 NONE DISABLE_BY_POINT_UP NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
127 천조어 0 1 1 0 NONE DISABLE_BY_POINT_UP NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
128 진노어 0 1 1 0 NONE DISABLE_BY_POINT_UP NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
125 변신 0 1 40 0 NONE 10+1000*k NONE 0 0 NORMAL 0 1 1000 0
|
||||||
|
256 CRUSH200스킬 0 1 1 0 HP -5*k*atk 2 ATTACK,USE_MELEE_DAMAGE,SPLASH,CRUSH NONE 0 0 MELEE 0 1 0 300
|
||||||
|
257 일반범위350스킬 0 1 1 0 HP -5*k*atk 5 ATTACK,USE_MELEE_DAMAGE,SPLASH NONE 0 0 MELEE 0 1 0 525
|
||||||
|
258 CRUSH300스킬 0 1 1 0 HP -5*k*atk 7 ATTACK,USE_MELEE_DAMAGE,SPLASH,CRUSH NONE 0 0 MELEE 0 1 0 450
|
||||||
|
259 일반범위200스킬 0 1 1 0 HP -5*k*atk 9 ATTACK,USE_MELEE_DAMAGE,SPLASH NONE 0 0 MELEE 0 1 0 300
|
||||||
|
260 CURSH400스킬 0 1 1 0 HP -5*k*atk 10 ATTACK,USE_MELEE_DAMAGE,SPLASH,CRUSH NONE 0 0 MELEE 0 1 0 600
|
||||||
|
261 독250스킬 0 1 1 0 HP -5*k*atk 9 ATTACK,USE_MELEE_DAMAGE,SPLASH,ATTACK_POISON NONE 80 0 0 MELEE 0 1 0 375
|
||||||
|
262 SLOW300스킬 0 1 1 0 HP -5*k*atk 12 ATTACK,USE_MELEE_DAMAGE,SPLASH MOV_SPEED -20 10 0 0 MELEE 0 1 0 450
|
||||||
|
130 승마 0 1 1 0 NONE DISABLE_BY_POINT_UP NONE 0 0 NORMAL 0 1 0 0
|
||||||
|
137 난무 5 1 1 50 HP -(3*atk) 60+80*k 5 ATTACK,USE_MELEE_DAMAGE,CRUSH NONE 0 0 MELEE 10 1 300 0
|
||||||
|
138 돌격 5 1 1 52 HP -(3*atk) 60+80*k 5 ATTACK,USE_MELEE_DAMAGE,SPLASH MOV_SPEED 50 5 0 0 MELEE 6 1 400 100
|
||||||
|
139 탈출 5 1 1 55 HP -(3*atk) 60+80*k 5 ATTACK,USE_MELEE_DAMAGE,SELFONLY,SPLASH,CRUSH NONE 0 0 MELEE 12 1 400 250
|
||||||
|
140 난무(활) 5 1 1 50 HP -(3*atk) 60+80*k 5 ATTACK,USE_ARROW_DAMAGE,CRUSH NONE 0 0 5 1 2500 0
|
||||||
|
131 말소환 0 1 10 0 NONE NONE 0 0 NORMAL 0 1 0 0
|
||||||
+1530
File diff suppressed because it is too large
Load Diff
+1627
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,110 @@
|
|||||||
|
map_a2 256000 665600 6 6
|
||||||
|
map_b2 102400 51200 6 6
|
||||||
|
map_c2 665600 281600 6 6
|
||||||
|
map_n_snowm_01 358400 153600 6 6
|
||||||
|
metin2_map_a1 409600 896000 4 5
|
||||||
|
metin2_map_a3 307200 819200 4 4
|
||||||
|
metin2_map_b1 0 102400 4 5
|
||||||
|
metin2_map_b3 102400 204800 4 4
|
||||||
|
metin2_map_c1 921600 204800 4 5
|
||||||
|
metin2_map_c3 819200 204800 4 4
|
||||||
|
metin2_map_deviltower1 204800 665600 3 3
|
||||||
|
metin2_map_milgyo 537600 51200 4 4
|
||||||
|
metin2_map_n_desert_01 204800 486400 6 6
|
||||||
|
metin2_map_n_flame_01 588800 614400 6 6
|
||||||
|
metin2_map_spiderdungeon 51200 486400 3 3
|
||||||
|
metin2_map_spiderdungeon_02 665600 435200 4 4
|
||||||
|
metin2_map_t1 0 25600 3 3
|
||||||
|
metin2_map_t2 6400 0 1 1
|
||||||
|
metin2_map_t3 32000 0 1 1
|
||||||
|
metin2_map_t4 57600 0 1 1
|
||||||
|
metin2_map_t5 793600 0 1 1
|
||||||
|
metin2_map_monkeydungeon 819200 51200 3 3
|
||||||
|
metin2_map_monkeydungeon 768000 435200 3 3
|
||||||
|
metin2_map_monkeydungeon 844800 435200 3 3
|
||||||
|
metin2_map_monkeydungeon 921600 435200 3 3
|
||||||
|
metin2_map_monkeydungeon_02 128000 640000 3 3
|
||||||
|
metin2_map_monkeydungeon_03 128000 716800 3 3
|
||||||
|
metin2_map_wedding_01 819200 0 1 1
|
||||||
|
metin2_map_guild_01 128000 0 2 2
|
||||||
|
metin2_map_guild_02 179200 0 2 2
|
||||||
|
metin2_map_guild_03 230400 0 2 2
|
||||||
|
metin2_map_trent 281600 0 2 2
|
||||||
|
metin2_map_trent02 1049600 0 4 4
|
||||||
|
gm_guild_build 83200 0 1 1
|
||||||
|
metin2_map_duel 844800 0 1 1
|
||||||
|
season1/metin2_map_WL_01 1049600 716800 6 6
|
||||||
|
season1/metin2_map_nusluck01 819200 716800 4 4
|
||||||
|
season1/metin2_map_oxevent 870400 0 2 2
|
||||||
|
season1/metin2_map_sungzi 921600 0 2 2
|
||||||
|
metin2_map_bf 972800 0 2 2
|
||||||
|
metin2_map_bf_02 921600 51200 2 2
|
||||||
|
metin2_map_bf_03 972800 51200 2 2
|
||||||
|
metin2_map_sungzi_flame_pass01 1024000 102400 4 4
|
||||||
|
metin2_map_sungzi_flame_pass02 1024000 204800 4 4
|
||||||
|
metin2_map_sungzi_flame_pass03 1024000 307200 4 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_01 1126400 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_02 1126400 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_03 1126400 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_snow 1152000 0 3 3
|
||||||
|
season1/metin2_map_sungzi_snow_pass01 1177600 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_snow_pass02 1177600 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_snow_pass03 1177600 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_01 1228800 0 4 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_01 1228800 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_02 1228800 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_03 1228800 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_milgyo 1331200 0 3 3
|
||||||
|
season1/metin2_map_sungzi 1408000 0 3 3
|
||||||
|
season1/metin2_map_sungzi_snow 1484800 0 3 3
|
||||||
|
season1/metin2_map_sungzi_desert_01 1561600 0 3 3
|
||||||
|
season1/metin2_map_sungzi_milgyo_pass01 1280000 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_milgyo_pass02 1280000 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_milgyo_pass03 1280000 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_01 1331200 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_02 1331200 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_flame_hill_03 1331200 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_snow_pass01 1382400 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_snow_pass02 1382400 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_snow_pass03 1382400 307200 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_01 1433600 102400 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_02 1433600 204800 2 4
|
||||||
|
season1/metin2_map_sungzi_desert_hill_03 1433600 307200 2 4
|
||||||
|
season1/metin2_map_ew02 256000 51200 4 4
|
||||||
|
season2/metin2_map_empirewar01 972800 102400 2 2
|
||||||
|
season2/metin2_map_empirewar02 921600 153600 2 2
|
||||||
|
season2/metin2_map_empirewar03 972800 153600 2 2
|
||||||
|
season2/map_n_snowm_02 0 1049600 6 6
|
||||||
|
season2/metin2_map_milgyo_a 153600 1049600 4 4
|
||||||
|
season2/metin2_map_n_desert_02 307200 1049600 6 6
|
||||||
|
season2/metin2_map_n_flame_02 460800 1049600 6 6
|
||||||
|
season2/metin2_map_a2_1 614400 1049600 6 6
|
||||||
|
season2/metin2_map_trent_a 768000 1049600 2 2
|
||||||
|
season2/metin2_map_trent02_a 921600 1049600 3 3
|
||||||
|
season2/metin2_map_skipia_dungeon_01 0 1203200 6 6
|
||||||
|
metin2_map_skipia_dungeon_02 153600 1203200 6 6
|
||||||
|
season2/metin2_map_skipia_dungeon_01 0 1356800 6 6
|
||||||
|
season2/metin2_map_skipia_dungeon_01 0 1510400 6 6
|
||||||
|
season2/metin2_map_skipia_dungeon_01 0 1664000 6 6
|
||||||
|
metin2_map_skipia_dungeon_02 153600 1356800 6 6
|
||||||
|
metin2_map_skipia_dungeon_02 153600 1510400 6 6
|
||||||
|
metin2_map_skipia_dungeon_02 153600 1664000 6 6
|
||||||
|
season2/metin2_map_empirewar01 665600 230400 2 2
|
||||||
|
season2/metin2_map_empirewar02 716800 230400 2 2
|
||||||
|
season2/metin2_map_empirewar03 768000 230400 2 2
|
||||||
|
season1/metin2_map_oxevent 742400 0 2 2
|
||||||
|
metin2_map_skipia_dungeon_boss 819200 1049600 2 2
|
||||||
|
metin2_map_skipia_dungeon_boss 819200 1100800 2 2
|
||||||
|
metin2_map_skipia_dungeon_boss2 819200 1152000 2 2
|
||||||
|
metin2_map_skipia_dungeon_boss 819200 1203200 2 2
|
||||||
|
metin2_map_devilsCatacomb 307200 1203200 8 8
|
||||||
|
metin2_map_spiderdungeon_03 51200 563200 3 3
|
||||||
|
Metin2_map_CapeDragonHead 1024000 1664000 6 6
|
||||||
|
metin2_map_Mt_Thunder 1126400 1510400 4 6
|
||||||
|
metin2_map_dawnmistwood 1177600 1664000 7 4
|
||||||
|
metin2_map_BayBlackSand 1049600 1510400 3 6
|
||||||
|
metin2_guild_village_01 204800 204800 2 2
|
||||||
|
metin2_guild_village_02 614400 384000 2 2
|
||||||
|
metin2_guild_village_03 256000 819200 2 2
|
||||||
|
metin2_map_n_flame_dungeon_01 742400 614400 3 3
|
||||||
|
metin2_map_n_snow_dungeon_01 512000 153600 4 3
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
CHAT_RGB_TALK = (255, 255, 255)
|
||||||
|
CHAT_RGB_INFO = (255, 200, 200)
|
||||||
|
CHAT_RGB_NOTICE = (255, 230, 186)
|
||||||
|
CHAT_RGB_PARTY = (0, 255, 228)
|
||||||
|
CHAT_RGB_GUILD = (253, 255, 124)
|
||||||
|
#CHAT_RGB_GUILD = (231, 215, 255)
|
||||||
|
CHAT_RGB_COMMAND = (167, 255, 212)
|
||||||
|
CHAT_RGB_SHOUT = (167, 255, 212)
|
||||||
|
CHAT_RGB_WHISPER = (74, 225, 74)
|
||||||
|
|
||||||
|
CHR_NAME_RGB_MOB = (235, 22, 9)
|
||||||
|
CHR_NAME_RGB_NPC = (122, 231, 93)
|
||||||
|
CHR_NAME_RGB_PC = (255, 215, 76)
|
||||||
|
CHR_NAME_RGB_PK = (180, 100, 0)
|
||||||
|
CHR_NAME_RGB_PVP = (238, 54, 223)
|
||||||
|
CHR_NAME_RGB_PARTY = (128, 192, 255)
|
||||||
|
CHR_NAME_RGB_WARP = (136, 218, 241)
|
||||||
|
CHR_NAME_RGB_WAYPOINT = (255, 255, 255)
|
||||||
|
|
||||||
|
CHR_NAME_RGB_EMPIRE_MOB = (235, 22, 9)
|
||||||
|
CHR_NAME_RGB_EMPIRE_NPC = (122, 231, 93)
|
||||||
|
CHR_NAME_RGB_EMPIRE_PC_A = (157, 0, 0)
|
||||||
|
CHR_NAME_RGB_EMPIRE_PC_B = (222, 160, 47)
|
||||||
|
CHR_NAME_RGB_EMPIRE_PC_C = (23, 30, 138)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TITLE_RGB_GOOD_4 = ( 0, 204, 255)
|
||||||
|
TITLE_RGB_GOOD_3 = ( 0, 144, 255)
|
||||||
|
TITLE_RGB_GOOD_2 = ( 92, 110, 255)
|
||||||
|
TITLE_RGB_GOOD_1 = (155, 155, 255)
|
||||||
|
TITLE_RGB_NORMAL = (255, 255, 255)
|
||||||
|
TITLE_RGB_EVIL_1 = (207, 117, 0)
|
||||||
|
TITLE_RGB_EVIL_2 = (235, 83, 0)
|
||||||
|
TITLE_RGB_EVIL_3 = (227, 0, 0)
|
||||||
|
TITLE_RGB_EVIL_4 = (255, 0, 0)
|
||||||
@@ -0,0 +1,903 @@
|
|||||||
|
import app
|
||||||
|
import grp
|
||||||
|
import wndMgr
|
||||||
|
import ui
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import stat
|
||||||
|
import chrmgr
|
||||||
|
import chr
|
||||||
|
import net
|
||||||
|
import background
|
||||||
|
import snd
|
||||||
|
import net
|
||||||
|
import player
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
class Console(object):
|
||||||
|
def __init__(self, output):
|
||||||
|
self.dirNameList = []
|
||||||
|
self.fileNameList = []
|
||||||
|
|
||||||
|
self.output = output
|
||||||
|
self.curPathName = "D:\\Ymir Work\\"
|
||||||
|
self.collision = 0
|
||||||
|
|
||||||
|
self.bgPartDict = {
|
||||||
|
"terrain":background.PART_TERRAIN,
|
||||||
|
"object":background.PART_OBJECT,
|
||||||
|
"cloud":background.PART_CLOUD,
|
||||||
|
"tree":background.PART_TREE,
|
||||||
|
"water":background.PART_WATER,
|
||||||
|
"sky":background.PART_SKY,
|
||||||
|
}
|
||||||
|
|
||||||
|
self.bgSortDict = {
|
||||||
|
"distance":background.DISTANCE_SORT,
|
||||||
|
"texture":background.TEXTURE_SORT,
|
||||||
|
}
|
||||||
|
|
||||||
|
self.game = 0
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.output = 0
|
||||||
|
|
||||||
|
def BindGameClass(self, game):
|
||||||
|
self.game = game
|
||||||
|
|
||||||
|
def Exit(self):
|
||||||
|
"Exit Program"
|
||||||
|
app.Exit()
|
||||||
|
|
||||||
|
def EnablePerformanceTime(self, mode, isEnable):
|
||||||
|
app.EnablePerformanceTime(mode, int(isEnable))
|
||||||
|
|
||||||
|
def ReloadLocale(self):
|
||||||
|
"Reload Locale"
|
||||||
|
reload(localeInfo)
|
||||||
|
reload(uiScriptLocale)
|
||||||
|
self.Print("RELOAD LOCALE")
|
||||||
|
|
||||||
|
def ReloadDevel(self):
|
||||||
|
"ReloadDevel"
|
||||||
|
import consoleModule
|
||||||
|
import uiGuild
|
||||||
|
import uiInventory
|
||||||
|
reload(uiGuild)
|
||||||
|
self.Print("ReloadGuild")
|
||||||
|
reload(uiInventory)
|
||||||
|
self.Print("ReloadInventory")
|
||||||
|
|
||||||
|
def ShowPerformanceInfo(self):
|
||||||
|
"Shows Performance Info"
|
||||||
|
self.Print(app.GetInfo(app.INFO_ACTOR))
|
||||||
|
self.Print(app.GetInfo(app.INFO_ITEM))
|
||||||
|
self.Print(app.GetInfo(app.INFO_EFFECT))
|
||||||
|
self.Print(app.GetInfo(app.INFO_TEXTTAIL))
|
||||||
|
|
||||||
|
def Disconnect(self):
|
||||||
|
"Disconnect by sending unknown packet"
|
||||||
|
net.SendStrangePacket()
|
||||||
|
|
||||||
|
def ToggleActorDirectionLine(self):
|
||||||
|
"Shows character's direction line"
|
||||||
|
chrmgr.ToggleDirectionLine()
|
||||||
|
|
||||||
|
def RegisterCharacterEffect(self, effectType, effectFileName):
|
||||||
|
"Set character's effect state (state number, bone name, effect filename/number)"
|
||||||
|
if effectFileName.isdigit():
|
||||||
|
effectFileName = self.GetFileName(int(effectFileName))
|
||||||
|
|
||||||
|
effectFullPathFileName = self.GetFullPathName(effectFileName)
|
||||||
|
chrmgr.RegisterEffect(chrmgr.EFFECT_STATE+int(effectType), "", effectFullPathFileName)
|
||||||
|
self.Print("effect state %d: %s" % (int(effectType), effectFullPathFileName))
|
||||||
|
|
||||||
|
def SetCharacterAffect(self, affectType, isVisible):
|
||||||
|
"Set character's affect (number, visiblity 1|0)"
|
||||||
|
chrmgr.SetAffect(-1, int(affectType), int(isVisible))
|
||||||
|
self.Print("affect set %d: %d" % (int(affectType), int(isVisible)))
|
||||||
|
|
||||||
|
def SetCharacterEmoticon(self, EmoticonNum):
|
||||||
|
"Show emoticon (number)"
|
||||||
|
chrmgr.SetEmoticon(-1, int(EmoticonNum))
|
||||||
|
self.Print("Emoticon %d: %d" % (int(EmoticonNum), int(isVisible)))
|
||||||
|
|
||||||
|
def ShowPickedCharacterInfo(self):
|
||||||
|
"Show information of picked character"
|
||||||
|
vid=chrmgr.GetPickedVID()
|
||||||
|
info=chrmgr.GetVIDInfo(vid)
|
||||||
|
self.Print(info)
|
||||||
|
|
||||||
|
def ShowCharacterInfo(self, arg):
|
||||||
|
"Show information of character (vid)"
|
||||||
|
if arg.isdigit():
|
||||||
|
vid=int(arg)
|
||||||
|
else:
|
||||||
|
vid=0
|
||||||
|
|
||||||
|
info=chrmgr.GetVIDInfo(vid)
|
||||||
|
self.Print(info)
|
||||||
|
|
||||||
|
def SetWeaponTraceTexture(self, arg):
|
||||||
|
"Sets sword afterimage texture (filename)"
|
||||||
|
if arg.isdigit():
|
||||||
|
textureFileName = self.GetFileName(int(arg))
|
||||||
|
else:
|
||||||
|
textureFileName = arg
|
||||||
|
|
||||||
|
chr.WeaponTraceSetTexture(textureFileName)
|
||||||
|
|
||||||
|
def SetAutoCameraRotationSpeed(self, arg):
|
||||||
|
"Auto camera rotation speed (angle per sec)"
|
||||||
|
spd=float(arg)
|
||||||
|
player.SetAutoCameraRotationSpeed(spd)
|
||||||
|
|
||||||
|
self.Print("Auto camera rotation speed: %f" % (spd))
|
||||||
|
|
||||||
|
def SetWeaponTraceMode(self, *mode):
|
||||||
|
"Sword afterimage mode (0 = Use alpha, 1 = Use texture)"
|
||||||
|
if mode and mode[0].isdigit() and int(mode[0]):
|
||||||
|
chr.WeaponTraceUseTexture()
|
||||||
|
else:
|
||||||
|
chr.WeaponTraceUseAlpha()
|
||||||
|
|
||||||
|
def SetCollision(self, *mode):
|
||||||
|
"Show collison objects (0 | 1)"
|
||||||
|
if mode and mode[0].isdigit():
|
||||||
|
self.collision = int(mode[0])
|
||||||
|
else:
|
||||||
|
self.collision = not self.collision
|
||||||
|
|
||||||
|
def SetMovingSpeed(self, arg):
|
||||||
|
"Set walking speed"
|
||||||
|
chrmgr.SetMovingSpeed(int(arg))
|
||||||
|
|
||||||
|
def SetMusicVolume(self, arg):
|
||||||
|
"Set BGM volumn (0 ~ 1.0)"
|
||||||
|
snd.SetMusicVolume(float(arg))
|
||||||
|
|
||||||
|
def SetSoundVolume(self, arg):
|
||||||
|
"Set Effect sound volumn (0 ~ 5)"
|
||||||
|
snd.SetSoundVolume(int(arg))
|
||||||
|
|
||||||
|
def SetSoundScale(self, arg):
|
||||||
|
"3D Sound scale (default : 200)"
|
||||||
|
snd.SetSoundScale(int(arg))
|
||||||
|
|
||||||
|
def SetAmbienceSoundScale(self, arg):
|
||||||
|
"3D Ambience sound scale (default : 200)"
|
||||||
|
snd.SetAmbienceSoundScale(int(arg))
|
||||||
|
|
||||||
|
def SetCoolTime(self):
|
||||||
|
"Cooltime toggle"
|
||||||
|
flag = player.ToggleCoolTime()
|
||||||
|
if flag:
|
||||||
|
self.Print("Cooltime will be applied")
|
||||||
|
else:
|
||||||
|
self.Print("Cooltime disabled")
|
||||||
|
|
||||||
|
def SetLevelLimit(self):
|
||||||
|
"Sets Level limit"
|
||||||
|
flag = player.ToggleLevelLimit()
|
||||||
|
if flag:
|
||||||
|
self.Print("Level limit will be applied")
|
||||||
|
else:
|
||||||
|
self.Print("Level limit disabled")
|
||||||
|
|
||||||
|
def ShowCursor(self):
|
||||||
|
app.ShowCursor()
|
||||||
|
|
||||||
|
def HideCursor(self):
|
||||||
|
app.HideCursor()
|
||||||
|
|
||||||
|
def Print(self, msg):
|
||||||
|
self.output.Print(msg)
|
||||||
|
|
||||||
|
def RefreshPath(self):
|
||||||
|
self.SetPath(self.curPathName)
|
||||||
|
|
||||||
|
def SetPath(self, newPathName):
|
||||||
|
if '\\'!=newPathName[-1]:
|
||||||
|
newPathName=newPathName+'\\'
|
||||||
|
|
||||||
|
if os.access(newPathName, os.R_OK)==0:
|
||||||
|
self.Print(newPathName+" Cannot find path")
|
||||||
|
return
|
||||||
|
|
||||||
|
nameList=os.listdir(newPathName)
|
||||||
|
|
||||||
|
dirNameList=[]
|
||||||
|
fileNameList=[]
|
||||||
|
for sName in nameList:
|
||||||
|
mode=os.stat(newPathName+sName)[stat.ST_MODE]
|
||||||
|
if stat.S_ISDIR(mode):
|
||||||
|
dirNameList.append(sName)
|
||||||
|
else:
|
||||||
|
fileNameList.append(sName)
|
||||||
|
|
||||||
|
self.curPathName=newPathName
|
||||||
|
self.dirNameList=dirNameList
|
||||||
|
self.fileNameList=fileNameList
|
||||||
|
|
||||||
|
self.ShowPath()
|
||||||
|
|
||||||
|
def GetPath(self):
|
||||||
|
return self.curPathName
|
||||||
|
|
||||||
|
def GetDirName(self, iDir):
|
||||||
|
if (len(self.dirNameList)>iDir):
|
||||||
|
return self.dirNameList[iDir]
|
||||||
|
else:
|
||||||
|
print len(self.dirNameList)
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def GetFileName(self, iFile):
|
||||||
|
if (len(self.fileNameList)>iFile):
|
||||||
|
return self.fileNameList[iFile]
|
||||||
|
else:
|
||||||
|
print len(self.fileNameList)
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def MoveParentPath(self):
|
||||||
|
"Go to Parent directory"
|
||||||
|
newPathName=self.GetPath()
|
||||||
|
|
||||||
|
lastPos=-1
|
||||||
|
if '\\'==newPathName[-1]:
|
||||||
|
lastPos=-2
|
||||||
|
|
||||||
|
lastPos=newPathName.rfind('\\', 0, lastPos)
|
||||||
|
if 0>lastPos:
|
||||||
|
self.Print("Here is root")
|
||||||
|
return
|
||||||
|
|
||||||
|
newPathName=newPathName[0:lastPos]+'\\'
|
||||||
|
|
||||||
|
self.SetPath(newPathName)
|
||||||
|
|
||||||
|
def GetFullPathName(self, sPathName):
|
||||||
|
sParentPathName=self.GetPath()
|
||||||
|
|
||||||
|
if '\\'!=sParentPathName[-1]:
|
||||||
|
sParentPathName=sParentPathName+'\\'
|
||||||
|
|
||||||
|
return sParentPathName+sPathName
|
||||||
|
|
||||||
|
def MoveChildPath(self, directory):
|
||||||
|
"[Directory name/number] change to child directory"
|
||||||
|
if ""==directory:
|
||||||
|
self.Print("You need directory name or number")
|
||||||
|
return
|
||||||
|
|
||||||
|
if directory.isdigit():
|
||||||
|
directory=self.GetDirName(int(directory))
|
||||||
|
|
||||||
|
newPathName=self.GetFullPathName(directory)
|
||||||
|
|
||||||
|
self.SetPath(newPathName)
|
||||||
|
|
||||||
|
def SetHitEffect(self, arg):
|
||||||
|
"Sets hit effect"
|
||||||
|
if arg.isdigit():
|
||||||
|
effectFileName = self.GetFileName(int(arg))
|
||||||
|
else:
|
||||||
|
effectFileName = arg
|
||||||
|
|
||||||
|
effectFullPathFileName=self.GetFullPathName(EffectFileName)
|
||||||
|
chrmgr.RegisterEffect(chrmgr.EFFECT_HIT, "", effectFullPathFileName)
|
||||||
|
|
||||||
|
self.Print("Hit effect: "+effectFullPathFileName)
|
||||||
|
|
||||||
|
def SetStunEffect(self, arg):
|
||||||
|
"Sets stun effect"
|
||||||
|
if arg.isdigit():
|
||||||
|
effectFileName = self.GetFileName(int(arg))
|
||||||
|
else:
|
||||||
|
effectFileName = arg
|
||||||
|
|
||||||
|
effectFullPathFileName = self.GetFullPathName(effectFileName)
|
||||||
|
chrmgr.RegisterEffect(chrmgr.EFFECT_STUN, "Bip01 Head", effectFullPathFileName)
|
||||||
|
|
||||||
|
self.Print("Stun effect: "+effectFullPathFileName)
|
||||||
|
|
||||||
|
def SetDustEffect(self, arg):
|
||||||
|
"Sets dirt effect"
|
||||||
|
if arg.isdigit():
|
||||||
|
effectFileName = self.GetFileName(int(arg))
|
||||||
|
else:
|
||||||
|
effectFileName = arg
|
||||||
|
|
||||||
|
effectFullPathFileName = self.GetFullPathName(effectFileName)
|
||||||
|
chrmgr.RegisterEffect(chrmgr.EFFECT_DUST, "", effectFullPathFileName)
|
||||||
|
|
||||||
|
self.Print("Dirt effect: "+effectFullPathFileName)
|
||||||
|
|
||||||
|
def SetDustGap(self, arg):
|
||||||
|
"Sets dirt effect gap"
|
||||||
|
if arg.isdigit() == 0:
|
||||||
|
self.Print("Dirt effect gap argument must be a number")
|
||||||
|
else:
|
||||||
|
gap = int(arg)
|
||||||
|
chrmgr.SetDustGap(gap)
|
||||||
|
self.Print("Dirt effect gap: %d" % (gap))
|
||||||
|
|
||||||
|
def ShowBackgroundPart(self, arg):
|
||||||
|
"Show background part"
|
||||||
|
try:
|
||||||
|
background.SetVisiblePart(self.bgPartDict[arg], 1);
|
||||||
|
except KeyError:
|
||||||
|
self.Print("Unknown part: ", arg);
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
|
def HideBackgroundPart(self, arg):
|
||||||
|
"Hide background part"
|
||||||
|
try:
|
||||||
|
background.SetVisiblePart(self.bgPartDict[arg], 0);
|
||||||
|
except KeyError:
|
||||||
|
self.Print("Unknown part: ", arg);
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
|
def SetShadowLevel(self, arg):
|
||||||
|
"Shadow level setting (0~5)"
|
||||||
|
if arg.isdigit() == 0:
|
||||||
|
self.Print("Shadow setting must be a number")
|
||||||
|
else:
|
||||||
|
level = int(arg)
|
||||||
|
|
||||||
|
if level < 0 or level > 5:
|
||||||
|
self.Print("Shadow level range is 0~5")
|
||||||
|
else:
|
||||||
|
background.SetShadowLevel(level)
|
||||||
|
self.Print("Shadow level: %d" % (level))
|
||||||
|
|
||||||
|
def SetSplatLimit(self, arg):
|
||||||
|
"Splat number limit"
|
||||||
|
if arg.isdigit() == 0:
|
||||||
|
self.Print("Splat number limit must be a number")
|
||||||
|
else:
|
||||||
|
limit = int(arg)
|
||||||
|
|
||||||
|
background.SetSplatLimit(limit)
|
||||||
|
self.Print("Splat number limit: %d" % (limit))
|
||||||
|
|
||||||
|
def SelectViewDistanceNum(self, arg):
|
||||||
|
"View distance (0~4)"
|
||||||
|
if arg.isdigit() == 0:
|
||||||
|
self.Print("Enter between 0 to 4")
|
||||||
|
else:
|
||||||
|
settingnum = int(arg)
|
||||||
|
|
||||||
|
if settingnum < 0 or settingnum > 4:
|
||||||
|
self.Print("View distance range is 0 to 4")
|
||||||
|
|
||||||
|
else:
|
||||||
|
background.SelectViewDistanceNum(settingnum)
|
||||||
|
self.Print("View distance: %d" % (settingnum))
|
||||||
|
|
||||||
|
def SetBGLoading(self, bBGLoading):
|
||||||
|
"Background loading (0, 1)"
|
||||||
|
bResultBoolean = int(bBGLoading)
|
||||||
|
|
||||||
|
if bResultBoolean != 0 and bResultBoolean != 1:
|
||||||
|
self.Print("Enter 0 or 1")
|
||||||
|
else:
|
||||||
|
background.SetBGLoading(bResultBoolean)
|
||||||
|
self.Print("Background loading: %d" % (bResultBoolean))
|
||||||
|
|
||||||
|
def SetTerrainRenderSort(self, arg):
|
||||||
|
"Terrain rendering type"
|
||||||
|
try:
|
||||||
|
background.SetRenderSort(self.bgSortDict[arg]);
|
||||||
|
except KeyError:
|
||||||
|
self.Print("Unknown part: ", arg);
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
|
def SetTransparentTree(self, arg):
|
||||||
|
"Tree's leaf transparency"
|
||||||
|
bTransparent = int(arg)
|
||||||
|
try:
|
||||||
|
background.SetTransparentTree(bTransparent);
|
||||||
|
except KeyError:
|
||||||
|
self.Print("must be 0 or 1: ", bTransparent);
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
|
def WarpTest(self, warpX, warpY):
|
||||||
|
"WarpTest : warp dwX dwY"
|
||||||
|
iWarpX = int(warpX)
|
||||||
|
iWarpY = int(warpY)
|
||||||
|
try:
|
||||||
|
background.Destroy()
|
||||||
|
background.Initialize()
|
||||||
|
background.WarpTest(iWarpX, iWarpY);
|
||||||
|
background.RegisterEnvironmentData(0, "d:/ymir work/environment/b3.msenv")
|
||||||
|
background.SetEnvironmentData(0)
|
||||||
|
background.SetShadowLevel(background.SHADOW_ALL)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("consoleModule.Console.WarpTest")
|
||||||
|
|
||||||
|
def ToggleDebugInfo(self):
|
||||||
|
"Show DebugInfo"
|
||||||
|
net.ToggleGameDebugInfo()
|
||||||
|
|
||||||
|
def ShowPath(self):
|
||||||
|
"Show current path"
|
||||||
|
self.Print("Current path is "+self.GetPath())
|
||||||
|
|
||||||
|
def ShowList(self):
|
||||||
|
"Show current path's list"
|
||||||
|
self.ShowDirList()
|
||||||
|
self.ShowFileList()
|
||||||
|
|
||||||
|
def ShowDirList(self):
|
||||||
|
"Show current path's child directories"
|
||||||
|
self.Print(self.GetPath()+" directories:")
|
||||||
|
self.ShowNameList(self.dirNameList)
|
||||||
|
self.Print("")
|
||||||
|
|
||||||
|
def ShowFileList(self, Filter=[]):
|
||||||
|
"Show current path's files (extension filter)"
|
||||||
|
self.Print(self.GetPath()+" files:")
|
||||||
|
self.ShowNameList(self.fileNameList, Filter)
|
||||||
|
self.Print("")
|
||||||
|
|
||||||
|
def ShowEffectList(self):
|
||||||
|
"Show current path's effect"
|
||||||
|
self.Print(self.GetPath()+" effects:")
|
||||||
|
self.ShowNameList(self.fileNameList, ["mse"])
|
||||||
|
self.Print("")
|
||||||
|
|
||||||
|
def ShowWeb(self):
|
||||||
|
"ShowWeb"
|
||||||
|
if app.IsWebPageMode():
|
||||||
|
app.HideWebPage()
|
||||||
|
else:
|
||||||
|
app.ShowWebPage("http://wiki.metin.co.kr/metin1help/01.htm", (0, 0, 320, 600))
|
||||||
|
|
||||||
|
def ShowUI(self):
|
||||||
|
"Shows UI"
|
||||||
|
self.game.CheckGameButton()
|
||||||
|
self.game.interface.ShowDefaultWindows()
|
||||||
|
self.game.interface.wndChat.Show()
|
||||||
|
|
||||||
|
def HideUI(self):
|
||||||
|
"Hides UI"
|
||||||
|
self.game.interface.HideAllWindows()
|
||||||
|
self.game.interface.wndChat.Hide()
|
||||||
|
|
||||||
|
def SetCameraSpeed(self, percentage):
|
||||||
|
"Sets camera speed (Default = 100)"
|
||||||
|
app.SetCameraSpeed(int(percentage))
|
||||||
|
|
||||||
|
def SaveCameraSetting(self, filename):
|
||||||
|
"Save current camera attributes (filename)"
|
||||||
|
app.SaveCameraSetting(filename)
|
||||||
|
|
||||||
|
def LoadCameraSetting(self, filename):
|
||||||
|
"Load camera attributes (filename)"
|
||||||
|
if not app.LoadCameraSetting(filename):
|
||||||
|
self.Print("Could not load camera attribute")
|
||||||
|
|
||||||
|
def SetDefaultCamera(self):
|
||||||
|
"Return to default camera attribute"
|
||||||
|
app.SetDefaultCamera()
|
||||||
|
|
||||||
|
def ShowClock(self, second):
|
||||||
|
self.game.ShowClock(int(second))
|
||||||
|
|
||||||
|
def HideClock(self):
|
||||||
|
self.game.HideClock()
|
||||||
|
|
||||||
|
def ShowNotice(self):
|
||||||
|
app.SetVisibleNotice(TRUE)
|
||||||
|
self.Print("Show Notice")
|
||||||
|
|
||||||
|
def HideNotice(self):
|
||||||
|
app.SetVisibleNotice(FALSE)
|
||||||
|
self.Print("Hide Notice")
|
||||||
|
|
||||||
|
def SetSight(self, range):
|
||||||
|
"Set Force Sight Range"
|
||||||
|
app.SetSightRange(int(range))
|
||||||
|
|
||||||
|
def SetComboType(self, type):
|
||||||
|
chr.testSetComboType(int(type))
|
||||||
|
|
||||||
|
def SetSkillGroupFake(self, index):
|
||||||
|
"""테스트 코드"""
|
||||||
|
net.SetSkillGroupFake(int(index))
|
||||||
|
self.Print(" SetSkillGroupFake : %d" % int(index))
|
||||||
|
|
||||||
|
def SetEmpireLanguageMode(self, mode):
|
||||||
|
net.SetEmpireLanguageMode(int(mode))
|
||||||
|
self.Print(" SetEmpireLanguageMode : %d" % int(mode))
|
||||||
|
|
||||||
|
def SetCharacterRenderModeTypeAdd(self, color):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
print " -> SetCharacterRenderModeTypeAdd", vid, color
|
||||||
|
chr.testSetAddRenderMode(vid, int(color,16))
|
||||||
|
|
||||||
|
def SetCharacterRenderModeTypeMod(self, color):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
print " -> SetCharacterRenderModeTypeMod", vid, color, int(color,16)
|
||||||
|
chr.testSetModulateRenderMode(vid, int(color,16))
|
||||||
|
|
||||||
|
def SetCharacterRenderModeTypeAddRGB(self, r, g, b):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
print " -> SetCharacterRenderModeTypeAddRGB", vid, r, g, b
|
||||||
|
chr.testSetAddRenderModeRGB(vid, float(r)/255.0, float(g)/255.0, float(b)/255.0)
|
||||||
|
|
||||||
|
def SetCharacterRenderModeTypeModRGB(self, r, g, b):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
print " -> SetCharacterRenderModeTypeModRGB", vid, r, g, b
|
||||||
|
chr.testSetModulateRenderModeRGB(vid, float(r)/255.0, float(g)/255.0, float(b)/255.0)
|
||||||
|
|
||||||
|
def SetCharacterRenderModeSpecular(self, alpha):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
print " -> SetCharacterRenderModeSpecular", vid, alpha
|
||||||
|
chr.testSetSpecularRenderMode(vid, float(alpha))
|
||||||
|
|
||||||
|
def RestoreCharacterRenderModeType(self):
|
||||||
|
vid = player.GetTargetVID()
|
||||||
|
chr.testRestoreRenderMode(vid)
|
||||||
|
|
||||||
|
|
||||||
|
def ShowNameList(self, lstsName, lstsFilter=None):
|
||||||
|
if len(lstsName)==0:
|
||||||
|
self.Print("None")
|
||||||
|
return
|
||||||
|
|
||||||
|
if lstsFilter:
|
||||||
|
isFilter=1
|
||||||
|
else:
|
||||||
|
isFilter=0
|
||||||
|
|
||||||
|
sLine=""
|
||||||
|
iCol=0
|
||||||
|
|
||||||
|
iName=0
|
||||||
|
for sName in lstsName:
|
||||||
|
if isFilter:
|
||||||
|
iDotPos=sName.rfind('.', 0, -1)
|
||||||
|
if iDotPos<0:
|
||||||
|
iName=iName+1
|
||||||
|
continue
|
||||||
|
|
||||||
|
if (sName[iDotPos+1:] in lstsFilter)==0:
|
||||||
|
iName=iName+1
|
||||||
|
continue
|
||||||
|
|
||||||
|
sLine=sLine+"%3d %-15s " % (iName, sName)
|
||||||
|
|
||||||
|
if iCol>4:
|
||||||
|
iCol=0
|
||||||
|
self.Print(sLine)
|
||||||
|
sLine=""
|
||||||
|
|
||||||
|
iCol=iCol+1
|
||||||
|
|
||||||
|
iName=iName+1
|
||||||
|
|
||||||
|
if ""!=sLine:
|
||||||
|
self.Print(sLine)
|
||||||
|
|
||||||
|
class ConsoleWindow(ui.Window):
|
||||||
|
|
||||||
|
BACK_GROUND_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.5)
|
||||||
|
EDIT_LINE_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 1.0)
|
||||||
|
BUTTON_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 1.0)
|
||||||
|
HEIGHT = 200
|
||||||
|
LINE_STEP = 15
|
||||||
|
MAX_LINE_COUNT = 50
|
||||||
|
|
||||||
|
class ConsoleEditLine(ui.EditLine):
|
||||||
|
def __init__(self):
|
||||||
|
ui.EditLine.__init__(self)
|
||||||
|
self.eventReturn = 0
|
||||||
|
self.eventEscape = 0
|
||||||
|
def __del__(self):
|
||||||
|
ui.EditLine.__del__(self)
|
||||||
|
|
||||||
|
def SetReturnEvent(self, event):
|
||||||
|
self.eventReturn = event
|
||||||
|
|
||||||
|
def SetEscapeEvent(self, event):
|
||||||
|
self.eventEscape = event
|
||||||
|
|
||||||
|
def OnIMEReturn(self):
|
||||||
|
text = self.GetText()
|
||||||
|
|
||||||
|
if len(text) > 0:
|
||||||
|
self.eventReturn(text)
|
||||||
|
|
||||||
|
else:
|
||||||
|
wndMgr.KillFocus()
|
||||||
|
self.eventEscape()
|
||||||
|
|
||||||
|
self.SetText("")
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.SetText("")
|
||||||
|
wndMgr.KillFocus()
|
||||||
|
self.eventEscape()
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
class ResizingButton(ui.DragButton):
|
||||||
|
|
||||||
|
BUTTON_NORMAL_COLOR = grp.GenerateColor(0.3320, 0.2929, 0.2578, 1.0)
|
||||||
|
BUTTON_OVER_COLOR = grp.GenerateColor(0.5320, 0.4929, 0.4578, 1.0)
|
||||||
|
BUTTON_LIGHT_OUTLINE_COLOR = grp.GenerateColor(0.6666, 0.6509, 0.6313, 1.0)
|
||||||
|
BUTTON_DARK_OUTLINE_COLOR = grp.GenerateColor(0.1647, 0.1450, 0.1294, 1.0)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.DragButton.__init__(self)
|
||||||
|
self.AddFlag("limit")
|
||||||
|
self.AddFlag("restrict_x")
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.DragButton.__del__(self)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
self.TextList = []
|
||||||
|
self.game = 0
|
||||||
|
self.Console = Console(self)
|
||||||
|
|
||||||
|
self.ResizingButton = self.ResizingButton()
|
||||||
|
self.ResizingButton.SetParent(self)
|
||||||
|
self.ResizingButton.SetSize(15, 15)
|
||||||
|
self.ResizingButton.SetPosition(100, 100)
|
||||||
|
self.ResizingButton.Show()
|
||||||
|
|
||||||
|
self.EditLine = self.ConsoleEditLine()
|
||||||
|
self.EditLine.SetParent(self)
|
||||||
|
self.EditLine.SetMax(100)
|
||||||
|
self.EditLine.SetFontName(localeInfo.UI_DEF_FONT)
|
||||||
|
self.EditLine.SetText("")
|
||||||
|
self.EditLine.Show()
|
||||||
|
|
||||||
|
from _weakref import ref
|
||||||
|
|
||||||
|
self.ResizingButton.SetMoveEvent(lambda s = ref(self): s().UpdatePosition())
|
||||||
|
self.EditLine.SetReturnEvent(lambda x,s = ref(self): s().ProcessCommand(x))
|
||||||
|
self.EditLine.SetEscapeEvent(lambda s = ref(self): s().CloseWindow())
|
||||||
|
|
||||||
|
self.UpdatePosition()
|
||||||
|
|
||||||
|
self.functionDict = {}
|
||||||
|
self.InitFunction()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def BindGameClass(self, game):
|
||||||
|
self.Console.BindGameClass(game)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Console.Close()
|
||||||
|
self.ResizingButton = 0
|
||||||
|
self.EditLine = 0
|
||||||
|
|
||||||
|
def SetConsoleSize(self, width, height):
|
||||||
|
self.ResizingButton.SetPosition(width-20, height-20)
|
||||||
|
self.UpdatePosition()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
grp.SetColor(self.BACK_GROUND_COLOR)
|
||||||
|
grp.RenderBar(self.gx, self.gy, self.width, self.height)
|
||||||
|
|
||||||
|
grp.SetColor(ConsoleWindow.EDIT_LINE_COLOR)
|
||||||
|
grp.RenderBar(self.gxEditLine-2, self.gyEditLine-3, self.width - 40, 17)
|
||||||
|
|
||||||
|
grp.SetColor(ConsoleWindow.BUTTON_COLOR)
|
||||||
|
grp.RenderBar(self.gxButton-2, self.gyButton-3, self.widthButton, self.heightButton)
|
||||||
|
|
||||||
|
def UpdatePosition(self):
|
||||||
|
|
||||||
|
self.width = self.GetWidth()
|
||||||
|
self.height = self.GetHeight()
|
||||||
|
self.widthButton = self.ResizingButton.GetWidth()
|
||||||
|
self.heightButton = self.ResizingButton.GetHeight()
|
||||||
|
(self.gx, self.gy) = self.GetGlobalPosition()
|
||||||
|
(self.gxButton, self.gyButton) = self.ResizingButton.GetGlobalPosition()
|
||||||
|
|
||||||
|
self.SetSize(self.gxButton - self.gx + 20, self.gyButton - self.gy + 20)
|
||||||
|
|
||||||
|
self.EditLine.SetSize(self.width-30, 16)
|
||||||
|
self.EditLine.SetPosition(7, self.height-20)
|
||||||
|
(self.gxEditLine, self.gyEditLine) = self.EditLine.GetGlobalPosition()
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
yPosition = (self.height-20) - self.LINE_STEP
|
||||||
|
ItemCount = len(self.TextList)
|
||||||
|
|
||||||
|
for i in xrange(ItemCount):
|
||||||
|
TextLine = self.TextList[ItemCount-i-1]
|
||||||
|
|
||||||
|
TextLine.SetPosition(10, yPosition)
|
||||||
|
yPosition -= self.LINE_STEP
|
||||||
|
|
||||||
|
if yPosition < 0:
|
||||||
|
TextLine.Hide()
|
||||||
|
else:
|
||||||
|
TextLine.Show()
|
||||||
|
|
||||||
|
def OpenWindow(self):
|
||||||
|
|
||||||
|
self.EditLine.SetFocus()
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
self.Console.RefreshPath()
|
||||||
|
|
||||||
|
def CloseWindow(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
## NOTE : 이곳에서 Command를 처리합니다 - [levites]
|
||||||
|
def ProcessCommand(self, text):
|
||||||
|
|
||||||
|
if '/' == text[0]:
|
||||||
|
net.SendChatPacket(text)
|
||||||
|
return
|
||||||
|
|
||||||
|
Console=self.Console
|
||||||
|
Console.Print(">> "+text)
|
||||||
|
|
||||||
|
lstsArg=text.split()
|
||||||
|
if len(lstsArg)==0:
|
||||||
|
return
|
||||||
|
|
||||||
|
sCmd=lstsArg[0]
|
||||||
|
|
||||||
|
if self.functionDict.has_key(sCmd):
|
||||||
|
try:
|
||||||
|
self.functionDict[sCmd](self.Console, *lstsArg[1:])
|
||||||
|
except Exception, e:
|
||||||
|
Console.Print(str(e))
|
||||||
|
#self.Console.Print(e)
|
||||||
|
#self.Console.Print(self.functionDict[sCmd].__doc__)
|
||||||
|
else:
|
||||||
|
if sCmd == 'help' or sCmd == 'h':
|
||||||
|
try:
|
||||||
|
k = lstsArg[1]
|
||||||
|
v = self.functionDict[k]
|
||||||
|
argcount = v.im_func.func_code.co_argcount - 1 # -1 for self
|
||||||
|
if v.im_func.func_code.co_flags & 4:
|
||||||
|
argcount+=1
|
||||||
|
argnames = v.im_func.func_code.co_varnames[1:argcount+1]
|
||||||
|
if argcount:
|
||||||
|
Console.Print("%s(%s) : %s" % (k,argcount, v.__doc__))
|
||||||
|
Console.Print(" arg : %s" % argnames)
|
||||||
|
else:
|
||||||
|
Console.Print("%s : %s" % (k,v.__doc__))
|
||||||
|
except:
|
||||||
|
for k,v in self.functionDict.iteritems():
|
||||||
|
argcount = v.im_func.func_code.co_argcount - 1 # -1 for self
|
||||||
|
if v.im_func.func_code.co_flags & 4:
|
||||||
|
argcount+=1
|
||||||
|
if argcount:
|
||||||
|
Console.Print("%s(%s) : %s" % (k,argcount, v.__doc__))
|
||||||
|
else:
|
||||||
|
Console.Print("%s : %s" % (k,v.__doc__))
|
||||||
|
Console.Print("? : All commands list")
|
||||||
|
Console.Print("h : Help for all commands")
|
||||||
|
Console.Print("h blah : Help for blah")
|
||||||
|
|
||||||
|
Console.Print("")
|
||||||
|
elif sCmd == '?':
|
||||||
|
list = self.functionDict.keys()
|
||||||
|
list.sort()
|
||||||
|
Console.ShowNameList(list)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def InitFunction(self):
|
||||||
|
#self.AddFunction("help", Console.PrintHelp)
|
||||||
|
#self.AddFunction("?", Console.PrintHelp)
|
||||||
|
|
||||||
|
self.AddFunction("exit", Console.Exit)
|
||||||
|
self.AddFunction("mvol", Console.SetMusicVolume)
|
||||||
|
self.AddFunction("svol", Console.SetSoundVolume)
|
||||||
|
self.AddFunction("snds", Console.SetSoundScale)
|
||||||
|
self.AddFunction("asnds", Console.SetAmbienceSoundScale)
|
||||||
|
self.AddFunction("mspd", Console.SetMovingSpeed)
|
||||||
|
self.AddFunction("pwd", Console.ShowPath)
|
||||||
|
self.AddFunction("ls", Console.ShowList)
|
||||||
|
self.AddFunction("shadow", Console.SetShadowLevel)
|
||||||
|
self.AddFunction("splat", Console.SetSplatLimit)
|
||||||
|
self.AddFunction("distance", Console.SelectViewDistanceNum)
|
||||||
|
self.AddFunction("bgloading", Console.SetBGLoading)
|
||||||
|
self.AddFunction("terrainrender", Console.SetTerrainRenderSort)
|
||||||
|
self.AddFunction("transtree", Console.SetTransparentTree)
|
||||||
|
self.AddFunction("stune", Console.SetStunEffect)
|
||||||
|
self.AddFunction("duste", Console.SetDustEffect)
|
||||||
|
self.AddFunction("dustt", Console.SetDustGap)
|
||||||
|
self.AddFunction("hite", Console.SetHitEffect)
|
||||||
|
self.AddFunction("cd", Console.MoveChildPath)
|
||||||
|
self.AddFunction("up", Console.MoveParentPath)
|
||||||
|
self.AddFunction("lsd", Console.ShowDirList)
|
||||||
|
self.AddFunction("lsf", Console.ShowFileList)
|
||||||
|
self.AddFunction("lse", Console.ShowEffectList)
|
||||||
|
self.AddFunction("show", Console.ShowBackgroundPart)
|
||||||
|
self.AddFunction("hide", Console.HideBackgroundPart)
|
||||||
|
self.AddFunction("debuginfo", Console.ToggleDebugInfo)
|
||||||
|
|
||||||
|
self.AddFunction("collision", Console.SetCollision)
|
||||||
|
self.AddFunction("colli", Console.SetCollision)
|
||||||
|
|
||||||
|
#self.AddFunction("wt", Console.SetWeaponTrace)
|
||||||
|
self.AddFunction("wtt", Console.SetWeaponTraceTexture)
|
||||||
|
self.AddFunction("wtm", Console.SetWeaponTraceMode)
|
||||||
|
|
||||||
|
self.AddFunction("disconnect", Console.Disconnect)
|
||||||
|
self.AddFunction("autorot", Console.SetAutoCameraRotationSpeed)
|
||||||
|
|
||||||
|
self.AddFunction("dirline", Console.ToggleActorDirectionLine)
|
||||||
|
self.AddFunction("pickc", Console.ShowPickedCharacterInfo)
|
||||||
|
self.AddFunction("infoc", Console.ShowCharacterInfo)
|
||||||
|
self.AddFunction("regchre", Console.RegisterCharacterEffect)
|
||||||
|
self.AddFunction("setchra", Console.SetCharacterAffect)
|
||||||
|
self.AddFunction("emoticon", Console.SetCharacterEmoticon)
|
||||||
|
self.AddFunction("perfinfo", Console.ShowPerformanceInfo)
|
||||||
|
self.AddFunction("reload_locale", Console.ReloadLocale)
|
||||||
|
self.AddFunction("re", Console.ReloadDevel)
|
||||||
|
self.AddFunction("perftime", Console.EnablePerformanceTime)
|
||||||
|
self.AddFunction("cooltime", Console.SetCoolTime)
|
||||||
|
self.AddFunction("levellimit", Console.SetLevelLimit)
|
||||||
|
self.AddFunction("showcursor", Console.ShowCursor)
|
||||||
|
self.AddFunction("hidecursor", Console.HideCursor)
|
||||||
|
|
||||||
|
self.AddFunction("warp", Console.WarpTest)
|
||||||
|
self.AddFunction("web", Console.ShowWeb)
|
||||||
|
|
||||||
|
self.AddFunction("showui", Console.ShowUI)
|
||||||
|
self.AddFunction("hideui", Console.HideUI)
|
||||||
|
|
||||||
|
self.AddFunction("setcspd", Console.SetCameraSpeed)
|
||||||
|
self.AddFunction("savecmr", Console.SaveCameraSetting)
|
||||||
|
self.AddFunction("loadcmr", Console.LoadCameraSetting)
|
||||||
|
self.AddFunction("setdefcmr", Console.SetDefaultCamera)
|
||||||
|
|
||||||
|
self.AddFunction("showclock", Console.ShowClock)
|
||||||
|
self.AddFunction("hideclock", Console.HideClock)
|
||||||
|
|
||||||
|
self.AddFunction("setsight", Console.SetSight)
|
||||||
|
|
||||||
|
self.AddFunction("setcombotype", Console.SetComboType)
|
||||||
|
self.AddFunction("setsk_fake", Console.SetSkillGroupFake)
|
||||||
|
|
||||||
|
self.AddFunction("trans", Console.SetEmpireLanguageMode)
|
||||||
|
|
||||||
|
self.AddFunction("shownotice", Console.ShowNotice)
|
||||||
|
self.AddFunction("hidenotice", Console.HideNotice)
|
||||||
|
|
||||||
|
self.AddFunction("setrmadd", Console.SetCharacterRenderModeTypeAdd)
|
||||||
|
self.AddFunction("setrmmod", Console.SetCharacterRenderModeTypeMod)
|
||||||
|
self.AddFunction("setrmaddrgb", Console.SetCharacterRenderModeTypeAddRGB)
|
||||||
|
self.AddFunction("setrmmodrgb", Console.SetCharacterRenderModeTypeModRGB)
|
||||||
|
self.AddFunction("setspec", Console.SetCharacterRenderModeSpecular)
|
||||||
|
self.AddFunction("restorerm", Console.RestoreCharacterRenderModeType)
|
||||||
|
|
||||||
|
def AddFunction(self, cmd, func):
|
||||||
|
self.functionDict[cmd] = func
|
||||||
|
|
||||||
|
def Print(self, text):
|
||||||
|
TextLine = ui.TextLine()
|
||||||
|
TextLine.SetParent(self)
|
||||||
|
TextLine.SetFontName(localeInfo.UI_DEF_FONT)
|
||||||
|
TextLine.Show()
|
||||||
|
TextLine.SetText(text)
|
||||||
|
self.TextList.append(TextLine)
|
||||||
|
|
||||||
|
count = len(self.TextList)
|
||||||
|
if count > self.MAX_LINE_COUNT:
|
||||||
|
for i in xrange(count - self.MAX_LINE_COUNT):
|
||||||
|
del self.TextList[0]
|
||||||
|
|
||||||
|
self.UpdatePosition()
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
# option
|
||||||
|
IN_GAME_SHOP_ENABLE = 1
|
||||||
|
CONSOLE_ENABLE = 0
|
||||||
|
|
||||||
|
PVPMODE_ENABLE = 1
|
||||||
|
PVPMODE_TEST_ENABLE = 0
|
||||||
|
PVPMODE_ACCELKEY_ENABLE = 1
|
||||||
|
PVPMODE_ACCELKEY_DELAY = 0.5
|
||||||
|
PVPMODE_PROTECTED_LEVEL = 30
|
||||||
|
|
||||||
|
FOG_LEVEL0 = 4800.0
|
||||||
|
FOG_LEVEL1 = 9600.0
|
||||||
|
FOG_LEVEL2 = 12800.0
|
||||||
|
FOG_LEVEL = FOG_LEVEL0
|
||||||
|
FOG_LEVEL_LIST=[FOG_LEVEL0, FOG_LEVEL1, FOG_LEVEL2]
|
||||||
|
|
||||||
|
CAMERA_MAX_DISTANCE_SHORT = 2500.0
|
||||||
|
CAMERA_MAX_DISTANCE_LONG = 3500.0
|
||||||
|
CAMERA_MAX_DISTANCE_LIST=[CAMERA_MAX_DISTANCE_SHORT, CAMERA_MAX_DISTANCE_LONG]
|
||||||
|
CAMERA_MAX_DISTANCE = CAMERA_MAX_DISTANCE_SHORT
|
||||||
|
|
||||||
|
CHRNAME_COLOR_INDEX = 0
|
||||||
|
|
||||||
|
ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
|
||||||
|
|
||||||
|
# constant
|
||||||
|
HIGH_PRICE = 500000
|
||||||
|
MIDDLE_PRICE = 50000
|
||||||
|
ERROR_METIN_STONE = 28960
|
||||||
|
SUB2_LOADING_ENABLE = 1
|
||||||
|
EXPANDED_COMBO_ENABLE = 1
|
||||||
|
CONVERT_EMPIRE_LANGUAGE_ENABLE = 1
|
||||||
|
USE_ITEM_WEAPON_TABLE_ATTACK_BONUS = 0
|
||||||
|
ADD_DEF_BONUS_ENABLE = 1
|
||||||
|
LOGIN_COUNT_LIMIT_ENABLE = 0
|
||||||
|
|
||||||
|
USE_SKILL_EFFECT_UPGRADE_ENABLE = 1
|
||||||
|
|
||||||
|
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = 1
|
||||||
|
GUILD_MONEY_PER_GSP = 100
|
||||||
|
GUILD_WAR_TYPE_SELECT_ENABLE = 1
|
||||||
|
TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE = 0
|
||||||
|
|
||||||
|
HAIR_COLOR_ENABLE = 1
|
||||||
|
ARMOR_SPECULAR_ENABLE = 1
|
||||||
|
WEAPON_SPECULAR_ENABLE = 1
|
||||||
|
SEQUENCE_PACKET_ENABLE = 1
|
||||||
|
KEEP_ACCOUNT_CONNETION_ENABLE = 1
|
||||||
|
MINIMAP_POSITIONINFO_ENABLE = 0
|
||||||
|
CONVERT_EMPIRE_LANGUAGE_ENABLE = 0
|
||||||
|
USE_ITEM_WEAPON_TABLE_ATTACK_BONUS = 0
|
||||||
|
ADD_DEF_BONUS_ENABLE = 0
|
||||||
|
LOGIN_COUNT_LIMIT_ENABLE = 0
|
||||||
|
PVPMODE_PROTECTED_LEVEL = 15
|
||||||
|
TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE = 10
|
||||||
|
|
||||||
|
isItemQuestionDialog = 0
|
||||||
|
|
||||||
|
def GET_ITEM_QUESTION_DIALOG_STATUS():
|
||||||
|
global isItemQuestionDialog
|
||||||
|
return isItemQuestionDialog
|
||||||
|
|
||||||
|
def SET_ITEM_QUESTION_DIALOG_STATUS(flag):
|
||||||
|
global isItemQuestionDialog
|
||||||
|
isItemQuestionDialog = flag
|
||||||
|
|
||||||
|
import app
|
||||||
|
import net
|
||||||
|
|
||||||
|
########################
|
||||||
|
|
||||||
|
def SET_DEFAULT_FOG_LEVEL():
|
||||||
|
global FOG_LEVEL
|
||||||
|
app.SetMinFog(FOG_LEVEL)
|
||||||
|
|
||||||
|
def SET_FOG_LEVEL_INDEX(index):
|
||||||
|
global FOG_LEVEL
|
||||||
|
global FOG_LEVEL_LIST
|
||||||
|
try:
|
||||||
|
FOG_LEVEL=FOG_LEVEL_LIST[index]
|
||||||
|
except IndexError:
|
||||||
|
FOG_LEVEL=FOG_LEVEL_LIST[0]
|
||||||
|
app.SetMinFog(FOG_LEVEL)
|
||||||
|
|
||||||
|
def GET_FOG_LEVEL_INDEX():
|
||||||
|
global FOG_LEVEL
|
||||||
|
global FOG_LEVEL_LIST
|
||||||
|
return FOG_LEVEL_LIST.index(FOG_LEVEL)
|
||||||
|
|
||||||
|
########################
|
||||||
|
|
||||||
|
def SET_DEFAULT_CAMERA_MAX_DISTANCE():
|
||||||
|
global CAMERA_MAX_DISTANCE
|
||||||
|
app.SetCameraMaxDistance(CAMERA_MAX_DISTANCE)
|
||||||
|
|
||||||
|
def SET_CAMERA_MAX_DISTANCE_INDEX(index):
|
||||||
|
global CAMERA_MAX_DISTANCE
|
||||||
|
global CAMERA_MAX_DISTANCE_LIST
|
||||||
|
try:
|
||||||
|
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[index]
|
||||||
|
except:
|
||||||
|
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[0]
|
||||||
|
|
||||||
|
app.SetCameraMaxDistance(CAMERA_MAX_DISTANCE)
|
||||||
|
|
||||||
|
def GET_CAMERA_MAX_DISTANCE_INDEX():
|
||||||
|
global CAMERA_MAX_DISTANCE
|
||||||
|
global CAMERA_MAX_DISTANCE_LIST
|
||||||
|
return CAMERA_MAX_DISTANCE_LIST.index(CAMERA_MAX_DISTANCE)
|
||||||
|
|
||||||
|
########################
|
||||||
|
|
||||||
|
import chrmgr
|
||||||
|
import player
|
||||||
|
import app
|
||||||
|
|
||||||
|
def SET_DEFAULT_CHRNAME_COLOR():
|
||||||
|
global CHRNAME_COLOR_INDEX
|
||||||
|
chrmgr.SetEmpireNameMode(CHRNAME_COLOR_INDEX)
|
||||||
|
|
||||||
|
def SET_CHRNAME_COLOR_INDEX(index):
|
||||||
|
global CHRNAME_COLOR_INDEX
|
||||||
|
CHRNAME_COLOR_INDEX=index
|
||||||
|
chrmgr.SetEmpireNameMode(index)
|
||||||
|
|
||||||
|
def GET_CHRNAME_COLOR_INDEX():
|
||||||
|
global CHRNAME_COLOR_INDEX
|
||||||
|
return CHRNAME_COLOR_INDEX
|
||||||
|
|
||||||
|
def SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(index):
|
||||||
|
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
|
||||||
|
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = index
|
||||||
|
|
||||||
|
def GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
|
||||||
|
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
|
||||||
|
return VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
|
||||||
|
|
||||||
|
def SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE():
|
||||||
|
global CONVERT_EMPIRE_LANGUAGE_ENABLE
|
||||||
|
net.SetEmpireLanguageMode(CONVERT_EMPIRE_LANGUAGE_ENABLE)
|
||||||
|
|
||||||
|
def SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS():
|
||||||
|
global USE_ITEM_WEAPON_TABLE_ATTACK_BONUS
|
||||||
|
player.SetWeaponAttackBonusFlag(USE_ITEM_WEAPON_TABLE_ATTACK_BONUS)
|
||||||
|
|
||||||
|
def SET_DEFAULT_USE_SKILL_EFFECT_ENABLE():
|
||||||
|
global USE_SKILL_EFFECT_UPGRADE_ENABLE
|
||||||
|
app.SetSkillEffectUpgradeEnable(USE_SKILL_EFFECT_UPGRADE_ENABLE)
|
||||||
|
|
||||||
|
def SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE():
|
||||||
|
global TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE
|
||||||
|
app.SetTwoHandedWeaponAttSpeedDecreaseValue(TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE)
|
||||||
|
|
||||||
|
########################
|
||||||
|
import item
|
||||||
|
|
||||||
|
ACCESSORY_MATERIAL_LIST = [50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 50632, 50633, 50634, 50635, 50636, 50637, 50638]
|
||||||
|
#ACCESSORY_MATERIAL_LIST = [50623, 50623, 50624, 50624, 50625, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 50632, 50633,
|
||||||
|
# 50623, 50623, 50624, 50624, ]
|
||||||
|
JewelAccessoryInfos = [
|
||||||
|
# jewel wrist neck ear
|
||||||
|
[ 50634, 14420, 16220, 17220 ],
|
||||||
|
[ 50635, 14500, 16500, 17500 ],
|
||||||
|
[ 50636, 14520, 16520, 17520 ],
|
||||||
|
[ 50637, 14540, 16540, 17540 ],
|
||||||
|
[ 50638, 14560, 16560, 17560 ],
|
||||||
|
]
|
||||||
|
def GET_ACCESSORY_MATERIAL_VNUM(vnum, subType):
|
||||||
|
ret = vnum
|
||||||
|
item_base = (vnum / 10) * 10
|
||||||
|
for info in JewelAccessoryInfos:
|
||||||
|
if item.ARMOR_WRIST == subType:
|
||||||
|
if info[1] == item_base:
|
||||||
|
return info[0]
|
||||||
|
elif item.ARMOR_NECK == subType:
|
||||||
|
if info[2] == item_base:
|
||||||
|
return info[0]
|
||||||
|
elif item.ARMOR_EAR == subType:
|
||||||
|
if info[3] == item_base:
|
||||||
|
return info[0]
|
||||||
|
|
||||||
|
if vnum >= 16210 and vnum <= 16219:
|
||||||
|
return 50625
|
||||||
|
|
||||||
|
if item.ARMOR_WRIST == subType:
|
||||||
|
WRIST_ITEM_VNUM_BASE = 14000
|
||||||
|
ret -= WRIST_ITEM_VNUM_BASE
|
||||||
|
elif item.ARMOR_NECK == subType:
|
||||||
|
NECK_ITEM_VNUM_BASE = 16000
|
||||||
|
ret -= NECK_ITEM_VNUM_BASE
|
||||||
|
elif item.ARMOR_EAR == subType:
|
||||||
|
EAR_ITEM_VNUM_BASE = 17000
|
||||||
|
ret -= EAR_ITEM_VNUM_BASE
|
||||||
|
|
||||||
|
type = ret/20
|
||||||
|
|
||||||
|
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
|
||||||
|
type = (ret-170) / 20
|
||||||
|
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return ACCESSORY_MATERIAL_LIST[type]
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
## ���� �߰��� '��Ʈ' ������ Ÿ��, ��Ʈ�� ���Ͽ� ���� ������ ����..
|
||||||
|
## ��Ʈ�� ���Ͻý����� �Ǽ������� �����ϱ� ������, �� �Ǽ����� ���� �ϵ��ڵ�ó�� �̷������� �� ���ۿ� ����..
|
||||||
|
|
||||||
|
def GET_BELT_MATERIAL_VNUM(vnum, subType = 0):
|
||||||
|
# ����� ��� ��Ʈ���� �ϳ��� ������(#18900)�� ���� ����
|
||||||
|
return 18900
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
## �ڵ����� (HP: #72723 ~ #72726, SP: #72727 ~ #72730)
|
||||||
|
|
||||||
|
# �ش� vnum�� �ڵ������ΰ�?
|
||||||
|
def IS_AUTO_POTION(itemVnum):
|
||||||
|
return IS_AUTO_POTION_HP(itemVnum) or IS_AUTO_POTION_SP(itemVnum)
|
||||||
|
|
||||||
|
# �ش� vnum�� HP �ڵ������ΰ�?
|
||||||
|
def IS_AUTO_POTION_HP(itemVnum):
|
||||||
|
if 72723 <= itemVnum and 72726 >= itemVnum:
|
||||||
|
return 1
|
||||||
|
elif itemVnum >= 76021 and itemVnum <= 76022: ## ���� �� ������ ȭ���� �ູ
|
||||||
|
return 1
|
||||||
|
elif itemVnum == 79012:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# �ش� vnum�� SP �ڵ������ΰ�?
|
||||||
|
def IS_AUTO_POTION_SP(itemVnum):
|
||||||
|
if 72727 <= itemVnum and 72730 >= itemVnum:
|
||||||
|
return 1
|
||||||
|
elif itemVnum >= 76004 and itemVnum <= 76005: ## ���� �� ������ ������ �ູ
|
||||||
|
return 1
|
||||||
|
elif itemVnum == 79013:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
## Aktivierbare Items (weisser Rahmen bei Aktivierung, wie Auto-Potion, ueber metinSocket[0])
|
||||||
|
## Hier eingetragene Items sind unabhaengig von Auto-Potion und koennen permanent oder
|
||||||
|
## zeitlich befristet aktiv sein (Reit-Siegel, kuenftig auch Traenke etc.)
|
||||||
|
|
||||||
|
MOUNT_SEAL_VNUM_LIST = (
|
||||||
|
71124, # Weisser Loewe Siegel
|
||||||
|
)
|
||||||
|
|
||||||
|
def IS_MOUNT_SEAL(itemVnum):
|
||||||
|
return itemVnum in MOUNT_SEAL_VNUM_LIST
|
||||||
|
|
||||||
|
def IS_ACTIVATABLE_ITEM(itemVnum):
|
||||||
|
return IS_MOUNT_SEAL(itemVnum)
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
g_isDebugMode=0
|
||||||
|
|
||||||
|
def SetDebugMode(isDebugMode):
|
||||||
|
global g_isDebugMode
|
||||||
|
g_isDebugMode=isDebugMode
|
||||||
|
|
||||||
|
def IsDebugMode():
|
||||||
|
global g_isDebugMode
|
||||||
|
return g_isDebugMode
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import item
|
||||||
|
|
||||||
|
# default_grade_need_count = [3, 3, 3, 3]
|
||||||
|
default_grade_need_count = [15, 10, 5, 3]
|
||||||
|
default_grade_fee = [30000, 50000, 70000, 100000]
|
||||||
|
default_step_need_count = [4, 3, 2, 1]
|
||||||
|
default_step_fee = [20000, 30000, 40000, 50000]
|
||||||
|
|
||||||
|
strength_fee = {
|
||||||
|
item.MATERIAL_DS_REFINE_NORMAL : 10000,
|
||||||
|
item.MATERIAL_DS_REFINE_BLESSED : 20000,
|
||||||
|
item.MATERIAL_DS_REFINE_HOLLY : 30000,
|
||||||
|
}
|
||||||
|
|
||||||
|
# 강화가 어느 단계 까지 가능 한지
|
||||||
|
# table(GRADE, STEP) = max strength.
|
||||||
|
default_strength_max_table = [
|
||||||
|
[2, 2, 3, 3, 4],
|
||||||
|
[3, 3, 3, 4, 4],
|
||||||
|
[4, 4, 4, 4, 4],
|
||||||
|
[4, 4, 4, 4, 5],
|
||||||
|
[4, 4, 4, 5, 6],
|
||||||
|
]
|
||||||
|
|
||||||
|
# 일단 기획적으로는 strength 강화의 경우, 강화석에 의해 fee가 셋팅되기 때문에,
|
||||||
|
# dragon_soul_refine_info에 넣지 않았다.
|
||||||
|
# (강화석만 넣어도 얼마 필요한지 보일 수 있도록 하기 위해)
|
||||||
|
# 다만 서버에서는 용혼석 타입 별로 강화석 fee를 셋팅할 수 있도록 해놨기 때문에,
|
||||||
|
# 만일 용혼석 별로 강화석 fee를 다르게 하고 싶다면,
|
||||||
|
# 클라 코드를 수정해야할 것이다.
|
||||||
|
default_refine_info = {
|
||||||
|
"grade_need_count" : default_grade_need_count,
|
||||||
|
"grade_fee" : default_grade_fee,
|
||||||
|
"step_need_count" : default_step_need_count,
|
||||||
|
"step_fee" : default_step_fee,
|
||||||
|
"strength_max_table" : default_strength_max_table,
|
||||||
|
}
|
||||||
|
|
||||||
|
dragon_soul_refine_info = {
|
||||||
|
11 : default_refine_info,
|
||||||
|
12 : default_refine_info,
|
||||||
|
13 : default_refine_info,
|
||||||
|
14 : default_refine_info,
|
||||||
|
15 : default_refine_info,
|
||||||
|
16 : default_refine_info,
|
||||||
|
}
|
||||||
|
|
||||||
+251
@@ -0,0 +1,251 @@
|
|||||||
|
import localeInfo
|
||||||
|
import player
|
||||||
|
import chrmgr
|
||||||
|
import chr
|
||||||
|
|
||||||
|
EMOTION_VERSION = 2
|
||||||
|
|
||||||
|
if EMOTION_VERSION == 2:
|
||||||
|
EMOTION_CLAP = 1
|
||||||
|
EMOTION_CONGRATULATION = 2
|
||||||
|
EMOTION_FORGIVE = 3
|
||||||
|
EMOTION_ANGRY = 4
|
||||||
|
EMOTION_ATTRACTIVE = 5
|
||||||
|
EMOTION_SAD = 6
|
||||||
|
EMOTION_SHY = 7
|
||||||
|
EMOTION_CHEERUP = 8
|
||||||
|
EMOTION_BANTER = 9
|
||||||
|
EMOTION_JOY = 10
|
||||||
|
EMOTION_CHEERS_1 = 11
|
||||||
|
EMOTION_CHEERS_2 = 12
|
||||||
|
EMOTION_DANCE_1 = 13
|
||||||
|
EMOTION_DANCE_2 = 14
|
||||||
|
EMOTION_DANCE_3 = 15
|
||||||
|
EMOTION_DANCE_4 = 16
|
||||||
|
EMOTION_DANCE_5 = 17
|
||||||
|
EMOTION_DANCE_6 = 18
|
||||||
|
EMOTION_KISS = 51
|
||||||
|
EMOTION_FRENCH_KISS = 52
|
||||||
|
EMOTION_SLAP = 53
|
||||||
|
|
||||||
|
EMOTION_DICT = {
|
||||||
|
EMOTION_CLAP : {"name": localeInfo.EMOTION_CLAP, "command":"/clap"},
|
||||||
|
EMOTION_DANCE_1 : {"name": localeInfo.EMOTION_DANCE_1, "command":"/dance1"},
|
||||||
|
EMOTION_DANCE_2 : {"name": localeInfo.EMOTION_DANCE_2, "command":"/dance2"},
|
||||||
|
EMOTION_DANCE_3 : {"name": localeInfo.EMOTION_DANCE_3, "command":"/dance3"},
|
||||||
|
EMOTION_DANCE_4 : {"name": localeInfo.EMOTION_DANCE_4, "command":"/dance4"},
|
||||||
|
EMOTION_DANCE_5 : {"name": localeInfo.EMOTION_DANCE_5, "command":"/dance5"},
|
||||||
|
EMOTION_DANCE_6 : {"name": localeInfo.EMOTION_DANCE_6, "command":"/dance6"},
|
||||||
|
EMOTION_CONGRATULATION : {"name": localeInfo.EMOTION_CONGRATULATION, "command":"/congratulation"},
|
||||||
|
EMOTION_FORGIVE : {"name": localeInfo.EMOTION_FORGIVE, "command":"/forgive"},
|
||||||
|
EMOTION_ANGRY : {"name": localeInfo.EMOTION_ANGRY, "command":"/angry"},
|
||||||
|
EMOTION_ATTRACTIVE : {"name": localeInfo.EMOTION_ATTRACTIVE, "command":"/attractive"},
|
||||||
|
EMOTION_SAD : {"name": localeInfo.EMOTION_SAD, "command":"/sad"},
|
||||||
|
EMOTION_SHY : {"name": localeInfo.EMOTION_SHY, "command":"/shy"},
|
||||||
|
EMOTION_CHEERUP : {"name": localeInfo.EMOTION_CHEERUP, "command":"/cheerup"},
|
||||||
|
EMOTION_BANTER : {"name": localeInfo.EMOTION_BANTER, "command":"/banter"},
|
||||||
|
EMOTION_JOY : {"name": localeInfo.EMOTION_JOY, "command":"/joy"},
|
||||||
|
EMOTION_CHEERS_1 : {"name": localeInfo.EMOTION_CHEERS_1, "command":"/cheer1"},
|
||||||
|
EMOTION_CHEERS_2 : {"name": localeInfo.EMOTION_CHEERS_2, "command":"/cheer2"},
|
||||||
|
EMOTION_KISS : {"name": localeInfo.EMOTION_CLAP_KISS, "command":"/kiss"},
|
||||||
|
EMOTION_FRENCH_KISS : {"name": localeInfo.EMOTION_FRENCH_KISS, "command":"/french_kiss"},
|
||||||
|
EMOTION_SLAP : {"name": localeInfo.EMOTION_SLAP, "command":"/slap"},
|
||||||
|
}
|
||||||
|
|
||||||
|
ICON_DICT = {
|
||||||
|
EMOTION_CLAP : "d:/ymir work/ui/game/windows/emotion_clap.sub",
|
||||||
|
EMOTION_CHEERS_1 : "d:/ymir work/ui/game/windows/emotion_cheers_1.sub",
|
||||||
|
EMOTION_CHEERS_2 : "d:/ymir work/ui/game/windows/emotion_cheers_2.sub",
|
||||||
|
|
||||||
|
EMOTION_DANCE_1 : "icon/action/dance1.tga",
|
||||||
|
EMOTION_DANCE_2 : "icon/action/dance2.tga",
|
||||||
|
|
||||||
|
EMOTION_CONGRATULATION : "icon/action/congratulation.tga",
|
||||||
|
EMOTION_FORGIVE : "icon/action/forgive.tga",
|
||||||
|
EMOTION_ANGRY : "icon/action/angry.tga",
|
||||||
|
EMOTION_ATTRACTIVE : "icon/action/attractive.tga",
|
||||||
|
EMOTION_SAD : "icon/action/sad.tga",
|
||||||
|
EMOTION_SHY : "icon/action/shy.tga",
|
||||||
|
EMOTION_CHEERUP : "icon/action/cheerup.tga",
|
||||||
|
EMOTION_BANTER : "icon/action/banter.tga",
|
||||||
|
EMOTION_JOY : "icon/action/joy.tga",
|
||||||
|
EMOTION_DANCE_1 : "icon/action/dance1.tga",
|
||||||
|
EMOTION_DANCE_2 : "icon/action/dance2.tga",
|
||||||
|
EMOTION_DANCE_3 : "icon/action/dance3.tga",
|
||||||
|
EMOTION_DANCE_4 : "icon/action/dance4.tga",
|
||||||
|
EMOTION_DANCE_5 : "icon/action/dance5.tga",
|
||||||
|
EMOTION_DANCE_6 : "icon/action/dance6.tga",
|
||||||
|
|
||||||
|
EMOTION_KISS : "d:/ymir work/ui/game/windows/emotion_kiss.sub",
|
||||||
|
EMOTION_FRENCH_KISS : "d:/ymir work/ui/game/windows/emotion_french_kiss.sub",
|
||||||
|
EMOTION_SLAP : "d:/ymir work/ui/game/windows/emotion_slap.sub",
|
||||||
|
}
|
||||||
|
|
||||||
|
ANI_DICT = {
|
||||||
|
chr.MOTION_CLAP : "clap.msa",
|
||||||
|
chr.MOTION_CHEERS_1 : "cheers_1.msa",
|
||||||
|
chr.MOTION_CHEERS_2 : "cheers_2.msa",
|
||||||
|
chr.MOTION_DANCE_1 : "dance_1.msa",
|
||||||
|
chr.MOTION_DANCE_2 : "dance_2.msa",
|
||||||
|
chr.MOTION_DANCE_3 : "dance_3.msa",
|
||||||
|
chr.MOTION_DANCE_4 : "dance_4.msa",
|
||||||
|
chr.MOTION_DANCE_5 : "dance_5.msa",
|
||||||
|
chr.MOTION_DANCE_6 : "dance_6.msa",
|
||||||
|
chr.MOTION_CONGRATULATION : "congratulation.msa",
|
||||||
|
chr.MOTION_FORGIVE : "forgive.msa",
|
||||||
|
chr.MOTION_ANGRY : "angry.msa",
|
||||||
|
chr.MOTION_ATTRACTIVE : "attractive.msa",
|
||||||
|
chr.MOTION_SAD : "sad.msa",
|
||||||
|
chr.MOTION_SHY : "shy.msa",
|
||||||
|
chr.MOTION_CHEERUP : "cheerup.msa",
|
||||||
|
chr.MOTION_BANTER : "banter.msa",
|
||||||
|
chr.MOTION_JOY : "joy.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_WARRIOR : "french_kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_ASSASSIN : "french_kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SURA : "french_kiss_with_sura.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SHAMAN : "french_kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_KISS_WITH_WARRIOR : "kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_KISS_WITH_ASSASSIN : "kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SURA : "kiss_with_sura.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SHAMAN : "kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_WARRIOR : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_ASSASSIN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SURA : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SHAMAN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_WARRIOR : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_ASSASSIN : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SURA : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SHAMAN : "slap_hurt.msa",
|
||||||
|
}
|
||||||
|
|
||||||
|
elif EMOTION_VERSION == 1:
|
||||||
|
EMOTION_CLAP = 1
|
||||||
|
EMOTION_CHEERS_1 = 2
|
||||||
|
EMOTION_CHEERS_2 = 3
|
||||||
|
EMOTION_DANCE_1 = 4
|
||||||
|
EMOTION_DANCE_2 = 5
|
||||||
|
EMOTION_KISS = 51
|
||||||
|
EMOTION_FRENCH_KISS = 52
|
||||||
|
EMOTION_SLAP = 53
|
||||||
|
|
||||||
|
EMOTION_DICT = {
|
||||||
|
EMOTION_CLAP : {"name": localeInfo.EMOTION_CLAP, "command":"/clap"},
|
||||||
|
EMOTION_CHEERS_1 : {"name": localeInfo.EMOTION_CHEERS_1, "command":"/cheer1"},
|
||||||
|
EMOTION_CHEERS_2 : {"name": localeInfo.EMOTION_CHEERS_2, "command":"/cheer2"},
|
||||||
|
EMOTION_DANCE_1 : {"name": localeInfo.EMOTION_DANCE_1, "command":"/dance1"},
|
||||||
|
EMOTION_DANCE_2 : {"name": localeInfo.EMOTION_DANCE_2, "command":"/dance2"},
|
||||||
|
EMOTION_KISS : {"name": localeInfo.EMOTION_CLAP_KISS, "command":"/kiss"},
|
||||||
|
EMOTION_FRENCH_KISS : {"name": localeInfo.EMOTION_FRENCH_KISS, "command":"/french_kiss"},
|
||||||
|
EMOTION_SLAP : {"name": localeInfo.EMOTION_SLAP, "command":"/slap"},
|
||||||
|
}
|
||||||
|
|
||||||
|
ICON_DICT = {
|
||||||
|
EMOTION_CLAP : "d:/ymir work/ui/game/windows/emotion_clap.sub",
|
||||||
|
EMOTION_CHEERS_1 : "d:/ymir work/ui/game/windows/emotion_cheers_1.sub",
|
||||||
|
EMOTION_CHEERS_2 : "d:/ymir work/ui/game/windows/emotion_cheers_2.sub",
|
||||||
|
|
||||||
|
EMOTION_DANCE_1 : "icon/action/dance1.tga",
|
||||||
|
EMOTION_DANCE_2 : "icon/action/dance2.tga",
|
||||||
|
|
||||||
|
EMOTION_KISS : "d:/ymir work/ui/game/windows/emotion_kiss.sub",
|
||||||
|
EMOTION_FRENCH_KISS : "d:/ymir work/ui/game/windows/emotion_french_kiss.sub",
|
||||||
|
EMOTION_SLAP : "d:/ymir work/ui/game/windows/emotion_slap.sub",
|
||||||
|
}
|
||||||
|
|
||||||
|
ANI_DICT = {
|
||||||
|
chr.MOTION_CLAP : "clap.msa",
|
||||||
|
chr.MOTION_CHEERS_1 : "cheers_1.msa",
|
||||||
|
chr.MOTION_CHEERS_2 : "cheers_2.msa",
|
||||||
|
chr.MOTION_DANCE_1 : "dance_1.msa",
|
||||||
|
chr.MOTION_DANCE_2 : "dance_2.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_WARRIOR : "french_kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_ASSASSIN : "french_kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SURA : "french_kiss_with_sura.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SHAMAN : "french_kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_KISS_WITH_WARRIOR : "kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_KISS_WITH_ASSASSIN : "kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SURA : "kiss_with_sura.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SHAMAN : "kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_WARRIOR : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_ASSASSIN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SURA : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SHAMAN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_WARRIOR : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_ASSASSIN : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SURA : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SHAMAN : "slap_hurt.msa",
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
EMOTION_CLAP = 1
|
||||||
|
EMOTION_CHEERS_1 = 2
|
||||||
|
EMOTION_CHEERS_2 = 3
|
||||||
|
EMOTION_KISS = 51
|
||||||
|
EMOTION_FRENCH_KISS = 52
|
||||||
|
EMOTION_SLAP = 53
|
||||||
|
|
||||||
|
EMOTION_DICT = {
|
||||||
|
EMOTION_CLAP : {"name": localeInfo.EMOTION_CLAP, "command":"/clap"},
|
||||||
|
EMOTION_CHEERS_1 : {"name": localeInfo.EMOTION_CHEERS_1, "command":"/cheer1"},
|
||||||
|
EMOTION_CHEERS_2 : {"name": localeInfo.EMOTION_CHEERS_2, "command":"/cheer2"},
|
||||||
|
EMOTION_KISS : {"name": localeInfo.EMOTION_CLAP_KISS, "command":"/kiss"},
|
||||||
|
EMOTION_FRENCH_KISS : {"name": localeInfo.EMOTION_FRENCH_KISS, "command":"/french_kiss"},
|
||||||
|
EMOTION_SLAP : {"name": localeInfo.EMOTION_SLAP, "command":"/slap"},
|
||||||
|
}
|
||||||
|
|
||||||
|
ICON_DICT = {
|
||||||
|
EMOTION_CLAP : "d:/ymir work/ui/game/windows/emotion_clap.sub",
|
||||||
|
EMOTION_CHEERS_1 : "d:/ymir work/ui/game/windows/emotion_cheers_1.sub",
|
||||||
|
EMOTION_CHEERS_2 : "d:/ymir work/ui/game/windows/emotion_cheers_2.sub",
|
||||||
|
|
||||||
|
EMOTION_KISS : "d:/ymir work/ui/game/windows/emotion_kiss.sub",
|
||||||
|
EMOTION_FRENCH_KISS : "d:/ymir work/ui/game/windows/emotion_french_kiss.sub",
|
||||||
|
EMOTION_SLAP : "d:/ymir work/ui/game/windows/emotion_slap.sub",
|
||||||
|
}
|
||||||
|
|
||||||
|
ANI_DICT = {
|
||||||
|
chr.MOTION_CLAP : "clap.msa",
|
||||||
|
chr.MOTION_CHEERS_1 : "cheers_1.msa",
|
||||||
|
chr.MOTION_CHEERS_2 : "cheers_2.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_WARRIOR : "french_kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_ASSASSIN : "french_kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SURA : "french_kiss_with_sura.msa",
|
||||||
|
chr.MOTION_FRENCH_KISS_WITH_SHAMAN : "french_kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_KISS_WITH_WARRIOR : "kiss_with_warrior.msa",
|
||||||
|
chr.MOTION_KISS_WITH_ASSASSIN : "kiss_with_assassin.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SURA : "kiss_with_sura.msa",
|
||||||
|
chr.MOTION_KISS_WITH_SHAMAN : "kiss_with_shaman.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_WARRIOR : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_ASSASSIN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SURA : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HIT_WITH_SHAMAN : "slap_hit.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_WARRIOR : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_ASSASSIN : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SURA : "slap_hurt.msa",
|
||||||
|
chr.MOTION_SLAP_HURT_WITH_SHAMAN : "slap_hurt.msa",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def __RegisterSharedEmotionAnis(mode, path):
|
||||||
|
chrmgr.SetPathName(path)
|
||||||
|
chrmgr.RegisterMotionMode(mode)
|
||||||
|
|
||||||
|
for key, val in ANI_DICT.items():
|
||||||
|
chrmgr.RegisterMotionData(mode, key, val)
|
||||||
|
|
||||||
|
def RegisterEmotionAnis(path):
|
||||||
|
actionPath = path + "action/"
|
||||||
|
weddingPath = path + "wedding/"
|
||||||
|
|
||||||
|
__RegisterSharedEmotionAnis(chr.MOTION_MODE_GENERAL, actionPath)
|
||||||
|
__RegisterSharedEmotionAnis(chr.MOTION_MODE_WEDDING_DRESS, actionPath)
|
||||||
|
|
||||||
|
chrmgr.SetPathName(weddingPath)
|
||||||
|
chrmgr.RegisterMotionMode(chr.MOTION_MODE_WEDDING_DRESS)
|
||||||
|
chrmgr.RegisterMotionData(chr.MOTION_MODE_WEDDING_DRESS, chr.MOTION_WAIT, "wait.msa")
|
||||||
|
chrmgr.RegisterMotionData(chr.MOTION_MODE_WEDDING_DRESS, chr.MOTION_WALK, "walk.msa")
|
||||||
|
chrmgr.RegisterMotionData(chr.MOTION_MODE_WEDDING_DRESS, chr.MOTION_RUN, "walk.msa")
|
||||||
|
|
||||||
|
def RegisterEmotionIcons():
|
||||||
|
for key, val in ICON_DICT.items():
|
||||||
|
player.RegisterEmotionIcon(key, val)
|
||||||
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
def GetExceptionString(excTitle):
|
||||||
|
|
||||||
|
import sys
|
||||||
|
(excType, excMsg, excTraceBack)=sys.exc_info()
|
||||||
|
|
||||||
|
excText=""
|
||||||
|
excText+=chr(10)
|
||||||
|
|
||||||
|
import traceback
|
||||||
|
traceLineList=traceback.extract_tb(excTraceBack)
|
||||||
|
|
||||||
|
for traceLine in traceLineList:
|
||||||
|
if traceLine[3]:
|
||||||
|
excText+="%s(line:%d) %s - %s" % (traceLine[0], traceLine[1], traceLine[2], traceLine[3])
|
||||||
|
else:
|
||||||
|
excText+="%s(line:%d) %s" % (traceLine[0], traceLine[1], traceLine[2])
|
||||||
|
|
||||||
|
excText+=chr(10)
|
||||||
|
|
||||||
|
excText+=chr(10)
|
||||||
|
excText+="%s - %s:%s" % (excTitle, excType, excMsg)
|
||||||
|
excText+=chr(10)
|
||||||
|
|
||||||
|
return excText
|
||||||
|
|
||||||
|
def Abort(excTitle):
|
||||||
|
import dbg
|
||||||
|
excText=GetExceptionString(excTitle)
|
||||||
|
|
||||||
|
dbg.TraceError(excText)
|
||||||
|
|
||||||
|
import app
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
return 0
|
||||||
+2183
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
|||||||
|
nv4_disp.dll 0006000e 000a1628
|
||||||
|
nv4_disp.dll 0006000e 000a1460
|
||||||
|
nv4_disp.dll 0006000e 000a14b7
|
||||||
|
nv4_disp.dll 0006000e.000a1620
|
||||||
|
nv4_disp.dll 0006000e.000a1628
|
||||||
|
nv4_disp.dll 0006000e.000a1a25
|
||||||
|
nv4_disp.dll 0006000e.000110ff
|
||||||
|
nv4_disp.dll 0006000e.000a1133
|
||||||
|
nv4_disp.dll 0006000e.000a11ab
|
||||||
|
nv4_disp.dll 0006000e.000a1629
|
||||||
|
nv4_disp.dll 0006000e.000a1820
|
||||||
|
nv4_disp.dll 0006000e.000a14b7
|
||||||
|
NVDD32.DLL 0004000d.00010b7e
|
||||||
|
ialmdd.dll 0004000d.000a0db6
|
||||||
|
ialmdd.dll 0004000d.00010cc0
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,661 @@
|
|||||||
|
import chr
|
||||||
|
import grp
|
||||||
|
import app
|
||||||
|
import net
|
||||||
|
import snd
|
||||||
|
import wndMgr
|
||||||
|
import event
|
||||||
|
import systemSetting
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import networkModule
|
||||||
|
import math
|
||||||
|
import snd
|
||||||
|
import musicInfo
|
||||||
|
import playerSettingModule
|
||||||
|
import uiScriptLocale
|
||||||
|
import uiToolTip
|
||||||
|
|
||||||
|
LOCALE_PATH = "uiscript/"+uiScriptLocale.CODEPAGE+"_"
|
||||||
|
|
||||||
|
MAN = 0
|
||||||
|
WOMAN = 1
|
||||||
|
SHAPE0 = 0
|
||||||
|
SHAPE1 = 1
|
||||||
|
PAGE_COUNT = 2
|
||||||
|
SLOT_COUNT = 4
|
||||||
|
BASE_CHR_ID = 3
|
||||||
|
|
||||||
|
class CreateCharacterWindow(ui.Window):
|
||||||
|
|
||||||
|
SLOT_ROTATION = [135.0, 225.0, 315.0, 45.0]
|
||||||
|
|
||||||
|
|
||||||
|
CREATE_STAT_POINT = 0
|
||||||
|
|
||||||
|
STAT_CON = 0
|
||||||
|
STAT_INT = 1
|
||||||
|
STAT_STR = 2
|
||||||
|
STAT_DEX = 3
|
||||||
|
|
||||||
|
STAT_DESCRIPTION = {
|
||||||
|
STAT_CON : localeInfo.STAT_TOOLTIP_CON,
|
||||||
|
STAT_INT : localeInfo.STAT_TOOLTIP_INT,
|
||||||
|
STAT_STR : localeInfo.STAT_TOOLTIP_STR,
|
||||||
|
STAT_DEX : localeInfo.STAT_TOOLTIP_DEX,
|
||||||
|
}
|
||||||
|
|
||||||
|
START_STAT = ( ## CON INT STR DEX
|
||||||
|
[ 4, 3, 6, 3, ], ## Warrior
|
||||||
|
[ 3, 3, 4, 6, ], ## Assassin
|
||||||
|
[ 3, 5, 5, 3, ], ## Sura
|
||||||
|
[ 4, 6, 3, 3, ], ## Shaman
|
||||||
|
[ 4, 3, 6, 3, ], ## Warrior
|
||||||
|
[ 3, 3, 4, 6, ], ## Assassin
|
||||||
|
[ 3, 5, 5, 3, ], ## Sura
|
||||||
|
[ 4, 6, 3, 3, ], ## Shaman
|
||||||
|
)
|
||||||
|
|
||||||
|
DESCRIPTION_FILE_NAME = (
|
||||||
|
uiScriptLocale.JOBDESC_WARRIOR_PATH,
|
||||||
|
uiScriptLocale.JOBDESC_ASSASSIN_PATH,
|
||||||
|
uiScriptLocale.JOBDESC_SURA_PATH,
|
||||||
|
uiScriptLocale.JOBDESC_SHAMAN_PATH,
|
||||||
|
)
|
||||||
|
|
||||||
|
class DescriptionBox(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.descIndex = 0
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
def SetIndex(self, index):
|
||||||
|
self.descIndex = index
|
||||||
|
def OnRender(self):
|
||||||
|
event.RenderEventSet(self.descIndex)
|
||||||
|
|
||||||
|
class CharacterRenderer(ui.Window):
|
||||||
|
def OnRender(self):
|
||||||
|
grp.ClearDepthBuffer()
|
||||||
|
grp.SetGameRenderState()
|
||||||
|
grp.PushState()
|
||||||
|
grp.SetOmniLight()
|
||||||
|
|
||||||
|
screenWidth = wndMgr.GetScreenWidth()
|
||||||
|
screenHeight = wndMgr.GetScreenHeight()
|
||||||
|
newScreenWidth = float(screenWidth - 270)
|
||||||
|
newScreenHeight = float(screenHeight)
|
||||||
|
|
||||||
|
grp.SetViewport(270.0/screenWidth, 0.0, newScreenWidth/screenWidth, newScreenHeight/screenHeight)
|
||||||
|
|
||||||
|
app.SetCenterPosition(0.0, 0.0, 0.0)
|
||||||
|
app.SetCamera(1550.0, 15.0, 180.0, 95.0)
|
||||||
|
grp.SetPerspective(10.0, newScreenWidth/newScreenHeight, 1000.0, 3000.0)
|
||||||
|
|
||||||
|
(x, y) = app.GetCursorPosition()
|
||||||
|
grp.SetCursorPosition(x, y)
|
||||||
|
|
||||||
|
chr.Deform()
|
||||||
|
chr.Render()
|
||||||
|
|
||||||
|
grp.RestoreViewport()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
def __init__(self, stream):
|
||||||
|
print "NEW CREATE WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_CREATE, self)
|
||||||
|
|
||||||
|
self.stream=stream
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE CREATE WINDOW"
|
||||||
|
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_CREATE, 0)
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
print "OPEN CREATE WINDOW ----------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
playerSettingModule.LoadGameData("INIT")
|
||||||
|
|
||||||
|
self.reservingRaceIndex = -1
|
||||||
|
self.reservingShapeIndex = -1
|
||||||
|
self.reservingStartTime = 0
|
||||||
|
self.stat = [0, 0, 0, 0]
|
||||||
|
|
||||||
|
self.gender = 0
|
||||||
|
self.slot = -1
|
||||||
|
self.shapeList = [
|
||||||
|
[0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0]]
|
||||||
|
|
||||||
|
self.descIndex = 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
dlgBoard = ui.ScriptWindow()
|
||||||
|
pythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
pythonScriptLoader.LoadScriptFile(dlgBoard, uiScriptLocale.LOCALE_UISCRIPT_PATH + "createcharacterwindow.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CreateCharacterWindow.Open.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
getChild = dlgBoard.GetChild
|
||||||
|
|
||||||
|
self.NameList = []
|
||||||
|
self.NameList.append(getChild("name_warrior"))
|
||||||
|
self.NameList.append(getChild("name_assassin"))
|
||||||
|
self.NameList.append(getChild("name_sura"))
|
||||||
|
self.NameList.append(getChild("name_shaman"))
|
||||||
|
|
||||||
|
self.GaugeList = []
|
||||||
|
self.GaugeList.append(getChild("hth_gauge"))
|
||||||
|
self.GaugeList.append(getChild("int_gauge"))
|
||||||
|
self.GaugeList.append(getChild("str_gauge"))
|
||||||
|
self.GaugeList.append(getChild("dex_gauge"))
|
||||||
|
|
||||||
|
self.btnCreate = getChild("create_button")
|
||||||
|
self.btnCancel = getChild("cancel_button")
|
||||||
|
self.btnPrev = getChild("prev_button")
|
||||||
|
self.btnNext = getChild("next_button")
|
||||||
|
self.btnLeft = getChild("left_button")
|
||||||
|
self.btnRight = getChild("right_button")
|
||||||
|
self.textBoard = getChild("text_board")
|
||||||
|
|
||||||
|
self.genderButtonList = []
|
||||||
|
self.genderButtonList.append(getChild("gender_button_01"))
|
||||||
|
self.genderButtonList.append(getChild("gender_button_02"))
|
||||||
|
|
||||||
|
self.shapeButtonList = []
|
||||||
|
self.shapeButtonList.append(getChild("shape_button_01"))
|
||||||
|
self.shapeButtonList.append(getChild("shape_button_02"))
|
||||||
|
|
||||||
|
self.editCharacterName = getChild("character_name_value")
|
||||||
|
|
||||||
|
self.statValue = []
|
||||||
|
self.statValue.append(getChild("hth_value"))
|
||||||
|
self.statValue.append(getChild("int_value"))
|
||||||
|
self.statValue.append(getChild("str_value"))
|
||||||
|
self.statValue.append(getChild("dex_value"))
|
||||||
|
|
||||||
|
getChild("hth_button").ShowToolTip = lambda arg=self.STAT_CON: self.OverInStatButton(arg)
|
||||||
|
getChild("hth_button").HideToolTip = lambda arg=self.STAT_CON: self.OverOutStatButton()
|
||||||
|
getChild("int_button").ShowToolTip = lambda arg=self.STAT_INT: self.OverInStatButton(arg)
|
||||||
|
getChild("int_button").HideToolTip = lambda arg=self.STAT_INT: self.OverOutStatButton()
|
||||||
|
getChild("str_button").ShowToolTip = lambda arg=self.STAT_STR: self.OverInStatButton(arg)
|
||||||
|
getChild("str_button").HideToolTip = lambda arg=self.STAT_STR: self.OverOutStatButton()
|
||||||
|
getChild("dex_button").ShowToolTip = lambda arg=self.STAT_DEX: self.OverInStatButton(arg)
|
||||||
|
getChild("dex_button").HideToolTip = lambda arg=self.STAT_DEX: self.OverOutStatButton()
|
||||||
|
|
||||||
|
getChild("hth_button").Hide()
|
||||||
|
getChild("int_button").Hide()
|
||||||
|
getChild("str_button").Hide()
|
||||||
|
getChild("dex_button").Hide()
|
||||||
|
|
||||||
|
self.backGround = getChild("BackGround")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CreateCharacterWindow.Open.BindObject")
|
||||||
|
|
||||||
|
self.btnCreate.SetEvent(ui.__mem_func__(self.CreateCharacter))
|
||||||
|
self.btnCancel.SetEvent(ui.__mem_func__(self.CancelCreate))
|
||||||
|
self.btnPrev.SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
|
||||||
|
self.btnNext.SetEvent(ui.__mem_func__(self.NextDescriptionPage))
|
||||||
|
self.btnLeft.SetEvent(ui.__mem_func__(self.__DecreaseSlotIndex))
|
||||||
|
self.btnRight.SetEvent(ui.__mem_func__(self.__IncreaseSlotIndex))
|
||||||
|
|
||||||
|
self.genderButtonList[0].SetEvent(ui.__mem_func__(self.__SelectGender), MAN)
|
||||||
|
self.genderButtonList[1].SetEvent(ui.__mem_func__(self.__SelectGender), WOMAN)
|
||||||
|
|
||||||
|
self.shapeButtonList[0].SetEvent(ui.__mem_func__(self.__SelectShape), SHAPE0)
|
||||||
|
self.shapeButtonList[1].SetEvent(ui.__mem_func__(self.__SelectShape), SHAPE1)
|
||||||
|
self.editCharacterName.SetReturnEvent(ui.__mem_func__(self.CreateCharacter))
|
||||||
|
self.editCharacterName.SetEscapeEvent(ui.__mem_func__(self.CancelCreate))
|
||||||
|
self.dlgBoard = dlgBoard
|
||||||
|
|
||||||
|
self.curRotation = [] + self.SLOT_ROTATION
|
||||||
|
self.destRotation = [] + self.SLOT_ROTATION
|
||||||
|
self.curNameAlpha = [0.0, 0.0, 0.0, 0.0, 0.0]
|
||||||
|
self.destNameAlpha = [0.0, 0.0, 0.0, 0.0, 0.0]
|
||||||
|
self.curGauge = [0.0, 0.0, 0.0, 0.0]
|
||||||
|
self.destGauge = [0.0, 0.0, 0.0, 0.0]
|
||||||
|
|
||||||
|
self.descriptionBox = self.DescriptionBox()
|
||||||
|
self.descriptionBox.Show()
|
||||||
|
|
||||||
|
self.chrRenderer = self.CharacterRenderer()
|
||||||
|
self.chrRenderer.SetParent(self.backGround)
|
||||||
|
self.chrRenderer.Show()
|
||||||
|
|
||||||
|
self.toolTip = uiToolTip.ToolTip()
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
|
||||||
|
self.editCharacterName.SetText("")
|
||||||
|
|
||||||
|
self.EnableWindow()
|
||||||
|
self.__SelectSlot(0)
|
||||||
|
|
||||||
|
app.SetCamera(500.0, 10.0, 180.0, 95.0)
|
||||||
|
|
||||||
|
self.__MakeCharacter(0, 0, playerSettingModule.RACE_WARRIOR_M)
|
||||||
|
self.__MakeCharacter(0, 1, playerSettingModule.RACE_ASSASSIN_M)
|
||||||
|
self.__MakeCharacter(0, 2, playerSettingModule.RACE_SURA_M)
|
||||||
|
self.__MakeCharacter(0, 3, playerSettingModule.RACE_SHAMAN_M)
|
||||||
|
|
||||||
|
self.__MakeCharacter(1, 0, playerSettingModule.RACE_WARRIOR_W)
|
||||||
|
self.__MakeCharacter(1, 1, playerSettingModule.RACE_ASSASSIN_W)
|
||||||
|
self.__MakeCharacter(1, 2, playerSettingModule.RACE_SURA_W)
|
||||||
|
self.__MakeCharacter(1, 3, playerSettingModule.RACE_SHAMAN_W)
|
||||||
|
|
||||||
|
self.__SelectGender(app.GetRandom(MAN, WOMAN))
|
||||||
|
self.__SelectShape(0)
|
||||||
|
self.__SelectSlot(app.GetRandom(0, 3))
|
||||||
|
|
||||||
|
self.dlgBoard.Show()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
if musicInfo.createMusic != "":
|
||||||
|
snd.SetMusicVolume(systemSetting.GetMusicVolume())
|
||||||
|
snd.FadeInMusic("BGM/"+musicInfo.createMusic)
|
||||||
|
|
||||||
|
app.ShowCursor()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
print "---------------------------------------------------------------------------- CLOSE CREATE WINDOW"
|
||||||
|
|
||||||
|
self.editCharacterName.Enable()
|
||||||
|
self.dlgBoard.ClearDictionary()
|
||||||
|
self.stream=0
|
||||||
|
self.shapeButtonList = []
|
||||||
|
self.genderButtonList = []
|
||||||
|
self.btnCreate = 0
|
||||||
|
self.btnCancel = 0
|
||||||
|
self.btnPrev = 0
|
||||||
|
self.btnNext = 0
|
||||||
|
self.btnLeft = 0
|
||||||
|
self.btnRight = 0
|
||||||
|
self.textBoard = 0
|
||||||
|
self.editCharacterName = 0
|
||||||
|
self.backGround = None
|
||||||
|
|
||||||
|
if musicInfo.createMusic != "":
|
||||||
|
snd.FadeOutMusic("BGM/"+musicInfo.createMusic)
|
||||||
|
|
||||||
|
for id in xrange(BASE_CHR_ID + SLOT_COUNT * PAGE_COUNT):
|
||||||
|
chr.DeleteInstance(id)
|
||||||
|
|
||||||
|
self.dlgBoard.Hide()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
app.HideCursor()
|
||||||
|
event.Destroy()
|
||||||
|
|
||||||
|
def EnableWindow(self):
|
||||||
|
self.reservingRaceIndex = -1
|
||||||
|
self.reservingShapeIndex = -1
|
||||||
|
self.btnCreate.Enable()
|
||||||
|
self.btnCancel.Enable()
|
||||||
|
self.btnPrev.Enable()
|
||||||
|
self.btnNext.Enable()
|
||||||
|
self.btnLeft.Enable()
|
||||||
|
self.btnRight.Enable()
|
||||||
|
|
||||||
|
self.editCharacterName.SetFocus()
|
||||||
|
self.editCharacterName.Enable()
|
||||||
|
|
||||||
|
for page in xrange(PAGE_COUNT):
|
||||||
|
for slot in xrange(SLOT_COUNT):
|
||||||
|
chr_id = self.__GetSlotChrID(page, slot)
|
||||||
|
chr.SelectInstance(chr_id)
|
||||||
|
chr.BlendLoopMotion(chr.MOTION_INTRO_WAIT, 0.1)
|
||||||
|
|
||||||
|
def DisableWindow(self):
|
||||||
|
self.btnCreate.Disable()
|
||||||
|
self.btnCancel.Disable()
|
||||||
|
self.btnPrev.Disable()
|
||||||
|
self.btnNext.Disable()
|
||||||
|
self.btnLeft.Disable()
|
||||||
|
self.btnRight.Disable()
|
||||||
|
self.editCharacterName.Disable()
|
||||||
|
|
||||||
|
self.btnCreate.SetUp()
|
||||||
|
|
||||||
|
## Manage Character
|
||||||
|
def __GetSlotChrID(self, page, slot):
|
||||||
|
return BASE_CHR_ID + page * SLOT_COUNT + slot
|
||||||
|
|
||||||
|
def __MakeCharacter(self, page, slot, race):
|
||||||
|
|
||||||
|
chr_id = self.__GetSlotChrID(page, slot)
|
||||||
|
|
||||||
|
chr.CreateInstance(chr_id)
|
||||||
|
chr.SelectInstance(chr_id)
|
||||||
|
chr.SetVirtualID(chr_id)
|
||||||
|
|
||||||
|
chr.SetRace(race)
|
||||||
|
chr.SetArmor(0)
|
||||||
|
chr.SetHair(0)
|
||||||
|
|
||||||
|
chr.Refresh()
|
||||||
|
chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
|
||||||
|
chr.SetLoopMotion(chr.MOTION_INTRO_WAIT)
|
||||||
|
|
||||||
|
chr.SetRotation(0.0)
|
||||||
|
chr.Hide()
|
||||||
|
|
||||||
|
def __SelectGender(self, gender):
|
||||||
|
for button in self.genderButtonList:
|
||||||
|
button.SetUp()
|
||||||
|
|
||||||
|
self.genderButtonList[gender].Down()
|
||||||
|
|
||||||
|
self.gender = gender
|
||||||
|
|
||||||
|
if gender == MAN:
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
chr.SelectInstance(self.__GetSlotChrID(0, i))
|
||||||
|
chr.Show()
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
chr.SelectInstance(self.__GetSlotChrID(1, i))
|
||||||
|
chr.Hide()
|
||||||
|
else:
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
chr.SelectInstance(self.__GetSlotChrID(0, i))
|
||||||
|
chr.Hide()
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
chr.SelectInstance(self.__GetSlotChrID(1, i))
|
||||||
|
chr.Show()
|
||||||
|
|
||||||
|
def __SelectShape(self, shape):
|
||||||
|
self.shapeList[self.gender][self.slot] = shape
|
||||||
|
|
||||||
|
for button in self.shapeButtonList:
|
||||||
|
button.SetUp()
|
||||||
|
|
||||||
|
self.shapeButtonList[shape].Down()
|
||||||
|
|
||||||
|
chr_id = self.__GetSlotChrID(self.gender, self.slot)
|
||||||
|
chr.SelectInstance(chr_id)
|
||||||
|
chr.ChangeShape(shape)
|
||||||
|
chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
|
||||||
|
chr.SetLoopMotion(chr.MOTION_INTRO_WAIT)
|
||||||
|
|
||||||
|
def GetSlotIndex(self):
|
||||||
|
return self.slot
|
||||||
|
|
||||||
|
def RefreshStat(self):
|
||||||
|
statSummary = self.stat[0] + self.stat[1] + self.stat[2] + self.stat[3]
|
||||||
|
self.destGauge = (
|
||||||
|
float(self.stat[0])/float(statSummary),
|
||||||
|
float(self.stat[1])/float(statSummary),
|
||||||
|
float(self.stat[2])/float(statSummary),
|
||||||
|
float(self.stat[3])/float(statSummary),
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in xrange(4):
|
||||||
|
self.statValue[i].SetText(str(self.stat[i]))
|
||||||
|
|
||||||
|
def __SelectSlot(self, slot):
|
||||||
|
|
||||||
|
if slot < 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
if slot >= SLOT_COUNT:
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.slot == slot:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.slot = slot
|
||||||
|
self.ResetStat()
|
||||||
|
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
self.destNameAlpha[i] = 0.0
|
||||||
|
|
||||||
|
self.destNameAlpha[slot] = 1.0
|
||||||
|
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
self.destRotation[(i+self.slot)%SLOT_COUNT] = self.SLOT_ROTATION[i]
|
||||||
|
|
||||||
|
if self.IsShow():
|
||||||
|
snd.PlaySound("sound/ui/click.wav")
|
||||||
|
|
||||||
|
event.ClearEventSet(self.descIndex)
|
||||||
|
self.descIndex = event.RegisterEventSet(self.DESCRIPTION_FILE_NAME[self.slot])
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
event.SetEventSetWidth(self.descIndex, 170)
|
||||||
|
|
||||||
|
chr_id = self.__GetSlotChrID(self.gender, slot)
|
||||||
|
if chr.HasInstance(chr_id):
|
||||||
|
chr.SelectInstance(chr_id)
|
||||||
|
self.__SelectShape(self.shapeList[self.gender][slot])
|
||||||
|
|
||||||
|
def CreateCharacter(self):
|
||||||
|
|
||||||
|
if -1 != self.reservingRaceIndex:
|
||||||
|
return
|
||||||
|
|
||||||
|
textName = self.editCharacterName.GetText()
|
||||||
|
if False == self.__CheckCreateCharacter(textName):
|
||||||
|
return
|
||||||
|
|
||||||
|
if musicInfo.selectMusic != "":
|
||||||
|
snd.FadeLimitOutMusic("BGM/"+musicInfo.selectMusic, systemSetting.GetMusicVolume()*0.05)
|
||||||
|
|
||||||
|
self.DisableWindow()
|
||||||
|
|
||||||
|
|
||||||
|
chr_id = self.__GetSlotChrID(self.gender, self.slot)
|
||||||
|
|
||||||
|
chr.SelectInstance(chr_id)
|
||||||
|
|
||||||
|
self.reservingRaceIndex = chr.GetRace()
|
||||||
|
|
||||||
|
self.reservingShapeIndex = self.shapeList[self.gender][self.slot]
|
||||||
|
self.reservingStartTime = app.GetTime()
|
||||||
|
|
||||||
|
for eachSlot in xrange(SLOT_COUNT):
|
||||||
|
|
||||||
|
sel_id = self.__GetSlotChrID(self.gender, eachSlot)
|
||||||
|
|
||||||
|
chr.SelectInstance(sel_id)
|
||||||
|
|
||||||
|
if eachSlot == self.slot:
|
||||||
|
chr.PushOnceMotion(chr.MOTION_INTRO_SELECTED)
|
||||||
|
else:
|
||||||
|
chr.PushOnceMotion(chr.MOTION_INTRO_NOT_SELECTED)
|
||||||
|
|
||||||
|
def CancelCreate(self):
|
||||||
|
self.stream.SetSelectCharacterPhase()
|
||||||
|
|
||||||
|
def __DecreaseSlotIndex(self):
|
||||||
|
slotIndex = (self.GetSlotIndex() - 1 + SLOT_COUNT) % SLOT_COUNT
|
||||||
|
self.__SelectSlot(slotIndex)
|
||||||
|
|
||||||
|
def __IncreaseSlotIndex(self):
|
||||||
|
slotIndex = (self.GetSlotIndex() + 1) % SLOT_COUNT
|
||||||
|
self.__SelectSlot(slotIndex)
|
||||||
|
|
||||||
|
def PrevDescriptionPage(self):
|
||||||
|
if True == event.IsWait(self.descIndex):
|
||||||
|
if event.GetVisibleStartLine(self.descIndex)-5 >= 0:
|
||||||
|
event.SetVisibleStartLine(self.descIndex, event.GetVisibleStartLine(self.descIndex)-5)
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
else:
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
|
||||||
|
def NextDescriptionPage(self):
|
||||||
|
if True == event.IsWait(self.descIndex):
|
||||||
|
event.SetVisibleStartLine(self.descIndex, event.GetVisibleStartLine(self.descIndex)+5)
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
else:
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
|
||||||
|
def __CheckCreateCharacter(self, name):
|
||||||
|
if len(name) == 0:
|
||||||
|
self.PopupMessage(localeInfo.CREATE_INPUT_NAME, self.EnableWindow)
|
||||||
|
return False
|
||||||
|
|
||||||
|
if name.find(localeInfo.CREATE_GM_NAME)!=-1:
|
||||||
|
self.PopupMessage(localeInfo.CREATE_ERROR_GM_NAME, self.EnableWindow)
|
||||||
|
return False
|
||||||
|
|
||||||
|
if net.IsInsultIn(name):
|
||||||
|
self.PopupMessage(localeInfo.CREATE_ERROR_INSULT_NAME, self.EnableWindow)
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def ResetStat(self):
|
||||||
|
for i in xrange(4):
|
||||||
|
self.stat[i] = self.START_STAT[self.slot][i]
|
||||||
|
self.lastStatPoint = self.CREATE_STAT_POINT
|
||||||
|
self.RefreshStat()
|
||||||
|
|
||||||
|
## Event
|
||||||
|
def OnCreateSuccess(self):
|
||||||
|
self.stream.SetSelectCharacterPhase()
|
||||||
|
|
||||||
|
def OnCreateFailure(self, type):
|
||||||
|
if 1 == type:
|
||||||
|
self.PopupMessage(localeInfo.CREATE_EXIST_SAME_NAME, self.EnableWindow)
|
||||||
|
else:
|
||||||
|
self.PopupMessage(localeInfo.CREATE_FAILURE, self.EnableWindow)
|
||||||
|
|
||||||
|
def OnKeyDown(self, key):
|
||||||
|
|
||||||
|
if key == 2:
|
||||||
|
self.__SelectSlot(0)
|
||||||
|
if key == 3:
|
||||||
|
self.__SelectSlot(1)
|
||||||
|
if key == 4:
|
||||||
|
self.__SelectSlot(2)
|
||||||
|
if key == 5:
|
||||||
|
self.__SelectSlot(3)
|
||||||
|
|
||||||
|
if 203 == key:
|
||||||
|
self.__DecreaseSlotIndex()
|
||||||
|
if 205 == key:
|
||||||
|
self.__IncreaseSlotIndex()
|
||||||
|
|
||||||
|
if 59 == key:
|
||||||
|
self.__SelectGender(MAN_PAGE)
|
||||||
|
if 60 == key:
|
||||||
|
self.__SelectGender(WOMAN_PAGE)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
chr.Update()
|
||||||
|
|
||||||
|
(xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
|
||||||
|
event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
|
||||||
|
self.descriptionBox.SetIndex(self.descIndex)
|
||||||
|
|
||||||
|
for i in xrange(4):
|
||||||
|
self.curNameAlpha[i] += (self.destNameAlpha[i] - self.curNameAlpha[i]) / 10.0
|
||||||
|
self.NameList[i].SetAlpha(self.curNameAlpha[i])
|
||||||
|
|
||||||
|
for i in xrange(4):
|
||||||
|
self.curGauge[i] += (self.destGauge[i] - self.curGauge[i]) / 10.0
|
||||||
|
if abs(self.curGauge[i] - self.destGauge[i]) < 0.005:
|
||||||
|
self.curGauge[i] = self.destGauge[i]
|
||||||
|
self.GaugeList[i].SetPercentage(self.curGauge[i], 1.0)
|
||||||
|
|
||||||
|
for page in xrange(PAGE_COUNT):
|
||||||
|
for i in xrange(SLOT_COUNT):
|
||||||
|
chr.SelectInstance(self.__GetSlotChrID(page, i))
|
||||||
|
|
||||||
|
distance = 50.0
|
||||||
|
rotRadian = self.curRotation[i] * (math.pi*2) / 360.0
|
||||||
|
x = distance*math.sin(rotRadian) + distance*math.cos(rotRadian)
|
||||||
|
y = distance*math.cos(rotRadian) - distance*math.sin(rotRadian)
|
||||||
|
chr.SetPixelPosition(int(x), int(y), 30)
|
||||||
|
|
||||||
|
if abs(self.destRotation[i] - self.curRotation[i]) < 1.0:
|
||||||
|
self.curRotation[i] = self.destRotation[i]
|
||||||
|
|
||||||
|
dir = app.GetRotatingDirection(self.destRotation[i], self.curRotation[i])
|
||||||
|
rot = app.GetDegreeDifference(self.destRotation[i], self.curRotation[i])
|
||||||
|
|
||||||
|
if app.DEGREE_DIRECTION_RIGHT == dir:
|
||||||
|
self.curRotation[i] += rot / 10.0
|
||||||
|
elif app.DEGREE_DIRECTION_LEFT == dir:
|
||||||
|
self.curRotation[i] -= rot / 10.0
|
||||||
|
|
||||||
|
self.curRotation[i] = (self.curRotation[i] + 360.0) % 360.0
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
if -1 != self.reservingRaceIndex:
|
||||||
|
if app.GetTime() - self.reservingStartTime >= 1.5:
|
||||||
|
|
||||||
|
chrSlot=self.stream.GetCharacterSlot()
|
||||||
|
textName = self.editCharacterName.GetText()
|
||||||
|
raceIndex = self.reservingRaceIndex
|
||||||
|
shapeIndex = self.reservingShapeIndex
|
||||||
|
|
||||||
|
startStat = self.START_STAT[self.reservingRaceIndex]
|
||||||
|
statCon = self.stat[0] - startStat[0]
|
||||||
|
statInt = self.stat[1] - startStat[1]
|
||||||
|
statStr = self.stat[2] - startStat[2]
|
||||||
|
statDex = self.stat[3] - startStat[3]
|
||||||
|
|
||||||
|
net.SendCreateCharacterPacket(chrSlot, textName, raceIndex, shapeIndex, statCon, statInt, statStr, statDex)
|
||||||
|
|
||||||
|
self.reservingRaceIndex = -1
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
def EmptyFunc(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def PopupMessage(self, msg, func=0):
|
||||||
|
if not func:
|
||||||
|
func=self.EmptyFunc
|
||||||
|
|
||||||
|
self.stream.popupWindow.Close()
|
||||||
|
self.stream.popupWindow.Open(msg, func, localeInfo.UI_OK)
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
self.CancelCreate()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OverInStatButton(self, stat):
|
||||||
|
if not self.STAT_DESCRIPTION.has_key(stat):
|
||||||
|
return
|
||||||
|
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
self.toolTip.AppendTextLine(self.STAT_DESCRIPTION[stat])
|
||||||
|
self.toolTip.Show()
|
||||||
|
|
||||||
|
def OverOutStatButton(self):
|
||||||
|
self.toolTip.Hide()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import networkModule
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
mainStream = networkModule.MainStream()
|
||||||
|
mainStream.Create()
|
||||||
|
|
||||||
|
test = CreateCharacterWindow(mainStream)
|
||||||
|
test.Open()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
@@ -0,0 +1,256 @@
|
|||||||
|
import ui
|
||||||
|
import net
|
||||||
|
import wndMgr
|
||||||
|
import dbg
|
||||||
|
import app
|
||||||
|
import event
|
||||||
|
import _weakref
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
LOCALE_PATH = "uiscript/"+uiScriptLocale.CODEPAGE+"_"
|
||||||
|
|
||||||
|
class SelectEmpireWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
EMPIRE_DESCRIPTION_TEXT_FILE_NAME = {
|
||||||
|
net.EMPIRE_A : uiScriptLocale.EMPIREDESC_A,
|
||||||
|
net.EMPIRE_B : uiScriptLocale.EMPIREDESC_B,
|
||||||
|
net.EMPIRE_C : uiScriptLocale.EMPIREDESC_C, }
|
||||||
|
|
||||||
|
class EmpireButton(ui.Window):
|
||||||
|
def __init__(self, owner, arg):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.owner = owner
|
||||||
|
self.arg = arg
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
self.owner.OnOverInEmpire(self.arg)
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
self.owner.OnOverOutEmpire(self.arg)
|
||||||
|
def OnMouseLeftButtonDown(self):
|
||||||
|
if self.owner.empireID != self.arg:
|
||||||
|
self.owner.OnSelectEmpire(self.arg)
|
||||||
|
|
||||||
|
class DescriptionBox(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.descIndex = 0
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
def SetIndex(self, index):
|
||||||
|
self.descIndex = index
|
||||||
|
def OnRender(self):
|
||||||
|
event.RenderEventSet(self.descIndex)
|
||||||
|
|
||||||
|
def __init__(self, stream):
|
||||||
|
print "NEW EMPIRE WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, self)
|
||||||
|
|
||||||
|
self.stream=stream
|
||||||
|
self.empireID=app.GetRandom(1, 3)
|
||||||
|
self.descIndex=0
|
||||||
|
self.empireArea = {}
|
||||||
|
self.empireAreaFlag = {}
|
||||||
|
self.empireFlag = {}
|
||||||
|
self.empireAreaButton = {}
|
||||||
|
self.empireAreaCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
self.empireAreaDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
self.empireAreaFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
self.empireAreaFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
self.empireFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
self.empireFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, 0)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE EMPIRE WINDOW"
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
print "---------------------------------------------------------------------------- CLOSE EMPIRE WINDOW"
|
||||||
|
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.leftButton = None
|
||||||
|
self.rightButton = None
|
||||||
|
self.selectButton = None
|
||||||
|
self.exitButton = None
|
||||||
|
self.textBoard = None
|
||||||
|
self.descriptionBox = None
|
||||||
|
self.empireArea = None
|
||||||
|
self.empireAreaButton = None
|
||||||
|
|
||||||
|
self.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
app.HideCursor()
|
||||||
|
event.Destroy()
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
print "OPEN EMPIRE WINDOW ----------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
|
||||||
|
self.SetWindowName("SelectEmpireWindow")
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
if not self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "SelectEmpireWindow.py"):
|
||||||
|
dbg.TraceError("SelectEmpireWindow.Open - __LoadScript Error")
|
||||||
|
return
|
||||||
|
|
||||||
|
self.OnSelectEmpire(self.empireID)
|
||||||
|
self.__CreateButtons()
|
||||||
|
self.__CreateDescriptionBox()
|
||||||
|
app.ShowCursor()
|
||||||
|
|
||||||
|
def __CreateButtons(self):
|
||||||
|
for key, img in self.empireArea.items():
|
||||||
|
|
||||||
|
img.SetAlpha(0.0)
|
||||||
|
|
||||||
|
(x, y) = img.GetGlobalPosition()
|
||||||
|
btn = self.EmpireButton(_weakref.proxy(self), key)
|
||||||
|
btn.SetParent(self)
|
||||||
|
btn.SetPosition(x, y)
|
||||||
|
btn.SetSize(img.GetWidth(), img.GetHeight())
|
||||||
|
btn.Show()
|
||||||
|
self.empireAreaButton[key] = btn
|
||||||
|
|
||||||
|
def __CreateDescriptionBox(self):
|
||||||
|
self.descriptionBox = self.DescriptionBox()
|
||||||
|
self.descriptionBox.Show()
|
||||||
|
|
||||||
|
def OnOverInEmpire(self, arg):
|
||||||
|
self.empireAreaDestAlpha[arg] = 1.0
|
||||||
|
|
||||||
|
def OnOverOutEmpire(self, arg):
|
||||||
|
if arg != self.empireID:
|
||||||
|
self.empireAreaDestAlpha[arg] = 0.0
|
||||||
|
|
||||||
|
def OnSelectEmpire(self, arg):
|
||||||
|
for key in self.empireArea.keys():
|
||||||
|
self.empireAreaDestAlpha[key] = 0.0
|
||||||
|
self.empireAreaFlagDestAlpha[key] = 0.0
|
||||||
|
self.empireFlagDestAlpha[key] = 0.0
|
||||||
|
self.empireAreaDestAlpha[arg] = 1.0
|
||||||
|
self.empireAreaFlagDestAlpha[arg] = 1.0
|
||||||
|
self.empireFlagDestAlpha[arg] = 1.0
|
||||||
|
self.empireID = arg
|
||||||
|
|
||||||
|
event.ClearEventSet(self.descIndex)
|
||||||
|
if self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME.has_key(arg):
|
||||||
|
self.descIndex = event.RegisterEventSet(self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME[arg])
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
event.SetEventSetWidth(self.descIndex, 170)
|
||||||
|
else:
|
||||||
|
event.SetRestrictedCount(self.descIndex, 35)
|
||||||
|
|
||||||
|
def PrevDescriptionPage(self):
|
||||||
|
if True == event.IsWait(self.descIndex):
|
||||||
|
if event.GetVisibleStartLine(self.descIndex)-5 >= 0:
|
||||||
|
event.SetVisibleStartLine(self.descIndex, event.GetVisibleStartLine(self.descIndex)-5)
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
else:
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
|
||||||
|
def NextDescriptionPage(self):
|
||||||
|
if True == event.IsWait(self.descIndex):
|
||||||
|
event.SetVisibleStartLine(self.descIndex, event.GetVisibleStartLine(self.descIndex)+5)
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
else:
|
||||||
|
event.Skip(self.descIndex)
|
||||||
|
|
||||||
|
def __LoadScript(self, fileName):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectEmpireWindow.__LoadScript.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.leftButton = GetObject("left_button")
|
||||||
|
self.rightButton = GetObject("right_button")
|
||||||
|
self.selectButton = GetObject("select_button")
|
||||||
|
self.exitButton = GetObject("exit_button")
|
||||||
|
self.textBoard = GetObject("text_board")
|
||||||
|
self.empireArea[net.EMPIRE_A] = GetObject("EmpireArea_A")
|
||||||
|
self.empireArea[net.EMPIRE_B] = GetObject("EmpireArea_B")
|
||||||
|
self.empireArea[net.EMPIRE_C] = GetObject("EmpireArea_C")
|
||||||
|
self.empireAreaFlag[net.EMPIRE_A] = GetObject("EmpireAreaFlag_A")
|
||||||
|
self.empireAreaFlag[net.EMPIRE_B] = GetObject("EmpireAreaFlag_B")
|
||||||
|
self.empireAreaFlag[net.EMPIRE_C] = GetObject("EmpireAreaFlag_C")
|
||||||
|
self.empireFlag[net.EMPIRE_A] = GetObject("EmpireFlag_A")
|
||||||
|
self.empireFlag[net.EMPIRE_B] = GetObject("EmpireFlag_B")
|
||||||
|
self.empireFlag[net.EMPIRE_C] = GetObject("EmpireFlag_C")
|
||||||
|
GetObject("prev_text_button").SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
|
||||||
|
GetObject("next_text_button").SetEvent(ui.__mem_func__(self.NextDescriptionPage))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectEmpireWindow.__LoadScript.BindObject")
|
||||||
|
|
||||||
|
self.selectButton.SetEvent(ui.__mem_func__(self.ClickSelectButton))
|
||||||
|
self.exitButton.SetEvent(ui.__mem_func__(self.ClickExitButton))
|
||||||
|
self.leftButton.SetEvent(ui.__mem_func__(self.ClickLeftButton))
|
||||||
|
self.rightButton.SetEvent(ui.__mem_func__(self.ClickRightButton))
|
||||||
|
for flag in self.empireAreaFlag.values():
|
||||||
|
flag.SetAlpha(0.0)
|
||||||
|
for flag in self.empireFlag.values():
|
||||||
|
flag.SetAlpha(0.0)
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def ClickLeftButton(self):
|
||||||
|
self.empireID-=1
|
||||||
|
if self.empireID<1:
|
||||||
|
self.empireID=3
|
||||||
|
|
||||||
|
self.OnSelectEmpire(self.empireID)
|
||||||
|
|
||||||
|
def ClickRightButton(self):
|
||||||
|
self.empireID+=1
|
||||||
|
if self.empireID>3:
|
||||||
|
self.empireID=1
|
||||||
|
|
||||||
|
self.OnSelectEmpire(self.empireID)
|
||||||
|
|
||||||
|
def ClickSelectButton(self):
|
||||||
|
net.SendSelectEmpirePacket(self.empireID)
|
||||||
|
self.stream.SetSelectCharacterPhase()
|
||||||
|
|
||||||
|
def ClickExitButton(self):
|
||||||
|
self.stream.SetLoginPhase()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
(xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
|
||||||
|
event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
|
||||||
|
self.descriptionBox.SetIndex(self.descIndex)
|
||||||
|
|
||||||
|
self.__UpdateAlpha(self.empireArea, self.empireAreaCurAlpha, self.empireAreaDestAlpha)
|
||||||
|
self.__UpdateAlpha(self.empireAreaFlag, self.empireAreaFlagCurAlpha, self.empireAreaFlagDestAlpha)
|
||||||
|
self.__UpdateAlpha(self.empireFlag, self.empireFlagCurAlpha, self.empireFlagDestAlpha)
|
||||||
|
|
||||||
|
def __UpdateAlpha(self, dict, curAlphaDict, destAlphaDict):
|
||||||
|
for key, img in dict.items():
|
||||||
|
|
||||||
|
curAlpha = curAlphaDict[key]
|
||||||
|
destAlpha = destAlphaDict[key]
|
||||||
|
|
||||||
|
if abs(destAlpha - curAlpha) / 10 > 0.0001:
|
||||||
|
curAlpha += (destAlpha - curAlpha) / 7
|
||||||
|
else:
|
||||||
|
curAlpha = destAlpha
|
||||||
|
|
||||||
|
curAlphaDict[key] = curAlpha
|
||||||
|
img.SetAlpha(curAlpha)
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.ClickExitButton()
|
||||||
|
return True
|
||||||
|
|
||||||
|
class ReselectEmpireWindow(SelectEmpireWindow):
|
||||||
|
def ClickSelectButton(self):
|
||||||
|
net.SendSelectEmpirePacket(self.empireID)
|
||||||
|
self.stream.SetCreateCharacterPhase()
|
||||||
|
|
||||||
|
def ClickExitButton(self):
|
||||||
|
self.stream.SetSelectCharacterPhase()
|
||||||
@@ -0,0 +1,402 @@
|
|||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
import net
|
||||||
|
import app
|
||||||
|
import dbg
|
||||||
|
import player
|
||||||
|
import background
|
||||||
|
import wndMgr
|
||||||
|
|
||||||
|
import localeInfo
|
||||||
|
import chrmgr
|
||||||
|
import colorInfo
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
import playerSettingModule
|
||||||
|
import stringCommander
|
||||||
|
import emotion
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# 빠른 실행을 위한 모듈 로딩 분담
|
||||||
|
####################################
|
||||||
|
import uiRefine
|
||||||
|
import uiToolTip
|
||||||
|
import uiAttachMetin
|
||||||
|
import uiPickMoney
|
||||||
|
import uiChat
|
||||||
|
import uiMessenger
|
||||||
|
import uiHelp
|
||||||
|
import uiWhisper
|
||||||
|
import uiPointReset
|
||||||
|
import uiShop
|
||||||
|
import uiExchange
|
||||||
|
import uiSystem
|
||||||
|
import uiOption
|
||||||
|
import uiRestart
|
||||||
|
####################################
|
||||||
|
|
||||||
|
class LoadingWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self, stream):
|
||||||
|
print "NEW LOADING WINDOW -------------------------------------------------------------------------------"
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_LOAD, self)
|
||||||
|
|
||||||
|
self.stream=stream
|
||||||
|
self.loadingImage=0
|
||||||
|
self.loadingGage=0
|
||||||
|
self.errMsg=0
|
||||||
|
self.update=0
|
||||||
|
self.playerX=0
|
||||||
|
self.playerY=0
|
||||||
|
self.loadStepList=[]
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE LOADING WINDOW"
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_LOAD, 0)
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
print "OPEN LOADING WINDOW -------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
#app.HideCursor()
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
|
||||||
|
if localeInfo.IsYMIR() or localeInfo.IsWE_KOREA() or localeInfo.IsCANADA() or localeInfo.IsBRAZIL() or localeInfo.IsEUROPE() or localeInfo.IsJAPAN():
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoadingWindow.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/LoadingWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("LodingWindow.Open - LoadScriptFile Error")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.loadingImage=self.GetChild("BackGround")
|
||||||
|
self.errMsg=self.GetChild("ErrorMessage")
|
||||||
|
self.loadingGage=self.GetChild("FullGage")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("LodingWindow.Open - LoadScriptFile Error")
|
||||||
|
|
||||||
|
self.errMsg.Hide()
|
||||||
|
|
||||||
|
# if localeInfo.IsHONGKONG():
|
||||||
|
# imgFileNameDict = {
|
||||||
|
# 0 : app.GetLocalePath() + "/ui/loading/loading0.sub",
|
||||||
|
# 1 : app.GetLocalePath() + "/ui/loading/loading1.sub",
|
||||||
|
# 2 : app.GetLocalePath() + "/ui/loading/loading2.sub",
|
||||||
|
# 3 : app.GetLocalePath() + "/ui/loading/loading3.sub",
|
||||||
|
# 4 : app.GetLocalePath() + "/ui/loading/loading4.sub",
|
||||||
|
# 5 : app.GetLocalePath() + "/ui/loading/loading5.sub",
|
||||||
|
# 6 : app.GetLocalePath() + "/ui/loading/loading6.sub"
|
||||||
|
# }
|
||||||
|
# elif localeInfo.IsCIBN10():
|
||||||
|
# imgFileNameDict = {
|
||||||
|
# 0 : app.GetLocalePath() + "/ui/loading/loading0.jpg",
|
||||||
|
# 1 : app.GetLocalePath() + "/ui/loading/loading1.jpg",
|
||||||
|
# 2 : app.GetLocalePath() + "/ui/loading/loading2.jpg",
|
||||||
|
# 3 : app.GetLocalePath() + "/ui/loading/loading3.jpg",
|
||||||
|
# 4 : app.GetLocalePath() + "/ui/loading/loading4.jpg",
|
||||||
|
# 5 : app.GetLocalePath() + "/ui/loading/loading5.jpg",
|
||||||
|
# 6 : app.GetLocalePath() + "/ui/loading/loading6.jpg",
|
||||||
|
# 7 : app.GetLocalePath() + "/ui/loading/loading7.jpg",
|
||||||
|
# }
|
||||||
|
# elif localeInfo.IsYMIR() or localeInfo.IsWE_KOREA() or localeInfo.IsCANADA() or localeInfo.IsBRAZIL() or localeInfo.IsEUROPE() or localeInfo.IsJAPAN():
|
||||||
|
# imgFileNameDict = {
|
||||||
|
# 0 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading0.sub",
|
||||||
|
# 1 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading1.sub",
|
||||||
|
# 2 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading2.sub",
|
||||||
|
# 3 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading3.sub",
|
||||||
|
|
||||||
|
# }
|
||||||
|
# elif constInfo.SUB2_LOADING_ENABLE:
|
||||||
|
# imgFileNameDict = {
|
||||||
|
# 0 : "d:/ymir work/uiloading/background_loading_warrior.sub",
|
||||||
|
# 1 : "d:/ymir work/uiloading/background_loading_assassin.sub",
|
||||||
|
# 2 : "d:/ymir work/uiloading/background_loading_shaman.sub",
|
||||||
|
# 3 : "d:/ymir work/uiloading/background_loading_sura.sub",
|
||||||
|
# 4 : "d:/ymir work/uiloading/background_loading_assassin2.sub",
|
||||||
|
# 5 : "d:/ymir work/uiloading/background_loading_sura2.sub",
|
||||||
|
# 6 : "d:/ymir work/uiloading/background_loading_assassin3.sub",
|
||||||
|
# 7 : "d:/ymir work/uiloading/background_loading_assassin3.sub",
|
||||||
|
# }
|
||||||
|
# else:
|
||||||
|
# imgFileNameDict = {
|
||||||
|
# 0 : "d:/ymir work/ui/intro/pattern/background_loading_warrior.jpg",
|
||||||
|
# 1 : "d:/ymir work/ui/intro/pattern/background_loading_assassin.jpg",
|
||||||
|
# 2 : "d:/ymir work/ui/intro/pattern/background_loading_shaman.jpg",
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Loading merged together
|
||||||
|
imgFileNameDict = {
|
||||||
|
# Base
|
||||||
|
0 : "d:/ymir work/uiloading/base/background_loading_warrior.sub",
|
||||||
|
1 : "d:/ymir work/uiloading/base/background_loading_shaman.sub",
|
||||||
|
2 : "d:/ymir work/uiloading/base/background_loading_sura.sub",
|
||||||
|
3 : "d:/ymir work/uiloading/base/background_loading_assassin.sub",
|
||||||
|
4 : "d:/ymir work/uiloading/base/background_loading_assassin2.sub",
|
||||||
|
5 : "d:/ymir work/uiloading/base/background_loading_assassin3.sub",
|
||||||
|
6 : "d:/ymir work/uiloading/base/background_loading_sura2.sub",
|
||||||
|
7 : "d:/ymir work/uiloading/base/background_loading_assassin3.sub",
|
||||||
|
# Grotto
|
||||||
|
8 : "d:/ymir work/uiloading/grotto/background_loading_samahi1.sub",
|
||||||
|
9 : "d:/ymir work/uiloading/grotto/background_loading_warrior5.sub",
|
||||||
|
10 : "d:/ymir work/uiloading/grotto/background_loading_warriorghist1.sub",
|
||||||
|
# Catacomb
|
||||||
|
11 : "d:/ymir work/uiloading/catacomb/loading0.sub",
|
||||||
|
12 : "d:/ymir work/uiloading/catacomb/loading1.sub",
|
||||||
|
13 : "d:/ymir work/uiloading/catacomb/loading2.sub",
|
||||||
|
14 : "d:/ymir work/uiloading/catacomb/loading3.sub",
|
||||||
|
# Dark Dragons
|
||||||
|
15 : "d:/ymir work/uiloading/dark_dragons/loading0.sub",
|
||||||
|
16 : "d:/ymir work/uiloading/dark_dragons/loading1.sub",
|
||||||
|
17 : "d:/ymir work/uiloading/dark_dragons/loading2.sub",
|
||||||
|
18 : "d:/ymir work/uiloading/dark_dragons/loading3.sub",
|
||||||
|
# Purgatory
|
||||||
|
19 : "d:/ymir work/uiloading/purgatory/loading0.sub",
|
||||||
|
20 : "d:/ymir work/uiloading/purgatory/loading1.sub",
|
||||||
|
21 : "d:/ymir work/uiloading/purgatory/loading2.sub",
|
||||||
|
22 : "d:/ymir work/uiloading/purgatory/loading3.sub",
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
imgFileName = imgFileNameDict[app.GetRandom(0, len(imgFileNameDict) - 1)]
|
||||||
|
self.loadingImage.LoadImage(imgFileName)
|
||||||
|
|
||||||
|
except:
|
||||||
|
print "LoadingWindow.Open.LoadImage - %s File Load Error" % (imgFileName)
|
||||||
|
self.loadingImage.Hide()
|
||||||
|
|
||||||
|
|
||||||
|
width = float(wndMgr.GetScreenWidth()) / float(self.loadingImage.GetWidth())
|
||||||
|
height = float(wndMgr.GetScreenHeight()) / float(self.loadingImage.GetHeight())
|
||||||
|
|
||||||
|
self.loadingImage.SetScale(width, height)
|
||||||
|
self.loadingGage.SetPercentage(2, 100)
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
chrSlot=self.stream.GetCharacterSlot()
|
||||||
|
net.SendSelectCharacterPacket(chrSlot)
|
||||||
|
|
||||||
|
app.SetFrameSkip(0)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
print "---------------------------------------------------------------------------- CLOSE LOADING WINDOW"
|
||||||
|
|
||||||
|
app.SetFrameSkip(1)
|
||||||
|
|
||||||
|
self.loadStepList=[]
|
||||||
|
self.loadingImage=0
|
||||||
|
self.loadingGage=0
|
||||||
|
self.errMsg=0
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
app.SetFrameSkip(1)
|
||||||
|
self.stream.SetLoginPhase()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def __SetNext(self, next):
|
||||||
|
if next:
|
||||||
|
self.update=ui.__mem_func__(next)
|
||||||
|
else:
|
||||||
|
self.update=0
|
||||||
|
|
||||||
|
def __SetProgress(self, p):
|
||||||
|
if self.loadingGage:
|
||||||
|
self.loadingGage.SetPercentage(2+98*p/100, 100)
|
||||||
|
|
||||||
|
def DEBUG_LoadData(self, playerX, playerY):
|
||||||
|
self.playerX=playerX
|
||||||
|
self.playerY=playerY
|
||||||
|
|
||||||
|
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||||
|
self.__RegisterTitleName()
|
||||||
|
self.__RegisterColor()
|
||||||
|
self.__InitData()
|
||||||
|
self.__LoadMap()
|
||||||
|
self.__LoadSound()
|
||||||
|
self.__LoadEffect()
|
||||||
|
self.__LoadWarrior()
|
||||||
|
self.__LoadAssassin()
|
||||||
|
self.__LoadSura()
|
||||||
|
self.__LoadShaman()
|
||||||
|
self.__LoadSkill()
|
||||||
|
self.__LoadEnemy()
|
||||||
|
self.__LoadNPC()
|
||||||
|
self.__StartGame()
|
||||||
|
|
||||||
|
def LoadData(self, playerX, playerY):
|
||||||
|
self.playerX=playerX
|
||||||
|
self.playerY=playerY
|
||||||
|
|
||||||
|
self.__RegisterDungeonMapName()
|
||||||
|
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||||
|
self.__RegisterTitleName()
|
||||||
|
self.__RegisterColor()
|
||||||
|
self.__RegisterEmotionIcon()
|
||||||
|
|
||||||
|
self.loadStepList=[
|
||||||
|
(0, ui.__mem_func__(self.__InitData)),
|
||||||
|
(10, ui.__mem_func__(self.__LoadMap)),
|
||||||
|
(30, ui.__mem_func__(self.__LoadSound)),
|
||||||
|
(40, ui.__mem_func__(self.__LoadEffect)),
|
||||||
|
(50, ui.__mem_func__(self.__LoadWarrior)),
|
||||||
|
(60, ui.__mem_func__(self.__LoadAssassin)),
|
||||||
|
(70, ui.__mem_func__(self.__LoadSura)),
|
||||||
|
(80, ui.__mem_func__(self.__LoadShaman)),
|
||||||
|
(90, ui.__mem_func__(self.__LoadSkill)),
|
||||||
|
(93, ui.__mem_func__(self.__LoadEnemy)),
|
||||||
|
(97, ui.__mem_func__(self.__LoadNPC)),
|
||||||
|
|
||||||
|
# GUILD_BUILDING
|
||||||
|
(98, ui.__mem_func__(self.__LoadGuildBuilding)),
|
||||||
|
# END_OF_GUILD_BUILDING
|
||||||
|
|
||||||
|
(100, ui.__mem_func__(self.__StartGame)),
|
||||||
|
]
|
||||||
|
|
||||||
|
self.__SetProgress(0)
|
||||||
|
#self.__SetNext(self.__LoadMap)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
if len(self.loadStepList)>0:
|
||||||
|
(progress, runFunc)=self.loadStepList[0]
|
||||||
|
|
||||||
|
try:
|
||||||
|
runFunc()
|
||||||
|
except:
|
||||||
|
self.errMsg.Show()
|
||||||
|
self.loadStepList=[]
|
||||||
|
|
||||||
|
## 이곳에서 syserr.txt 를 보낸다.
|
||||||
|
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError(" !!! Failed to load game data : STEP [%d]" % (progress))
|
||||||
|
|
||||||
|
#import shutil
|
||||||
|
#import os
|
||||||
|
#shutil.copyfile("syserr.txt", "errorlog.txt")
|
||||||
|
#os.system("errorlog.exe")
|
||||||
|
|
||||||
|
app.Exit()
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
self.loadStepList.pop(0)
|
||||||
|
|
||||||
|
self.__SetProgress(progress)
|
||||||
|
|
||||||
|
def __InitData(self):
|
||||||
|
playerSettingModule.LoadGameData("INIT")
|
||||||
|
|
||||||
|
def __RegisterDungeonMapName(self):
|
||||||
|
background.RegisterDungeonMapName("metin2_map_spiderdungeon")
|
||||||
|
background.RegisterDungeonMapName("metin2_map_monkeydungeon")
|
||||||
|
background.RegisterDungeonMapName("metin2_map_monkeydungeon_02")
|
||||||
|
background.RegisterDungeonMapName("metin2_map_monkeydungeon_03")
|
||||||
|
background.RegisterDungeonMapName("metin2_map_deviltower1")
|
||||||
|
|
||||||
|
def __RegisterSkill(self):
|
||||||
|
|
||||||
|
race = net.GetMainActorRace()
|
||||||
|
group = net.GetMainActorSkillGroup()
|
||||||
|
empire = net.GetMainActorEmpire()
|
||||||
|
|
||||||
|
playerSettingModule.RegisterSkill(race, group, empire)
|
||||||
|
|
||||||
|
def __RegisterTitleName(self):
|
||||||
|
for i in xrange(len(localeInfo.TITLE_NAME_LIST)):
|
||||||
|
chrmgr.RegisterTitleName(i, localeInfo.TITLE_NAME_LIST[i])
|
||||||
|
|
||||||
|
def __RegisterColor(self):
|
||||||
|
|
||||||
|
## Name
|
||||||
|
NAME_COLOR_DICT = {
|
||||||
|
chrmgr.NAMECOLOR_PC : colorInfo.CHR_NAME_RGB_PC,
|
||||||
|
chrmgr.NAMECOLOR_NPC : colorInfo.CHR_NAME_RGB_NPC,
|
||||||
|
chrmgr.NAMECOLOR_MOB : colorInfo.CHR_NAME_RGB_MOB,
|
||||||
|
chrmgr.NAMECOLOR_PVP : colorInfo.CHR_NAME_RGB_PVP,
|
||||||
|
chrmgr.NAMECOLOR_PK : colorInfo.CHR_NAME_RGB_PK,
|
||||||
|
chrmgr.NAMECOLOR_PARTY : colorInfo.CHR_NAME_RGB_PARTY,
|
||||||
|
chrmgr.NAMECOLOR_WARP : colorInfo.CHR_NAME_RGB_WARP,
|
||||||
|
chrmgr.NAMECOLOR_WAYPOINT : colorInfo.CHR_NAME_RGB_WAYPOINT,
|
||||||
|
|
||||||
|
chrmgr.NAMECOLOR_EMPIRE_MOB : colorInfo.CHR_NAME_RGB_EMPIRE_MOB,
|
||||||
|
chrmgr.NAMECOLOR_EMPIRE_NPC : colorInfo.CHR_NAME_RGB_EMPIRE_NPC,
|
||||||
|
chrmgr.NAMECOLOR_EMPIRE_PC+1 : colorInfo.CHR_NAME_RGB_EMPIRE_PC_A,
|
||||||
|
chrmgr.NAMECOLOR_EMPIRE_PC+2 : colorInfo.CHR_NAME_RGB_EMPIRE_PC_B,
|
||||||
|
chrmgr.NAMECOLOR_EMPIRE_PC+3 : colorInfo.CHR_NAME_RGB_EMPIRE_PC_C,
|
||||||
|
}
|
||||||
|
for name, rgb in NAME_COLOR_DICT.items():
|
||||||
|
chrmgr.RegisterNameColor(name, rgb[0], rgb[1], rgb[2])
|
||||||
|
|
||||||
|
## Title
|
||||||
|
TITLE_COLOR_DICT = ( colorInfo.TITLE_RGB_GOOD_4,
|
||||||
|
colorInfo.TITLE_RGB_GOOD_3,
|
||||||
|
colorInfo.TITLE_RGB_GOOD_2,
|
||||||
|
colorInfo.TITLE_RGB_GOOD_1,
|
||||||
|
colorInfo.TITLE_RGB_NORMAL,
|
||||||
|
colorInfo.TITLE_RGB_EVIL_1,
|
||||||
|
colorInfo.TITLE_RGB_EVIL_2,
|
||||||
|
colorInfo.TITLE_RGB_EVIL_3,
|
||||||
|
colorInfo.TITLE_RGB_EVIL_4, )
|
||||||
|
count = 0
|
||||||
|
for rgb in TITLE_COLOR_DICT:
|
||||||
|
chrmgr.RegisterTitleColor(count, rgb[0], rgb[1], rgb[2])
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
def __RegisterEmotionIcon(self):
|
||||||
|
emotion.RegisterEmotionIcons()
|
||||||
|
|
||||||
|
def __LoadMap(self):
|
||||||
|
net.Warp(self.playerX, self.playerY)
|
||||||
|
|
||||||
|
def __LoadSound(self):
|
||||||
|
playerSettingModule.LoadGameData("SOUND")
|
||||||
|
|
||||||
|
def __LoadEffect(self):
|
||||||
|
playerSettingModule.LoadGameData("EFFECT")
|
||||||
|
|
||||||
|
def __LoadWarrior(self):
|
||||||
|
playerSettingModule.LoadGameData("WARRIOR")
|
||||||
|
|
||||||
|
def __LoadAssassin(self):
|
||||||
|
playerSettingModule.LoadGameData("ASSASSIN")
|
||||||
|
|
||||||
|
def __LoadSura(self):
|
||||||
|
playerSettingModule.LoadGameData("SURA")
|
||||||
|
|
||||||
|
def __LoadShaman(self):
|
||||||
|
playerSettingModule.LoadGameData("SHAMAN")
|
||||||
|
|
||||||
|
def __LoadSkill(self):
|
||||||
|
playerSettingModule.LoadGameData("SKILL")
|
||||||
|
|
||||||
|
def __LoadEnemy(self):
|
||||||
|
playerSettingModule.LoadGameData("ENEMY")
|
||||||
|
|
||||||
|
def __LoadNPC(self):
|
||||||
|
playerSettingModule.LoadGameData("NPC")
|
||||||
|
|
||||||
|
# GUILD_BUILDING
|
||||||
|
def __LoadGuildBuilding(self):
|
||||||
|
playerSettingModule.LoadGuildBuildingList(localeInfo.GUILD_BUILDING_LIST_TXT)
|
||||||
|
# END_OF_GUILD_BUILDING
|
||||||
|
|
||||||
|
def __StartGame(self):
|
||||||
|
background.SetViewDistanceSet(background.DISTANCE0, 25600)
|
||||||
|
"""
|
||||||
|
background.SetViewDistanceSet(background.DISTANCE1, 19200)
|
||||||
|
background.SetViewDistanceSet(background.DISTANCE2, 12800)
|
||||||
|
background.SetViewDistanceSet(background.DISTANCE3, 9600)
|
||||||
|
background.SetViewDistanceSet(background.DISTANCE4, 6400)
|
||||||
|
"""
|
||||||
|
background.SelectViewDistanceNum(background.DISTANCE0)
|
||||||
|
|
||||||
|
app.SetGlobalCenterPosition(self.playerX, self.playerY)
|
||||||
|
|
||||||
|
net.StartGame()
|
||||||
+1379
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
|||||||
|
import app
|
||||||
|
import net
|
||||||
|
import ui
|
||||||
|
import snd
|
||||||
|
import wndMgr
|
||||||
|
import uiScriptLocale
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
# 대부분의 실제 구현은 PythonApplicationLogo.cpp에 있다.
|
||||||
|
|
||||||
|
app.SetGuildMarkPath("test")
|
||||||
|
|
||||||
|
class LogoWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
# 보여 줄 동영상 목록 (배열 순서대로 보여줌)
|
||||||
|
videoList = []
|
||||||
|
|
||||||
|
def __init__(self, stream):
|
||||||
|
print "NEW LOGO WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_LOGO, self)
|
||||||
|
self.stream = stream
|
||||||
|
self.playingVideo = 0
|
||||||
|
self.bNeedUpdate = True
|
||||||
|
self.nextLogoIndex = 0
|
||||||
|
self.videoList = ["logo1.avi", "logo2.avi"]
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_LOGO, 0)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE LOGO WINDOW"
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
|
||||||
|
self.SetWindowName("SelectLogoWindow")
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.LoadNextVideo()
|
||||||
|
|
||||||
|
app.ShowCursor()
|
||||||
|
print "OPEN LOGO WINDOW ----------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
print "---------------------------------------------------------------CLOSE LOGO WINDOW"
|
||||||
|
app.OnLogoClose()
|
||||||
|
self.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
app.HideCursor()
|
||||||
|
|
||||||
|
# 영상 재생이 불가능한 환경이거나, 파일이 존재하지 않는 경우 introLogin으로 skip.
|
||||||
|
def OnUpdate(self):
|
||||||
|
if self.bNeedUpdate:
|
||||||
|
if self.playingVideo == 0:
|
||||||
|
if self.nextLogoIndex < len(self.videoList):
|
||||||
|
self.CloseVideo()
|
||||||
|
self.LoadNextVideo()
|
||||||
|
else:
|
||||||
|
self.bNeedUpdate = False
|
||||||
|
self.stream.SetLoginPhase()
|
||||||
|
else:
|
||||||
|
self.playingVideo = app.OnLogoUpdate()
|
||||||
|
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
if self.playingVideo:
|
||||||
|
app.OnLogoRender()
|
||||||
|
|
||||||
|
def LoadNextVideo(self):
|
||||||
|
if self.nextLogoIndex < len(self.videoList):
|
||||||
|
self.playingVideo = app.OnLogoOpen(self.videoList[self.nextLogoIndex])
|
||||||
|
self.nextLogoIndex = self.nextLogoIndex + 1
|
||||||
|
|
||||||
|
def CloseVideo(self):
|
||||||
|
app.OnLogoClose()
|
||||||
|
|
||||||
@@ -0,0 +1,779 @@
|
|||||||
|
import chr
|
||||||
|
import grp
|
||||||
|
import app
|
||||||
|
import math
|
||||||
|
import wndMgr
|
||||||
|
import snd
|
||||||
|
import net
|
||||||
|
import systemSetting
|
||||||
|
import localeInfo
|
||||||
|
import chr
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
import networkModule
|
||||||
|
import musicInfo
|
||||||
|
import playerSettingModule
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# 빠른 실행을 위한 모듈 로딩 분담
|
||||||
|
####################################
|
||||||
|
import uiCommon
|
||||||
|
import uiMapNameShower
|
||||||
|
import uiAffectShower
|
||||||
|
import uiPlayerGauge
|
||||||
|
import uiCharacter
|
||||||
|
import uiTarget
|
||||||
|
import consoleModule
|
||||||
|
|
||||||
|
# interface module이 문제야...
|
||||||
|
import interfaceModule
|
||||||
|
import uiTaskBar
|
||||||
|
import uiInventory
|
||||||
|
|
||||||
|
###################################
|
||||||
|
|
||||||
|
LEAVE_BUTTON_FOR_POTAL = False
|
||||||
|
NOT_NEED_DELETE_CODE = False
|
||||||
|
ENABLE_ENGNUM_DELETE_CODE = False
|
||||||
|
|
||||||
|
if localeInfo.IsJAPAN():
|
||||||
|
NOT_NEED_DELETE_CODE = True
|
||||||
|
elif localeInfo.IsHONGKONG():
|
||||||
|
ENABLE_ENGNUM_DELETE_CODE = True
|
||||||
|
elif localeInfo.IsNEWCIBN() or localeInfo.IsCIBN10():
|
||||||
|
ENABLE_ENGNUM_DELETE_CODE = True
|
||||||
|
elif localeInfo.IsEUROPE():
|
||||||
|
ENABLE_ENGNUM_DELETE_CODE = True
|
||||||
|
|
||||||
|
###################################
|
||||||
|
|
||||||
|
class SelectCharacterWindow(ui.Window):
|
||||||
|
|
||||||
|
# SLOT4
|
||||||
|
#SLOT_ROTATION = ( 140.0, 260.0, 20.0 )
|
||||||
|
#SLOT_COUNT = 3
|
||||||
|
SLOT_ROTATION = [135.0, 225.0, 315.0, 45.0]
|
||||||
|
SLOT_COUNT = 4
|
||||||
|
CHARACTER_TYPE_COUNT = 4
|
||||||
|
|
||||||
|
EMPIRE_NAME = {
|
||||||
|
net.EMPIRE_A : localeInfo.EMPIRE_A,
|
||||||
|
net.EMPIRE_B : localeInfo.EMPIRE_B,
|
||||||
|
net.EMPIRE_C : localeInfo.EMPIRE_C
|
||||||
|
}
|
||||||
|
|
||||||
|
class CharacterRenderer(ui.Window):
|
||||||
|
def OnRender(self):
|
||||||
|
grp.ClearDepthBuffer()
|
||||||
|
|
||||||
|
grp.SetGameRenderState()
|
||||||
|
grp.PushState()
|
||||||
|
grp.SetOmniLight()
|
||||||
|
|
||||||
|
screenWidth = wndMgr.GetScreenWidth()
|
||||||
|
screenHeight = wndMgr.GetScreenHeight()
|
||||||
|
newScreenWidth = float(screenWidth - 270)
|
||||||
|
newScreenHeight = float(screenHeight)
|
||||||
|
|
||||||
|
grp.SetViewport(270.0/screenWidth, 0.0, newScreenWidth/screenWidth, newScreenHeight/screenHeight)
|
||||||
|
|
||||||
|
app.SetCenterPosition(0.0, 0.0, 0.0)
|
||||||
|
app.SetCamera(1550.0, 15.0, 180.0, 95.0)
|
||||||
|
grp.SetPerspective(10.0, newScreenWidth/newScreenHeight, 1000.0, 3000.0)
|
||||||
|
|
||||||
|
(x, y) = app.GetCursorPosition()
|
||||||
|
grp.SetCursorPosition(x, y)
|
||||||
|
|
||||||
|
chr.Deform()
|
||||||
|
chr.Render()
|
||||||
|
|
||||||
|
grp.RestoreViewport()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
def __init__(self, stream):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_SELECT, self)
|
||||||
|
|
||||||
|
self.stream=stream
|
||||||
|
self.slot = self.stream.GetCharacterSlot()
|
||||||
|
|
||||||
|
self.openLoadingFlag = False
|
||||||
|
self.startIndex = -1
|
||||||
|
self.startReservingTime = 0
|
||||||
|
|
||||||
|
self.flagDict = {}
|
||||||
|
self.curRotation = []
|
||||||
|
self.destRotation = []
|
||||||
|
for rot in self.SLOT_ROTATION:
|
||||||
|
self.curRotation.append(rot)
|
||||||
|
self.destRotation.append(rot)
|
||||||
|
|
||||||
|
self.curNameAlpha = []
|
||||||
|
self.destNameAlpha = []
|
||||||
|
for i in xrange(self.CHARACTER_TYPE_COUNT):
|
||||||
|
self.curNameAlpha.append(0.0)
|
||||||
|
self.destNameAlpha.append(0.0)
|
||||||
|
|
||||||
|
self.curGauge = [0.0, 0.0, 0.0, 0.0]
|
||||||
|
self.destGauge = [0.0, 0.0, 0.0, 0.0]
|
||||||
|
|
||||||
|
self.dlgBoard = 0
|
||||||
|
self.changeNameFlag = False
|
||||||
|
self.nameInputBoard = None
|
||||||
|
self.sendedChangeNamePacket = False
|
||||||
|
|
||||||
|
self.startIndex = -1
|
||||||
|
self.isLoad = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
net.SetPhaseWindow(net.PHASE_WINDOW_SELECT, 0)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
if not self.__LoadBoardDialog(uiScriptLocale.LOCALE_UISCRIPT_PATH + "selectcharacterwindow.py"):
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("SelectCharacterWindow.Open - __LoadScript Error")
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.__LoadQuestionDialog("uiscript/questiondialog.py"):
|
||||||
|
return
|
||||||
|
|
||||||
|
playerSettingModule.LoadGameData("INIT")
|
||||||
|
|
||||||
|
self.InitCharacterBoard()
|
||||||
|
|
||||||
|
self.btnStart.Enable()
|
||||||
|
self.btnCreate.Enable()
|
||||||
|
self.btnDelete.Enable()
|
||||||
|
self.btnExit.Enable()
|
||||||
|
self.btnLeft.Enable()
|
||||||
|
self.btnRight.Enable()
|
||||||
|
|
||||||
|
self.dlgBoard.Show()
|
||||||
|
self.SetWindowName("SelectCharacterWindow")
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
if self.slot>=0:
|
||||||
|
self.SelectSlot(self.slot)
|
||||||
|
|
||||||
|
if musicInfo.selectMusic != "":
|
||||||
|
snd.SetMusicVolume(systemSetting.GetMusicVolume())
|
||||||
|
snd.FadeInMusic("BGM/"+musicInfo.selectMusic)
|
||||||
|
|
||||||
|
app.SetCenterPosition(0.0, 0.0, 0.0)
|
||||||
|
app.SetCamera(1550.0, 15.0, 180.0, 95.0)
|
||||||
|
|
||||||
|
self.isLoad=1
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
if self.stream.isAutoSelect:
|
||||||
|
chrSlot=self.stream.GetCharacterSlot()
|
||||||
|
self.SelectSlot(chrSlot)
|
||||||
|
self.StartGame()
|
||||||
|
|
||||||
|
self.HideAllFlag()
|
||||||
|
self.SetEmpire(net.GetEmpireID())
|
||||||
|
|
||||||
|
app.ShowCursor()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
if musicInfo.selectMusic != "":
|
||||||
|
snd.FadeOutMusic("BGM/"+musicInfo.selectMusic)
|
||||||
|
|
||||||
|
self.stream.popupWindow.Close()
|
||||||
|
|
||||||
|
if self.dlgBoard:
|
||||||
|
self.dlgBoard.ClearDictionary()
|
||||||
|
|
||||||
|
self.empireName = None
|
||||||
|
self.flagDict = {}
|
||||||
|
self.dlgBoard = None
|
||||||
|
self.btnStart = None
|
||||||
|
self.btnCreate = None
|
||||||
|
self.btnDelete = None
|
||||||
|
self.btnExit = None
|
||||||
|
self.btnLeft = None
|
||||||
|
self.btnRight = None
|
||||||
|
self.backGround = None
|
||||||
|
|
||||||
|
self.dlgQuestion.ClearDictionary()
|
||||||
|
self.dlgQuestion = None
|
||||||
|
self.dlgQuestionText = None
|
||||||
|
self.dlgQuestionAcceptButton = None
|
||||||
|
self.dlgQuestionCancelButton = None
|
||||||
|
self.privateInputBoard = None
|
||||||
|
self.nameInputBoard = None
|
||||||
|
|
||||||
|
chr.DeleteInstance(0)
|
||||||
|
chr.DeleteInstance(1)
|
||||||
|
chr.DeleteInstance(2)
|
||||||
|
chr.DeleteInstance(3)
|
||||||
|
|
||||||
|
self.Hide()
|
||||||
|
self.KillFocus()
|
||||||
|
|
||||||
|
app.HideCursor()
|
||||||
|
|
||||||
|
def SetEmpire(self, id):
|
||||||
|
self.empireName.SetText(self.EMPIRE_NAME.get(id, ""))
|
||||||
|
if self.flagDict.has_key(id):
|
||||||
|
self.flagDict[id].Show()
|
||||||
|
|
||||||
|
def HideAllFlag(self):
|
||||||
|
for flag in self.flagDict.values():
|
||||||
|
flag.Hide()
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
if not self.isLoad:
|
||||||
|
return
|
||||||
|
|
||||||
|
# SLOT4
|
||||||
|
indexArray = (3, 2, 1, 0)
|
||||||
|
for index in indexArray:
|
||||||
|
id=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_ID)
|
||||||
|
race=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_RACE)
|
||||||
|
form=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_FORM)
|
||||||
|
name=net.GetAccountCharacterSlotDataString(index, net.ACCOUNT_CHARACTER_SLOT_NAME)
|
||||||
|
hair=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_HAIR)
|
||||||
|
|
||||||
|
if id:
|
||||||
|
self.MakeCharacter(index, id, name, race, form, hair)
|
||||||
|
self.SelectSlot(index)
|
||||||
|
|
||||||
|
self.SelectSlot(self.slot)
|
||||||
|
|
||||||
|
def GetCharacterSlotID(self, slotIndex):
|
||||||
|
return net.GetAccountCharacterSlotDataInteger(slotIndex, net.ACCOUNT_CHARACTER_SLOT_ID)
|
||||||
|
|
||||||
|
def __LoadQuestionDialog(self, fileName):
|
||||||
|
self.dlgQuestion = ui.ScriptWindow()
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self.dlgQuestion, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectCharacterWindow.LoadQuestionDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.dlgQuestion.GetChild
|
||||||
|
self.dlgQuestionText=GetObject("message")
|
||||||
|
self.dlgQuestionAcceptButton=GetObject("accept")
|
||||||
|
self.dlgQuestionCancelButton=GetObject("cancel")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectCharacterWindow.LoadQuestionDialog.BindObject")
|
||||||
|
|
||||||
|
self.dlgQuestionText.SetText(localeInfo.SELECT_DO_YOU_DELETE_REALLY)
|
||||||
|
self.dlgQuestionAcceptButton.SetEvent(ui.__mem_func__(self.RequestDeleteCharacter))
|
||||||
|
self.dlgQuestionCancelButton.SetEvent(ui.__mem_func__(self.dlgQuestion.Hide))
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def __LoadBoardDialog(self, fileName):
|
||||||
|
self.dlgBoard = ui.ScriptWindow()
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self.dlgBoard, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectCharacterWindow.LoadBoardDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.dlgBoard.GetChild
|
||||||
|
|
||||||
|
self.btnStart = GetObject("start_button")
|
||||||
|
self.btnCreate = GetObject("create_button")
|
||||||
|
self.btnDelete = GetObject("delete_button")
|
||||||
|
self.btnExit = GetObject("exit_button")
|
||||||
|
|
||||||
|
self.CharacterName = GetObject("character_name_value")
|
||||||
|
self.CharacterLevel = GetObject("character_level_value")
|
||||||
|
self.PlayTime = GetObject("character_play_time_value")
|
||||||
|
self.CharacterHTH = GetObject("character_hth_value")
|
||||||
|
self.CharacterINT = GetObject("character_int_value")
|
||||||
|
self.CharacterSTR = GetObject("character_str_value")
|
||||||
|
self.CharacterDEX = GetObject("character_dex_value")
|
||||||
|
self.GuildName = GetObject("GuildName")
|
||||||
|
|
||||||
|
self.NameList = []
|
||||||
|
self.NameList.append(GetObject("name_warrior"))
|
||||||
|
self.NameList.append(GetObject("name_assassin"))
|
||||||
|
self.NameList.append(GetObject("name_sura"))
|
||||||
|
self.NameList.append(GetObject("name_shaman"))
|
||||||
|
|
||||||
|
self.GaugeList = []
|
||||||
|
self.GaugeList.append(GetObject("gauge_hth"))
|
||||||
|
self.GaugeList.append(GetObject("gauge_int"))
|
||||||
|
self.GaugeList.append(GetObject("gauge_str"))
|
||||||
|
self.GaugeList.append(GetObject("gauge_dex"))
|
||||||
|
|
||||||
|
self.btnLeft = GetObject("left_button")
|
||||||
|
self.btnRight = GetObject("right_button")
|
||||||
|
|
||||||
|
self.empireName = GetObject("EmpireName")
|
||||||
|
self.flagDict[net.EMPIRE_A] = GetObject("EmpireFlag_A")
|
||||||
|
self.flagDict[net.EMPIRE_B] = GetObject("EmpireFlag_B")
|
||||||
|
self.flagDict[net.EMPIRE_C] = GetObject("EmpireFlag_C")
|
||||||
|
|
||||||
|
self.backGround = GetObject("BackGround")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectCharacterWindow.LoadBoardDialog.BindObject")
|
||||||
|
|
||||||
|
for name in self.NameList:
|
||||||
|
name.SetAlpha(0.0)
|
||||||
|
|
||||||
|
self.btnStart.SetEvent(ui.__mem_func__(self.StartGame))
|
||||||
|
self.btnCreate.SetEvent(ui.__mem_func__(self.CreateCharacter))
|
||||||
|
self.btnExit.SetEvent(ui.__mem_func__(self.ExitSelect))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if NOT_NEED_DELETE_CODE:
|
||||||
|
self.btnDelete.SetEvent(ui.__mem_func__(self.PopupDeleteQuestion))
|
||||||
|
else:
|
||||||
|
self.btnDelete.SetEvent(ui.__mem_func__(self.InputPrivateCode))
|
||||||
|
|
||||||
|
self.btnLeft.SetEvent(ui.__mem_func__(self.DecreaseSlotIndex))
|
||||||
|
self.btnRight.SetEvent(ui.__mem_func__(self.IncreaseSlotIndex))
|
||||||
|
|
||||||
|
self.chrRenderer = self.CharacterRenderer()
|
||||||
|
self.chrRenderer.SetParent(self.backGround)
|
||||||
|
self.chrRenderer.Show()
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def SameLoginDisconnect(self):
|
||||||
|
self.stream.popupWindow.Close()
|
||||||
|
self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_SAMELOGIN, self.ExitSelect, localeInfo.UI_OK)
|
||||||
|
#self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_ALREAY, app.Exit, localeInfo.UI_OK)
|
||||||
|
|
||||||
|
def MakeCharacter(self, index, id, name, race, form, hair):
|
||||||
|
if 0 == id:
|
||||||
|
return
|
||||||
|
|
||||||
|
chr.CreateInstance(index)
|
||||||
|
chr.SelectInstance(index)
|
||||||
|
chr.SetVirtualID(index)
|
||||||
|
chr.SetNameString(name)
|
||||||
|
|
||||||
|
chr.SetRace(race)
|
||||||
|
chr.SetArmor(form)
|
||||||
|
chr.SetHair(hair)
|
||||||
|
|
||||||
|
chr.Refresh()
|
||||||
|
chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
|
||||||
|
chr.SetLoopMotion(chr.MOTION_INTRO_WAIT)
|
||||||
|
|
||||||
|
chr.SetRotation(0.0)
|
||||||
|
|
||||||
|
## Manage Character
|
||||||
|
def StartGame(self):
|
||||||
|
|
||||||
|
if self.sendedChangeNamePacket:
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.changeNameFlag:
|
||||||
|
self.OpenChangeNameDialog()
|
||||||
|
return
|
||||||
|
|
||||||
|
if -1 != self.startIndex:
|
||||||
|
return
|
||||||
|
|
||||||
|
if musicInfo.selectMusic != "":
|
||||||
|
snd.FadeLimitOutMusic("BGM/"+musicInfo.selectMusic, systemSetting.GetMusicVolume()*0.05)
|
||||||
|
|
||||||
|
self.btnStart.SetUp()
|
||||||
|
self.btnCreate.SetUp()
|
||||||
|
self.btnDelete.SetUp()
|
||||||
|
self.btnExit.SetUp()
|
||||||
|
self.btnLeft.SetUp()
|
||||||
|
self.btnRight.SetUp()
|
||||||
|
|
||||||
|
self.btnStart.Disable()
|
||||||
|
self.btnCreate.Disable()
|
||||||
|
self.btnDelete.Disable()
|
||||||
|
self.btnExit.Disable()
|
||||||
|
self.btnLeft.Disable()
|
||||||
|
self.btnRight.Disable()
|
||||||
|
self.dlgQuestion.Hide()
|
||||||
|
|
||||||
|
self.stream.SetCharacterSlot(self.slot)
|
||||||
|
|
||||||
|
self.startIndex = self.slot
|
||||||
|
self.startReservingTime = app.GetTime()
|
||||||
|
|
||||||
|
for i in xrange(self.SLOT_COUNT):
|
||||||
|
|
||||||
|
if False == chr.HasInstance(i):
|
||||||
|
continue
|
||||||
|
|
||||||
|
chr.SelectInstance(i)
|
||||||
|
|
||||||
|
if i == self.slot:
|
||||||
|
self.slot=self.slot
|
||||||
|
chr.PushOnceMotion(chr.MOTION_INTRO_SELECTED, 0.1)
|
||||||
|
continue
|
||||||
|
|
||||||
|
chr.PushOnceMotion(chr.MOTION_INTRO_NOT_SELECTED, 0.1)
|
||||||
|
|
||||||
|
def OpenChangeNameDialog(self):
|
||||||
|
import uiCommon
|
||||||
|
nameInputBoard = uiCommon.InputDialogWithDescription()
|
||||||
|
nameInputBoard.SetTitle(localeInfo.SELECT_CHANGE_NAME_TITLE)
|
||||||
|
nameInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputName))
|
||||||
|
nameInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputName))
|
||||||
|
nameInputBoard.SetMaxLength(chr.PLAYER_NAME_MAX_LEN)
|
||||||
|
nameInputBoard.SetBoardWidth(200)
|
||||||
|
nameInputBoard.SetDescription(localeInfo.SELECT_INPUT_CHANGING_NAME)
|
||||||
|
nameInputBoard.Open()
|
||||||
|
nameInputBoard.slot = self.slot
|
||||||
|
self.nameInputBoard = nameInputBoard
|
||||||
|
|
||||||
|
def OnChangeName(self, id, name):
|
||||||
|
self.SelectSlot(id)
|
||||||
|
self.sendedChangeNamePacket = False
|
||||||
|
self.PopupMessage(localeInfo.SELECT_CHANGED_NAME)
|
||||||
|
|
||||||
|
def AcceptInputName(self):
|
||||||
|
changeName = self.nameInputBoard.GetText()
|
||||||
|
if not changeName:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.sendedChangeNamePacket = True
|
||||||
|
net.SendChangeNamePacket(self.nameInputBoard.slot, changeName)
|
||||||
|
return self.CancelInputName()
|
||||||
|
|
||||||
|
def CancelInputName(self):
|
||||||
|
self.nameInputBoard.Close()
|
||||||
|
self.nameInputBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCreateFailure(self, type):
|
||||||
|
self.sendedChangeNamePacket = False
|
||||||
|
if 0 == type:
|
||||||
|
self.PopupMessage(localeInfo.SELECT_CHANGE_FAILURE_STRANGE_NAME)
|
||||||
|
elif 1 == type:
|
||||||
|
self.PopupMessage(localeInfo.SELECT_CHANGE_FAILURE_ALREADY_EXIST_NAME)
|
||||||
|
elif 100 == type:
|
||||||
|
self.PopupMessage(localeInfo.SELECT_CHANGE_FAILURE_STRANGE_INDEX)
|
||||||
|
|
||||||
|
def CreateCharacter(self):
|
||||||
|
id = self.GetCharacterSlotID(self.slot)
|
||||||
|
if 0==id:
|
||||||
|
self.stream.SetCharacterSlot(self.slot)
|
||||||
|
|
||||||
|
EMPIRE_MODE = 1
|
||||||
|
|
||||||
|
if EMPIRE_MODE:
|
||||||
|
if self.__AreAllSlotEmpty():
|
||||||
|
self.stream.SetReselectEmpirePhase()
|
||||||
|
else:
|
||||||
|
self.stream.SetCreateCharacterPhase()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.stream.SetCreateCharacterPhase()
|
||||||
|
|
||||||
|
def __AreAllSlotEmpty(self):
|
||||||
|
for iSlot in xrange(self.SLOT_COUNT):
|
||||||
|
if 0!=net.GetAccountCharacterSlotDataInteger(iSlot, net.ACCOUNT_CHARACTER_SLOT_ID):
|
||||||
|
return 0
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def PopupDeleteQuestion(self):
|
||||||
|
id = self.GetCharacterSlotID(self.slot)
|
||||||
|
if 0 == id:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.dlgQuestion.Show()
|
||||||
|
self.dlgQuestion.SetTop()
|
||||||
|
|
||||||
|
def RequestDeleteCharacter(self):
|
||||||
|
self.dlgQuestion.Hide()
|
||||||
|
|
||||||
|
id = self.GetCharacterSlotID(self.slot)
|
||||||
|
if 0 == id:
|
||||||
|
self.PopupMessage(localeInfo.SELECT_EMPTY_SLOT)
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendDestroyCharacterPacket(self.slot, "1234567")
|
||||||
|
self.PopupMessage(localeInfo.SELECT_DELEING)
|
||||||
|
|
||||||
|
def InputPrivateCode(self):
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
privateInputBoard = uiCommon.InputDialogWithDescription()
|
||||||
|
privateInputBoard.SetTitle(localeInfo.INPUT_PRIVATE_CODE_DIALOG_TITLE)
|
||||||
|
privateInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrivateCode))
|
||||||
|
privateInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrivateCode))
|
||||||
|
|
||||||
|
if ENABLE_ENGNUM_DELETE_CODE:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
privateInputBoard.SetNumberMode()
|
||||||
|
|
||||||
|
privateInputBoard.SetSecretMode()
|
||||||
|
privateInputBoard.SetMaxLength(7)
|
||||||
|
|
||||||
|
privateInputBoard.SetBoardWidth(250)
|
||||||
|
privateInputBoard.SetDescription(localeInfo.INPUT_PRIVATE_CODE_DIALOG_DESCRIPTION)
|
||||||
|
privateInputBoard.Open()
|
||||||
|
self.privateInputBoard = privateInputBoard
|
||||||
|
|
||||||
|
def AcceptInputPrivateCode(self):
|
||||||
|
privateCode = self.privateInputBoard.GetText()
|
||||||
|
if not privateCode:
|
||||||
|
return
|
||||||
|
|
||||||
|
id = self.GetCharacterSlotID(self.slot)
|
||||||
|
if 0 == id:
|
||||||
|
self.PopupMessage(localeInfo.SELECT_EMPTY_SLOT)
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendDestroyCharacterPacket(self.slot, privateCode)
|
||||||
|
self.PopupMessage(localeInfo.SELECT_DELEING)
|
||||||
|
|
||||||
|
self.CancelInputPrivateCode()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def CancelInputPrivateCode(self):
|
||||||
|
self.privateInputBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnDeleteSuccess(self, slot):
|
||||||
|
self.PopupMessage(localeInfo.SELECT_DELETED)
|
||||||
|
self.DeleteCharacter(slot)
|
||||||
|
|
||||||
|
def OnDeleteFailure(self):
|
||||||
|
self.PopupMessage(localeInfo.SELECT_CAN_NOT_DELETE)
|
||||||
|
|
||||||
|
def DeleteCharacter(self, index):
|
||||||
|
chr.DeleteInstance(index)
|
||||||
|
self.SelectSlot(self.slot)
|
||||||
|
|
||||||
|
def ExitSelect(self):
|
||||||
|
self.dlgQuestion.Hide()
|
||||||
|
|
||||||
|
if LEAVE_BUTTON_FOR_POTAL:
|
||||||
|
if app.loggined:
|
||||||
|
self.stream.SetPhaseWindow(0)
|
||||||
|
else:
|
||||||
|
self.stream.setloginphase()
|
||||||
|
else:
|
||||||
|
self.stream.SetLoginPhase()
|
||||||
|
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def GetSlotIndex(self):
|
||||||
|
return self.slot
|
||||||
|
|
||||||
|
def DecreaseSlotIndex(self):
|
||||||
|
slotIndex = (self.GetSlotIndex() - 1 + self.SLOT_COUNT) % self.SLOT_COUNT
|
||||||
|
self.SelectSlot(slotIndex)
|
||||||
|
|
||||||
|
def IncreaseSlotIndex(self):
|
||||||
|
slotIndex = (self.GetSlotIndex() + 1) % self.SLOT_COUNT
|
||||||
|
self.SelectSlot(slotIndex)
|
||||||
|
|
||||||
|
def SelectSlot(self, index):
|
||||||
|
|
||||||
|
if index < 0:
|
||||||
|
return
|
||||||
|
if index >= self.SLOT_COUNT:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.slot = index
|
||||||
|
|
||||||
|
chr.SelectInstance(self.slot)
|
||||||
|
|
||||||
|
for i in xrange(self.CHARACTER_TYPE_COUNT):
|
||||||
|
self.destNameAlpha[i] = 0.0
|
||||||
|
|
||||||
|
for i in xrange(self.SLOT_COUNT):
|
||||||
|
self.destRotation[(i+self.slot)%self.SLOT_COUNT] = self.SLOT_ROTATION[i]
|
||||||
|
|
||||||
|
self.destGauge = [0.0, 0.0, 0.0, 0.0]
|
||||||
|
|
||||||
|
id=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID)
|
||||||
|
if 0 != id:
|
||||||
|
|
||||||
|
self.btnStart.Show()
|
||||||
|
self.btnDelete.Show()
|
||||||
|
self.btnCreate.Hide()
|
||||||
|
|
||||||
|
playTime=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME)
|
||||||
|
level=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_LEVEL)
|
||||||
|
race=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_RACE)
|
||||||
|
valueHTH=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_HTH)
|
||||||
|
valueINT=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_INT)
|
||||||
|
valueSTR=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_STR)
|
||||||
|
valueDEX=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_DEX)
|
||||||
|
name=net.GetAccountCharacterSlotDataString(self.slot, net.ACCOUNT_CHARACTER_SLOT_NAME)
|
||||||
|
guildID=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_ID)
|
||||||
|
guildName=net.GetAccountCharacterSlotDataString(self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_NAME)
|
||||||
|
self.changeNameFlag=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG)
|
||||||
|
|
||||||
|
job = chr.RaceToJob(race)
|
||||||
|
if job >= 0 and job < self.CHARACTER_TYPE_COUNT:
|
||||||
|
self.destNameAlpha[job] = 1.0
|
||||||
|
|
||||||
|
self.CharacterName.SetText(name)
|
||||||
|
self.CharacterLevel.SetText(str(level))
|
||||||
|
|
||||||
|
self.PlayTime.SetText(str(playTime))
|
||||||
|
self.CharacterHTH.SetText(str(valueHTH))
|
||||||
|
self.CharacterINT.SetText(str(valueINT))
|
||||||
|
self.CharacterSTR.SetText(str(valueSTR))
|
||||||
|
self.CharacterDEX.SetText(str(valueDEX))
|
||||||
|
|
||||||
|
if guildName:
|
||||||
|
self.GuildName.SetText(guildName)
|
||||||
|
else:
|
||||||
|
self.GuildName.SetText(localeInfo.SELECT_NOT_JOIN_GUILD)
|
||||||
|
|
||||||
|
# statesSummary = float(valueHTH + valueINT + valueSTR + valueDEX)
|
||||||
|
# if statesSummary > 0.0:
|
||||||
|
# self.destGauge = [
|
||||||
|
# float(valueHTH) / statesSummary,
|
||||||
|
# float(valueINT) / statesSummary,
|
||||||
|
# float(valueSTR) / statesSummary,
|
||||||
|
# float(valueDEX) / statesSummary
|
||||||
|
# ]
|
||||||
|
|
||||||
|
|
||||||
|
statesSummary = float(valueHTH + valueINT + valueSTR + valueDEX)
|
||||||
|
if statesSummary > 0.0:
|
||||||
|
self.destGauge =[
|
||||||
|
float(valueHTH) / 90,
|
||||||
|
float(valueINT) / 90,
|
||||||
|
float(valueSTR) / 90,
|
||||||
|
float(valueDEX) / 90
|
||||||
|
]
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
self.InitCharacterBoard()
|
||||||
|
|
||||||
|
def InitCharacterBoard(self):
|
||||||
|
|
||||||
|
self.btnStart.Hide()
|
||||||
|
self.btnDelete.Hide()
|
||||||
|
self.btnCreate.Show()
|
||||||
|
|
||||||
|
self.CharacterName.SetText("")
|
||||||
|
self.CharacterLevel.SetText("")
|
||||||
|
self.PlayTime.SetText("")
|
||||||
|
self.CharacterHTH.SetText("")
|
||||||
|
self.CharacterINT.SetText("")
|
||||||
|
self.CharacterSTR.SetText("")
|
||||||
|
self.CharacterDEX.SetText("")
|
||||||
|
self.GuildName.SetText(localeInfo.SELECT_NOT_JOIN_GUILD)
|
||||||
|
|
||||||
|
## Event
|
||||||
|
def OnKeyDown(self, key):
|
||||||
|
|
||||||
|
if 1 == key:
|
||||||
|
self.ExitSelect()
|
||||||
|
if 2 == key:
|
||||||
|
self.SelectSlot(0)
|
||||||
|
if 3 == key:
|
||||||
|
self.SelectSlot(1)
|
||||||
|
if 4 == key:
|
||||||
|
self.SelectSlot(2)
|
||||||
|
if 5 == key:
|
||||||
|
self.SelectSlot(3)
|
||||||
|
|
||||||
|
if 28 == key:
|
||||||
|
|
||||||
|
id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID)
|
||||||
|
if 0 == id:
|
||||||
|
self.CreateCharacter()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.StartGame()
|
||||||
|
|
||||||
|
if 203 == key:
|
||||||
|
self.slot = (self.GetSlotIndex() - 1 + self.SLOT_COUNT) % self.SLOT_COUNT
|
||||||
|
self.SelectSlot(self.slot)
|
||||||
|
if 205 == key:
|
||||||
|
self.slot = (self.GetSlotIndex() + 1) % self.SLOT_COUNT
|
||||||
|
self.SelectSlot(self.slot)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
chr.Update()
|
||||||
|
|
||||||
|
for i in xrange(4):
|
||||||
|
self.curGauge[i] += (self.destGauge[i] - self.curGauge[i]) / 10.0
|
||||||
|
if abs(self.curGauge[i] - self.destGauge[i]) < 0.005:
|
||||||
|
self.curGauge[i] = self.destGauge[i]
|
||||||
|
self.GaugeList[i].SetPercentage(self.curGauge[i], 1.0)
|
||||||
|
|
||||||
|
for i in xrange(self.CHARACTER_TYPE_COUNT):
|
||||||
|
self.curNameAlpha[i] += (self.destNameAlpha[i] - self.curNameAlpha[i]) / 10.0
|
||||||
|
self.NameList[i].SetAlpha(self.curNameAlpha[i])
|
||||||
|
|
||||||
|
for i in xrange(self.SLOT_COUNT):
|
||||||
|
|
||||||
|
if False == chr.HasInstance(i):
|
||||||
|
continue
|
||||||
|
|
||||||
|
chr.SelectInstance(i)
|
||||||
|
|
||||||
|
distance = 50.0
|
||||||
|
rotRadian = self.curRotation[i] * (math.pi*2) / 360.0
|
||||||
|
x = distance*math.sin(rotRadian) + distance*math.cos(rotRadian)
|
||||||
|
y = distance*math.cos(rotRadian) - distance*math.sin(rotRadian)
|
||||||
|
chr.SetPixelPosition(int(x), int(y), 30)
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
dir = app.GetRotatingDirection(self.destRotation[i], self.curRotation[i])
|
||||||
|
rot = app.GetDegreeDifference(self.destRotation[i], self.curRotation[i])
|
||||||
|
|
||||||
|
if app.DEGREE_DIRECTION_RIGHT == dir:
|
||||||
|
self.curRotation[i] += rot / 10.0
|
||||||
|
elif app.DEGREE_DIRECTION_LEFT == dir:
|
||||||
|
self.curRotation[i] -= rot / 10.0
|
||||||
|
|
||||||
|
self.curRotation[i] = (self.curRotation[i] + 360.0) % 360.0
|
||||||
|
|
||||||
|
#######################################################
|
||||||
|
if -1 != self.startIndex:
|
||||||
|
|
||||||
|
## Temporary
|
||||||
|
## BackGroundLoading이 지원 될때까지 임시로..
|
||||||
|
if app.GetTime() - self.startReservingTime > 3.0:
|
||||||
|
if False == self.openLoadingFlag:
|
||||||
|
chrSlot=self.stream.GetCharacterSlot()
|
||||||
|
net.DirectEnter(chrSlot)
|
||||||
|
self.openLoadingFlag = True
|
||||||
|
|
||||||
|
playTime=net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME)
|
||||||
|
|
||||||
|
import player
|
||||||
|
player.SetPlayTime(playTime)
|
||||||
|
import chat
|
||||||
|
chat.Clear() ## 들어갈때 Chat 을 초기화. 임시 Pos.
|
||||||
|
## Temporary
|
||||||
|
#######################################################
|
||||||
|
|
||||||
|
def EmptyFunc(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def PopupMessage(self, msg, func=0):
|
||||||
|
if not func:
|
||||||
|
func=self.EmptyFunc
|
||||||
|
|
||||||
|
self.stream.popupWindow.Close()
|
||||||
|
self.stream.popupWindow.Open(msg, func, localeInfo.UI_OK)
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
self.ExitSelect()
|
||||||
|
return True
|
||||||
|
|
||||||
@@ -0,0 +1,959 @@
|
|||||||
|
import app
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
MAP_TRENT02 = "MAP_TRENT02" # 烙矫
|
||||||
|
MAP_WL = "MAP_WL" # 烙矫
|
||||||
|
MAP_NUSLUCK = "MAP_NUSLUCK" # 烙矫
|
||||||
|
MAP_TREE2 = "MAP_TREE2"
|
||||||
|
|
||||||
|
BLEND_POTION_NO_TIME = "BLEND_POTION_NO_TIME"
|
||||||
|
BLEND_POTION_NO_INFO = "BLEND_POTION_NO_INFO"
|
||||||
|
|
||||||
|
APP_TITLE = "METIN2"
|
||||||
|
|
||||||
|
GUILD_HEADQUARTER = "Main Building"
|
||||||
|
GUILD_FACILITY = "Facility"
|
||||||
|
GUILD_OBJECT = "Object"
|
||||||
|
GUILD_MEMBER_COUNT_INFINITY = "INFINITY"
|
||||||
|
|
||||||
|
LOGIN_FAILURE_WEB_BLOCK = "BLOCK_LOGIN(WEB)"
|
||||||
|
LOGIN_FAILURE_BLOCK_LOGIN = "BLOCK_LOGIN"
|
||||||
|
CHANNEL_NOTIFY_FULL = "CHANNEL_NOTIFY_FULL"
|
||||||
|
|
||||||
|
GUILD_BUILDING_LIST_TXT = app.GetLocalePath() + "/GuildBuildingList.txt"
|
||||||
|
|
||||||
|
GUILD_MARK_MIN_LEVEL = "3"
|
||||||
|
GUILD_MARK_NOT_ENOUGH_LEVEL = "辨靛饭骇 3捞惑 何磐 啊瓷钦聪促."
|
||||||
|
|
||||||
|
ERROR_MARK_UPLOAD_NEED_RECONNECT = "UploadMark: Reconnect to game"
|
||||||
|
ERROR_MARK_CHECK_NEED_RECONNECT = "CheckMark: Reconnect to game"
|
||||||
|
|
||||||
|
VIRTUAL_KEY_ALPHABET_LOWERS = r"[1234567890]/qwertyuiop\=asdfghjkl;`'zxcvbnm.,"
|
||||||
|
VIRTUAL_KEY_ALPHABET_UPPERS = r'{1234567890}?QWERTYUIOP|+ASDFGHJKL:~"ZXCVBNM<>'
|
||||||
|
VIRTUAL_KEY_SYMBOLS = '!@#$%^&*()_+|{}:"<>?~'
|
||||||
|
VIRTUAL_KEY_NUMBERS = "1234567890-=\[];',./`"
|
||||||
|
VIRTUAL_KEY_SYMBOLS_BR = '!@#$%^&*()_+|{}:"<>?~徉汊殍觏祗螋斛�'
|
||||||
|
|
||||||
|
__IS_ENGLISH = "ENGLISH" == app.GetLocaleServiceName()
|
||||||
|
__IS_HONGKONG = "HONGKONG" == app.GetLocaleServiceName()
|
||||||
|
__IS_NEWCIBN = "locale/newcibn" == app.GetLocalePath()
|
||||||
|
__IS_EUROPE = "EUROPE" == app.GetLocaleServiceName()
|
||||||
|
__IS_CANADA = "locale/ca" == app.GetLocalePath()
|
||||||
|
__IS_BRAZIL = "locale/br" == app.GetLocalePath()
|
||||||
|
__IS_SINGAPORE = "locale/sg" == app.GetLocalePath()
|
||||||
|
__IS_VIETNAM = "locale/vn" == app.GetLocalePath()
|
||||||
|
__IS_ARABIC = "locale/ae" == app.GetLocalePath()
|
||||||
|
__IS_CIBN10 = "locale/cibn10" == app.GetLocalePath()
|
||||||
|
__IS_WE_KOREA = "locale/we_korea" == app.GetLocalePath()
|
||||||
|
__IS_TAIWAN = "locale/taiwan" == app.GetLocalePath()
|
||||||
|
__IS_JAPAN = "locale/japan" == app.GetLocalePath()
|
||||||
|
LOGIN_FAILURE_WRONG_SOCIALID = "ASDF"
|
||||||
|
LOGIN_FAILURE_SHUTDOWN_TIME = "ASDF"
|
||||||
|
|
||||||
|
if __IS_CANADA:
|
||||||
|
__IS_EUROPE = True
|
||||||
|
|
||||||
|
def IsYMIR():
|
||||||
|
return "locale/ymir" == app.GetLocalePath()
|
||||||
|
|
||||||
|
def IsJAPAN():
|
||||||
|
return "locale/japan" == app.GetLocalePath()
|
||||||
|
|
||||||
|
def IsENGLISH():
|
||||||
|
global __IS_ENGLISH
|
||||||
|
return __IS_ENGLISH
|
||||||
|
|
||||||
|
def IsHONGKONG():
|
||||||
|
global __IS_HONGKONG
|
||||||
|
return __IS_HONGKONG
|
||||||
|
|
||||||
|
def IsTAIWAN():
|
||||||
|
return "locale/taiwan" == app.GetLocalePath()
|
||||||
|
|
||||||
|
def IsNEWCIBN():
|
||||||
|
return "locale/newcibn" == app.GetLocalePath()
|
||||||
|
|
||||||
|
def IsCIBN10():
|
||||||
|
global __IS_CIBN10
|
||||||
|
return __IS_CIBN10
|
||||||
|
|
||||||
|
def IsEUROPE():
|
||||||
|
global __IS_EUROPE
|
||||||
|
return __IS_EUROPE
|
||||||
|
|
||||||
|
def IsCANADA():
|
||||||
|
global __IS_CANADA
|
||||||
|
return __IS_CANADA
|
||||||
|
|
||||||
|
def IsBRAZIL():
|
||||||
|
global __IS_BRAZIL
|
||||||
|
return __IS_BRAZIL
|
||||||
|
|
||||||
|
def IsVIETNAM():
|
||||||
|
global __IS_VIETNAM
|
||||||
|
return __IS_VIETNAM
|
||||||
|
|
||||||
|
def IsSINGAPORE():
|
||||||
|
global __IS_SINGAPORE
|
||||||
|
return __IS_SINGAPORE
|
||||||
|
|
||||||
|
def IsARABIC():
|
||||||
|
global __IS_ARABIC
|
||||||
|
return __IS_ARABIC
|
||||||
|
|
||||||
|
def IsWE_KOREA():
|
||||||
|
return "locale/we_korea" == app.GetLocalePath()
|
||||||
|
|
||||||
|
# SUPPORT_NEW_KOREA_SERVER
|
||||||
|
def LoadLocaleData():
|
||||||
|
if IsYMIR():
|
||||||
|
import net
|
||||||
|
SERVER = "蔫档 辑滚"
|
||||||
|
if SERVER == net.GetServerInfo()[:len(SERVER)]:
|
||||||
|
app.SetCHEONMA(0)
|
||||||
|
app.LoadLocaleData("locale/we_korea")
|
||||||
|
constInfo.ADD_DEF_BONUS_ENABLE = 0
|
||||||
|
else:
|
||||||
|
app.SetCHEONMA(1)
|
||||||
|
app.LoadLocaleData("locale/ymir")
|
||||||
|
constInfo.ADD_DEF_BONUS_ENABLE = 1
|
||||||
|
else:
|
||||||
|
app.LoadLocaleData(app.GetLocalePath())
|
||||||
|
|
||||||
|
def IsCHEONMA():
|
||||||
|
return IsYMIR() # 捞力 YMIR 肺纳老篮 公炼扒 玫付辑滚烙. 玫付辑滚啊 巩阑 摧扁 傈鳖瘤 函且 老 绝澜.
|
||||||
|
|
||||||
|
# END_OF_SUPPORT_NEW_KOREA_SERVER
|
||||||
|
|
||||||
|
def mapping(**kwargs): return kwargs
|
||||||
|
|
||||||
|
def SNA(text):
|
||||||
|
def f(x):
|
||||||
|
return text
|
||||||
|
return f
|
||||||
|
|
||||||
|
def SA(text):
|
||||||
|
def f(x):
|
||||||
|
return text % x
|
||||||
|
return f
|
||||||
|
|
||||||
|
def LoadLocaleFile(srcFileName, localeDict):
|
||||||
|
|
||||||
|
funcDict = {"SA":SA, "SNA":SNA}
|
||||||
|
|
||||||
|
lineIndex = 1
|
||||||
|
|
||||||
|
try:
|
||||||
|
lines = pack_open(srcFileName, "r").readlines()
|
||||||
|
except IOError:
|
||||||
|
import dbg
|
||||||
|
dbg.LogBox("LoadLocaleError(%(srcFileName)s)" % locals())
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
for line in lines:
|
||||||
|
try:
|
||||||
|
tokens = line[:-1].split("\t")
|
||||||
|
if len(tokens) == 2:
|
||||||
|
localeDict[tokens[0]] = tokens[1]
|
||||||
|
elif len(tokens) >= 3:
|
||||||
|
type = tokens[2].strip()
|
||||||
|
if type:
|
||||||
|
localeDict[tokens[0]] = funcDict[type](tokens[1])
|
||||||
|
else:
|
||||||
|
localeDict[tokens[0]] = tokens[1]
|
||||||
|
else:
|
||||||
|
raise RuntimeError, "Unknown TokenSize"
|
||||||
|
|
||||||
|
lineIndex += 1
|
||||||
|
except:
|
||||||
|
import dbg
|
||||||
|
dbg.LogBox("%s: line(%d): %s" % (srcFileName, lineIndex, line), "Error")
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
all = ["locale","error"]
|
||||||
|
|
||||||
|
if IsEUROPE() and IsBRAZIL() :
|
||||||
|
FN_GM_MARK = "%s/effect/gm.mse" % app.GetLocalePath()
|
||||||
|
LOCALE_FILE_NAME = "%s/locale_game.txt" % app.GetLocalePath()
|
||||||
|
constInfo.IN_GAME_SHOP_ENABLE = 0
|
||||||
|
elif IsSINGAPORE() :
|
||||||
|
FN_GM_MARK = "%s/effect/gm.mse" % app.GetLocalePath()
|
||||||
|
LOCALE_FILE_NAME = "%s/locale_game.txt" % app.GetLocalePath()
|
||||||
|
constInfo.IN_GAME_SHOP_ENABLE = 0
|
||||||
|
elif IsNEWCIBN() :
|
||||||
|
##霸烙疙捞柄柳促.
|
||||||
|
APP_TITLE = "新倚天2"
|
||||||
|
FN_GM_MARK = "%s/effect/gm.mse" % app.GetLocalePath()
|
||||||
|
LOCALE_FILE_NAME = "%s/locale_game.txt" % app.GetLocalePath()
|
||||||
|
constInfo.IN_GAME_SHOP_ENABLE = 1
|
||||||
|
elif IsTAIWAN():
|
||||||
|
APP_TITLE = "矮III瓣"
|
||||||
|
FN_GM_MARK = "%s/effect/gm.mse" % app.GetLocalePath()
|
||||||
|
LOCALE_FILE_NAME = "%s/locale_game.txt" % app.GetLocalePath()
|
||||||
|
|
||||||
|
constInfo.IN_GAME_SHOP_ENABLE = 1
|
||||||
|
|
||||||
|
else:
|
||||||
|
FN_GM_MARK = "%s/effect/gm.mse" % app.GetLocalePath()
|
||||||
|
LOCALE_FILE_NAME = "%s/locale_game.txt" % app.GetLocalePath()
|
||||||
|
|
||||||
|
constInfo.IN_GAME_SHOP_ENABLE = 1
|
||||||
|
|
||||||
|
LoadLocaleFile(LOCALE_FILE_NAME, locals())
|
||||||
|
|
||||||
|
########################################################################################################
|
||||||
|
## NOTE : 酒捞袍阑 滚副锭 "公均阑/甫 滚府矫摆嚼聪鳖?" 巩磊凯狼 炼荤 急琶阑 困茄 内靛
|
||||||
|
dictSingleWord = {
|
||||||
|
"m":1, "n":1, "r":1, "M":1, "N":1, "R":1, "l":1, "L":1, "1":1, "3":1, "6":1, "7":1, "8":1, "0":1,
|
||||||
|
}
|
||||||
|
|
||||||
|
dictDoubleWord = {
|
||||||
|
"啊":1, "凹":1, "芭":1, "败":1, "绊":1, "背":1, "备":1, "痹":1, "弊":1, "扁":1, "俺":1, "奥":1, "霸":1, "拌":1, "苞":1, "饱":1, "迸":1, "彼":1, "鲍":1, "蓖":1, "贬":1,
|
||||||
|
"鳖":1, "播":1, "波":1, "哺":1, "部":1, "藏":1, "操":1, "搀":1, "掺":1, "尝":1, "柄":1, "兤":1, "膊":1, "簿":1, "彩":1, "蚕":1, "层":1, "茬":1, "惨":1, "差":1, "吺":1,
|
||||||
|
"唱":1, "衬":1, "呈":1, "赤":1, "畴":1, "储":1, "穿":1, "春":1, "蠢":1, "聪":1, "郴":1, "唙":1, "匙":1, "抽":1, "出":1, "嘡":1, "床":1, "创":1, "锄":1, "吹":1, "刺":1,
|
||||||
|
"促":1, "呆":1, "歹":1, "诞":1, "档":1, "低":1, "滴":1, "掂":1, "靛":1, "叼":1, "措":1, "堐":1, "单":1, "党":1, "德":1, "蹬":1, "抵":1, "地":1, "登":1, "第":1, "碉":1,
|
||||||
|
"蝶":1, "媥":1, "栋":1, "杜":1, "肚":1, "屆":1, "堆":1, "崗":1, "哆":1, "鹅":1, "锭":1, "嫐":1, "都":1, "嬻":1, "短":1, "段":1, "岕":1, "敦":1, "断":1, "顿":1, "剁":1,
|
||||||
|
"扼":1, "藩":1, "矾":1, "妨":1, "肺":1, "丰":1, "风":1, "幅":1, "福":1, "府":1, "贰":1, "巑":1, "饭":1, "肥":1, "分":1, "廜":1, "凤":1, "否":1, "汾":1, "夫":1, "恖":1,
|
||||||
|
"付":1, "赶":1, "赣":1, "哥":1, "葛":1, "功":1, "公":1, "孤":1, "骨":1, "固":1, "概":1, "愘":1, "皋":1, "革":1, "跟":1, "懤":1, "构":1, "咕":1, "羹":1, "箍":1, "掁":1,
|
||||||
|
"官":1, "跪":1, "滚":1, "涵":1, "焊":1, "禾":1, "何":1, "轰":1, "宏":1, "厚":1, "硅":1, "搸":1, "海":1, "憾":1, "毫":1, "耗":1, "痕":1, "恨":1, "浩":1, "哼":1, "晳":1,
|
||||||
|
"狐":1, "徊":1, "坏":1, "焕":1, "磺":1, "幌":1, "谎":1, "回":1, "悔":1, "贿":1, "哗":1, "曽":1, "痪":1, "枾":1, "栘":1, "桇":1, "棬":1, "椖":1, "晃":1, "椸":1, "榰":1,
|
||||||
|
"荤":1, "箕":1, "辑":1, "寂":1, "家":1, "碱":1, "荐":1, "酱":1, "胶":1, "矫":1, "货":1, "绩":1, "技":1, "嘉":1, "驾":1, "尖":1, "饯":1, "溅":1, "艰":1, "浆":1, "毭":1,
|
||||||
|
"轿":1, "沊":1, "结":1, "浨":1, "筋":1, "兢":1, "茎":1, "漮":1, "静":1, "揪":1, "截":1, "泍":1, "疥":1, "涖":1, "谨":1, "禁":1, "粳":1, "井":1, "烬":1, "警":1, "竞":1,
|
||||||
|
"酒":1, "具":1, "绢":1, "咯":1, "坷":1, "夸":1, "快":1, "蜡":1, "栏":1, "捞":1, "局":1, "娟":1, "俊":1, "抗":1, "客":1, "恐":1, "况":1, "傀":1, "寇":1, "困":1, "狼":1,
|
||||||
|
"磊":1, "鲤":1, "历":1, "廉":1, "炼":1, "烈":1, "林":1, "陵":1, "令":1, "瘤":1, "犁":1, "厉":1, "力":1, "恋":1, "谅":1, "寥":1, "拎":1, "菱":1, "了":1, "零":1, "�":1,
|
||||||
|
"楼":1, "鹿":1, "录":1, "虑":1, "律":1, "�":1, "罗":1, "麻":1, "玛":1, "骂":1, "掳":1, "�":1, "屡":1, "�":1, "乱":1, "轮":1, "洛":1, "≧":1, "仑":1, "妈":1, "﹏":1,
|
||||||
|
"瞒":1, "铆":1, "贸":1, "媚":1, "檬":1, "幂":1, "眠":1, "抿":1, "明":1, "摹":1, "盲":1, "獕":1, "眉":1, "们":1, "靡":1, "瑐":1, "苗":1, "瞄":1, "弥":1, "秒":1, "疢":1,
|
||||||
|
"墨":1, "募":1, "目":1, "难":1, "内":1, "撵":1, "捻":1, "钮":1, "农":1, "虐":1, "某":1, "癿":1, "纳":1, "馁":1, "拟":1, "蔫":1, "孽":1, "涅":1, "年":1, "柠":1, "磾":1,
|
||||||
|
"鸥":1, "潘":1, "磐":1, "胚":1, "配":1, "鹏":1, "捧":1, "譬":1, "飘":1, "萍":1, "怕":1, "禣":1, "抛":1, "赔":1, "彭":1, "棚":1, "琵":1, "啤":1, "硼":1, "脾":1, "品":1,
|
||||||
|
"颇":1, "瀑":1, "欺":1, "旗":1, "器":1, "钎":1, "仟":1, "腔":1, "橇":1, "乔":1, "菩":1, "粭":1, "其":1, "企":1, "恰":1, "綅":1, "谴":1, "縍":1, "牵":1, "嵌":1, "纁":1,
|
||||||
|
"窍":1, "轻":1, "倾":1, "囚":1, "龋":1, "瓤":1, "饶":1, "绒":1, "儒":1, "洒":1, "秦":1, "羺":1, "庆":1, "驱":1, "拳":1, "瘸":1, "忍":1, "妊":1, "雀":1, "戎":1, "锐":1,
|
||||||
|
}
|
||||||
|
|
||||||
|
locale = mapping(
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def GetAuxiliaryWordType(text):
|
||||||
|
|
||||||
|
textLength = len(text)
|
||||||
|
|
||||||
|
if textLength > 1:
|
||||||
|
|
||||||
|
singleWord = text[-1]
|
||||||
|
|
||||||
|
if (singleWord >= '0' and singleWord <= '9') or\
|
||||||
|
(singleWord >= 'a' and singleWord <= 'z') or\
|
||||||
|
(singleWord >= 'A' and singleWord <= 'Z'):
|
||||||
|
if not dictSingleWord.has_key(singleWord):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
elif dictDoubleWord.has_key(text[-2:]):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def CutMoneyString(sourceText, startIndex, endIndex, insertingText, backText):
|
||||||
|
|
||||||
|
sourceLength = len(sourceText)
|
||||||
|
|
||||||
|
if sourceLength < startIndex:
|
||||||
|
return backText
|
||||||
|
|
||||||
|
text = sourceText[max(0, sourceLength-endIndex):sourceLength-startIndex]
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return backText
|
||||||
|
|
||||||
|
if int(text) <= 0:
|
||||||
|
return backText
|
||||||
|
|
||||||
|
text = str(int(text))
|
||||||
|
|
||||||
|
if backText:
|
||||||
|
backText = " " + backText
|
||||||
|
|
||||||
|
return text + insertingText + backText
|
||||||
|
|
||||||
|
def SecondToDHM(time):
|
||||||
|
if time < 60:
|
||||||
|
if IsARABIC():
|
||||||
|
return "%.2f %s" % (time, SECOND)
|
||||||
|
else:
|
||||||
|
return "0" + MINUTE
|
||||||
|
|
||||||
|
second = int(time % 60)
|
||||||
|
minute = int((time / 60) % 60)
|
||||||
|
hour = int((time / 60) / 60) % 24
|
||||||
|
day = int(int((time / 60) / 60) / 24)
|
||||||
|
|
||||||
|
text = ""
|
||||||
|
|
||||||
|
if day > 0:
|
||||||
|
text += str(day) + DAY
|
||||||
|
text += " "
|
||||||
|
|
||||||
|
if hour > 0:
|
||||||
|
text += str(hour) + HOUR
|
||||||
|
text += " "
|
||||||
|
|
||||||
|
if minute > 0:
|
||||||
|
text += str(minute) + MINUTE
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
|
def SecondToHM(time):
|
||||||
|
|
||||||
|
if time < 60:
|
||||||
|
if IsARABIC():
|
||||||
|
return "%.2f %s" % (time, SECOND)
|
||||||
|
else:
|
||||||
|
return "0" + MINUTE
|
||||||
|
|
||||||
|
second = int(time % 60)
|
||||||
|
minute = int((time / 60) % 60)
|
||||||
|
hour = int((time / 60) / 60)
|
||||||
|
|
||||||
|
text = ""
|
||||||
|
|
||||||
|
if hour > 0:
|
||||||
|
text += str(hour) + HOUR
|
||||||
|
if hour > 0:
|
||||||
|
text += " "
|
||||||
|
|
||||||
|
if minute > 0:
|
||||||
|
text += str(minute) + MINUTE
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
def GetAlignmentTitleName(alignment):
|
||||||
|
if alignment >= 12000:
|
||||||
|
return TITLE_NAME_LIST[0]
|
||||||
|
elif alignment >= 8000:
|
||||||
|
return TITLE_NAME_LIST[1]
|
||||||
|
elif alignment >= 4000:
|
||||||
|
return TITLE_NAME_LIST[2]
|
||||||
|
elif alignment >= 1000:
|
||||||
|
return TITLE_NAME_LIST[3]
|
||||||
|
elif alignment >= 0:
|
||||||
|
return TITLE_NAME_LIST[4]
|
||||||
|
elif alignment > -4000:
|
||||||
|
return TITLE_NAME_LIST[5]
|
||||||
|
elif alignment > -8000:
|
||||||
|
return TITLE_NAME_LIST[6]
|
||||||
|
elif alignment > -12000:
|
||||||
|
return TITLE_NAME_LIST[7]
|
||||||
|
|
||||||
|
return TITLE_NAME_LIST[8]
|
||||||
|
|
||||||
|
|
||||||
|
OPTION_PVPMODE_MESSAGE_DICT = {
|
||||||
|
0 : PVP_MODE_NORMAL,
|
||||||
|
1 : PVP_MODE_REVENGE,
|
||||||
|
2 : PVP_MODE_KILL,
|
||||||
|
3 : PVP_MODE_PROTECT,
|
||||||
|
4 : PVP_MODE_GUILD,
|
||||||
|
}
|
||||||
|
|
||||||
|
error = mapping(
|
||||||
|
CREATE_WINDOW = GAME_INIT_ERROR_MAIN_WINDOW,
|
||||||
|
CREATE_CURSOR = GAME_INIT_ERROR_CURSOR,
|
||||||
|
CREATE_NETWORK = GAME_INIT_ERROR_NETWORK,
|
||||||
|
CREATE_ITEM_PROTO = GAME_INIT_ERROR_ITEM_PROTO,
|
||||||
|
CREATE_MOB_PROTO = GAME_INIT_ERROR_MOB_PROTO,
|
||||||
|
CREATE_NO_DIRECTX = GAME_INIT_ERROR_DIRECTX,
|
||||||
|
CREATE_DEVICE = GAME_INIT_ERROR_GRAPHICS_NOT_EXIST,
|
||||||
|
CREATE_NO_APPROPRIATE_DEVICE = GAME_INIT_ERROR_GRAPHICS_BAD_PERFORMANCE,
|
||||||
|
CREATE_FORMAT = GAME_INIT_ERROR_GRAPHICS_NOT_SUPPORT_32BIT,
|
||||||
|
NO_ERROR = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
GUILDWAR_NORMAL_DESCLIST = [GUILD_WAR_USE_NORMAL_MAP, GUILD_WAR_LIMIT_30MIN, GUILD_WAR_WIN_CHECK_SCORE]
|
||||||
|
GUILDWAR_WARP_DESCLIST = [GUILD_WAR_USE_BATTLE_MAP, GUILD_WAR_WIN_WIPE_OUT_GUILD, GUILD_WAR_REWARD_POTION]
|
||||||
|
GUILDWAR_CTF_DESCLIST = [GUILD_WAR_USE_BATTLE_MAP, GUILD_WAR_WIN_TAKE_AWAY_FLAG1, GUILD_WAR_WIN_TAKE_AWAY_FLAG2, GUILD_WAR_REWARD_POTION]
|
||||||
|
|
||||||
|
MINIMAP_ZONE_NAME_DICT = {
|
||||||
|
"metin2_map_a1" : MAP_A1,
|
||||||
|
"map_a2" : MAP_A2,
|
||||||
|
"metin2_map_a3" : MAP_A3,
|
||||||
|
"metin2_map_b1" : MAP_B1,
|
||||||
|
"map_b2" : MAP_B2,
|
||||||
|
"metin2_map_b3" : MAP_B3,
|
||||||
|
"metin2_map_c1" : MAP_C1,
|
||||||
|
"map_c2" : MAP_C2,
|
||||||
|
"metin2_map_c3" : MAP_C3,
|
||||||
|
"map_n_snowm_01" : MAP_SNOW,
|
||||||
|
"metin2_map_n_flame_01" : MAP_FLAME,
|
||||||
|
"metin2_map_n_desert_01" : MAP_DESERT,
|
||||||
|
"metin2_map_milgyo" : MAP_TEMPLE,
|
||||||
|
"metin2_map_spiderdungeon" : MAP_SPIDER,
|
||||||
|
"metin2_map_deviltower1" : MAP_SKELTOWER,
|
||||||
|
"metin2_map_guild_01" : MAP_AG,
|
||||||
|
"metin2_map_guild_02" : MAP_BG,
|
||||||
|
"metin2_map_guild_03" : MAP_CG,
|
||||||
|
"metin2_map_trent" : MAP_TREE,
|
||||||
|
"metin2_map_trent02" : MAP_TREE2,
|
||||||
|
"season1/metin2_map_WL_01" : MAP_WL,
|
||||||
|
"season1/metin2_map_nusluck01" : MAP_NUSLUCK,
|
||||||
|
"Metin2_map_CapeDragonHead" : MAP_CAPE,
|
||||||
|
"metin2_map_Mt_Thunder" : MAP_THUNDER,
|
||||||
|
"metin2_map_dawnmistwood" : MAP_DAWN,
|
||||||
|
"metin2_map_BayBlackSand" : MAP_BAY,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JOBINFO_TITLE = [
|
||||||
|
[JOB_WARRIOR0, JOB_WARRIOR1, JOB_WARRIOR2,],
|
||||||
|
[JOB_ASSASSIN0, JOB_ASSASSIN1, JOB_ASSASSIN2,],
|
||||||
|
[JOB_SURA0, JOB_SURA1, JOB_SURA2,],
|
||||||
|
[JOB_SHAMAN0, JOB_SHAMAN1, JOB_SHAMAN2,],
|
||||||
|
]
|
||||||
|
|
||||||
|
JOBINFO_DATA_LIST = [
|
||||||
|
[
|
||||||
|
["鸥绊抄 侩竿苞 绷洒瘤 臼绰 公荤狼",
|
||||||
|
"扁俺甫 荤恩甸篮 老拿绢 [侩磊]扼绊",
|
||||||
|
"何弗促. 绢栋茄 困扁俊辑档 弊甸篮 ",
|
||||||
|
"第肺 拱矾辑瘤 臼栏哥, 促摹绊 框流",
|
||||||
|
"捞扁 塞电 悼丰甫 困秦 窜脚栏肺",
|
||||||
|
"利甸苞 付林 轿快扁档 茄促. 捞甸篮",
|
||||||
|
"肋 窜访等 辟腊苞 塞, 碍仿茄 傍拜仿",
|
||||||
|
"栏肺 傈厘 弥急滴俊辑 傍拜柳栏肺",
|
||||||
|
"劝距茄促. ",],
|
||||||
|
["啊厘 老馆利牢 傍拜屈 公荤肺, ",
|
||||||
|
"利立傈俊 蝶弗 流立 傍拜栏肺 傈厘",
|
||||||
|
"俊辑 劝距茄促. 焙流 漂己惑 辟仿阑",
|
||||||
|
"皋牢栏肺 胶泡 器牢飘甫 捧磊窍登, ",
|
||||||
|
"利立傈俊 蝶弗 积疙仿 / 规绢仿",
|
||||||
|
"犬焊甫 困秦 眉仿阑 棵赴促. 肚茄",
|
||||||
|
"傍拜狼 沥犬己阑 臭捞扁 困秦 刮酶",
|
||||||
|
"俊档 器牢飘甫 捧磊且 鞘夸啊 乐促.",],
|
||||||
|
["惑寸 荐霖狼 沥脚仿阑 捞侩窍绰",
|
||||||
|
"吝/辟芭府 立傈屈 公荤肺, 阿 扁贱",
|
||||||
|
"窍唱窍唱狼 臭篮 傍拜仿栏肺 傈厘俊辑",
|
||||||
|
"劝距茄促. 焙流 漂己惑 辟仿阑 皋牢",
|
||||||
|
"栏肺 胶湃 器牢飘甫 捧磊窍登, ",
|
||||||
|
"吝/辟芭府 傍拜狼 沥犬己苞 疙吝伏阑",
|
||||||
|
"困秦 刮酶阑 棵赴促. 肚茄 立傈 矫 ",
|
||||||
|
"利 傍拜俊 蝶弗 积疙仿 / 规绢仿",
|
||||||
|
"犬焊甫 困秦 眉仿俊档 器牢飘甫",
|
||||||
|
"捧磊且 鞘夸啊 乐促. ",],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["磊按篮 绢栋茄 惑炔俊辑档 磊脚狼",
|
||||||
|
"个阑 见扁绊 篮剐茄 绢狄狼 烙公甫",
|
||||||
|
"荐青窍搁辑 傈厘狼 饶困甫 瘤盔窍绰",
|
||||||
|
"磊甸捞促. 捞甸篮 酒林 狐福绊 脚加",
|
||||||
|
"窍哥, 厚且 单 绝捞 苞皑窍绊 例力等",
|
||||||
|
"青悼栏肺 利狼 鞭家俊 摹疙鸥甫 朝府",
|
||||||
|
"登, 傈厘俊急 利柳阑 氢秦 公荐茄",
|
||||||
|
"拳混阑 郴徽栏哥 磊脚狼 侩竿阑",
|
||||||
|
"急焊牢促. "],
|
||||||
|
["滴颊 窜八阑 林公扁肺 促风哥, 脚加",
|
||||||
|
"窍霸 摹绊 狐瘤绰 磊按 漂蜡狼 框流烙",
|
||||||
|
"栏肺 傈厘俊辑 劝距茄促. 焙流 漂己惑",
|
||||||
|
"刮酶阑 皋牢栏肺 胶泡 器牢飘甫 捧磊",
|
||||||
|
"窍登, 辟仿阑 棵妨 傍拜仿阑 臭牢促.",
|
||||||
|
"肚茄 辟立傈俊 蝶弗 积疙仿/规绢仿 ",
|
||||||
|
"惑铰阑 困秦 眉仿俊档 器牢飘甫",
|
||||||
|
"捧磊且 鞘夸啊 乐促. ",],
|
||||||
|
["劝阑 林公扁肺 促风哥, 变 矫具客",
|
||||||
|
"荤沥芭府俊 蝶弗 盔芭府 傍拜栏肺",
|
||||||
|
"傈厘俊辑 劝距茄促. 焙流 漂己惑",
|
||||||
|
"傍拜 己傍伏狼 刘啊甫 困秦 刮酶阑",
|
||||||
|
"皋牢栏肺 棵妨具 窍哥, 盔芭府",
|
||||||
|
"傍拜狼 单固瘤 刘啊甫 困秦 辟仿阑",
|
||||||
|
"棵副 鞘夸啊 乐促. 肚茄 利甸俊霸",
|
||||||
|
"器困登菌阑 矫, 利 傍拜俊 滚萍扁",
|
||||||
|
"困茄 积疙仿/规绢仿 惑铰阑 困秦",
|
||||||
|
"眉仿俊档 器牢飘甫 捧磊且 鞘夸啊",
|
||||||
|
"乐促. ", ],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["荐扼绰 [刀篮 刀栏肺]狼 加己栏肺",
|
||||||
|
"芒汲等 漂荐 加己狼 焙流捞促. ",
|
||||||
|
"弊甸篮 傈厘俊辑 利甸狼 荤扁甫 历窍",
|
||||||
|
"矫虐绊, 厩付狼 塞阑 角篮 付藕栏肺",
|
||||||
|
"利狼 康去苞 腊脚阑 窿苟暗促. 锭肺",
|
||||||
|
"捞甸篮 磊脚狼 八苞 癌渴俊 绢狄狼",
|
||||||
|
"塞阑 角绢, 傈厘俊辑 公荤 给瘤 臼篮",
|
||||||
|
"傍拜仿阑 惯戎窍扁档 窍绰单, 利甸阑",
|
||||||
|
"磷咯措绰弊 葛嚼捞 况倡俊 阐嘛秦",
|
||||||
|
"荤恩甸篮 荐扼甫 老拿绢 [付脚]捞扼",
|
||||||
|
"何福扁甫 林历 旧绰促."],
|
||||||
|
["券公焙狼 荐扼绰 厩付狼 揪俊辑",
|
||||||
|
"掘绢瘤绰 付仿阑 公扁唱 规绢备俊",
|
||||||
|
"角绢 公荤 给瘤 臼篮 傈捧仿栏肺",
|
||||||
|
"傈厘俊辑 劝距茄促. 焙流 漂己惑",
|
||||||
|
"瘤瓷捞 臭酒龙荐废 馒侩 厘厚俊",
|
||||||
|
"角府绰 付仿狼 困仿捞 刘措登骨肺,",
|
||||||
|
"瘤瓷苞 辟仿阑 皋牢栏肺 胶湃",
|
||||||
|
"器牢飘甫 捧磊窍登, 立傈俊 蝶弗",
|
||||||
|
"积疙仿/规绢仿 犬焊甫 困秦 眉仿阑",
|
||||||
|
"棵赴促. 肚茄 傍拜狼 沥犬己苞",
|
||||||
|
"雀乔甫 困秦辑 刮酶俊档 器牢飘甫",
|
||||||
|
"捧磊且 鞘夸啊 乐促. ",],
|
||||||
|
["孺付焙狼 荐扼甸篮 阿辆 绢狄狼",
|
||||||
|
"林巩苞 厩付狼 付过栏肺 傈厘俊辑",
|
||||||
|
"劝距茄促. 焙流 漂己惑 付过 傍拜捞",
|
||||||
|
"林捞骨肺 瘤瓷阑 皋牢栏肺 胶泡",
|
||||||
|
"器牢飘甫 捧磊窍登, 盔芭府 付过",
|
||||||
|
"傍拜狼 沥犬己阑 困秦 刮酶阑 棵赴促.",
|
||||||
|
"肚茄 器困 登菌阑矫, 利 傍拜俊 蝶弗",
|
||||||
|
"积疙仿 / 规绢仿 犬焊甫 困秦 眉仿俊档",
|
||||||
|
"器牢飘甫 捧磊且 鞘夸啊 乐促. ",],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["公寸篮 侩脚苞 磊楷, 滴 绊措狼",
|
||||||
|
"塞阑 促逢 荐 乐绰 蜡老茄 流辆捞促.",
|
||||||
|
"弊甸篮 饶规俊辑 酒焙阑 焊炼窍绊",
|
||||||
|
"促模 悼丰狼 何惑阑 雀汗 矫虐哥",
|
||||||
|
"冻绢柳 荤扁甫 惑铰矫挪促. 弊甸篮",
|
||||||
|
"酒焙狼 荐搁苞 绒侥阑 规秦窍绰 磊甫 ",
|
||||||
|
"例措 侩辑窍瘤 臼栏哥, 弊繁 磊甸",
|
||||||
|
"俊霸绰 茄 痢 林历 绝捞 林巩阑",
|
||||||
|
"磐飘妨 弊 厚疤窃阑 决洒 隆拌茄促.",],
|
||||||
|
["玫锋焙狼 公寸甸篮 阿辆 何利贱苞",
|
||||||
|
"焊炼林巩俊 瓷窍哥, 利狼 流 / 埃立",
|
||||||
|
"傍拜栏肺何磐 酒焙阑 瘤挪促. 焙流",
|
||||||
|
"漂己惑 付过 瓷仿捞 林捞骨肺 瘤瓷阑",
|
||||||
|
"皋牢栏肺 胶泡 器牢飘甫 捧磊窍登,",
|
||||||
|
"器困登菌阑 矫, 利 傍拜俊 蝶弗",
|
||||||
|
"积疙仿 / 规绢仿 犬焊甫 困秦 眉仿阑",
|
||||||
|
"棵赴促. 肚茄 盔芭府 付过 傍拜狼",
|
||||||
|
"沥犬己阑 困俊 刮酶俊档 器牢飘甫",
|
||||||
|
"捧磊且 鞘夸啊 乐促. ",],
|
||||||
|
["堡汾焙狼 公寸甸篮 磊楷狼 塞阑",
|
||||||
|
"呼妨 酒焙阑 雀汗窍绊, 锄脚狼 ",
|
||||||
|
"塞栏肺 剐笼茄 利甸俊霸 奴 面拜阑",
|
||||||
|
"涝鳃 荐 乐绰 捞甸捞促. 焙流狼",
|
||||||
|
"漂己惑 付过 瓷仿捞 林捞骨肺 瘤瓷阑",
|
||||||
|
"皋牢栏肺 胶泡 器牢飘甫 捧磊窍登,",
|
||||||
|
"器困登菌阑矫, 利 傍拜俊 蝶弗",
|
||||||
|
"积疙仿 / 规绢仿 犬焊甫 困秦 眉仿阑",
|
||||||
|
"棵赴促. 肚茄 盔芭府 付过 傍拜狼",
|
||||||
|
"沥犬己阑 困俊 刮酶俊档 器牢飘甫",
|
||||||
|
"捧磊且 鞘夸啊 乐促. "],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
WHISPER_ERROR = {
|
||||||
|
1 : CANNOT_WHISPER_NOT_LOGON,
|
||||||
|
2 : CANNOT_WHISPER_DEST_REFUSE,
|
||||||
|
3 : CANNOT_WHISPER_SELF_REFUSE,
|
||||||
|
}
|
||||||
|
|
||||||
|
NOTIFY_MESSAGE = {
|
||||||
|
"CANNOT_EQUIP_SHOP" : CANNOT_EQUIP_IN_SHOP,
|
||||||
|
"CANNOT_EQUIP_EXCHANGE" : CANNOT_EQUIP_IN_EXCHANGE,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ATTACK_ERROR_TAIL_DICT = {
|
||||||
|
"IN_SAFE" : CANNOT_ATTACK_SELF_IN_SAFE,
|
||||||
|
"DEST_IN_SAFE" : CANNOT_ATTACK_DEST_IN_SAFE,
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOT_ERROR_TAIL_DICT = {
|
||||||
|
"EMPTY_ARROW" : CANNOT_SHOOT_EMPTY_ARROW,
|
||||||
|
"IN_SAFE" : CANNOT_SHOOT_SELF_IN_SAFE,
|
||||||
|
"DEST_IN_SAFE" : CANNOT_SHOOT_DEST_IN_SAFE,
|
||||||
|
}
|
||||||
|
|
||||||
|
USE_SKILL_ERROR_TAIL_DICT = {
|
||||||
|
"IN_SAFE" : CANNOT_SKILL_SELF_IN_SAFE,
|
||||||
|
"NEED_TARGET" : CANNOT_SKILL_NEED_TARGET,
|
||||||
|
"NEED_EMPTY_BOTTLE" : CANNOT_SKILL_NEED_EMPTY_BOTTLE,
|
||||||
|
"NEED_POISON_BOTTLE" : CANNOT_SKILL_NEED_POISON_BOTTLE,
|
||||||
|
"REMOVE_FISHING_ROD" : CANNOT_SKILL_REMOVE_FISHING_ROD,
|
||||||
|
"NOT_YET_LEARN" : CANNOT_SKILL_NOT_YET_LEARN,
|
||||||
|
"NOT_MATCHABLE_WEAPON" : CANNOT_SKILL_NOT_MATCHABLE_WEAPON,
|
||||||
|
"WAIT_COOLTIME" : CANNOT_SKILL_WAIT_COOLTIME,
|
||||||
|
"NOT_ENOUGH_HP" : CANNOT_SKILL_NOT_ENOUGH_HP,
|
||||||
|
"NOT_ENOUGH_SP" : CANNOT_SKILL_NOT_ENOUGH_SP,
|
||||||
|
"CANNOT_USE_SELF" : CANNOT_SKILL_USE_SELF,
|
||||||
|
"ONLY_FOR_ALLIANCE" : CANNOT_SKILL_ONLY_FOR_ALLIANCE,
|
||||||
|
"CANNOT_ATTACK_ENEMY_IN_SAFE_AREA" : CANNOT_SKILL_DEST_IN_SAFE,
|
||||||
|
"CANNOT_APPROACH" : CANNOT_SKILL_APPROACH,
|
||||||
|
"CANNOT_ATTACK" : CANNOT_SKILL_ATTACK,
|
||||||
|
"ONLY_FOR_CORPSE" : CANNOT_SKILL_ONLY_FOR_CORPSE,
|
||||||
|
"EQUIP_FISHING_ROD" : CANNOT_SKILL_EQUIP_FISHING_ROD,
|
||||||
|
"NOT_HORSE_SKILL" : CANNOT_SKILL_NOT_HORSE_SKILL,
|
||||||
|
"HAVE_TO_RIDE" : CANNOT_SKILL_HAVE_TO_RIDE,
|
||||||
|
}
|
||||||
|
|
||||||
|
LEVEL_LIST=["", HORSE_LEVEL1, HORSE_LEVEL2, HORSE_LEVEL3]
|
||||||
|
|
||||||
|
HEALTH_LIST=[
|
||||||
|
HORSE_HEALTH0,
|
||||||
|
HORSE_HEALTH1,
|
||||||
|
HORSE_HEALTH2,
|
||||||
|
HORSE_HEALTH3,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
USE_SKILL_ERROR_CHAT_DICT = {
|
||||||
|
"NEED_EMPTY_BOTTLE" : SKILL_NEED_EMPTY_BOTTLE,
|
||||||
|
"NEED_POISON_BOTTLE" : SKILL_NEED_POISON_BOTTLE,
|
||||||
|
"ONLY_FOR_GUILD_WAR" : SKILL_ONLY_FOR_GUILD_WAR,
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOP_ERROR_DICT = {
|
||||||
|
"NOT_ENOUGH_MONEY" : SHOP_NOT_ENOUGH_MONEY,
|
||||||
|
"SOLDOUT" : SHOP_SOLDOUT,
|
||||||
|
"INVENTORY_FULL" : SHOP_INVENTORY_FULL,
|
||||||
|
"INVALID_POS" : SHOP_INVALID_POS,
|
||||||
|
"NOT_ENOUGH_MONEY_EX" : SHOP_NOT_ENOUGH_MONEY_EX,
|
||||||
|
}
|
||||||
|
|
||||||
|
STAT_MINUS_DESCRIPTION = {
|
||||||
|
"HTH-" : STAT_MINUS_CON,
|
||||||
|
"INT-" : STAT_MINUS_INT,
|
||||||
|
"STR-" : STAT_MINUS_STR,
|
||||||
|
"DEX-" : STAT_MINUS_DEX,
|
||||||
|
}
|
||||||
|
|
||||||
|
MODE_NAME_LIST = ( PVP_OPTION_NORMAL, PVP_OPTION_REVENGE, PVP_OPTION_KILL, PVP_OPTION_PROTECT, )
|
||||||
|
TITLE_NAME_LIST = ( PVP_LEVEL0, PVP_LEVEL1, PVP_LEVEL2, PVP_LEVEL3, PVP_LEVEL4, PVP_LEVEL5, PVP_LEVEL6, PVP_LEVEL7, PVP_LEVEL8, )
|
||||||
|
|
||||||
|
def GetLetterImageName():
|
||||||
|
return "season1/icon/scroll_close.tga"
|
||||||
|
def GetLetterOpenImageName():
|
||||||
|
return "season1/icon/scroll_open.tga"
|
||||||
|
def GetLetterCloseImageName():
|
||||||
|
return "season1/icon/scroll_close.tga"
|
||||||
|
|
||||||
|
if 949 == app.GetDefaultCodePage():
|
||||||
|
def EUL(name):
|
||||||
|
if GetAuxiliaryWordType(name):
|
||||||
|
return "甫 "
|
||||||
|
else:
|
||||||
|
return "阑 "
|
||||||
|
|
||||||
|
def I(name):
|
||||||
|
if GetAuxiliaryWordType(name):
|
||||||
|
return "啊 "
|
||||||
|
else:
|
||||||
|
return "捞 "
|
||||||
|
|
||||||
|
def DO_YOU_SELL_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
name = sellItemName
|
||||||
|
if sellItemCount > 1:
|
||||||
|
name += " "
|
||||||
|
name += str(sellItemCount)
|
||||||
|
name += "俺"
|
||||||
|
|
||||||
|
return name + EUL(name) + str(sellItemPrice) + "成俊 颇矫摆嚼聪鳖?"
|
||||||
|
|
||||||
|
def DO_YOU_BUY_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
name = sellItemName
|
||||||
|
if sellItemCount > 1:
|
||||||
|
name += " "
|
||||||
|
name += str(sellItemCount)
|
||||||
|
name += "俺"
|
||||||
|
|
||||||
|
return name + EUL(name) + str(sellItemPrice) + "俊 荤矫摆嚼聪鳖?"
|
||||||
|
|
||||||
|
def REFINE_FAILURE_CAN_NOT_ATTACH(attachedItemName):
|
||||||
|
return attachedItemName+EUL(attachedItemName)+"何馒且 荐 绝绰 酒捞袍涝聪促"
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_SOCKET(attachedItemName):
|
||||||
|
return attachedItemName+EUL(attachedItemName)+"何馒且 荐 乐绰 家南捞 绝嚼聪促"
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_GOLD_SOCKET(attachedItemName):
|
||||||
|
return attachedItemName+EUL(attachedItemName)+"何馒且 荐 乐绰 炔陛 家南捞 绝嚼聪促"
|
||||||
|
|
||||||
|
def HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, dropItemCount):
|
||||||
|
name = dropItemName
|
||||||
|
if dropItemCount > 1:
|
||||||
|
name += " "
|
||||||
|
name += str(dropItemCount)
|
||||||
|
name += "俺"
|
||||||
|
|
||||||
|
return name+EUL(name)+"滚府矫摆嚼聪鳖?"
|
||||||
|
|
||||||
|
def NumberToMoneyString(number):
|
||||||
|
if number <= 0:
|
||||||
|
return "0成"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "父", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "撅", result)
|
||||||
|
result = result + "成"
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def NumberToSecondaryCoinString(number):
|
||||||
|
if number <= 0:
|
||||||
|
return "0傈"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "父", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "撅", result)
|
||||||
|
result = result + "傈"
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def FISHING_NOTIFY(isFish, fishName):
|
||||||
|
if isFish:
|
||||||
|
return fishName + I(fishName) + "巩 淀 钦聪促."
|
||||||
|
else:
|
||||||
|
return fishName + I(fishName) + "吧赴淀 钦聪促."
|
||||||
|
|
||||||
|
def FISHING_SUCCESS(isFish, fishName):
|
||||||
|
if isFish:
|
||||||
|
return fishName + EUL(fishName) + "棱疽嚼聪促!"
|
||||||
|
else:
|
||||||
|
return fishName + EUL(fishName) + "掘菌嚼聪促!"
|
||||||
|
|
||||||
|
elif 932 == app.GetDefaultCodePage():
|
||||||
|
def DO_YOU_SELL_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
if sellItemCount > 1 :
|
||||||
|
return "%s %s 屄傪 %s偵攧傝傑偡偐丠" % ( sellItemName, sellItemCount, NumberToMoneyString(sellItemPrice) )
|
||||||
|
else:
|
||||||
|
return "%s 傪 %s偱攧傝傑偡偐丠" % (sellItemName, NumberToMoneyString(sellItemPrice) )
|
||||||
|
|
||||||
|
def DO_YOU_BUY_ITEM(buyItemName, buyItemCount, buyItemPrice) :
|
||||||
|
if buyItemCount > 1 :
|
||||||
|
return "%s %s屄傪 %s偱攦偄傑偡偐丠" % ( buyItemName, buyItemCount, buyItemPrice )
|
||||||
|
else:
|
||||||
|
return "%s傪 %s偱攦偄傑偡偐丠" % ( buyItemName, buyItemPrice )
|
||||||
|
|
||||||
|
def REFINE_FAILURE_CAN_NOT_ATTACH(attachedItemName) :
|
||||||
|
return "%s傪憰拝偱偒側偄傾僀僥?偱偡丅" % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_SOCKET(attachedItemName) :
|
||||||
|
return "%s傪憰拝偡傞?働僢僩偑偁傝傑偣傫丅" % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_GOLD_SOCKET(attachedItemName) :
|
||||||
|
return "%s傪憰拝偱偒傞墿嬥?働僢僩偑偁傝傑偣傫丅" % (attachedItemName)
|
||||||
|
|
||||||
|
def HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, dropItemCount) :
|
||||||
|
if dropItemCount > 1 :
|
||||||
|
return "%s %d 屄傪幪偰傑偡偐丠" % (dropItemName, dropItemCount)
|
||||||
|
else :
|
||||||
|
return "%s傪幪偰傑偡偐丠" % (dropItemName)
|
||||||
|
|
||||||
|
def FISHING_NOTIFY(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return "%s 偑怘偄偮偄偨傛偆偱偡" % ( fishName )
|
||||||
|
else :
|
||||||
|
return "%s 偑偐偐偭偨傛偆偱偡" % ( fishName )
|
||||||
|
|
||||||
|
def FISHING_SUCCESS(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return "%s 傪曔傑偊傑偟偨両" % (fishName)
|
||||||
|
else :
|
||||||
|
return "%s 傪庤偵擖傟傑偟偨両" % (fishName)
|
||||||
|
|
||||||
|
def NumberToMoneyString(number) :
|
||||||
|
if number <= 0 :
|
||||||
|
return "0椉"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "枩", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "壄", result)
|
||||||
|
result = result + "椉"
|
||||||
|
|
||||||
|
return result
|
||||||
|
def NumberToSecondaryCoinString(number) :
|
||||||
|
if number <= 0 :
|
||||||
|
return "0jun"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "枩", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "壄", result)
|
||||||
|
result = result + "jun"
|
||||||
|
|
||||||
|
return result
|
||||||
|
elif IsHONGKONG():
|
||||||
|
def DO_YOU_SELL_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
if sellItemCount > 1 :
|
||||||
|
return DO_YOU_SELL_ITEM2 % (sellItemName, sellItemCount, NumberToMoneyString(sellItemPrice) )
|
||||||
|
else:
|
||||||
|
return DO_YOU_SELL_ITEM1 % (sellItemName, NumberToMoneyString(sellItemPrice) )
|
||||||
|
|
||||||
|
def DO_YOU_BUY_ITEM(buyItemName, buyItemCount, buyItemPrice) :
|
||||||
|
if buyItemCount > 1 :
|
||||||
|
return DO_YOU_BUY_ITEM2 % ( buyItemName, buyItemCount, buyItemPrice )
|
||||||
|
else:
|
||||||
|
return DO_YOU_BUY_ITEM1 % ( buyItemName, buyItemPrice )
|
||||||
|
|
||||||
|
def REFINE_FAILURE_CAN_NOT_ATTACH(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_CAN_NOT_ATTACH0 % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_SOCKET(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_NO_SOCKET0 % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_GOLD_SOCKET(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_NO_GOLD_SOCKET0 % (attachedItemName)
|
||||||
|
|
||||||
|
def HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, dropItemCount) :
|
||||||
|
if dropItemCount > 1 :
|
||||||
|
return HOW_MANY_ITEM_DO_YOU_DROP2 % (dropItemName, dropItemCount)
|
||||||
|
else :
|
||||||
|
return HOW_MANY_ITEM_DO_YOU_DROP1 % (dropItemName)
|
||||||
|
|
||||||
|
def FISHING_NOTIFY(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return FISHING_NOTIFY1 % ( fishName )
|
||||||
|
else :
|
||||||
|
return FISHING_NOTIFY2 % ( fishName )
|
||||||
|
|
||||||
|
def FISHING_SUCCESS(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return FISHING_SUCCESS1 % (fishName)
|
||||||
|
else :
|
||||||
|
return FISHING_SUCCESS2 % (fishName)
|
||||||
|
|
||||||
|
def NumberToMoneyString(number) :
|
||||||
|
if number <= 0 :
|
||||||
|
return "0 %s" % (MONETARY_UNIT0)
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, MONETARY_UNIT1, result)
|
||||||
|
result = CutMoneyString(number, 8, 12, MONETARY_UNIT2, result)
|
||||||
|
result = result + MONETARY_UNIT0
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def NumberToSecondaryCoinString(number) :
|
||||||
|
if number <= 0 :
|
||||||
|
return "0 %s" % (MONETARY_UNIT_JUN)
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, MONETARY_UNIT1, result)
|
||||||
|
result = CutMoneyString(number, 8, 12, MONETARY_UNIT2, result)
|
||||||
|
result = result + MONETARY_UNIT_JUN
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
elif IsNEWCIBN() or IsCIBN10():
|
||||||
|
def DO_YOU_SELL_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
if sellItemCount>1:
|
||||||
|
return "确定要把%s个%s以%s金币卖掉吗?" % (str(sellItemCount), sellItemName, str(sellItemPrice))
|
||||||
|
else:
|
||||||
|
return "确定要把%s以%s金币卖掉吗?" % (sellItemName, str(sellItemPrice))
|
||||||
|
|
||||||
|
def DO_YOU_BUY_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
if sellItemCount>1:
|
||||||
|
return "确定要把%s个%s以%s金币买进吗?" % (str(sellItemCount), sellItemName, str(sellItemPrice))
|
||||||
|
else:
|
||||||
|
return "确定要把%s以%s金币买进吗?" % (sellItemName, str(sellItemPrice))
|
||||||
|
|
||||||
|
def REFINE_FAILURE_CAN_NOT_ATTACH(attachedItemName):
|
||||||
|
return "无法镶嵌%s 的装备" % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_SOCKET(attachedItemName):
|
||||||
|
return "没有可以镶嵌%s 的孔" % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_GOLD_SOCKET(attachedItemName):
|
||||||
|
return "没有可以镶嵌%s 的黄金孔" % (attachedItemName)
|
||||||
|
|
||||||
|
def HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, dropItemCount):
|
||||||
|
if dropItemCount>1:
|
||||||
|
return "确定要扔掉%d个%s吗?" % (dropItemCount, dropItemName)
|
||||||
|
else:
|
||||||
|
return "确定要扔掉%s吗?" % (dropItemName)
|
||||||
|
|
||||||
|
def FISHING_NOTIFY(isFish, fishName):
|
||||||
|
if isFish:
|
||||||
|
return fishName # 夯贰 咯扁俊 绢恫 富捞 嘿绢乐绰单, 牢内爹捞 柄廉乐绢辑 汗盔且 荐啊 绝促 ばば... cython俊辑 牢内爹 俊矾 唱辑 瘤况滚覆...
|
||||||
|
else:
|
||||||
|
return "钓着" + fishName + "了。"
|
||||||
|
|
||||||
|
def FISHING_SUCCESS(isFish, fishName):
|
||||||
|
if isFish:
|
||||||
|
return "钓着" + fishName + "了。"
|
||||||
|
else:
|
||||||
|
return "获得" + fishName + "了。"
|
||||||
|
|
||||||
|
def NumberToMoneyString(number):
|
||||||
|
|
||||||
|
if number <= 0:
|
||||||
|
return "0两"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "万", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "亿", result)
|
||||||
|
result = result + "两"
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def NumberToSecondaryCoinString(number):
|
||||||
|
|
||||||
|
if number <= 0:
|
||||||
|
return "0JUN"
|
||||||
|
|
||||||
|
number = str(number)
|
||||||
|
result = CutMoneyString(number, 0, 4, "", "")
|
||||||
|
result = CutMoneyString(number, 4, 8, "万", result)
|
||||||
|
result = CutMoneyString(number, 8, 12, "亿", result)
|
||||||
|
result = result + "JUN"
|
||||||
|
|
||||||
|
return result
|
||||||
|
elif IsEUROPE() and not IsWE_KOREA() and not IsYMIR():
|
||||||
|
def DO_YOU_SELL_ITEM(sellItemName, sellItemCount, sellItemPrice):
|
||||||
|
if sellItemCount > 1 :
|
||||||
|
return DO_YOU_SELL_ITEM2 % (sellItemName, sellItemCount, NumberToMoneyString(sellItemPrice) )
|
||||||
|
else:
|
||||||
|
return DO_YOU_SELL_ITEM1 % (sellItemName, NumberToMoneyString(sellItemPrice) )
|
||||||
|
|
||||||
|
def DO_YOU_BUY_ITEM(buyItemName, buyItemCount, buyItemPrice) :
|
||||||
|
if buyItemCount > 1 :
|
||||||
|
return DO_YOU_BUY_ITEM2 % ( buyItemName, buyItemCount, buyItemPrice )
|
||||||
|
else:
|
||||||
|
return DO_YOU_BUY_ITEM1 % ( buyItemName, buyItemPrice )
|
||||||
|
|
||||||
|
def REFINE_FAILURE_CAN_NOT_ATTACH(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_CAN_NOT_ATTACH0 % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_SOCKET(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_NO_SOCKET0 % (attachedItemName)
|
||||||
|
|
||||||
|
def REFINE_FAILURE_NO_GOLD_SOCKET(attachedItemName) :
|
||||||
|
return REFINE_FAILURE_NO_GOLD_SOCKET0 % (attachedItemName)
|
||||||
|
|
||||||
|
def HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, dropItemCount) :
|
||||||
|
if dropItemCount > 1 :
|
||||||
|
return HOW_MANY_ITEM_DO_YOU_DROP2 % (dropItemName, dropItemCount)
|
||||||
|
else :
|
||||||
|
return HOW_MANY_ITEM_DO_YOU_DROP1 % (dropItemName)
|
||||||
|
|
||||||
|
def FISHING_NOTIFY(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return FISHING_NOTIFY1 % ( fishName )
|
||||||
|
else :
|
||||||
|
return FISHING_NOTIFY2 % ( fishName )
|
||||||
|
|
||||||
|
def FISHING_SUCCESS(isFish, fishName) :
|
||||||
|
if isFish :
|
||||||
|
return FISHING_SUCCESS1 % (fishName)
|
||||||
|
else :
|
||||||
|
return FISHING_SUCCESS2 % (fishName)
|
||||||
|
|
||||||
|
def NumberToMoneyString(n) :
|
||||||
|
if n <= 0 :
|
||||||
|
return "0 %s" % (MONETARY_UNIT0)
|
||||||
|
|
||||||
|
return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0)
|
||||||
|
|
||||||
|
def NumberToSecondaryCoinString(n) :
|
||||||
|
if n <= 0 :
|
||||||
|
return "0 %s" % (MONETARY_UNIT_JUN)
|
||||||
|
|
||||||
|
return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT_JUN)
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
FolderName "pack"
|
||||||
|
|
||||||
|
List ExcludedFolderNameList
|
||||||
|
{
|
||||||
|
"CVS"
|
||||||
|
}
|
||||||
|
List ExcludedFileNameList
|
||||||
|
{
|
||||||
|
"vssver.scc"
|
||||||
|
"syserr.txt"
|
||||||
|
"soundscript.txt"
|
||||||
|
"log.txt"
|
||||||
|
"Test.py"
|
||||||
|
"Prototype[OffLine].py"
|
||||||
|
"loginInfo.py"
|
||||||
|
"error_lookup.py"
|
||||||
|
"errorlog.txt"
|
||||||
|
"makepackscript.txt"
|
||||||
|
"makepackscript_onlyroot.txt"
|
||||||
|
"moviemakepackscript.txt"
|
||||||
|
"build_mottable.py"
|
||||||
|
"uitest.py"
|
||||||
|
"packall.txt"
|
||||||
|
"packitem.txt"
|
||||||
|
"packpc.txt"
|
||||||
|
"packroot.txt"
|
||||||
|
"test.txt"
|
||||||
|
"test2.txt"
|
||||||
|
"quest_test.py"
|
||||||
|
}
|
||||||
|
List SecurityExtNameList
|
||||||
|
{
|
||||||
|
"txt"
|
||||||
|
"msk"
|
||||||
|
"msa"
|
||||||
|
"msm"
|
||||||
|
"py"
|
||||||
|
}
|
||||||
|
List CompressExtNameList
|
||||||
|
{
|
||||||
|
"txt"
|
||||||
|
"msk"
|
||||||
|
"mss"
|
||||||
|
"mse"
|
||||||
|
"msf"
|
||||||
|
"msa"
|
||||||
|
"spt"
|
||||||
|
"atr"
|
||||||
|
"dds"
|
||||||
|
"raw"
|
||||||
|
"wtr"
|
||||||
|
"mde"
|
||||||
|
"tga"
|
||||||
|
}
|
||||||
|
|
||||||
|
Group RootPackItemList
|
||||||
|
{
|
||||||
|
Group ItemProto
|
||||||
|
{
|
||||||
|
FileName "*item_proto"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group mob_proto
|
||||||
|
{
|
||||||
|
FileName "*mob_proto"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group TextureSet
|
||||||
|
{
|
||||||
|
FileName "TextureSet/*.txt"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group TextFiles
|
||||||
|
{
|
||||||
|
FileName "*.txt"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group TextFiles
|
||||||
|
{
|
||||||
|
FileName "*.tbl"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group KoreanFiles
|
||||||
|
{
|
||||||
|
FileName "*.cvt"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
Group ModelFiles
|
||||||
|
{
|
||||||
|
FileName "*.msm"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Group PackList
|
||||||
|
{
|
||||||
|
Group UIScript
|
||||||
|
{
|
||||||
|
PathName "UIScript/*"
|
||||||
|
Fixed TRUE
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,399 @@
|
|||||||
|
import app
|
||||||
|
import grp
|
||||||
|
import grpImage
|
||||||
|
import item
|
||||||
|
import wndMgr
|
||||||
|
import player
|
||||||
|
|
||||||
|
import skill
|
||||||
|
import dbg
|
||||||
|
import grpText
|
||||||
|
|
||||||
|
import ui
|
||||||
|
|
||||||
|
import systemSetting
|
||||||
|
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
## Mouse Controler
|
||||||
|
## 마우스 커서를 제어하며 마우스 커서에 Attach되어 움직이는 Object들까지 제어할 수 있다.
|
||||||
|
|
||||||
|
class CursorImage(object):
|
||||||
|
def __init__(self):
|
||||||
|
self.handle = 0
|
||||||
|
|
||||||
|
def __init__(self, imageName):
|
||||||
|
self.handle = 0
|
||||||
|
self.LoadImage(imageName)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
grpImage.Delete(self.handle)
|
||||||
|
|
||||||
|
def LoadImage(self, imageName):
|
||||||
|
try:
|
||||||
|
self.handle = grpImage.Generate(imageName)
|
||||||
|
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
dbg.TraceError("%s %s" % (sys.exc_info()[0], sys.exc_info()[1]))
|
||||||
|
self.handle = 0
|
||||||
|
|
||||||
|
def DeleteImage(self):
|
||||||
|
if self.handle:
|
||||||
|
grpImage.Delete(self.handle)
|
||||||
|
|
||||||
|
def IsImage(self):
|
||||||
|
if self.handle:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def SetPosition(self, x, y):
|
||||||
|
if self.handle:
|
||||||
|
grpImage.SetPosition(self.handle, x, y)
|
||||||
|
|
||||||
|
def Render(self):
|
||||||
|
if self.handle:
|
||||||
|
grpImage.Render(self.handle)
|
||||||
|
|
||||||
|
class CMouseController(object):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
self.x = 0
|
||||||
|
self.y = 0
|
||||||
|
|
||||||
|
self.IsSoftwareCursor = False
|
||||||
|
self.curCursorName = ""
|
||||||
|
self.curCursorImage = 0
|
||||||
|
self.cursorPosX = 0
|
||||||
|
self.cursorPosY = 0
|
||||||
|
|
||||||
|
self.AttachedIconHandle = 0
|
||||||
|
self.AttachedOwner = 0
|
||||||
|
self.AttachedFlag = False
|
||||||
|
self.AttachedType = 0
|
||||||
|
self.AttachedSlotNumber = 0
|
||||||
|
self.AttachedCount = 1
|
||||||
|
self.AttachedIconHalfWidth = 0
|
||||||
|
self.AttachedIconHalfHeight = 0
|
||||||
|
self.LastAttachedSlotNumber = 0
|
||||||
|
|
||||||
|
self.countNumberLine = None
|
||||||
|
|
||||||
|
self.DeattachObject()
|
||||||
|
|
||||||
|
self.callbackDict = {}
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.callbackDict = {}
|
||||||
|
|
||||||
|
def Create(self):
|
||||||
|
self.IsSoftwareCursor = systemSetting.IsSoftwareCursor()
|
||||||
|
|
||||||
|
self.cursorDict = {
|
||||||
|
app.NORMAL : CursorImage("D:/Ymir Work/UI/Cursor/cursor.sub"),
|
||||||
|
app.ATTACK : CursorImage("D:/Ymir Work/UI/Cursor/cursor_attack.sub"),
|
||||||
|
app.TARGET : CursorImage("D:/Ymir Work/UI/Cursor/cursor_attack.sub"),
|
||||||
|
app.TALK : CursorImage("D:/Ymir Work/UI/Cursor/cursor_talk.sub"),
|
||||||
|
app.CANT_GO : CursorImage("D:/Ymir Work/UI/Cursor/cursor_no.sub"),
|
||||||
|
app.PICK : CursorImage("D:/Ymir Work/UI/Cursor/cursor_pick.sub"),
|
||||||
|
app.DOOR : CursorImage("D:/Ymir Work/UI/Cursor/cursor_door.sub"),
|
||||||
|
app.CHAIR : CursorImage("D:/Ymir Work/UI/Cursor/cursor_chair.sub"),
|
||||||
|
app.MAGIC : CursorImage("D:/Ymir Work/UI/Cursor/cursor_chair.sub"),
|
||||||
|
app.BUY : CursorImage("D:/Ymir Work/UI/Cursor/cursor_buy.sub"),
|
||||||
|
app.SELL : CursorImage("D:/Ymir Work/UI/Cursor/cursor_sell.sub"),
|
||||||
|
app.CAMERA_ROTATE : CursorImage("D:/Ymir Work/UI/Cursor/cursor_camera_rotate.sub"),
|
||||||
|
app.HSIZE : CursorImage("D:/Ymir Work/UI/Cursor/cursor_hsize.sub"),
|
||||||
|
app.VSIZE : CursorImage("D:/Ymir Work/UI/Cursor/cursor_vsize.sub"),
|
||||||
|
app.HVSIZE : CursorImage("D:/Ymir Work/UI/Cursor/cursor_hvsize.sub"),
|
||||||
|
}
|
||||||
|
self.cursorPosDict = {
|
||||||
|
app.NORMAL : (0, 0),
|
||||||
|
app.TARGET : (0, 0),
|
||||||
|
app.ATTACK : (0, 0),
|
||||||
|
app.TALK : (0, 0),
|
||||||
|
app.CANT_GO : (0, 0),
|
||||||
|
app.PICK : (0, 0),
|
||||||
|
app.DOOR : (0, 0),
|
||||||
|
app.CHAIR : (0, 0),
|
||||||
|
app.MAGIC : (0, 0),
|
||||||
|
app.BUY : (0, 0),
|
||||||
|
app.SELL : (0, 0),
|
||||||
|
app.CAMERA_ROTATE : (0, 0),
|
||||||
|
app.HSIZE : (-16, -16),
|
||||||
|
app.VSIZE : (-16, -16),
|
||||||
|
app.HVSIZE : (-16, -16),
|
||||||
|
}
|
||||||
|
|
||||||
|
app.SetCursor(app.NORMAL)
|
||||||
|
|
||||||
|
"""
|
||||||
|
AttachedCountTextLineHandle = grpText.Generate()
|
||||||
|
grpText.SetFontName(AttachedCountTextLineHandle, localeInfo.UI_DEF_FONT_SMALL)
|
||||||
|
grpText.SetText(AttachedCountTextLineHandle, "1234")
|
||||||
|
grpText.SetPosition(AttachedCountTextLineHandle, 100, 100)
|
||||||
|
grpText.SetOutline(AttachedCountTextLineHandle, True)
|
||||||
|
grpText.SetFontColor(AttachedCountTextLineHandle, 1.0, 1.0, 1.0)
|
||||||
|
grpText.SetHorizontalAlign(AttachedCountTextLineHandle, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER)
|
||||||
|
self.AttachedCountTextLineHandle = AttachedCountTextLineHandle
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.countNumberLine = ui.NumberLine("CURTAIN")
|
||||||
|
self.countNumberLine.SetHorizontalAlignCenter()
|
||||||
|
self.countNumberLine.Hide()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
# Cursor Control
|
||||||
|
def ChangeCursor(self, cursorNum):
|
||||||
|
try:
|
||||||
|
self.curCursorNum = cursorNum
|
||||||
|
self.curCursorImage = self.cursorDict[cursorNum]
|
||||||
|
(self.cursorPosX, self.cursorPosY) = self.cursorPosDict[cursorNum]
|
||||||
|
|
||||||
|
if False == self.curCursorImage.IsImage():
|
||||||
|
self.curCursorNum = app.NORMAL
|
||||||
|
self.curCursorImage = self.cursorDict[app.NORMAL]
|
||||||
|
|
||||||
|
except KeyError:
|
||||||
|
dbg.TraceError("mouseModule.MouseController.SetCursor - 잘못된 커서 번호 [%d]" % cursorNum)
|
||||||
|
self.curCursorName = app.NORMAL
|
||||||
|
self.curCursorImage = self.cursorDict[app.NORMAL]
|
||||||
|
|
||||||
|
# Attaching
|
||||||
|
def AttachObject(self, Owner, Type, SlotNumber, ItemIndex, count = 0):
|
||||||
|
|
||||||
|
self.LastAttachedSlotNumber = self.AttachedSlotNumber
|
||||||
|
|
||||||
|
self.AttachedFlag = True
|
||||||
|
self.AttachedOwner = Owner
|
||||||
|
self.AttachedType = Type
|
||||||
|
self.AttachedSlotNumber = SlotNumber
|
||||||
|
self.AttachedItemIndex = ItemIndex
|
||||||
|
self.AttachedCount = count
|
||||||
|
self.countNumberLine.SetNumber("")
|
||||||
|
self.countNumberLine.Hide()
|
||||||
|
|
||||||
|
if count > 1:
|
||||||
|
self.countNumberLine.SetNumber(str(count))
|
||||||
|
self.countNumberLine.Show()
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
width = 1
|
||||||
|
height = 1
|
||||||
|
|
||||||
|
if Type == player.SLOT_TYPE_INVENTORY or\
|
||||||
|
Type == player.SLOT_TYPE_PRIVATE_SHOP or\
|
||||||
|
Type == player.SLOT_TYPE_SHOP or\
|
||||||
|
Type == player.SLOT_TYPE_SAFEBOX or\
|
||||||
|
Type == player.SLOT_TYPE_MALL or\
|
||||||
|
Type == player.SLOT_TYPE_DRAGON_SOUL_INVENTORY:
|
||||||
|
|
||||||
|
item.SelectItem(self.AttachedItemIndex)
|
||||||
|
self.AttachedIconHandle = item.GetIconInstance()
|
||||||
|
|
||||||
|
if not self.AttachedIconHandle:
|
||||||
|
self.AttachedIconHandle = 0
|
||||||
|
self.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
(width, height) = item.GetItemSize()
|
||||||
|
|
||||||
|
elif Type == player.SLOT_TYPE_SKILL:
|
||||||
|
skillGrade = player.GetSkillGrade(SlotNumber)
|
||||||
|
self.AttachedIconHandle = skill.GetIconInstanceNew(self.AttachedItemIndex, skillGrade)
|
||||||
|
|
||||||
|
elif Type == player.SLOT_TYPE_EMOTION:
|
||||||
|
image = player.GetEmotionIconImage(ItemIndex)
|
||||||
|
self.AttachedIconHandle = grpImage.GenerateFromHandle(image)
|
||||||
|
|
||||||
|
elif Type == player.SLOT_TYPE_QUICK_SLOT:
|
||||||
|
(quickSlotType, position) = player.GetGlobalQuickSlot(SlotNumber)
|
||||||
|
|
||||||
|
if quickSlotType == player.SLOT_TYPE_INVENTORY:
|
||||||
|
|
||||||
|
itemIndex = player.GetItemIndex(position)
|
||||||
|
item.SelectItem(itemIndex)
|
||||||
|
self.AttachedIconHandle = item.GetIconInstance()
|
||||||
|
(width, height) = item.GetItemSize()
|
||||||
|
|
||||||
|
elif quickSlotType == player.SLOT_TYPE_SKILL:
|
||||||
|
skillIndex = player.GetSkillIndex(position)
|
||||||
|
skillGrade = player.GetSkillGrade(position)
|
||||||
|
self.AttachedIconHandle = skill.GetIconInstanceNew(skillIndex, skillGrade)
|
||||||
|
|
||||||
|
elif quickSlotType == player.SLOT_TYPE_EMOTION:
|
||||||
|
image = player.GetEmotionIconImage(position)
|
||||||
|
self.AttachedIconHandle = grpImage.GenerateFromHandle(image)
|
||||||
|
|
||||||
|
if not self.AttachedIconHandle:
|
||||||
|
self.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.AttachedIconHalfWidth = grpImage.GetWidth(self.AttachedIconHandle) / 2
|
||||||
|
self.AttachedIconHalfHeight = grpImage.GetHeight(self.AttachedIconHandle) / 2
|
||||||
|
self.AttachedIconHalfWidth = grpImage.GetWidth(self.AttachedIconHandle) / 2
|
||||||
|
self.AttachedIconHalfHeight = grpImage.GetHeight(self.AttachedIconHandle) / 2
|
||||||
|
wndMgr.AttachIcon(self.AttachedType, self.AttachedItemIndex, self.AttachedSlotNumber, width, height)
|
||||||
|
|
||||||
|
except Exception, e:
|
||||||
|
dbg.TraceError("mouseModule.py: AttachObject : " + str(e))
|
||||||
|
self.AttachedIconHandle = 0
|
||||||
|
|
||||||
|
def IsAttachedMoney(self):
|
||||||
|
if True == self.isAttached():
|
||||||
|
if player.ITEM_MONEY == self.GetAttachedItemIndex():
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def GetAttachedMoneyAmount(self):
|
||||||
|
if True == self.isAttached():
|
||||||
|
if player.ITEM_MONEY == self.GetAttachedItemIndex():
|
||||||
|
return self.GetAttachedItemCount()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def AttachMoney(self, owner, type, count):
|
||||||
|
|
||||||
|
self.LastAttachedSlotNumber = self.AttachedSlotNumber
|
||||||
|
|
||||||
|
self.AttachedFlag = True
|
||||||
|
self.AttachedOwner = owner
|
||||||
|
self.AttachedType = type
|
||||||
|
self.AttachedSlotNumber = -1
|
||||||
|
self.AttachedItemIndex = player.ITEM_MONEY
|
||||||
|
self.AttachedCount = count
|
||||||
|
self.AttachedIconHandle = grpImage.Generate("icon/item/money.tga")
|
||||||
|
self.AttachedIconHalfWidth = grpImage.GetWidth(self.AttachedIconHandle) / 2
|
||||||
|
self.AttachedIconHalfHeight = grpImage.GetHeight(self.AttachedIconHandle) / 2
|
||||||
|
wndMgr.AttachIcon(self.AttachedType, self.AttachedItemIndex, self.AttachedSlotNumber, 1, 1)
|
||||||
|
|
||||||
|
if count > 1:
|
||||||
|
self.countNumberLine.SetNumber(str(count))
|
||||||
|
self.countNumberLine.Show()
|
||||||
|
#grpText.SetText(self.AttachedCountTextLineHandle, str(count))
|
||||||
|
|
||||||
|
def DeattachObject(self):
|
||||||
|
|
||||||
|
self.ClearCallBack()
|
||||||
|
self.LastAttachedSlotNumber = self.AttachedSlotNumber
|
||||||
|
|
||||||
|
if self.AttachedIconHandle != 0:
|
||||||
|
|
||||||
|
if self.AttachedType == player.SLOT_TYPE_INVENTORY or\
|
||||||
|
self.AttachedType == player.SLOT_TYPE_PRIVATE_SHOP or\
|
||||||
|
self.AttachedType == player.SLOT_TYPE_SHOP or\
|
||||||
|
self.AttachedType == player.SLOT_TYPE_SAFEBOX or\
|
||||||
|
self.AttachedType == player.SLOT_TYPE_MALL:
|
||||||
|
|
||||||
|
item.DeleteIconInstance(self.AttachedIconHandle)
|
||||||
|
|
||||||
|
elif self.AttachedType == player.SLOT_TYPE_SKILL:
|
||||||
|
skill.DeleteIconInstance(self.AttachedIconHandle)
|
||||||
|
|
||||||
|
elif self.AttachedType == player.SLOT_TYPE_EMOTION:
|
||||||
|
grpImage.Delete(self.AttachedIconHandle)
|
||||||
|
|
||||||
|
self.AttachedFlag = False
|
||||||
|
self.AttachedType = -1
|
||||||
|
self.AttachedItemIndex = -1
|
||||||
|
self.AttachedSlotNumber = -1
|
||||||
|
self.AttachedIconHandle = 0
|
||||||
|
wndMgr.SetAttachingFlag(False)
|
||||||
|
|
||||||
|
if self.countNumberLine:
|
||||||
|
self.countNumberLine.Hide()
|
||||||
|
|
||||||
|
def isAttached(self):
|
||||||
|
return self.AttachedFlag
|
||||||
|
|
||||||
|
def GetAttachedOwner(self):
|
||||||
|
|
||||||
|
if False == self.isAttached():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return self.AttachedOwner
|
||||||
|
|
||||||
|
def GetAttachedType(self):
|
||||||
|
|
||||||
|
if False == self.isAttached():
|
||||||
|
return player.SLOT_TYPE_NONE
|
||||||
|
|
||||||
|
return self.AttachedType
|
||||||
|
|
||||||
|
def GetAttachedSlotNumber(self):
|
||||||
|
|
||||||
|
if False == self.isAttached():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return self.AttachedSlotNumber
|
||||||
|
|
||||||
|
def GetLastAttachedSlotNumber(self):
|
||||||
|
|
||||||
|
return self.LastAttachedSlotNumber
|
||||||
|
|
||||||
|
def GetAttachedItemIndex(self):
|
||||||
|
|
||||||
|
if False == self.isAttached():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return self.AttachedItemIndex
|
||||||
|
|
||||||
|
def GetAttachedItemCount(self):
|
||||||
|
|
||||||
|
if False == self.isAttached():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return self.AttachedCount
|
||||||
|
|
||||||
|
# Update
|
||||||
|
def Update(self, x, y):
|
||||||
|
|
||||||
|
self.x = x
|
||||||
|
self.y = y
|
||||||
|
|
||||||
|
if True == self.isAttached():
|
||||||
|
if 0 != self.AttachedIconHandle:
|
||||||
|
grpImage.SetDiffuseColor(self.AttachedIconHandle, 1.0, 1.0, 1.0, 0.5)
|
||||||
|
grpImage.SetPosition(self.AttachedIconHandle, self.x - self.AttachedIconHalfWidth, self.y - self.AttachedIconHalfHeight)
|
||||||
|
self.countNumberLine.SetPosition(self.x, self.y - self.AttachedIconHalfHeight - 3)
|
||||||
|
|
||||||
|
if self.IsSoftwareCursor:
|
||||||
|
if 0 != self.curCursorImage:
|
||||||
|
self.curCursorImage.SetPosition(self.x + self.cursorPosX, self.y + self.cursorPosY)
|
||||||
|
|
||||||
|
# Render
|
||||||
|
def Render(self):
|
||||||
|
|
||||||
|
if True == self.isAttached():
|
||||||
|
if 0 != self.AttachedIconHandle:
|
||||||
|
grpImage.Render(self.AttachedIconHandle)
|
||||||
|
|
||||||
|
if self.IsSoftwareCursor:
|
||||||
|
if True == app.IsShowCursor():
|
||||||
|
if 0 != self.curCursorImage:
|
||||||
|
self.curCursorImage.Render()
|
||||||
|
else:
|
||||||
|
if False == app.IsShowCursor():
|
||||||
|
if True == app.IsLiarCursorOn():
|
||||||
|
if 0 != self.curCursorImage:
|
||||||
|
self.curCursorImage.SetPosition(self.x + self.cursorPosX, self.y + self.cursorPosY)
|
||||||
|
self.curCursorImage.Render()
|
||||||
|
|
||||||
|
def SetCallBack(self, type, event=lambda *arg:None):
|
||||||
|
self.callbackDict[type] = event
|
||||||
|
|
||||||
|
def RunCallBack(self, type, *arg):
|
||||||
|
|
||||||
|
if not self.callbackDict.has_key(type):
|
||||||
|
self.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.callbackDict[type]()
|
||||||
|
|
||||||
|
def ClearCallBack(self):
|
||||||
|
self.callbackDict = {}
|
||||||
|
|
||||||
|
mouseController = CMouseController()
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
METIN2THEMA = "M2BG.mp3"
|
||||||
|
|
||||||
|
loginMusic="login_window.mp3"
|
||||||
|
createMusic="characterselect.mp3"
|
||||||
|
selectMusic="characterselect.mp3"
|
||||||
|
fieldMusic=METIN2THEMA
|
||||||
|
|
||||||
|
def SaveLastPlayFieldMusic():
|
||||||
|
global fieldMusic
|
||||||
|
|
||||||
|
try:
|
||||||
|
lastPlayFile=open("BGM/lastplay.inf", "w")
|
||||||
|
except IOError:
|
||||||
|
return
|
||||||
|
|
||||||
|
lastPlayFile.write(fieldMusic)
|
||||||
|
|
||||||
|
|
||||||
|
def LoadLastPlayFieldMusic():
|
||||||
|
global fieldMusic
|
||||||
|
|
||||||
|
try:
|
||||||
|
lastPlayFile=open("BGM/lastplay.inf", "r")
|
||||||
|
except IOError:
|
||||||
|
return
|
||||||
|
|
||||||
|
fieldMusic=lastPlayFile.read()
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,292 @@
|
|||||||
|
###################################################################################################
|
||||||
|
# Network
|
||||||
|
|
||||||
|
import app
|
||||||
|
import chr
|
||||||
|
import dbg
|
||||||
|
import net
|
||||||
|
import snd
|
||||||
|
|
||||||
|
import chr
|
||||||
|
import chrmgr
|
||||||
|
import background
|
||||||
|
import player
|
||||||
|
import playerSettingModule
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import uiPhaseCurtain
|
||||||
|
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
class PopupDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW POPUP DIALOG ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.CloseEvent = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE POPUP DIALOG "
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
|
||||||
|
|
||||||
|
def Open(self, Message, event = 0, ButtonName = localeInfo.UI_CANCEL):
|
||||||
|
|
||||||
|
if True == self.IsShow():
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
self.Lock()
|
||||||
|
self.SetTop()
|
||||||
|
self.CloseEvent = event
|
||||||
|
|
||||||
|
AcceptButton = self.GetChild("accept")
|
||||||
|
AcceptButton.SetText(ButtonName)
|
||||||
|
AcceptButton.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.GetChild("message").SetText(Message)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
|
||||||
|
if False == self.IsShow():
|
||||||
|
self.CloseEvent = 0
|
||||||
|
return
|
||||||
|
|
||||||
|
self.Unlock()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
if 0 != self.CloseEvent:
|
||||||
|
self.CloseEvent()
|
||||||
|
self.CloseEvent = 0
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.Close()
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnIMEReturn(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
##
|
||||||
|
## Main Stream
|
||||||
|
##
|
||||||
|
class MainStream(object):
|
||||||
|
isChrData=0
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
print "NEWMAIN STREAM ----------------------------------------------------------------------------"
|
||||||
|
net.SetHandler(self)
|
||||||
|
net.SetTCPRecvBufferSize(128*1024)
|
||||||
|
net.SetTCPSendBufferSize(4096)
|
||||||
|
net.SetUDPRecvBufferSize(4096)
|
||||||
|
|
||||||
|
self.id=""
|
||||||
|
self.pwd=""
|
||||||
|
self.addr=""
|
||||||
|
self.port=0
|
||||||
|
self.account_addr=0
|
||||||
|
self.account_port=0
|
||||||
|
self.slot=0
|
||||||
|
self.isAutoSelect=0
|
||||||
|
self.isAutoLogin=0
|
||||||
|
|
||||||
|
self.curtain = 0
|
||||||
|
self.curPhaseWindow = 0
|
||||||
|
self.newPhaseWindow = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE MAIN STREAM "
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
if self.curPhaseWindow:
|
||||||
|
self.curPhaseWindow.Close()
|
||||||
|
self.curPhaseWindow = 0
|
||||||
|
|
||||||
|
if self.newPhaseWindow:
|
||||||
|
self.newPhaseWindow.Close()
|
||||||
|
self.newPhaseWindow = 0
|
||||||
|
|
||||||
|
self.popupWindow.Destroy()
|
||||||
|
self.popupWindow = 0
|
||||||
|
|
||||||
|
self.curtain = 0
|
||||||
|
|
||||||
|
def Create(self):
|
||||||
|
self.CreatePopupDialog()
|
||||||
|
|
||||||
|
self.curtain = uiPhaseCurtain.PhaseCurtain()
|
||||||
|
|
||||||
|
def SetPhaseWindow(self, newPhaseWindow):
|
||||||
|
if self.newPhaseWindow:
|
||||||
|
#print "이미 새로운 윈도우로 바꾼상태에서 또 바꿈", newPhaseWindow
|
||||||
|
self.__ChangePhaseWindow()
|
||||||
|
|
||||||
|
self.newPhaseWindow=newPhaseWindow
|
||||||
|
|
||||||
|
if self.curPhaseWindow:
|
||||||
|
#print "페이드 아웃되면 바꿈"
|
||||||
|
self.curtain.FadeOut(self.__ChangePhaseWindow)
|
||||||
|
else:
|
||||||
|
#print "현재 윈도우가 없는 상태라 바로 바꿈"
|
||||||
|
self.__ChangePhaseWindow()
|
||||||
|
|
||||||
|
def __ChangePhaseWindow(self):
|
||||||
|
oldPhaseWindow=self.curPhaseWindow
|
||||||
|
newPhaseWindow=self.newPhaseWindow
|
||||||
|
self.curPhaseWindow=0
|
||||||
|
self.newPhaseWindow=0
|
||||||
|
|
||||||
|
if oldPhaseWindow:
|
||||||
|
oldPhaseWindow.Close()
|
||||||
|
|
||||||
|
if newPhaseWindow:
|
||||||
|
newPhaseWindow.Open()
|
||||||
|
|
||||||
|
self.curPhaseWindow=newPhaseWindow
|
||||||
|
|
||||||
|
if self.curPhaseWindow:
|
||||||
|
self.curtain.FadeIn()
|
||||||
|
else:
|
||||||
|
app.Exit()
|
||||||
|
|
||||||
|
def CreatePopupDialog(self):
|
||||||
|
self.popupWindow = PopupDialog()
|
||||||
|
self.popupWindow.LoadDialog()
|
||||||
|
self.popupWindow.SetCenterPosition()
|
||||||
|
self.popupWindow.Hide()
|
||||||
|
|
||||||
|
|
||||||
|
## SelectPhase
|
||||||
|
##########################################################################################
|
||||||
|
def SetLogoPhase(self):
|
||||||
|
net.Disconnect()
|
||||||
|
|
||||||
|
import introLogo
|
||||||
|
self.SetPhaseWindow(introLogo.LogoWindow(self))
|
||||||
|
|
||||||
|
def SetLoginPhase(self):
|
||||||
|
net.Disconnect()
|
||||||
|
|
||||||
|
import introLogin
|
||||||
|
self.SetPhaseWindow(introLogin.LoginWindow(self))
|
||||||
|
|
||||||
|
def SameLogin_SetLoginPhase(self):
|
||||||
|
net.Disconnect()
|
||||||
|
|
||||||
|
import introLogin
|
||||||
|
introInst = introLogin.LoginWindow(self)
|
||||||
|
self.SetPhaseWindow(introInst)
|
||||||
|
introInst.SameLogin_OpenUI()
|
||||||
|
|
||||||
|
def SetSelectEmpirePhase(self):
|
||||||
|
try:
|
||||||
|
import introEmpire
|
||||||
|
self.SetPhaseWindow(introEmpire.SelectEmpireWindow(self))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetSelectEmpirePhase")
|
||||||
|
|
||||||
|
|
||||||
|
def SetReselectEmpirePhase(self):
|
||||||
|
try:
|
||||||
|
import introEmpire
|
||||||
|
self.SetPhaseWindow(introEmpire.ReselectEmpireWindow(self))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetReselectEmpirePhase")
|
||||||
|
|
||||||
|
def SetSelectCharacterPhase(self):
|
||||||
|
try:
|
||||||
|
localeInfo.LoadLocaleData()
|
||||||
|
import introSelect
|
||||||
|
self.popupWindow.Close()
|
||||||
|
self.SetPhaseWindow(introSelect.SelectCharacterWindow(self))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetSelectCharacterPhase")
|
||||||
|
|
||||||
|
def SetCreateCharacterPhase(self):
|
||||||
|
try:
|
||||||
|
import introCreate
|
||||||
|
self.SetPhaseWindow(introCreate.CreateCharacterWindow(self))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetCreateCharacterPhase")
|
||||||
|
|
||||||
|
def SetTestGamePhase(self, x, y):
|
||||||
|
try:
|
||||||
|
import introLoading
|
||||||
|
loadingPhaseWindow=introLoading.LoadingWindow(self)
|
||||||
|
loadingPhaseWindow.LoadData(x, y)
|
||||||
|
self.SetPhaseWindow(loadingPhaseWindow)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetLoadingPhase")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def SetLoadingPhase(self):
|
||||||
|
try:
|
||||||
|
import introLoading
|
||||||
|
self.SetPhaseWindow(introLoading.LoadingWindow(self))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetLoadingPhase")
|
||||||
|
|
||||||
|
def SetGamePhase(self):
|
||||||
|
try:
|
||||||
|
import game
|
||||||
|
self.popupWindow.Close()
|
||||||
|
self.SetPhaseWindow(game.GameWindow(self))
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
import exception
|
||||||
|
exception.Abort("networkModule.SetGamePhase")
|
||||||
|
|
||||||
|
################################
|
||||||
|
# Functions used in python
|
||||||
|
|
||||||
|
## Login
|
||||||
|
def Connect(self):
|
||||||
|
import constInfo
|
||||||
|
if constInfo.KEEP_ACCOUNT_CONNETION_ENABLE:
|
||||||
|
net.ConnectToAccountServer(self.addr, self.port, self.account_addr, self.account_port)
|
||||||
|
else:
|
||||||
|
net.ConnectTCP(self.addr, self.port)
|
||||||
|
|
||||||
|
#net.ConnectUDP(IP, Port)
|
||||||
|
|
||||||
|
def SetConnectInfo(self, addr, port, account_addr=0, account_port=0):
|
||||||
|
self.addr = addr
|
||||||
|
self.port = port
|
||||||
|
self.account_addr = account_addr
|
||||||
|
self.account_port = account_port
|
||||||
|
|
||||||
|
def GetConnectAddr(self):
|
||||||
|
return self.addr
|
||||||
|
|
||||||
|
def SetLoginInfo(self, id, pwd):
|
||||||
|
self.id = id
|
||||||
|
self.pwd = pwd
|
||||||
|
net.SetLoginInfo(id, pwd)
|
||||||
|
|
||||||
|
def CancelEnterGame(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
## Select
|
||||||
|
def SetCharacterSlot(self, slot):
|
||||||
|
self.slot=slot
|
||||||
|
|
||||||
|
def GetCharacterSlot(self):
|
||||||
|
return self.slot
|
||||||
|
|
||||||
|
## Empty
|
||||||
|
def EmptyFunction(self):
|
||||||
|
pass
|
||||||
+1473
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
|||||||
|
import dbg
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import networkModule
|
||||||
|
import uiCandidate
|
||||||
|
import constInfo
|
||||||
|
import musicInfo
|
||||||
|
import stringCommander
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#bind_me(locals().values())
|
||||||
|
|
||||||
|
def RunApp():
|
||||||
|
musicInfo.LoadLastPlayFieldMusic()
|
||||||
|
|
||||||
|
app.SetHairColorEnable(constInfo.HAIR_COLOR_ENABLE)
|
||||||
|
app.SetArmorSpecularEnable(constInfo.ARMOR_SPECULAR_ENABLE)
|
||||||
|
app.SetWeaponSpecularEnable(constInfo.WEAPON_SPECULAR_ENABLE)
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
|
||||||
|
try:
|
||||||
|
app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
except RuntimeError, msg:
|
||||||
|
msg = str(msg)
|
||||||
|
if "CREATE_DEVICE" == msg:
|
||||||
|
dbg.LogBox("Sorry, Your system does not support 3D graphics,\r\nplease check your hardware and system configeration\r\nthen try again.")
|
||||||
|
else:
|
||||||
|
dbg.LogBox("Metin2.%s" % msg)
|
||||||
|
return
|
||||||
|
|
||||||
|
app.SetCamera(1500.0, 30.0, 0.0, 180.0)
|
||||||
|
|
||||||
|
#Gets and sets the floating-point control word
|
||||||
|
#app.SetControlFP()
|
||||||
|
|
||||||
|
if not mouseModule.mouseController.Create():
|
||||||
|
return
|
||||||
|
|
||||||
|
mainStream = networkModule.MainStream()
|
||||||
|
mainStream.Create()
|
||||||
|
|
||||||
|
#mainStream.SetLoadingPhase()
|
||||||
|
mainStream.SetLogoPhase()
|
||||||
|
|
||||||
|
#mainStream.SetLoginPhase()
|
||||||
|
#mainStream.SetSelectCharacterPhase()
|
||||||
|
#mainStream.SetCreateCharacterPhase()
|
||||||
|
#mainStream.SetSelectEmpirePhase()
|
||||||
|
#mainStream.SetGamePhase()
|
||||||
|
app.Loop()
|
||||||
|
|
||||||
|
mainStream.Destroy()
|
||||||
|
|
||||||
|
RunApp()
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import sys
|
||||||
|
libpath = '..\\..\\Extern\\Py2Lib\\lib'
|
||||||
|
sys.path.append(libpath)
|
||||||
|
|
||||||
|
#import utils
|
||||||
|
import imp
|
||||||
|
fp, pathname, description = imp.find_module('utils', [libpath])
|
||||||
|
utils = imp.load_module('utils', fp, pathname, description)
|
||||||
|
import cythonizer
|
||||||
|
|
||||||
|
pys = utils.findMatchedFiles(".", "*.py")
|
||||||
|
pys.remove('RootlibCythonizer.py')
|
||||||
|
moduleLst = cythonizer.run(pys, forceRecompile=True)
|
||||||
|
moduleNameLst = []
|
||||||
|
sourceFileLst = []
|
||||||
|
import os.path
|
||||||
|
for m in moduleLst:
|
||||||
|
for source in m.sources:
|
||||||
|
base, ext = os.path.splitext(source)
|
||||||
|
moduleName = base.split('/')[-1]
|
||||||
|
moduleNameLst.append(moduleName)
|
||||||
|
sourceFileLst.append(base + (".cpp" if "c++" == m.language else ".c"))
|
||||||
|
|
||||||
|
import sourceWriter
|
||||||
|
|
||||||
|
sourceFileName = sourceWriter.run(moduleNameLst, 'rootlib')
|
||||||
|
print "%s create successful." % sourceFileName
|
||||||
|
|
||||||
|
# not yet implemented.
|
||||||
|
#from distutils.dist import Distribution
|
||||||
|
|
||||||
|
#dist = Distribution({'name' : 'test', 'libraries' : [('test', {'sources' : sourceFileLst})]})
|
||||||
|
|
||||||
|
#from builder import Builder
|
||||||
|
#cBuilder = Builder(dist)
|
||||||
|
#cBuilder.run()
|
||||||
|
#import builder
|
||||||
|
#builder.run(sourceFileLst, 'test')
|
||||||
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import net
|
||||||
|
import background
|
||||||
|
import stringCommander
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
class ServerCommandParser(object):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
net.SetServerCommandParserWindow(self)
|
||||||
|
self.__ServerCommand_Build()
|
||||||
|
|
||||||
|
def __ServerCommand_Build(self):
|
||||||
|
serverCommandList={
|
||||||
|
"DayMode" : self.__DayMode_Update,
|
||||||
|
"xmas_snow" : self.__XMasSnow_Enable,
|
||||||
|
"xmas_boom" : self.__XMasBoom_Enable,
|
||||||
|
"xmas_tree" : self.__XMasTree_Enable,
|
||||||
|
"newyear_boom" : self.__XMasBoom_Enable,
|
||||||
|
"item_mall" : self.__ItemMall_Open,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
self.serverCommander=stringCommander.Analyzer()
|
||||||
|
for serverCommandItem in serverCommandList.items():
|
||||||
|
self.serverCommander.SAFE_RegisterCallBack(
|
||||||
|
serverCommandItem[0], serverCommandItem[1]
|
||||||
|
)
|
||||||
|
|
||||||
|
def BINARY_ServerCommand_Run(self, line):
|
||||||
|
try:
|
||||||
|
print " BINARY_ServerCommand_Reserve", line
|
||||||
|
return self.serverCommander.Run(line)
|
||||||
|
except RuntimeError, msg:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError(msg)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def __PreserveCommand(self, line):
|
||||||
|
net.PreserveServerCommand(line)
|
||||||
|
|
||||||
|
def __DayMode_Update(self, mode):
|
||||||
|
self.__PreserveCommand("PRESERVE_DayMode " + mode)
|
||||||
|
|
||||||
|
def __ItemMall_Open(self):
|
||||||
|
self.__PreserveCommand("item_mall")
|
||||||
|
|
||||||
|
## ÀÓ½Ã
|
||||||
|
def __XMasBoom_Enable(self, mode):
|
||||||
|
if "1"==mode:
|
||||||
|
self.__PreserveCommand("PRESERVE_DayMode dark")
|
||||||
|
else:
|
||||||
|
self.__PreserveCommand("PRESERVE_DayMode light")
|
||||||
|
def __XMasSnow_Enable(self, mode):
|
||||||
|
self.__PreserveCommand("xmas_snow " + mode)
|
||||||
|
def __XMasTree_Enable(self, grade):
|
||||||
|
self.__PreserveCommand("xmas_tree " + grade)
|
||||||
|
|
||||||
|
parserWnd = ServerCommandParser()
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
SERVER_NAME = "Taverne"
|
||||||
|
SERVER_NAME_TEST = "Test"
|
||||||
|
SERVER_IP = "82.165.73.18"
|
||||||
|
SERVER_IP_TEST = "127.0.0.1"
|
||||||
|
CH1_NAME = "CH1"
|
||||||
|
CH2_NAME = "CH2"
|
||||||
|
CH3_NAME = "CH3"
|
||||||
|
CH4_NAME = "CH4"
|
||||||
|
PORT_1 = 13000
|
||||||
|
PORT_2 = 13010
|
||||||
|
PORT_3 = 13020
|
||||||
|
PORT_4 = 13030
|
||||||
|
PORT_AUTH = 11000
|
||||||
|
PORT_MARK = 13000
|
||||||
|
|
||||||
|
STATE_NONE = "..."
|
||||||
|
|
||||||
|
STATE_DICT = {
|
||||||
|
0 : "....",
|
||||||
|
1 : "NORM",
|
||||||
|
2 : "BUSY",
|
||||||
|
3 : "FULL"
|
||||||
|
}
|
||||||
|
|
||||||
|
SERVER01_CHANNEL_DICT = {
|
||||||
|
1:{"key":11,"name":CH1_NAME,"ip":SERVER_IP,"tcp_port":PORT_1,"udp_port":PORT_1,"state":STATE_NONE,},
|
||||||
|
2:{"key":12,"name":CH2_NAME,"ip":SERVER_IP,"tcp_port":PORT_2,"udp_port":PORT_2,"state":STATE_NONE,},
|
||||||
|
3:{"key":13,"name":CH3_NAME,"ip":SERVER_IP,"tcp_port":PORT_3,"udp_port":PORT_3,"state":STATE_NONE,},
|
||||||
|
4:{"key":14,"name":CH4_NAME,"ip":SERVER_IP,"tcp_port":PORT_4,"udp_port":PORT_4,"state":STATE_NONE,},
|
||||||
|
}
|
||||||
|
|
||||||
|
SERVER02_CHANNEL_DICT = {
|
||||||
|
1:{"key":21,"name":CH1_NAME,"ip":SERVER_IP_TEST,"tcp_port":PORT_1,"udp_port":PORT_1,"state":STATE_NONE,},
|
||||||
|
2:{"key":22,"name":CH2_NAME,"ip":SERVER_IP_TEST,"tcp_port":PORT_2,"udp_port":PORT_2,"state":STATE_NONE,},
|
||||||
|
}
|
||||||
|
|
||||||
|
REGION_NAME_DICT = {
|
||||||
|
0 : "",
|
||||||
|
}
|
||||||
|
|
||||||
|
REGION_AUTH_SERVER_DICT = {
|
||||||
|
0 : {
|
||||||
|
1 : { "ip":SERVER_IP, "port":PORT_AUTH, },
|
||||||
|
2 : { "ip":SERVER_IP_TEST, "port":PORT_AUTH, },
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
REGION_DICT = {
|
||||||
|
0 : {
|
||||||
|
1 : { "name" :SERVER_NAME, "channel" : SERVER01_CHANNEL_DICT, },
|
||||||
|
2 : { "name" :SERVER_NAME_TEST, "channel" : SERVER02_CHANNEL_DICT, },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
MARKADDR_DICT = {
|
||||||
|
10 : { "ip" : SERVER_IP, "tcp_port" : PORT_MARK, "mark" : "10.tga", "symbol_path" : "10", },
|
||||||
|
20 : { "ip" : SERVER_IP_TEST, "tcp_port" : PORT_MARK, "mark" : "20.tga", "symbol_path" : "20", },
|
||||||
|
}
|
||||||
+1594
File diff suppressed because it is too large
Load Diff
+1628
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
|||||||
|
import _weakref
|
||||||
|
|
||||||
|
class CallBackFunction:
|
||||||
|
class __noarg_call__:
|
||||||
|
def __init__(self, cls, obj, func):
|
||||||
|
self.cls=cls
|
||||||
|
self.obj=_weakref.proxy(obj)
|
||||||
|
self.func=_weakref.proxy(func)
|
||||||
|
|
||||||
|
def __call__(self, *arg):
|
||||||
|
return self.func(self.obj)
|
||||||
|
|
||||||
|
class __arg_call__:
|
||||||
|
def __init__(self, cls, obj, func):
|
||||||
|
self.cls=cls
|
||||||
|
self.obj=_weakref.proxy(obj)
|
||||||
|
self.func=_weakref.proxy(func)
|
||||||
|
|
||||||
|
def __call__(self, *arg):
|
||||||
|
return self.func(self.obj, *arg)
|
||||||
|
|
||||||
|
def __init__(self, mfunc):
|
||||||
|
self.argCount=mfunc.im_func.func_code.co_argcount
|
||||||
|
|
||||||
|
if self.argCount>1:
|
||||||
|
self.call=CallBackFunction.__arg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func)
|
||||||
|
else:
|
||||||
|
self.call=CallBackFunction.__noarg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func)
|
||||||
|
|
||||||
|
def __call__(self, *arg):
|
||||||
|
return self.call(*arg)
|
||||||
|
|
||||||
|
def GetArgumentCount(self):
|
||||||
|
return self.argCount
|
||||||
|
|
||||||
|
class Analyzer:
|
||||||
|
def __init__(self):
|
||||||
|
self.cmdDict={}
|
||||||
|
|
||||||
|
def SAFE_RegisterCallBack(self, cmd, callBackFunc):
|
||||||
|
self.cmdDict[cmd]=CallBackFunction(callBackFunc)
|
||||||
|
|
||||||
|
def Run(self, line):
|
||||||
|
tokens=line.split()
|
||||||
|
|
||||||
|
if len(tokens)==0:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
cmd=tokens.pop(0)
|
||||||
|
|
||||||
|
try:
|
||||||
|
callBackFunc=self.cmdDict[cmd]
|
||||||
|
except KeyError:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
argCount=callBackFunc.GetArgumentCount()-1
|
||||||
|
|
||||||
|
if len(tokens)<argCount:
|
||||||
|
raise RuntimeError, "Analyzer.Run(line=%s) - cmd=%s, curArgCount[%d]<needArgCount[%d]" % (line, cmd, len(tokens), argCount)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
tokens=tokens[:argCount]
|
||||||
|
callBackFunc(*tokens)
|
||||||
|
return 1
|
||||||
|
|
||||||
+1593
File diff suppressed because it is too large
Load Diff
+1692
File diff suppressed because it is too large
Load Diff
+296
@@ -0,0 +1,296 @@
|
|||||||
|
import sys
|
||||||
|
import app
|
||||||
|
import dbg
|
||||||
|
|
||||||
|
sys.path.append("lib")
|
||||||
|
|
||||||
|
class TraceFile:
|
||||||
|
def write(self, msg):
|
||||||
|
dbg.Trace(msg)
|
||||||
|
|
||||||
|
class TraceErrorFile:
|
||||||
|
def write(self, msg):
|
||||||
|
dbg.TraceError(msg)
|
||||||
|
dbg.RegisterExceptionString(msg)
|
||||||
|
|
||||||
|
class LogBoxFile:
|
||||||
|
def __init__(self):
|
||||||
|
self.stderrSave = sys.stderr
|
||||||
|
self.msg = ""
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.restore()
|
||||||
|
|
||||||
|
def restore(self):
|
||||||
|
sys.stderr = self.stderrSave
|
||||||
|
|
||||||
|
def write(self, msg):
|
||||||
|
self.msg = self.msg + msg
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
dbg.LogBox(self.msg,"Error")
|
||||||
|
|
||||||
|
sys.stdout = TraceFile()
|
||||||
|
sys.stderr = TraceErrorFile()
|
||||||
|
|
||||||
|
#
|
||||||
|
# pack file support (must move to system.py, systemrelease.pyc)
|
||||||
|
#
|
||||||
|
|
||||||
|
import marshal
|
||||||
|
import imp
|
||||||
|
import pack
|
||||||
|
|
||||||
|
class pack_file_iterator(object):
|
||||||
|
def __init__(self, packfile):
|
||||||
|
self.pack_file = packfile
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
tmp = self.pack_file.readline()
|
||||||
|
if tmp:
|
||||||
|
return tmp
|
||||||
|
raise StopIteration
|
||||||
|
|
||||||
|
_chr = __builtins__.chr
|
||||||
|
|
||||||
|
class pack_file(object):
|
||||||
|
|
||||||
|
def __init__(self, filename, mode = 'rb'):
|
||||||
|
assert mode in ('r', 'rb')
|
||||||
|
if not pack.Exist(filename):
|
||||||
|
raise IOError, 'No file or directory'
|
||||||
|
self.data = pack.Get(filename)
|
||||||
|
if mode == 'r':
|
||||||
|
self.data=_chr(10).join(self.data.split(_chr(13)+_chr(10)))
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return pack_file_iterator(self)
|
||||||
|
|
||||||
|
def read(self, len = None):
|
||||||
|
if not self.data:
|
||||||
|
return ''
|
||||||
|
if len:
|
||||||
|
tmp = self.data[:len]
|
||||||
|
self.data = self.data[len:]
|
||||||
|
return tmp
|
||||||
|
else:
|
||||||
|
tmp = self.data
|
||||||
|
self.data = ''
|
||||||
|
return tmp
|
||||||
|
|
||||||
|
def readline(self):
|
||||||
|
return self.read(self.data.find(_chr(10))+1)
|
||||||
|
|
||||||
|
def readlines(self):
|
||||||
|
return [x for x in self]
|
||||||
|
|
||||||
|
__builtins__.pack_open = pack_open = pack_file
|
||||||
|
|
||||||
|
_ModuleType = type(sys)
|
||||||
|
|
||||||
|
old_import = __import__
|
||||||
|
def _process_result(code, fqname):
|
||||||
|
# did get_code() return an actual module? (rather than a code object)
|
||||||
|
is_module = isinstance(code, _ModuleType)
|
||||||
|
|
||||||
|
# use the returned module, or create a new one to exec code into
|
||||||
|
if is_module:
|
||||||
|
module = code
|
||||||
|
else:
|
||||||
|
module = imp.new_module(fqname)
|
||||||
|
|
||||||
|
# insert additional values into the module (before executing the code)
|
||||||
|
#module.__dict__.update(values)
|
||||||
|
|
||||||
|
# the module is almost ready... make it visible
|
||||||
|
sys.modules[fqname] = module
|
||||||
|
|
||||||
|
# execute the code within the module's namespace
|
||||||
|
if not is_module:
|
||||||
|
exec code in module.__dict__
|
||||||
|
|
||||||
|
# fetch from sys.modules instead of returning module directly.
|
||||||
|
# also make module's __name__ agree with fqname, in case
|
||||||
|
# the "exec code in module.__dict__" played games on us.
|
||||||
|
module = sys.modules[fqname]
|
||||||
|
module.__name__ = fqname
|
||||||
|
return module
|
||||||
|
|
||||||
|
module_do = lambda x:None
|
||||||
|
|
||||||
|
def __pack_import(name,globals=None,locals=None,fromlist=None):
|
||||||
|
if name in sys.modules:
|
||||||
|
return sys.modules[name]
|
||||||
|
|
||||||
|
filename = name + '.py'
|
||||||
|
|
||||||
|
if pack.Exist(filename):
|
||||||
|
dbg.Trace('importing from pack %s\\n' % name)
|
||||||
|
|
||||||
|
newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name)
|
||||||
|
|
||||||
|
module_do(newmodule)
|
||||||
|
return newmodule
|
||||||
|
#return imp.load_module(name, pack_file(filename,'r'),filename,('.py','r',imp.PY_SOURCE))
|
||||||
|
else:
|
||||||
|
dbg.Trace('importing from lib %s\\n' % name)
|
||||||
|
return old_import(name,globals,locals,fromlist)
|
||||||
|
|
||||||
|
def splitext(p):
|
||||||
|
root, ext = '', ''
|
||||||
|
for c in p:
|
||||||
|
if c in ['/']:
|
||||||
|
root, ext = root + ext + c, ''
|
||||||
|
elif c == '.':
|
||||||
|
if ext:
|
||||||
|
root, ext = root + ext, c
|
||||||
|
else:
|
||||||
|
ext = c
|
||||||
|
elif ext:
|
||||||
|
ext = ext + c
|
||||||
|
else:
|
||||||
|
root = root + c
|
||||||
|
return root, ext
|
||||||
|
|
||||||
|
class PythonExecutioner:
|
||||||
|
|
||||||
|
def Run(kPESelf, sFileName, kDict):
|
||||||
|
if kPESelf.__IsCompiledFile__(sFileName):
|
||||||
|
kCode=kPESelf.__LoadCompiledFile__(sFileName)
|
||||||
|
else:
|
||||||
|
kCode=kPESelf.__LoadTextFile__(sFileName)
|
||||||
|
|
||||||
|
exec(kCode, kDict)
|
||||||
|
|
||||||
|
def __IsCompiledFile__(kPESelf, sFileName):
|
||||||
|
|
||||||
|
sBase, sExt = splitext(sFileName)
|
||||||
|
sExt=sExt.lower()
|
||||||
|
|
||||||
|
if sExt==".pyc" or sExt==".pyo":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def __LoadTextFile__(kPESelf, sFileName):
|
||||||
|
sText=pack_open(sFileName,'r').read()
|
||||||
|
return compile(sText, sFileName, "exec")
|
||||||
|
|
||||||
|
def __LoadCompiledFile__(kPESelf, sFileName):
|
||||||
|
kFile=pack_open(sFileName)
|
||||||
|
|
||||||
|
if kFile.read(4)!=imp.get_magic():
|
||||||
|
raise
|
||||||
|
|
||||||
|
kFile.read(4)
|
||||||
|
|
||||||
|
kData=kFile.read()
|
||||||
|
return marshal.loads(kData)
|
||||||
|
|
||||||
|
def execfile(fileName, dict):
|
||||||
|
kPE=PythonExecutioner()
|
||||||
|
kPE.Run(fileName, dict)
|
||||||
|
|
||||||
|
def exec_add_module_do(mod):
|
||||||
|
global execfile
|
||||||
|
mod.__dict__['execfile'] = execfile
|
||||||
|
|
||||||
|
import __builtin__
|
||||||
|
__builtin__.__import__ = __pack_import
|
||||||
|
module_do = exec_add_module_do
|
||||||
|
|
||||||
|
"""
|
||||||
|
#
|
||||||
|
# PSYCO installation (must move to system.py, systemrelease.pyc)
|
||||||
|
#
|
||||||
|
try:
|
||||||
|
import psyco
|
||||||
|
#from psyco.classes import *
|
||||||
|
|
||||||
|
def bind_me(bindable_list):
|
||||||
|
try:
|
||||||
|
for x in bindable_list:
|
||||||
|
try:
|
||||||
|
psyco.bind(x)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
_prev_psyco_old_module_do = module_do
|
||||||
|
def module_bind(module):
|
||||||
|
_prev_psyco_old_module_do(module)
|
||||||
|
#print 'start binding' + str(module)
|
||||||
|
try:
|
||||||
|
psyco.bind(module)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
for x in module.__dict__.itervalues():
|
||||||
|
try:
|
||||||
|
psyco.bind(x)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
#print 'end binding'
|
||||||
|
|
||||||
|
dbg.Trace("PSYCO installed\\n")
|
||||||
|
|
||||||
|
except Exception, msg:
|
||||||
|
bind_me = lambda x:None
|
||||||
|
dbg.Trace("No PSYCO support : %s\\n" % msg)
|
||||||
|
"""
|
||||||
|
|
||||||
|
def GetExceptionString(excTitle):
|
||||||
|
(excType, excMsg, excTraceBack)=sys.exc_info()
|
||||||
|
excText=""
|
||||||
|
excText+=_chr(10)
|
||||||
|
|
||||||
|
import traceback
|
||||||
|
traceLineList=traceback.extract_tb(excTraceBack)
|
||||||
|
|
||||||
|
for traceLine in traceLineList:
|
||||||
|
if traceLine[3]:
|
||||||
|
excText+="%s(line:%d) %s - %s" % (traceLine[0], traceLine[1], traceLine[2], traceLine[3])
|
||||||
|
else:
|
||||||
|
excText+="%s(line:%d) %s" % (traceLine[0], traceLine[1], traceLine[2])
|
||||||
|
|
||||||
|
excText+=_chr(10)
|
||||||
|
|
||||||
|
excText+=_chr(10)
|
||||||
|
excText+="%s - %s:%s" % (excTitle, excType, excMsg)
|
||||||
|
excText+=_chr(10)
|
||||||
|
|
||||||
|
return excText
|
||||||
|
|
||||||
|
def ShowException(excTitle):
|
||||||
|
excText=GetExceptionString(excTitle)
|
||||||
|
dbg.TraceError(excText)
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def RunMainScript(name):
|
||||||
|
try:
|
||||||
|
execfile(name, __main__.__dict__)
|
||||||
|
except RuntimeError, msg:
|
||||||
|
msg = str(msg)
|
||||||
|
|
||||||
|
import locale
|
||||||
|
if locale.error:
|
||||||
|
msg = locale.error.get(msg, msg)
|
||||||
|
|
||||||
|
dbg.LogBox(msg)
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
except:
|
||||||
|
msg = GetExceptionString("Run")
|
||||||
|
dbg.LogBox(msg)
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
import debugInfo
|
||||||
|
debugInfo.SetDebugMode(__DEBUG__)
|
||||||
|
|
||||||
|
loginMark = "-cs"
|
||||||
|
|
||||||
|
app.__COMMAND_LINE__ = __COMMAND_LINE__
|
||||||
|
RunMainScript("prototype.py")
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
from interfaceModule import *
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
import chr
|
||||||
|
import uiAffectShower
|
||||||
|
|
||||||
|
class TestGame(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
self.affectShower = uiAffectShower.AffectShower()
|
||||||
|
self.affectShower.BINARY_NEW_AddAffect(chr.NEW_AFFECT_EXP_BONUS_EURO_FREE, 0, 100, 1000)
|
||||||
|
|
||||||
|
self.interface = Interface()
|
||||||
|
self.interface.MakeInterface()
|
||||||
|
self.interface.ShowDefaultWindows()
|
||||||
|
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def OnKeyUp(self, key):
|
||||||
|
print key
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
app.UpdateGame()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
app.RenderGame()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
game = TestGame()
|
||||||
|
game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
game.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
+3624
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,713 @@
|
|||||||
|
import ui
|
||||||
|
import localeInfo
|
||||||
|
import chr
|
||||||
|
import item
|
||||||
|
import app
|
||||||
|
import skill
|
||||||
|
import player
|
||||||
|
import uiToolTip
|
||||||
|
import math
|
||||||
|
|
||||||
|
# WEDDING
|
||||||
|
class LovePointImage(ui.ExpandedImageBox):
|
||||||
|
|
||||||
|
FILE_PATH = "d:/ymir work/ui/pattern/LovePoint/"
|
||||||
|
FILE_DICT = {
|
||||||
|
0 : FILE_PATH + "01.dds",
|
||||||
|
1 : FILE_PATH + "02.dds",
|
||||||
|
2 : FILE_PATH + "02.dds",
|
||||||
|
3 : FILE_PATH + "03.dds",
|
||||||
|
4 : FILE_PATH + "04.dds",
|
||||||
|
5 : FILE_PATH + "05.dds",
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ExpandedImageBox.__init__(self)
|
||||||
|
|
||||||
|
self.loverName = ""
|
||||||
|
self.lovePoint = 0
|
||||||
|
|
||||||
|
self.toolTip = uiToolTip.ToolTip(100)
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ExpandedImageBox.__del__(self)
|
||||||
|
|
||||||
|
def SetLoverInfo(self, name, lovePoint):
|
||||||
|
self.loverName = name
|
||||||
|
self.lovePoint = lovePoint
|
||||||
|
self.__Refresh()
|
||||||
|
|
||||||
|
def OnUpdateLovePoint(self, lovePoint):
|
||||||
|
self.lovePoint = lovePoint
|
||||||
|
self.__Refresh()
|
||||||
|
|
||||||
|
def __Refresh(self):
|
||||||
|
self.lovePoint = max(0, self.lovePoint)
|
||||||
|
self.lovePoint = min(100, self.lovePoint)
|
||||||
|
|
||||||
|
if 0 == self.lovePoint:
|
||||||
|
loveGrade = 0
|
||||||
|
else:
|
||||||
|
loveGrade = self.lovePoint / 25 + 1
|
||||||
|
fileName = self.FILE_DICT.get(loveGrade, self.FILE_PATH+"00.dds")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.LoadImage(fileName)
|
||||||
|
except:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("LovePointImage.SetLoverInfo(lovePoint=%d) - LoadError %s" % (self.lovePoint, fileName))
|
||||||
|
|
||||||
|
self.SetScale(0.7, 0.7)
|
||||||
|
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
self.toolTip.SetTitle(self.loverName)
|
||||||
|
self.toolTip.AppendTextLine(localeInfo.AFF_LOVE_POINT % (self.lovePoint))
|
||||||
|
self.toolTip.ResizeToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
self.toolTip.ShowToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
# END_OF_WEDDING
|
||||||
|
|
||||||
|
|
||||||
|
class HorseImage(ui.ExpandedImageBox):
|
||||||
|
|
||||||
|
FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
|
||||||
|
|
||||||
|
FILE_DICT = {
|
||||||
|
00 : FILE_PATH+"00.dds",
|
||||||
|
01 : FILE_PATH+"00.dds",
|
||||||
|
02 : FILE_PATH+"00.dds",
|
||||||
|
03 : FILE_PATH+"00.dds",
|
||||||
|
10 : FILE_PATH+"10.dds",
|
||||||
|
11 : FILE_PATH+"11.dds",
|
||||||
|
12 : FILE_PATH+"12.dds",
|
||||||
|
13 : FILE_PATH+"13.dds",
|
||||||
|
20 : FILE_PATH+"20.dds",
|
||||||
|
21 : FILE_PATH+"21.dds",
|
||||||
|
22 : FILE_PATH+"22.dds",
|
||||||
|
23 : FILE_PATH+"23.dds",
|
||||||
|
30 : FILE_PATH+"30.dds",
|
||||||
|
31 : FILE_PATH+"31.dds",
|
||||||
|
32 : FILE_PATH+"32.dds",
|
||||||
|
33 : FILE_PATH+"33.dds",
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ExpandedImageBox.__init__(self)
|
||||||
|
|
||||||
|
#self.textLineList = []
|
||||||
|
self.toolTip = uiToolTip.ToolTip(100)
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
|
||||||
|
def __GetHorseGrade(self, level):
|
||||||
|
if 0 == level:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return (level-1)/10 + 1
|
||||||
|
|
||||||
|
def SetState(self, level, health, battery):
|
||||||
|
#self.textLineList=[]
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
|
||||||
|
if level>0:
|
||||||
|
|
||||||
|
try:
|
||||||
|
grade = self.__GetHorseGrade(level)
|
||||||
|
self.__AppendText(localeInfo.LEVEL_LIST[grade])
|
||||||
|
except IndexError:
|
||||||
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
healthName=localeInfo.HEALTH_LIST[health]
|
||||||
|
if len(healthName)>0:
|
||||||
|
self.__AppendText(healthName)
|
||||||
|
except IndexError:
|
||||||
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
|
||||||
|
return
|
||||||
|
|
||||||
|
if health>0:
|
||||||
|
if battery==0:
|
||||||
|
self.__AppendText(localeInfo.NEEFD_REST)
|
||||||
|
|
||||||
|
try:
|
||||||
|
fileName=self.FILE_DICT[health*10+battery]
|
||||||
|
except KeyError:
|
||||||
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.LoadImage(fileName)
|
||||||
|
except:
|
||||||
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - LoadError %s" % (level, health, battery, fileName)
|
||||||
|
|
||||||
|
self.SetScale(0.7, 0.7)
|
||||||
|
|
||||||
|
def __AppendText(self, text):
|
||||||
|
|
||||||
|
self.toolTip.AppendTextLine(text)
|
||||||
|
self.toolTip.ResizeToolTip()
|
||||||
|
|
||||||
|
#x=self.GetWidth()/2
|
||||||
|
#textLine = ui.TextLine()
|
||||||
|
#textLine.SetParent(self)
|
||||||
|
#textLine.SetSize(0, 0)
|
||||||
|
#textLine.SetOutline()
|
||||||
|
#textLine.Hide()
|
||||||
|
#textLine.SetPosition(x, 40+len(self.textLineList)*16)
|
||||||
|
#textLine.SetText(text)
|
||||||
|
#self.textLineList.append(textLine)
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
#for textLine in self.textLineList:
|
||||||
|
# textLine.Show()
|
||||||
|
|
||||||
|
self.toolTip.ShowToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
#for textLine in self.textLineList:
|
||||||
|
# textLine.Hide()
|
||||||
|
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
|
||||||
|
|
||||||
|
# AUTO_POTION
|
||||||
|
class AutoPotionImage(ui.ExpandedImageBox):
|
||||||
|
|
||||||
|
FILE_PATH_HP = "d:/ymir work/ui/pattern/auto_hpgauge/"
|
||||||
|
FILE_PATH_SP = "d:/ymir work/ui/pattern/auto_spgauge/"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ExpandedImageBox.__init__(self)
|
||||||
|
|
||||||
|
self.loverName = ""
|
||||||
|
self.lovePoint = 0
|
||||||
|
self.potionType = player.AUTO_POTION_TYPE_HP
|
||||||
|
self.filePath = ""
|
||||||
|
|
||||||
|
self.toolTip = uiToolTip.ToolTip(100)
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ExpandedImageBox.__del__(self)
|
||||||
|
|
||||||
|
def SetPotionType(self, type):
|
||||||
|
self.potionType = type
|
||||||
|
|
||||||
|
if player.AUTO_POTION_TYPE_HP == type:
|
||||||
|
self.filePath = self.FILE_PATH_HP
|
||||||
|
elif player.AUTO_POTION_TYPE_SP == type:
|
||||||
|
self.filePath = self.FILE_PATH_SP
|
||||||
|
|
||||||
|
|
||||||
|
def OnUpdateAutoPotionImage(self):
|
||||||
|
self.__Refresh()
|
||||||
|
|
||||||
|
def __Refresh(self):
|
||||||
|
print "__Refresh"
|
||||||
|
|
||||||
|
isActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(self.potionType)
|
||||||
|
|
||||||
|
amountPercent = (float(currentAmount) / totalAmount) * 100.0
|
||||||
|
grade = math.ceil(amountPercent / 20)
|
||||||
|
|
||||||
|
if 5.0 > amountPercent:
|
||||||
|
grade = 0
|
||||||
|
|
||||||
|
if 80.0 < amountPercent:
|
||||||
|
grade = 4
|
||||||
|
if 90.0 < amountPercent:
|
||||||
|
grade = 5
|
||||||
|
|
||||||
|
fmt = self.filePath + "%.2d.dds"
|
||||||
|
fileName = fmt % grade
|
||||||
|
|
||||||
|
print self.potionType, amountPercent, fileName
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.LoadImage(fileName)
|
||||||
|
except:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("AutoPotionImage.__Refresh(potionType=%d) - LoadError %s" % (self.potionType, fileName))
|
||||||
|
|
||||||
|
self.SetScale(0.7, 0.7)
|
||||||
|
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
|
||||||
|
if player.AUTO_POTION_TYPE_HP == type:
|
||||||
|
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_HP)
|
||||||
|
else:
|
||||||
|
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_SP)
|
||||||
|
|
||||||
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (amountPercent))
|
||||||
|
self.toolTip.ResizeToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
self.toolTip.ShowToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
self.toolTip.HideToolTip()
|
||||||
|
# END_OF_AUTO_POTION
|
||||||
|
|
||||||
|
|
||||||
|
class AffectImage(ui.ExpandedImageBox):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ExpandedImageBox.__init__(self)
|
||||||
|
|
||||||
|
self.toolTipText = None
|
||||||
|
self.isSkillAffect = TRUE
|
||||||
|
self.description = None
|
||||||
|
self.endTime = 0
|
||||||
|
self.affect = None
|
||||||
|
self.isClocked = TRUE
|
||||||
|
|
||||||
|
def SetAffect(self, affect):
|
||||||
|
self.affect = affect
|
||||||
|
|
||||||
|
def GetAffect(self):
|
||||||
|
return self.affect
|
||||||
|
|
||||||
|
def SetToolTipText(self, text, x = 0, y = -19):
|
||||||
|
|
||||||
|
if not self.toolTipText:
|
||||||
|
textLine = ui.TextLine()
|
||||||
|
textLine.SetParent(self)
|
||||||
|
textLine.SetSize(0, 0)
|
||||||
|
textLine.SetOutline()
|
||||||
|
textLine.Hide()
|
||||||
|
self.toolTipText = textLine
|
||||||
|
|
||||||
|
self.toolTipText.SetText(text)
|
||||||
|
w, h = self.toolTipText.GetTextSize()
|
||||||
|
self.toolTipText.SetPosition(max(0, x + self.GetWidth()/2 - w/2), y)
|
||||||
|
|
||||||
|
def SetDescription(self, description):
|
||||||
|
self.description = description
|
||||||
|
|
||||||
|
def SetDuration(self, duration):
|
||||||
|
self.endTime = 0
|
||||||
|
if duration > 0:
|
||||||
|
self.endTime = app.GetGlobalTimeStamp() + duration
|
||||||
|
|
||||||
|
def UpdateAutoPotionDescription(self):
|
||||||
|
|
||||||
|
potionType = 0
|
||||||
|
if self.affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
||||||
|
potionType = player.AUTO_POTION_TYPE_HP
|
||||||
|
else:
|
||||||
|
potionType = player.AUTO_POTION_TYPE_SP
|
||||||
|
|
||||||
|
isActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(potionType)
|
||||||
|
|
||||||
|
#print "UpdateAutoPotionDescription ", isActivated, currentAmount, totalAmount, slotIndex
|
||||||
|
|
||||||
|
amountPercent = 0.0
|
||||||
|
|
||||||
|
try:
|
||||||
|
amountPercent = (float(currentAmount) / totalAmount) * 100.0
|
||||||
|
except:
|
||||||
|
amountPercent = 100.0
|
||||||
|
|
||||||
|
self.SetToolTipText(self.description % amountPercent, 0, 40)
|
||||||
|
|
||||||
|
def SetClock(self, isClocked):
|
||||||
|
self.isClocked = isClocked
|
||||||
|
|
||||||
|
def UpdateDescription(self):
|
||||||
|
if not self.isClocked:
|
||||||
|
self.__UpdateDescription2()
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.description:
|
||||||
|
return
|
||||||
|
|
||||||
|
toolTip = self.description
|
||||||
|
if self.endTime > 0:
|
||||||
|
leftTime = localeInfo.SecondToDHM(self.endTime - app.GetGlobalTimeStamp())
|
||||||
|
toolTip += " (%s : %s)" % (localeInfo.LEFT_TIME, leftTime)
|
||||||
|
self.SetToolTipText(toolTip, 0, 40)
|
||||||
|
|
||||||
|
#독일버전에서 시간을 제거하기 위해서 사용
|
||||||
|
def __UpdateDescription2(self):
|
||||||
|
if not self.description:
|
||||||
|
return
|
||||||
|
|
||||||
|
toolTip = self.description
|
||||||
|
self.SetToolTipText(toolTip, 0, 40)
|
||||||
|
|
||||||
|
def SetSkillAffectFlag(self, flag):
|
||||||
|
self.isSkillAffect = flag
|
||||||
|
|
||||||
|
def IsSkillAffect(self):
|
||||||
|
return self.isSkillAffect
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
if self.toolTipText:
|
||||||
|
self.toolTipText.Show()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
if self.toolTipText:
|
||||||
|
self.toolTipText.Hide()
|
||||||
|
|
||||||
|
class AffectShower(ui.Window):
|
||||||
|
|
||||||
|
MALL_DESC_IDX_START = 1000
|
||||||
|
IMAGE_STEP = 25
|
||||||
|
AFFECT_MAX_NUM = 32
|
||||||
|
|
||||||
|
INFINITE_AFFECT_DURATION = 0x1FFFFFFF
|
||||||
|
|
||||||
|
AFFECT_DATA_DICT = {
|
||||||
|
chr.AFFECT_POISON : (localeInfo.SKILL_TOXICDIE, "d:/ymir work/ui/skill/common/affect/poison.sub"),
|
||||||
|
chr.AFFECT_SLOW : (localeInfo.SKILL_SLOW, "d:/ymir work/ui/skill/common/affect/slow.sub"),
|
||||||
|
chr.AFFECT_STUN : (localeInfo.SKILL_STUN, "d:/ymir work/ui/skill/common/affect/stun.sub"),
|
||||||
|
|
||||||
|
chr.AFFECT_ATT_SPEED_POTION : (localeInfo.SKILL_INC_ATKSPD, "d:/ymir work/ui/skill/common/affect/Increase_Attack_Speed.sub"),
|
||||||
|
chr.AFFECT_MOV_SPEED_POTION : (localeInfo.SKILL_INC_MOVSPD, "d:/ymir work/ui/skill/common/affect/Increase_Move_Speed.sub"),
|
||||||
|
chr.AFFECT_FISH_MIND : (localeInfo.SKILL_FISHMIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub"),
|
||||||
|
|
||||||
|
chr.AFFECT_JEONGWI : (localeInfo.SKILL_JEONGWI, "d:/ymir work/ui/skill/warrior/jeongwi_03.sub",),
|
||||||
|
chr.AFFECT_GEOMGYEONG : (localeInfo.SKILL_GEOMGYEONG, "d:/ymir work/ui/skill/warrior/geomgyeong_03.sub",),
|
||||||
|
chr.AFFECT_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
|
||||||
|
chr.AFFECT_GYEONGGONG : (localeInfo.SKILL_GYEONGGONG, "d:/ymir work/ui/skill/assassin/gyeonggong_03.sub",),
|
||||||
|
chr.AFFECT_EUNHYEONG : (localeInfo.SKILL_EUNHYEONG, "d:/ymir work/ui/skill/assassin/eunhyeong_03.sub",),
|
||||||
|
chr.AFFECT_GWIGEOM : (localeInfo.SKILL_GWIGEOM, "d:/ymir work/ui/skill/sura/gwigeom_03.sub",),
|
||||||
|
chr.AFFECT_GONGPO : (localeInfo.SKILL_GONGPO, "d:/ymir work/ui/skill/sura/gongpo_03.sub",),
|
||||||
|
chr.AFFECT_JUMAGAP : (localeInfo.SKILL_JUMAGAP, "d:/ymir work/ui/skill/sura/jumagap_03.sub"),
|
||||||
|
chr.AFFECT_HOSIN : (localeInfo.SKILL_HOSIN, "d:/ymir work/ui/skill/shaman/hosin_03.sub",),
|
||||||
|
chr.AFFECT_BOHO : (localeInfo.SKILL_BOHO, "d:/ymir work/ui/skill/shaman/boho_03.sub",),
|
||||||
|
chr.AFFECT_KWAESOK : (localeInfo.SKILL_KWAESOK, "d:/ymir work/ui/skill/shaman/kwaesok_03.sub",),
|
||||||
|
chr.AFFECT_HEUKSIN : (localeInfo.SKILL_HEUKSIN, "d:/ymir work/ui/skill/sura/heuksin_03.sub",),
|
||||||
|
chr.AFFECT_MUYEONG : (localeInfo.SKILL_MUYEONG, "d:/ymir work/ui/skill/sura/muyeong_03.sub",),
|
||||||
|
chr.AFFECT_GICHEON : (localeInfo.SKILL_GICHEON, "d:/ymir work/ui/skill/shaman/gicheon_03.sub",),
|
||||||
|
chr.AFFECT_JEUNGRYEOK : (localeInfo.SKILL_JEUNGRYEOK, "d:/ymir work/ui/skill/shaman/jeungryeok_03.sub",),
|
||||||
|
chr.AFFECT_PABEOP : (localeInfo.SKILL_PABEOP, "d:/ymir work/ui/skill/sura/pabeop_03.sub",),
|
||||||
|
chr.AFFECT_FALLEN_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
|
||||||
|
28 : (localeInfo.SKILL_FIRE, "d:/ymir work/ui/skill/sura/hwayeom_03.sub",),
|
||||||
|
chr.AFFECT_CHINA_FIREWORK : (localeInfo.SKILL_POWERFUL_STRIKE, "d:/ymir work/ui/skill/common/affect/powerfulstrike.sub",),
|
||||||
|
|
||||||
|
#64 - END
|
||||||
|
chr.NEW_AFFECT_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),
|
||||||
|
|
||||||
|
chr.NEW_AFFECT_ITEM_BONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
|
||||||
|
chr.NEW_AFFECT_SAFEBOX : (localeInfo.TOOLTIP_MALL_SAFEBOX, "d:/ymir work/ui/skill/common/affect/safebox.sub",),
|
||||||
|
chr.NEW_AFFECT_AUTOLOOT : (localeInfo.TOOLTIP_MALL_AUTOLOOT, "d:/ymir work/ui/skill/common/affect/autoloot.sub",),
|
||||||
|
chr.NEW_AFFECT_FISH_MIND : (localeInfo.TOOLTIP_MALL_FISH_MIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub",),
|
||||||
|
chr.NEW_AFFECT_MARRIAGE_FAST : (localeInfo.TOOLTIP_MALL_MARRIAGE_FAST, "d:/ymir work/ui/skill/common/affect/marriage_fast.sub",),
|
||||||
|
chr.NEW_AFFECT_GOLD_BONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),
|
||||||
|
|
||||||
|
chr.NEW_AFFECT_NO_DEATH_PENALTY : (localeInfo.TOOLTIP_APPLY_NO_DEATH_PENALTY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
chr.NEW_AFFECT_SKILL_BOOK_BONUS : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_BONUS, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_NO_DELAY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
|
||||||
|
# 자동물약 hp, sp
|
||||||
|
chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/pattern/auto_hpgauge/05.dds"),
|
||||||
|
chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/pattern/auto_spgauge/05.dds"),
|
||||||
|
#chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
#chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub"),
|
||||||
|
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MALL_ATTBONUS : (localeInfo.TOOLTIP_MALL_ATTBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/att_bonus.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MALL_DEFBONUS : (localeInfo.TOOLTIP_MALL_DEFBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/def_bonus.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MALL_EXPBONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MALL_ITEMBONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MALL_GOLDBONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_CRITICAL_PCT : (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,"d:/ymir work/ui/skill/common/affect/critical.sub"),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_PENETRATE_PCT : (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MAX_HP_PCT : (localeInfo.TOOLTIP_MAX_HP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_MAX_SP_PCT : (localeInfo.TOOLTIP_MAX_SP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
||||||
|
|
||||||
|
MALL_DESC_IDX_START+player.POINT_PC_BANG_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/EXP_Bonus_p_on.sub",),
|
||||||
|
MALL_DESC_IDX_START+player.POINT_PC_BANG_DROP_BONUS: (localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/Item_Bonus_p_on.sub",),
|
||||||
|
}
|
||||||
|
if app.ENABLE_DRAGON_SOUL_SYSTEM:
|
||||||
|
# 용혼석 천, 지 덱.
|
||||||
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK1] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK1, "d:/ymir work/ui/dragonsoul/buff_ds_sky1.tga")
|
||||||
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK2] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga")
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
self.serverPlayTime=0
|
||||||
|
self.clientPlayTime=0
|
||||||
|
|
||||||
|
self.lastUpdateTime=0
|
||||||
|
self.affectImageDict={}
|
||||||
|
self.horseImage=None
|
||||||
|
self.lovePointImage=None
|
||||||
|
self.autoPotionImageHP = AutoPotionImage()
|
||||||
|
self.autoPotionImageSP = AutoPotionImage()
|
||||||
|
self.SetPosition(10, 10)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def ClearAllAffects(self):
|
||||||
|
self.horseImage=None
|
||||||
|
self.lovePointImage=None
|
||||||
|
self.affectImageDict={}
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def ClearAffects(self): ## 스킬 이펙트만 없앱니다.
|
||||||
|
self.living_affectImageDict={}
|
||||||
|
for key, image in self.affectImageDict.items():
|
||||||
|
if not image.IsSkillAffect():
|
||||||
|
self.living_affectImageDict[key] = image
|
||||||
|
self.affectImageDict = self.living_affectImageDict
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
|
||||||
|
|
||||||
|
print "BINARY_NEW_AddAffect", type, pointIdx, value, duration
|
||||||
|
|
||||||
|
if type < 500:
|
||||||
|
return
|
||||||
|
|
||||||
|
if type == chr.NEW_AFFECT_MALL:
|
||||||
|
affect = self.MALL_DESC_IDX_START + pointIdx
|
||||||
|
else:
|
||||||
|
affect = type
|
||||||
|
|
||||||
|
if self.affectImageDict.has_key(affect):
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.AFFECT_DATA_DICT.has_key(affect):
|
||||||
|
return
|
||||||
|
|
||||||
|
## 용신의 가호, 선인의 교훈은 Duration 을 0 으로 설정한다.
|
||||||
|
if affect == chr.NEW_AFFECT_NO_DEATH_PENALTY or\
|
||||||
|
affect == chr.NEW_AFFECT_SKILL_BOOK_BONUS or\
|
||||||
|
affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or\
|
||||||
|
affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY or\
|
||||||
|
affect == chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY:
|
||||||
|
duration = 0
|
||||||
|
|
||||||
|
affectData = self.AFFECT_DATA_DICT[affect]
|
||||||
|
description = affectData[0]
|
||||||
|
filename = affectData[1]
|
||||||
|
|
||||||
|
if pointIdx == player.POINT_MALL_ITEMBONUS or\
|
||||||
|
pointIdx == player.POINT_MALL_GOLDBONUS:
|
||||||
|
value = 1 + float(value) / 100.0
|
||||||
|
|
||||||
|
trashValue = 123
|
||||||
|
#if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
||||||
|
if trashValue == 1:
|
||||||
|
try:
|
||||||
|
#image = AutoPotionImage()
|
||||||
|
#image.SetParent(self)
|
||||||
|
image = None
|
||||||
|
|
||||||
|
if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
||||||
|
image.SetPotionType(player.AUTO_POTION_TYPE_SP)
|
||||||
|
image = self.autoPotionImageSP
|
||||||
|
#self.autoPotionImageSP = image;
|
||||||
|
else:
|
||||||
|
image.SetPotionType(player.AUTO_POTION_TYPE_HP)
|
||||||
|
image = self.autoPotionImageHP
|
||||||
|
#self.autoPotionImageHP = image;
|
||||||
|
|
||||||
|
image.SetParent(self)
|
||||||
|
image.Show()
|
||||||
|
image.OnUpdateAutoPotionImage()
|
||||||
|
|
||||||
|
self.affectImageDict[affect] = image
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
except Exception, e:
|
||||||
|
print "except Aff auto potion affect ", e
|
||||||
|
pass
|
||||||
|
|
||||||
|
else:
|
||||||
|
if affect != chr.NEW_AFFECT_AUTO_SP_RECOVERY and affect != chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
||||||
|
description = description(float(value))
|
||||||
|
|
||||||
|
try:
|
||||||
|
print "Add affect %s" % affect
|
||||||
|
image = AffectImage()
|
||||||
|
image.SetParent(self)
|
||||||
|
image.LoadImage(filename)
|
||||||
|
image.SetDescription(description)
|
||||||
|
image.SetDuration(duration)
|
||||||
|
image.SetAffect(affect)
|
||||||
|
if affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE or\
|
||||||
|
affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE_UNDER_15 or\
|
||||||
|
self.INFINITE_AFFECT_DURATION < duration:
|
||||||
|
image.SetClock(FALSE)
|
||||||
|
image.UpdateDescription()
|
||||||
|
elif affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
||||||
|
image.UpdateAutoPotionDescription()
|
||||||
|
else:
|
||||||
|
image.UpdateDescription()
|
||||||
|
|
||||||
|
if affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK1 or affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK2:
|
||||||
|
image.SetScale(1, 1)
|
||||||
|
else:
|
||||||
|
image.SetScale(0.7, 0.7)
|
||||||
|
image.SetSkillAffectFlag(FALSE)
|
||||||
|
image.Show()
|
||||||
|
self.affectImageDict[affect] = image
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
except Exception, e:
|
||||||
|
print "except Aff affect ", e
|
||||||
|
pass
|
||||||
|
|
||||||
|
def BINARY_NEW_RemoveAffect(self, type, pointIdx):
|
||||||
|
if type == chr.NEW_AFFECT_MALL:
|
||||||
|
affect = self.MALL_DESC_IDX_START + pointIdx
|
||||||
|
else:
|
||||||
|
affect = type
|
||||||
|
|
||||||
|
print "Remove Affect %s %s" % ( type , pointIdx )
|
||||||
|
self.__RemoveAffect(affect)
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def SetAffect(self, affect):
|
||||||
|
self.__AppendAffect(affect)
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def ResetAffect(self, affect):
|
||||||
|
self.__RemoveAffect(affect)
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def SetLoverInfo(self, name, lovePoint):
|
||||||
|
image = LovePointImage()
|
||||||
|
image.SetParent(self)
|
||||||
|
image.SetLoverInfo(name, lovePoint)
|
||||||
|
self.lovePointImage = image
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def ShowLoverState(self):
|
||||||
|
if self.lovePointImage:
|
||||||
|
self.lovePointImage.Show()
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def HideLoverState(self):
|
||||||
|
if self.lovePointImage:
|
||||||
|
self.lovePointImage.Hide()
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def ClearLoverState(self):
|
||||||
|
self.lovePointImage = None
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def OnUpdateLovePoint(self, lovePoint):
|
||||||
|
if self.lovePointImage:
|
||||||
|
self.lovePointImage.OnUpdateLovePoint(lovePoint)
|
||||||
|
|
||||||
|
def SetHorseState(self, level, health, battery):
|
||||||
|
if level==0:
|
||||||
|
self.horseImage=None
|
||||||
|
else:
|
||||||
|
image = HorseImage()
|
||||||
|
image.SetParent(self)
|
||||||
|
image.SetState(level, health, battery)
|
||||||
|
image.Show()
|
||||||
|
|
||||||
|
self.horseImage=image
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def SetPlayTime(self, playTime):
|
||||||
|
self.serverPlayTime = playTime
|
||||||
|
self.clientPlayTime = app.GetTime()
|
||||||
|
|
||||||
|
if localeInfo.IsVIETNAM():
|
||||||
|
image = PlayTimeImage()
|
||||||
|
image.SetParent(self)
|
||||||
|
image.SetPlayTime(playTime)
|
||||||
|
image.Show()
|
||||||
|
|
||||||
|
self.playTimeImage=image
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def __AppendAffect(self, affect):
|
||||||
|
|
||||||
|
if self.affectImageDict.has_key(affect):
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
affectData = self.AFFECT_DATA_DICT[affect]
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
|
|
||||||
|
name = affectData[0]
|
||||||
|
filename = affectData[1]
|
||||||
|
|
||||||
|
skillIndex = player.AffectIndexToSkillIndex(affect)
|
||||||
|
if 0 != skillIndex:
|
||||||
|
name = skill.GetSkillName(skillIndex)
|
||||||
|
|
||||||
|
image = AffectImage()
|
||||||
|
image.SetParent(self)
|
||||||
|
image.SetSkillAffectFlag(TRUE)
|
||||||
|
|
||||||
|
try:
|
||||||
|
image.LoadImage(filename)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
image.SetToolTipText(name, 0, 40)
|
||||||
|
image.SetScale(0.7, 0.7)
|
||||||
|
image.Show()
|
||||||
|
self.affectImageDict[affect] = image
|
||||||
|
|
||||||
|
def __RemoveAffect(self, affect):
|
||||||
|
"""
|
||||||
|
if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
||||||
|
self.autoPotionImageSP.Hide()
|
||||||
|
|
||||||
|
if affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
||||||
|
self.autoPotionImageHP.Hide()
|
||||||
|
"""
|
||||||
|
|
||||||
|
if not self.affectImageDict.has_key(affect):
|
||||||
|
print "__RemoveAffect %s ( No Affect )" % affect
|
||||||
|
return
|
||||||
|
|
||||||
|
print "__RemoveAffect %s ( Affect )" % affect
|
||||||
|
del self.affectImageDict[affect]
|
||||||
|
|
||||||
|
self.__ArrangeImageList()
|
||||||
|
|
||||||
|
def __ArrangeImageList(self):
|
||||||
|
|
||||||
|
width = len(self.affectImageDict) * self.IMAGE_STEP
|
||||||
|
if self.lovePointImage:
|
||||||
|
width+=self.IMAGE_STEP
|
||||||
|
if self.horseImage:
|
||||||
|
width+=self.IMAGE_STEP
|
||||||
|
|
||||||
|
self.SetSize(width, 26)
|
||||||
|
|
||||||
|
xPos = 0
|
||||||
|
|
||||||
|
if self.lovePointImage:
|
||||||
|
if self.lovePointImage.IsShow():
|
||||||
|
self.lovePointImage.SetPosition(xPos, 0)
|
||||||
|
xPos += self.IMAGE_STEP
|
||||||
|
|
||||||
|
if self.horseImage:
|
||||||
|
self.horseImage.SetPosition(xPos, 0)
|
||||||
|
xPos += self.IMAGE_STEP
|
||||||
|
|
||||||
|
for image in self.affectImageDict.values():
|
||||||
|
image.SetPosition(xPos, 0)
|
||||||
|
xPos += self.IMAGE_STEP
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
try:
|
||||||
|
if app.GetGlobalTime() - self.lastUpdateTime > 500:
|
||||||
|
#if 0 < app.GetGlobalTime():
|
||||||
|
self.lastUpdateTime = app.GetGlobalTime()
|
||||||
|
|
||||||
|
for image in self.affectImageDict.values():
|
||||||
|
if image.GetAffect() == chr.NEW_AFFECT_AUTO_HP_RECOVERY or image.GetAffect() == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
||||||
|
image.UpdateAutoPotionDescription()
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not image.IsSkillAffect():
|
||||||
|
image.UpdateDescription()
|
||||||
|
except Exception, e:
|
||||||
|
print "AffectShower::OnUpdate error : ", e
|
||||||
|
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
import dbg
|
||||||
|
import player
|
||||||
|
import item
|
||||||
|
import net
|
||||||
|
import snd
|
||||||
|
import ui
|
||||||
|
import uiToolTip
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
class AttachMetinDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadScript()
|
||||||
|
|
||||||
|
self.metinItemPos = 0
|
||||||
|
self.targetItemPos = 0
|
||||||
|
|
||||||
|
def __LoadScript(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/attachstonedialog.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AttachStoneDialog.__LoadScript.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("Board")
|
||||||
|
self.titleBar = self.GetChild("TitleBar")
|
||||||
|
self.metinImage = self.GetChild("MetinImage")
|
||||||
|
self.GetChild("AcceptButton").SetEvent(ui.__mem_func__(self.Accept))
|
||||||
|
self.GetChild("CancelButton").SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AttachStoneDialog.__LoadScript.BindObject")
|
||||||
|
|
||||||
|
oldToolTip = uiToolTip.ItemToolTip()
|
||||||
|
oldToolTip.SetParent(self)
|
||||||
|
oldToolTip.SetPosition(15, 38)
|
||||||
|
oldToolTip.SetFollow(False)
|
||||||
|
oldToolTip.Show()
|
||||||
|
self.oldToolTip = oldToolTip
|
||||||
|
|
||||||
|
newToolTip = uiToolTip.ItemToolTip()
|
||||||
|
newToolTip.SetParent(self)
|
||||||
|
newToolTip.SetPosition(230 + 20, 38)
|
||||||
|
newToolTip.SetFollow(False)
|
||||||
|
newToolTip.Show()
|
||||||
|
self.newToolTip = newToolTip
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.board = 0
|
||||||
|
self.titleBar = 0
|
||||||
|
self.metinImage = 0
|
||||||
|
self.toolTip = 0
|
||||||
|
|
||||||
|
def CanAttachMetin(self, slot, metin):
|
||||||
|
if item.METIN_NORMAL == metin:
|
||||||
|
if player.METIN_SOCKET_TYPE_SILVER == slot or player.METIN_SOCKET_TYPE_GOLD == slot:
|
||||||
|
return True
|
||||||
|
|
||||||
|
elif item.METIN_GOLD == metin:
|
||||||
|
if player.METIN_SOCKET_TYPE_GOLD == slot:
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Open(self, metinItemPos, targetItemPos):
|
||||||
|
self.metinItemPos = metinItemPos
|
||||||
|
self.targetItemPos = targetItemPos
|
||||||
|
|
||||||
|
metinIndex = player.GetItemIndex(metinItemPos)
|
||||||
|
itemIndex = player.GetItemIndex(targetItemPos)
|
||||||
|
self.oldToolTip.ClearToolTip()
|
||||||
|
self.newToolTip.ClearToolTip()
|
||||||
|
|
||||||
|
item.SelectItem(metinIndex)
|
||||||
|
|
||||||
|
## Metin Image
|
||||||
|
try:
|
||||||
|
self.metinImage.LoadImage(item.GetIconImageFileName())
|
||||||
|
except:
|
||||||
|
dbg.TraceError("AttachMetinDialog.Open.LoadImage - Failed to find item data")
|
||||||
|
|
||||||
|
## Old Item ToolTip
|
||||||
|
metinSlot = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
|
||||||
|
self.oldToolTip.AddItemData(itemIndex, metinSlot)
|
||||||
|
|
||||||
|
## New Item ToolTip
|
||||||
|
item.SelectItem(metinIndex)
|
||||||
|
metinSubType = item.GetItemSubType()
|
||||||
|
|
||||||
|
metinSlot = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
slotData = metinSlot[i]
|
||||||
|
if self.CanAttachMetin(slotData, metinSubType):
|
||||||
|
metinSlot[i] = metinIndex
|
||||||
|
break
|
||||||
|
self.newToolTip.AddItemData(itemIndex, metinSlot)
|
||||||
|
|
||||||
|
self.UpdateDialog()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def UpdateDialog(self):
|
||||||
|
newWidth = self.newToolTip.GetWidth() + 230 + 15 + 20
|
||||||
|
newHeight = self.newToolTip.GetHeight() + 98
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.board.SetPosition( newWidth, 0 )
|
||||||
|
|
||||||
|
(x,y) = self.titleBar.GetLocalPosition()
|
||||||
|
self.titleBar.SetPosition( newWidth - 15, y )
|
||||||
|
|
||||||
|
self.board.SetSize(newWidth, newHeight)
|
||||||
|
self.titleBar.SetWidth(newWidth-15)
|
||||||
|
self.SetSize(newWidth, newHeight)
|
||||||
|
|
||||||
|
(x, y) = self.GetLocalPosition()
|
||||||
|
self.SetPosition(x, y)
|
||||||
|
|
||||||
|
def Accept(self):
|
||||||
|
net.SendItemUseToItemPacket(self.metinItemPos, self.targetItemPos)
|
||||||
|
snd.PlaySound("sound/ui/metinstone_insert.wav")
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
import ui
|
||||||
|
class AuctionWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
class PageWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self, parent, filename):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.SetParent(parent)
|
||||||
|
self.filename = filename
|
||||||
|
def GetScriptFileName(self):
|
||||||
|
return self.filename
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
self.SelectPage("UNIQUE_AUCTION")
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/auctionwindow.py")
|
||||||
|
|
||||||
|
self.pageName = {
|
||||||
|
"LIST" : "매매 리스트",
|
||||||
|
"REGISTER" : "매매 등록",
|
||||||
|
"UNIQUE_AUCTION" : "유니크 경매",
|
||||||
|
}
|
||||||
|
self.pageWindow = {
|
||||||
|
"LIST" : self.PageWindow(self, "uiscript/auctionwindow_listpage.py"),
|
||||||
|
"REGISTER" : self.PageWindow(self, "uiscript/auctionwindow_registerpage.py"),
|
||||||
|
"UNIQUE_AUCTION" : self.PageWindow(self, "uiscript/auctionwindow_uniqueauctionpage.py"),
|
||||||
|
}
|
||||||
|
|
||||||
|
self.board = self.GetChild("Board")
|
||||||
|
self.tabDict = {
|
||||||
|
"LIST" : self.GetChild("Tab_01"),
|
||||||
|
"REGISTER" : self.GetChild("Tab_02"),
|
||||||
|
"UNIQUE_AUCTION" : self.GetChild("Tab_03"),
|
||||||
|
}
|
||||||
|
self.tabButtonDict = {
|
||||||
|
"LIST" : self.GetChild("Tab_Button_01"),
|
||||||
|
"REGISTER" : self.GetChild("Tab_Button_02"),
|
||||||
|
"UNIQUE_AUCTION" : self.GetChild("Tab_Button_03"),
|
||||||
|
}
|
||||||
|
for page in self.pageWindow.values():
|
||||||
|
pyScrLoader.LoadScriptFile(page, page.GetScriptFileName())
|
||||||
|
for key, button in self.tabButtonDict.items():
|
||||||
|
button.SetEvent(self.SelectPage, key)
|
||||||
|
|
||||||
|
self.__MakeListPage()
|
||||||
|
self.__MakeRegisterPage()
|
||||||
|
self.__MakeUniqueAuctionPage()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
def __MakeListPage(self):
|
||||||
|
|
||||||
|
page = self.pageWindow["LIST"]
|
||||||
|
|
||||||
|
yPos = 27
|
||||||
|
|
||||||
|
AUCTION_LINE_COUNT = 10
|
||||||
|
|
||||||
|
for i in xrange(AUCTION_LINE_COUNT):
|
||||||
|
|
||||||
|
numberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 11, yPos)
|
||||||
|
numberSlot = ui.MakeTextLine(numberSlotImage)
|
||||||
|
page.Children.append(numberSlotImage)
|
||||||
|
page.Children.append(numberSlot)
|
||||||
|
|
||||||
|
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_04.sub", 55, yPos)
|
||||||
|
nameSlot = ui.MakeTextLine(nameSlotImage)
|
||||||
|
page.Children.append(nameSlotImage)
|
||||||
|
page.Children.append(nameSlot)
|
||||||
|
|
||||||
|
priceSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_05.sub", 175, yPos)
|
||||||
|
priceSlot = ui.MakeTextLine(priceSlotImage)
|
||||||
|
page.Children.append(priceSlotImage)
|
||||||
|
page.Children.append(priceSlot)
|
||||||
|
|
||||||
|
deleteButton = ui.Button()
|
||||||
|
deleteButton.SetParent(page)
|
||||||
|
deleteButton.SetPosition(310, yPos)
|
||||||
|
deleteButton.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub")
|
||||||
|
deleteButton.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub")
|
||||||
|
deleteButton.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub")
|
||||||
|
deleteButton.SetText("구입")
|
||||||
|
deleteButton.Show()
|
||||||
|
page.Children.append(deleteButton)
|
||||||
|
|
||||||
|
yPos += 20
|
||||||
|
|
||||||
|
def __MakeRegisterPage(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __MakeUniqueAuctionPage(self):
|
||||||
|
|
||||||
|
page = self.pageWindow["UNIQUE_AUCTION"]
|
||||||
|
|
||||||
|
LINE_COUNT = 3
|
||||||
|
|
||||||
|
for i in xrange(LINE_COUNT):
|
||||||
|
|
||||||
|
yPos = 5 + 99*i
|
||||||
|
|
||||||
|
itemSlotImage = ui.MakeSlotBar(page, 10, yPos, 97, 97)
|
||||||
|
page.Children.append(itemSlotImage)
|
||||||
|
|
||||||
|
itemName = ui.MakeTextLine(page, False, 117, yPos + 14)
|
||||||
|
page.Children.append(itemName)
|
||||||
|
## Temporary
|
||||||
|
itemName.SetText("선녀의 비녀")
|
||||||
|
## Temporary
|
||||||
|
|
||||||
|
curPrice = ui.MakeTextLine(page, False, 117, yPos + 31)
|
||||||
|
page.Children.append(curPrice)
|
||||||
|
## Temporary
|
||||||
|
curPrice.SetText("현재가 : 20억 1234만 1234냥")
|
||||||
|
## Temporary
|
||||||
|
|
||||||
|
lastTime = ui.MakeTextLine(page, False, 117, yPos + 48)
|
||||||
|
page.Children.append(lastTime)
|
||||||
|
## Temporary
|
||||||
|
lastTime.SetText("낙찰까지 남은 시간 : 19분 28초")
|
||||||
|
## Temporary
|
||||||
|
|
||||||
|
priceSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_05.sub", 117, yPos + 65)
|
||||||
|
priceSlot = ui.MakeTextLine(priceSlotImage)
|
||||||
|
page.Children.append(priceSlotImage)
|
||||||
|
page.Children.append(priceSlot)
|
||||||
|
## Temporary
|
||||||
|
priceSlot.SetText("20억 1234만 1234냥")
|
||||||
|
## Temporary
|
||||||
|
|
||||||
|
def SelectPage(self, arg):
|
||||||
|
for key, btn in self.tabButtonDict.items():
|
||||||
|
if arg != key:
|
||||||
|
btn.SetUp()
|
||||||
|
for key, img in self.tabDict.items():
|
||||||
|
if arg == key:
|
||||||
|
img.Show()
|
||||||
|
else:
|
||||||
|
img.Hide()
|
||||||
|
for key, page in self.pageWindow.items():
|
||||||
|
if arg == key:
|
||||||
|
page.Show()
|
||||||
|
else:
|
||||||
|
page.Hide()
|
||||||
|
self.board.SetTitleName(self.pageName[arg])
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
import app
|
||||||
|
import os
|
||||||
|
import net
|
||||||
|
import mouseModule
|
||||||
|
import player
|
||||||
|
import snd
|
||||||
|
import localeInfo
|
||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
class AutoBanQuizWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.answer = 0
|
||||||
|
self.restSec = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "AutoBanQuiz.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AutoBanQuiz.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
|
||||||
|
self.msgTexts = [
|
||||||
|
GetObject("msg1"),
|
||||||
|
GetObject("msg2"),
|
||||||
|
]
|
||||||
|
self.selButtons = [
|
||||||
|
GetObject("select1"),
|
||||||
|
GetObject("select2"),
|
||||||
|
GetObject("select3"),
|
||||||
|
]
|
||||||
|
|
||||||
|
self.statusText = GetObject("status")
|
||||||
|
self.answerButton = GetObject("answer")
|
||||||
|
self.refreshButton = GetObject("refresh")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AutoBanQuiz.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.selButtons[0].SAFE_SetEvent(self.__OnClickSelectButton0)
|
||||||
|
self.selButtons[1].SAFE_SetEvent(self.__OnClickSelectButton1)
|
||||||
|
self.selButtons[2].SAFE_SetEvent(self.__OnClickSelectButton2)
|
||||||
|
|
||||||
|
self.answerButton.SAFE_SetEvent(self.__OnClickAnswerButton)
|
||||||
|
self.refreshButton.SAFE_SetEvent(self.__OnClickRefreshButton)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.msgTexts = []
|
||||||
|
self.selButtons = []
|
||||||
|
self.statusText = None
|
||||||
|
self.answerButton = None
|
||||||
|
self.refreshButton = None
|
||||||
|
|
||||||
|
def Open(self, open, quiz, duration):
|
||||||
|
srcLines = quiz.split("|")
|
||||||
|
|
||||||
|
if len(srcLines) >= 5:
|
||||||
|
msgLines = srcLines[:2]
|
||||||
|
selLines = srcLines[2:]
|
||||||
|
|
||||||
|
for msgText, msgLine in zip(self.msgTexts, msgLines):
|
||||||
|
msgText.SetText(msgLine)
|
||||||
|
|
||||||
|
for selButton, selLine in zip(self.selButtons, selLines):
|
||||||
|
selButton.SetText(selLine)
|
||||||
|
|
||||||
|
self.statusText.SetText("%s: %s" % (uiScriptLocale.AUTOBAN_QUIZ_REST_TIME, localeInfo.SecondToDHM(duration)))
|
||||||
|
|
||||||
|
self.answer = 0
|
||||||
|
self.endTime = app.GetTime() + duration
|
||||||
|
|
||||||
|
for selectButton in self.selButtons:
|
||||||
|
selectButton.SetUp()
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
self.Lock()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Unlock()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def Clear(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __OnClickSelectButton0(self):
|
||||||
|
self.__Select(0)
|
||||||
|
|
||||||
|
def __OnClickSelectButton1(self):
|
||||||
|
self.__Select(1)
|
||||||
|
|
||||||
|
def __OnClickSelectButton2(self):
|
||||||
|
self.__Select(2)
|
||||||
|
|
||||||
|
def __Select(self, index):
|
||||||
|
for selectButton in self.selButtons:
|
||||||
|
selectButton.SetUp()
|
||||||
|
|
||||||
|
self.selButtons[index].Down()
|
||||||
|
self.answer = index + 1
|
||||||
|
|
||||||
|
print "autoban_select: %d" % (self.answer)
|
||||||
|
|
||||||
|
def __OnClickAnswerButton(self):
|
||||||
|
if self.answer:
|
||||||
|
print "autoban_answer: %d" % (self.answer)
|
||||||
|
net.SendChatPacket("/autoban_answer %d" % (self.answer))
|
||||||
|
self.Close()
|
||||||
|
else:
|
||||||
|
print "autoban_noanswer"
|
||||||
|
|
||||||
|
def __OnClickRefreshButton(self):
|
||||||
|
print "autoban_refresh"
|
||||||
|
net.SendChatPacket("/autoban_refresh")
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
restTime = self.endTime - app.GetTime()
|
||||||
|
if restTime < 0:
|
||||||
|
restTime = 0
|
||||||
|
|
||||||
|
self.statusText.SetText("%s: %s" % (uiScriptLocale.AUTOBAN_QUIZ_REST_TIME, localeInfo.SecondToDHM(restTime)))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import uiToolTip
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
class TestGame(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
localeInfo.LoadLocaleData()
|
||||||
|
|
||||||
|
self.cubeWindow = AutoBanQuizWindow()
|
||||||
|
self.cubeWindow.LoadWindow()
|
||||||
|
self.cubeWindow.Open()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
app.UpdateGame()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
app.RenderGame()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
game = TestGame()
|
||||||
|
game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
game.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import ui
|
||||||
|
import ime
|
||||||
|
import wndMgr
|
||||||
|
|
||||||
|
class VerticalCandidateBoard(ui.Board):
|
||||||
|
|
||||||
|
CORNER_WIDTH = 3
|
||||||
|
CORNER_HEIGHT = 3
|
||||||
|
LINE_WIDTH = 16
|
||||||
|
LINE_HEIGHT = 16
|
||||||
|
|
||||||
|
SLOT_WIDTH = 14
|
||||||
|
SLOT_HEIGHT = 14
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self, "CURTAIN")
|
||||||
|
|
||||||
|
self.Base = None
|
||||||
|
self.BaseBar = None
|
||||||
|
self.numberList = []
|
||||||
|
self.slotList = []
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Board.__del__(self)
|
||||||
|
|
||||||
|
def SetCharacterCount(self, xCount, yCount):
|
||||||
|
self.SetSize(xCount*14 + 14, yCount*14 + 7)
|
||||||
|
self.BaseBar.SetSize(xCount*14 + 1, yCount*14 + 1)
|
||||||
|
|
||||||
|
self.numberList = []
|
||||||
|
self.slotList = []
|
||||||
|
|
||||||
|
for y in xrange(yCount):
|
||||||
|
|
||||||
|
number = ui.ImageBox()
|
||||||
|
number.SetParent(self.BaseBar)
|
||||||
|
number.LoadImage("d:/ymir work/ui/pattern/ime/%d.tga" % (y+1))
|
||||||
|
number.SetPosition(5 - 10, 8 + y * 14 - 3)
|
||||||
|
number.Show()
|
||||||
|
self.numberList.append(number)
|
||||||
|
|
||||||
|
slot = ui.Bar()
|
||||||
|
slot.SetParent(self.BaseBar)
|
||||||
|
slot.SetPosition(10 + 1 - 10, 3 + y*14 + 1 - 3)
|
||||||
|
slot.SetSize(xCount*14 - 1, 13)
|
||||||
|
slot.SetColor(0xFF302C2A)
|
||||||
|
slot.Show()
|
||||||
|
self.slotList.append(slot)
|
||||||
|
|
||||||
|
#################################################################
|
||||||
|
|
||||||
|
def SetCandidatePosition(self, x, y, textCount):
|
||||||
|
xPos = x + (textCount - 5) * 6 + 2
|
||||||
|
yPos = y - self.GetHeight() - 2
|
||||||
|
self.SetPosition(xPos, yPos)
|
||||||
|
|
||||||
|
def Load(self):
|
||||||
|
self.MakeBoard("d:/ymir work/ui/pattern/ime/corner_", "d:/ymir work/ui/pattern/ime/bar_")
|
||||||
|
|
||||||
|
BaseBar = ui.Bar()
|
||||||
|
BaseBar.SetParent(self)
|
||||||
|
BaseBar.SetPosition(10, 3)
|
||||||
|
BaseBar.SetColor(0xff000000)
|
||||||
|
BaseBar.Show()
|
||||||
|
self.BaseBar = BaseBar
|
||||||
|
|
||||||
|
candidateListBox = ui.CandidateListBox(ui.CandidateListBox.VERTICAL_MODE)
|
||||||
|
candidateListBox.SetParent(self)
|
||||||
|
candidateListBox.SetPosition(11, 4)
|
||||||
|
candidateListBox.SetItemSize(16, 14)
|
||||||
|
candidateListBox.SetItemStep(14)
|
||||||
|
candidateListBox.Show()
|
||||||
|
self.candidateListBox = candidateListBox
|
||||||
|
|
||||||
|
def Clear(self):
|
||||||
|
self.candidateListBox.RemoveAllItems()
|
||||||
|
|
||||||
|
def Append(self, text):
|
||||||
|
self.candidateListBox.AppendItem(ui.CandidateListBox.Item(text))
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
|
||||||
|
maxTextLength = 0
|
||||||
|
yCount = ime.GetCandidateCount()
|
||||||
|
|
||||||
|
for i in xrange(yCount):
|
||||||
|
text, length = ime.GetCandidate(i)
|
||||||
|
self.Append(text)
|
||||||
|
|
||||||
|
if length > maxTextLength:
|
||||||
|
maxTextLength = length
|
||||||
|
|
||||||
|
if maxTextLength > 0:
|
||||||
|
self.SetCharacterCount(maxTextLength, yCount)
|
||||||
|
|
||||||
|
self.candidateListBox.SelectIndex(ime.GetCandidateSelection())
|
||||||
|
|
||||||
|
class KORCandidateWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self, "CURTAIN")
|
||||||
|
self.candidateListBox=None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def SetCandidatePosition(self, x, y, textCount):
|
||||||
|
xPos = x + textCount*6 - 20
|
||||||
|
yPos = y + 20
|
||||||
|
xPos = min(xPos, wndMgr.GetScreenWidth() - self.GetWidth())
|
||||||
|
self.SetPosition(xPos, yPos)
|
||||||
|
|
||||||
|
def Clear(self):
|
||||||
|
self.candidateListBox.RemoveAllItems()
|
||||||
|
|
||||||
|
def Append(self, text):
|
||||||
|
self.candidateListBox.AppendItem(ui.CandidateListBox.Item(text))
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
for i in xrange(9):
|
||||||
|
text, length = ime.GetCandidate(i)
|
||||||
|
self.Append(text)
|
||||||
|
|
||||||
|
self.candidateListBox.SelectIndex(ime.GetCandidateSelection())
|
||||||
|
|
||||||
|
def Select(self, pos):
|
||||||
|
self.candidateListBox.SelectIndex(pos)
|
||||||
|
|
||||||
|
def Load(self):
|
||||||
|
self.__LoadScript()
|
||||||
|
self.__BindObject()
|
||||||
|
|
||||||
|
def __LoadScript(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/IMEKOR.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CandidateWindow.__LoadScript")
|
||||||
|
|
||||||
|
def __BindObject(self):
|
||||||
|
try:
|
||||||
|
self.candidateListBox=self.GetChild("CandidateList")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CandidateWindow.__BindObject")
|
||||||
|
|
||||||
|
ui.RegisterCandidateWindowClass(949, KORCandidateWindow)
|
||||||
|
ui.RegisterCandidateWindowClass(932, VerticalCandidateBoard)
|
||||||
|
ui.RegisterCandidateWindowClass(936, VerticalCandidateBoard)
|
||||||
|
ui.RegisterCandidateWindowClass(950, VerticalCandidateBoard)
|
||||||
+1236
File diff suppressed because it is too large
Load Diff
+1169
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,419 @@
|
|||||||
|
import ui
|
||||||
|
import localeInfo
|
||||||
|
import app
|
||||||
|
import ime
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
class PopupDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadDialog()
|
||||||
|
self.acceptEvent = lambda *arg: None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadDialog(self):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
|
||||||
|
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.message = self.GetChild("message")
|
||||||
|
self.accceptButton = self.GetChild("accept")
|
||||||
|
self.accceptButton.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PopupDialog.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
self.acceptEvent()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.Close()
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
def SetWidth(self, width):
|
||||||
|
height = self.GetHeight()
|
||||||
|
self.SetSize(width, height)
|
||||||
|
self.board.SetSize(width, height)
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def SetText(self, text):
|
||||||
|
self.message.SetText(text)
|
||||||
|
|
||||||
|
def SetAcceptEvent(self, event):
|
||||||
|
self.acceptEvent = event
|
||||||
|
|
||||||
|
def SetButtonName(self, name):
|
||||||
|
self.accceptButton.SetText(name)
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnIMEReturn(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
class InputDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__CreateDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/inputdialog.py")
|
||||||
|
|
||||||
|
getObject = self.GetChild
|
||||||
|
self.board = getObject("Board")
|
||||||
|
self.acceptButton = getObject("AcceptButton")
|
||||||
|
self.cancelButton = getObject("CancelButton")
|
||||||
|
self.inputSlot = getObject("InputSlot")
|
||||||
|
self.inputValue = getObject("InputValue")
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.inputValue.SetFocus()
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.board = None
|
||||||
|
self.acceptButton = None
|
||||||
|
self.cancelButton = None
|
||||||
|
self.inputSlot = None
|
||||||
|
self.inputValue = None
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetTitle(self, name):
|
||||||
|
self.board.SetTitleName(name)
|
||||||
|
|
||||||
|
def SetNumberMode(self):
|
||||||
|
self.inputValue.SetNumberMode()
|
||||||
|
|
||||||
|
def SetSecretMode(self):
|
||||||
|
self.inputValue.SetSecret()
|
||||||
|
|
||||||
|
def SetFocus(self):
|
||||||
|
self.inputValue.SetFocus()
|
||||||
|
|
||||||
|
def SetMaxLength(self, length):
|
||||||
|
width = length * 6 + 10
|
||||||
|
self.SetBoardWidth(max(width + 50, 160))
|
||||||
|
self.SetSlotWidth(width)
|
||||||
|
self.inputValue.SetMax(length)
|
||||||
|
|
||||||
|
def SetSlotWidth(self, width):
|
||||||
|
self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
|
||||||
|
self.inputValue.SetSize(width, self.inputValue.GetHeight())
|
||||||
|
if self.IsRTL():
|
||||||
|
self.inputValue.SetPosition(self.inputValue.GetWidth(), 0)
|
||||||
|
|
||||||
|
def SetBoardWidth(self, width):
|
||||||
|
self.SetSize(max(width + 50, 160), self.GetHeight())
|
||||||
|
self.board.SetSize(max(width + 50, 160), self.GetHeight())
|
||||||
|
if self.IsRTL():
|
||||||
|
self.board.SetPosition(self.board.GetWidth(), 0)
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def SetAcceptEvent(self, event):
|
||||||
|
self.acceptButton.SetEvent(event)
|
||||||
|
self.inputValue.OnIMEReturn = event
|
||||||
|
|
||||||
|
def SetCancelEvent(self, event):
|
||||||
|
self.board.SetCloseEvent(event)
|
||||||
|
self.cancelButton.SetEvent(event)
|
||||||
|
self.inputValue.OnPressEscapeKey = event
|
||||||
|
|
||||||
|
def GetText(self):
|
||||||
|
return self.inputValue.GetText()
|
||||||
|
|
||||||
|
class InputDialogWithDescription(InputDialog):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__CreateDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
InputDialog.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if localeInfo.IsARABIC() :
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "inputdialogwithdescription.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/inputdialogwithdescription.py")
|
||||||
|
|
||||||
|
try:
|
||||||
|
getObject = self.GetChild
|
||||||
|
self.board = getObject("Board")
|
||||||
|
self.acceptButton = getObject("AcceptButton")
|
||||||
|
self.cancelButton = getObject("CancelButton")
|
||||||
|
self.inputSlot = getObject("InputSlot")
|
||||||
|
self.inputValue = getObject("InputValue")
|
||||||
|
self.description = getObject("Description")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("InputDialogWithDescription.LoadBoardDialog.BindObject")
|
||||||
|
|
||||||
|
def SetDescription(self, text):
|
||||||
|
self.description.SetText(text)
|
||||||
|
|
||||||
|
class InputDialogWithDescription2(InputDialog):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__CreateDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
InputDialog.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/inputdialogwithdescription2.py")
|
||||||
|
|
||||||
|
try:
|
||||||
|
getObject = self.GetChild
|
||||||
|
self.board = getObject("Board")
|
||||||
|
self.acceptButton = getObject("AcceptButton")
|
||||||
|
self.cancelButton = getObject("CancelButton")
|
||||||
|
self.inputSlot = getObject("InputSlot")
|
||||||
|
self.inputValue = getObject("InputValue")
|
||||||
|
self.description1 = getObject("Description1")
|
||||||
|
self.description2 = getObject("Description2")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("InputDialogWithDescription.LoadBoardDialog.BindObject")
|
||||||
|
|
||||||
|
def SetDescription1(self, text):
|
||||||
|
self.description1.SetText(text)
|
||||||
|
|
||||||
|
def SetDescription2(self, text):
|
||||||
|
self.description2.SetText(text)
|
||||||
|
|
||||||
|
class QuestionDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__CreateDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog.py")
|
||||||
|
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.textLine = self.GetChild("message")
|
||||||
|
self.acceptButton = self.GetChild("accept")
|
||||||
|
self.cancelButton = self.GetChild("cancel")
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetWidth(self, width):
|
||||||
|
height = self.GetHeight()
|
||||||
|
self.SetSize(width, height)
|
||||||
|
self.board.SetSize(width, height)
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def SAFE_SetAcceptEvent(self, event):
|
||||||
|
self.acceptButton.SAFE_SetEvent(event)
|
||||||
|
|
||||||
|
def SAFE_SetCancelEvent(self, event):
|
||||||
|
self.cancelButton.SAFE_SetEvent(event)
|
||||||
|
|
||||||
|
def SetAcceptEvent(self, event):
|
||||||
|
self.acceptButton.SetEvent(event)
|
||||||
|
|
||||||
|
def SetCancelEvent(self, event):
|
||||||
|
self.cancelButton.SetEvent(event)
|
||||||
|
|
||||||
|
def SetText(self, text):
|
||||||
|
self.textLine.SetText(text)
|
||||||
|
|
||||||
|
def SetAcceptText(self, text):
|
||||||
|
self.acceptButton.SetText(text)
|
||||||
|
|
||||||
|
def SetCancelText(self, text):
|
||||||
|
self.cancelButton.SetText(text)
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
class QuestionDialog2(QuestionDialog):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
QuestionDialog.__init__(self)
|
||||||
|
self.__CreateDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
QuestionDialog.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
|
||||||
|
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.textLine1 = self.GetChild("message1")
|
||||||
|
self.textLine2 = self.GetChild("message2")
|
||||||
|
self.acceptButton = self.GetChild("accept")
|
||||||
|
self.cancelButton = self.GetChild("cancel")
|
||||||
|
|
||||||
|
def SetText1(self, text):
|
||||||
|
self.textLine1.SetText(text)
|
||||||
|
|
||||||
|
def SetText2(self, text):
|
||||||
|
self.textLine2.SetText(text)
|
||||||
|
|
||||||
|
class QuestionDialogWithTimeLimit(QuestionDialog2):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__CreateDialog()
|
||||||
|
self.endTime = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
QuestionDialog2.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
|
||||||
|
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.textLine1 = self.GetChild("message1")
|
||||||
|
self.textLine2 = self.GetChild("message2")
|
||||||
|
self.acceptButton = self.GetChild("accept")
|
||||||
|
self.cancelButton = self.GetChild("cancel")
|
||||||
|
|
||||||
|
def Open(self, msg, timeout):
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.SetText1(msg)
|
||||||
|
self.endTime = app.GetTime() + timeout
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
leftTime = max(0, self.endTime - app.GetTime())
|
||||||
|
self.SetText2(localeInfo.UI_LEFT_TIME % (leftTime))
|
||||||
|
|
||||||
|
class MoneyInputDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.moneyHeaderText = localeInfo.MONEY_INPUT_DIALOG_SELLPRICE
|
||||||
|
self.__CreateDialog()
|
||||||
|
self.SetMaxLength(9)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __CreateDialog(self):
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/moneyinputdialog.py")
|
||||||
|
|
||||||
|
getObject = self.GetChild
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.acceptButton = getObject("AcceptButton")
|
||||||
|
self.cancelButton = getObject("CancelButton")
|
||||||
|
self.inputValue = getObject("InputValue")
|
||||||
|
self.inputValue.SetNumberMode()
|
||||||
|
self.inputValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
|
||||||
|
self.moneyText = getObject("MoneyValue")
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.inputValue.SetText("")
|
||||||
|
self.inputValue.SetFocus()
|
||||||
|
self.__OnValueUpdate()
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.board = None
|
||||||
|
self.acceptButton = None
|
||||||
|
self.cancelButton = None
|
||||||
|
self.inputValue = None
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetTitle(self, name):
|
||||||
|
self.board.SetTitleName(name)
|
||||||
|
|
||||||
|
def SetFocus(self):
|
||||||
|
self.inputValue.SetFocus()
|
||||||
|
|
||||||
|
def SetMaxLength(self, length):
|
||||||
|
length = min(9, length)
|
||||||
|
self.inputValue.SetMax(length)
|
||||||
|
|
||||||
|
def SetMoneyHeaderText(self, text):
|
||||||
|
self.moneyHeaderText = text
|
||||||
|
|
||||||
|
def SetAcceptEvent(self, event):
|
||||||
|
self.acceptButton.SetEvent(event)
|
||||||
|
self.inputValue.OnIMEReturn = event
|
||||||
|
|
||||||
|
def SetCancelEvent(self, event):
|
||||||
|
self.board.SetCloseEvent(event)
|
||||||
|
self.cancelButton.SetEvent(event)
|
||||||
|
self.inputValue.OnPressEscapeKey = event
|
||||||
|
|
||||||
|
def SetValue(self, value):
|
||||||
|
value=str(value)
|
||||||
|
self.inputValue.SetText(value)
|
||||||
|
self.__OnValueUpdate()
|
||||||
|
ime.SetCursorPosition(len(value))
|
||||||
|
|
||||||
|
|
||||||
|
def GetText(self):
|
||||||
|
return self.inputValue.GetText()
|
||||||
|
|
||||||
|
def __OnValueUpdate(self):
|
||||||
|
ui.EditLine.OnIMEUpdate(self.inputValue)
|
||||||
|
|
||||||
|
text = self.inputValue.GetText()
|
||||||
|
|
||||||
|
money = 0
|
||||||
|
if text and text.isdigit():
|
||||||
|
try:
|
||||||
|
money = int(text)
|
||||||
|
except ValueError:
|
||||||
|
money = 199999999
|
||||||
|
|
||||||
|
self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))
|
||||||
+600
@@ -0,0 +1,600 @@
|
|||||||
|
import ui
|
||||||
|
import net
|
||||||
|
import mouseModule
|
||||||
|
import player
|
||||||
|
import snd
|
||||||
|
import localeInfo
|
||||||
|
import item
|
||||||
|
import grp
|
||||||
|
import uiScriptLocale
|
||||||
|
import uiToolTip
|
||||||
|
|
||||||
|
class CubeResultWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/CubeResultWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CubeResultWindow.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
self.btnClose = GetObject("CloseButton")
|
||||||
|
self.cubeSlot = GetObject("CubeSlot")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CubeWindow.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.cubeSlot.SetOverInItemEvent(ui.__mem_func__(self.__OnOverInItem))
|
||||||
|
self.cubeSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OnOverOutItem))
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.__OnCloseButtonClick))
|
||||||
|
self.btnClose.SetEvent(ui.__mem_func__(self.__OnCloseButtonClick))
|
||||||
|
self.itemVnum = 0
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.titleBar = None
|
||||||
|
self.btnClose = None
|
||||||
|
self.cubeSlot = None
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.itemVnum = 0
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def SetCubeResultItem(self, itemVnum, count):
|
||||||
|
self.itemVnum = itemVnum
|
||||||
|
|
||||||
|
if 0 == count:
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
self.cubeSlot.SetItemSlot(0, itemVnum, count)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __OnCloseButtonClick(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def __OnOverInItem(self, slotIndex):
|
||||||
|
if self.tooltipItem:
|
||||||
|
if 0 != self.itemVnum:
|
||||||
|
self.tooltipItem.SetItemToolTip(self.itemVnum)
|
||||||
|
|
||||||
|
def __OnOverOutItem(self):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
if 0 != self.eventClose:
|
||||||
|
self.eventClose()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
class CubeWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.xShopStart = 0
|
||||||
|
self.yShopStart = 0
|
||||||
|
self.isUsable = False
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/CubeWindow.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CubeWindow.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.board = GetObject("board")
|
||||||
|
self.board.SetScale(-1.0, 1.0)
|
||||||
|
self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
|
||||||
|
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
self.btnAccept = GetObject("AcceptButton")
|
||||||
|
self.btnCancel = GetObject("CancelButton")
|
||||||
|
self.cubeSlot = GetObject("CubeSlot")
|
||||||
|
self.needMoney = GetObject("NeedMoney")
|
||||||
|
self.contentScrollbar = GetObject("contentScrollbar")
|
||||||
|
self.resultSlots = [GetObject("result1"), GetObject("result2"), GetObject("result3")]
|
||||||
|
self.materialSlots = [
|
||||||
|
[GetObject("material11"), GetObject("material12"), GetObject("material13"), GetObject("material14"), GetObject("material15")],
|
||||||
|
[GetObject("material21"), GetObject("material22"), GetObject("material23"), GetObject("material24"), GetObject("material25")],
|
||||||
|
[GetObject("material31"), GetObject("material32"), GetObject("material33"), GetObject("material34"), GetObject("material35")],
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
row = 0
|
||||||
|
for materialRow in self.materialSlots:
|
||||||
|
j = 0
|
||||||
|
for material in materialRow:
|
||||||
|
material.SetOverInItemEvent(lambda trash = 0, rowIndex = row, col = j: self.__OverInMaterialSlot(trash, rowIndex, col))
|
||||||
|
material.SetSelectItemSlotEvent(lambda trash = 0, rowIndex = row, col = j: self.__OnSelectMaterialSlot(trash, rowIndex, col))
|
||||||
|
material.SetOverOutItemEvent(lambda : self.__OverOutMaterialSlot())
|
||||||
|
j = j + 1
|
||||||
|
row = row + 1
|
||||||
|
|
||||||
|
row = 0
|
||||||
|
for resultSlot in self.resultSlots:
|
||||||
|
resultSlot.SetOverInItemEvent(lambda trash = 0, rowIndex = row: self.__OverInCubeResultSlot(trash, rowIndex))
|
||||||
|
resultSlot.SetOverOutItemEvent(lambda : self.__OverOutMaterialSlot())
|
||||||
|
row = row + 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("CubeWindow.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.contentScrollbar.SetScrollStep(0.15)
|
||||||
|
self.contentScrollbar.SetScrollEvent(ui.__mem_func__(self.OnScrollResultList))
|
||||||
|
self.cubeSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.__OnSelectEmptySlot))
|
||||||
|
self.cubeSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__OnSelectItemSlot))
|
||||||
|
self.cubeSlot.SetOverInItemEvent(ui.__mem_func__(self.__OnOverInItem))
|
||||||
|
self.cubeSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OnOverOutItem))
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.__OnCloseButtonClick))
|
||||||
|
self.btnCancel.SetEvent(ui.__mem_func__(self.__OnCloseButtonClick))
|
||||||
|
self.btnAccept.SetEvent(ui.__mem_func__(self.__OnAcceptButtonClick))
|
||||||
|
|
||||||
|
self.cubeItemInfo = {}
|
||||||
|
self.cubeResultInfos = []
|
||||||
|
self.cubeMaterialInfos = {}
|
||||||
|
|
||||||
|
self.tooltipItem = None
|
||||||
|
|
||||||
|
self.firstSlotIndex = 0
|
||||||
|
self.RESULT_SLOT_COUNT = len(self.resultSlots)
|
||||||
|
self.SLOT_SIZEX = 32
|
||||||
|
self.SLOT_SIZEY = 32
|
||||||
|
self.CUBE_SLOT_COUNTX = 8
|
||||||
|
self.CUBE_SLOT_COUNTY = 3
|
||||||
|
|
||||||
|
def SetItemToolTip(self, itemTooltip):
|
||||||
|
self.tooltipItem = itemTooltip
|
||||||
|
|
||||||
|
def GetResultCount(self):
|
||||||
|
return len(self.cubeResultInfos)
|
||||||
|
|
||||||
|
def OnScrollResultList(self):
|
||||||
|
count = self.GetResultCount()
|
||||||
|
scrollLineCount = max(0, count - self.RESULT_SLOT_COUNT)
|
||||||
|
startIndex = int(scrollLineCount * self.contentScrollbar.GetPos())
|
||||||
|
|
||||||
|
if startIndex != self.firstSlotIndex:
|
||||||
|
self.firstSlotIndex = startIndex
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def AddCubeResultItem(self, itemVnum, count):
|
||||||
|
self.cubeResultInfos.append((itemVnum, count))
|
||||||
|
#self.Refresh()
|
||||||
|
|
||||||
|
def AddMaterialInfo(self, itemIndex, orderIndex, itemVnum, itemCount):
|
||||||
|
if itemIndex not in self.cubeMaterialInfos:
|
||||||
|
self.cubeMaterialInfos[itemIndex] = [[], [], [], [], []]
|
||||||
|
|
||||||
|
self.cubeMaterialInfos[itemIndex][orderIndex].append((itemVnum, itemCount))
|
||||||
|
#print "AddMaterialInfo", itemIndex, orderIndex, itemVnum, itemCount, self.cubeMaterialInfos
|
||||||
|
|
||||||
|
def ClearCubeResultItem(self):
|
||||||
|
self.cubeResultInfos = []
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.titleBar = None
|
||||||
|
self.btnAccept = None
|
||||||
|
self.btnCancel = None
|
||||||
|
self.cubeSlot = None
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.needMoney = None
|
||||||
|
|
||||||
|
def __OverOutMaterialSlot(self):
|
||||||
|
self.tooltipItem.SetCannotUseItemForceSetDisableColor(True)
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def __OverInCubeResultSlot(self, trash, resultIndex):
|
||||||
|
self.tooltipItem.ClearToolTip()
|
||||||
|
self.tooltipItem.SetCannotUseItemForceSetDisableColor(True)
|
||||||
|
|
||||||
|
metinSlot = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
metinSlot.append(0)
|
||||||
|
attrSlot = []
|
||||||
|
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
|
||||||
|
attrSlot.append((0, 0))
|
||||||
|
|
||||||
|
#print "resultIndex, firstSlotIndex", resultIndex, self.firstSlotIndex
|
||||||
|
|
||||||
|
resultIndex = resultIndex + self.firstSlotIndex
|
||||||
|
itemVnum, itemCount = self.cubeResultInfos[resultIndex]
|
||||||
|
|
||||||
|
self.tooltipItem.AddItemData(itemVnum, metinSlot, attrSlot)
|
||||||
|
|
||||||
|
|
||||||
|
# 재료를 클릭하면 인벤토리에서 해당 아이템을 찾아서 등록함.
|
||||||
|
def __OnSelectMaterialSlot(self, trash, resultIndex, materialIndex):
|
||||||
|
resultIndex = resultIndex + self.firstSlotIndex
|
||||||
|
if resultIndex not in self.cubeMaterialInfos:
|
||||||
|
return
|
||||||
|
|
||||||
|
materialInfo = self.cubeMaterialInfos[resultIndex]
|
||||||
|
materialCount = len(materialInfo[materialIndex])
|
||||||
|
|
||||||
|
if 0 == materialCount:
|
||||||
|
return
|
||||||
|
|
||||||
|
for itemVnum, itemCount in materialInfo[materialIndex]:
|
||||||
|
bAddedNow = False # 이번에 클릭함으로써 아이템이 추가되었나?
|
||||||
|
item.SelectItem(itemVnum)
|
||||||
|
itemSizeX, itemSizeY = item.GetItemSize()
|
||||||
|
|
||||||
|
# 제조에 필요한 만큼의 재료를 가지고 있는가?
|
||||||
|
if player.GetItemCountByVnum(itemVnum) >= itemCount:
|
||||||
|
for i in xrange(player.INVENTORY_SLOT_COUNT):
|
||||||
|
vnum = player.GetItemIndex(i)
|
||||||
|
count= player.GetItemCount(i)
|
||||||
|
|
||||||
|
if vnum == itemVnum and count >= itemCount:
|
||||||
|
# 이미 같은 아이템이 등록되어 있는지 검사하고, 없다면 추가함
|
||||||
|
bAlreadyExists = False
|
||||||
|
for slotPos, invenPos in self.cubeItemInfo.items():
|
||||||
|
if invenPos == i:
|
||||||
|
bAlreadyExists = True
|
||||||
|
|
||||||
|
if True == bAlreadyExists:
|
||||||
|
continue #continue inventory iterating
|
||||||
|
|
||||||
|
#print "Cube Status : ", self.cubeItemInfo
|
||||||
|
|
||||||
|
# 여기 진입하면 큐브에 등록되지 않은 아이템이므로, 빈 큐브 슬롯에 해당 아이템 추가
|
||||||
|
bCanAddSlot = False
|
||||||
|
for slotPos in xrange(self.cubeSlot.GetSlotCount()):
|
||||||
|
# 이 큐브 슬롯이 비어있는가?
|
||||||
|
if not slotPos in self.cubeItemInfo:
|
||||||
|
upperColumnItemSizeY = -1
|
||||||
|
currentSlotLine = int(slotPos / self.CUBE_SLOT_COUNTX)
|
||||||
|
cubeColumn = int(slotPos % self.CUBE_SLOT_COUNTX)
|
||||||
|
|
||||||
|
|
||||||
|
# 만약 큐브에 3칸짜리 아이템이 등록되어 있다면, 이 열(column)은 더 이상 볼 것도 없이 넘어간다
|
||||||
|
if cubeColumn in self.cubeItemInfo:
|
||||||
|
columnVNUM = player.GetItemIndex(self.cubeItemInfo[cubeColumn])
|
||||||
|
item.SelectItem(columnVNUM)
|
||||||
|
columnItemSizeX, columnItemSizeY = item.GetItemSize()
|
||||||
|
|
||||||
|
if 3 == columnItemSizeY:
|
||||||
|
continue #continue cube slot iterating
|
||||||
|
|
||||||
|
if 0 < currentSlotLine and slotPos - self.CUBE_SLOT_COUNTX in self.cubeItemInfo:
|
||||||
|
upperColumnVNUM = player.GetItemIndex(self.cubeItemInfo[slotPos - self.CUBE_SLOT_COUNTX])
|
||||||
|
item.SelectItem(upperColumnVNUM)
|
||||||
|
columnItemSizeX, upperColumnItemSizeY = item.GetItemSize()
|
||||||
|
|
||||||
|
# 1칸짜리 아이템은 바로 윗줄에 한칸짜리 아이템이 있어야 함
|
||||||
|
if 1 == itemSizeY:
|
||||||
|
if 0 == currentSlotLine:
|
||||||
|
bCanAddSlot = True
|
||||||
|
elif 1 == currentSlotLine and 1 == upperColumnItemSizeY:
|
||||||
|
bCanAddSlot = True
|
||||||
|
elif 2 == currentSlotLine:
|
||||||
|
bCanAddSlot = True
|
||||||
|
# 2칸짜리 아이템은 위아래가 비어있어야 함
|
||||||
|
elif 2 == itemSizeY:
|
||||||
|
if 0 == currentSlotLine and not cubeColumn + self.CUBE_SLOT_COUNTX in self.cubeItemInfo:
|
||||||
|
bCanAddSlot = True
|
||||||
|
elif 1 == currentSlotLine and 1 == upperColumnItemSizeY and not cubeColumn + (self.CUBE_SLOT_COUNTX * 2) in self.cubeItemInfo:
|
||||||
|
bCanAddSlot = True
|
||||||
|
# 3칸짜리 아이템은 해당 Column 자체가 모두 비어있어야 함
|
||||||
|
else:
|
||||||
|
if not cubeColumn in self.cubeItemInfo and not cubeColumn + self.CUBE_SLOT_COUNTX in self.cubeItemInfo and not cubeColumn + (self.CUBE_SLOT_COUNTX * 2) in self.cubeItemInfo:
|
||||||
|
bCanAddSlot = True
|
||||||
|
|
||||||
|
if True == bCanAddSlot:
|
||||||
|
self.cubeItemInfo[slotPos] = i
|
||||||
|
self.cubeSlot.SetItemSlot(slotPos, vnum, count)
|
||||||
|
net.SendChatPacket("/cube add %d %d" % (slotPos, i))
|
||||||
|
|
||||||
|
bAddedNow = True
|
||||||
|
|
||||||
|
if True == bAddedNow:
|
||||||
|
break #break cube slot iterating
|
||||||
|
|
||||||
|
if True == bAddedNow:
|
||||||
|
break #break inventory iterating
|
||||||
|
|
||||||
|
if True == bAddedNow:
|
||||||
|
break #break material iterating
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def __OverInMaterialSlot(self, trash, resultIndex, col):
|
||||||
|
self.tooltipItem.ClearToolTip()
|
||||||
|
self.tooltipItem.SetCannotUseItemForceSetDisableColor(False)
|
||||||
|
|
||||||
|
resultIndex = resultIndex + self.firstSlotIndex
|
||||||
|
|
||||||
|
if resultIndex not in self.cubeMaterialInfos:
|
||||||
|
return
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
materialInfo = self.cubeMaterialInfos[resultIndex]
|
||||||
|
materialCount = len(materialInfo[col])
|
||||||
|
|
||||||
|
for itemVnum, count in materialInfo[col]:
|
||||||
|
item.SelectItem(itemVnum)
|
||||||
|
if player.GetItemCountByVnum(itemVnum) >= count:
|
||||||
|
self.tooltipItem.AppendTextLine("%s" % (item.GetItemName()), grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)).SetFeather()
|
||||||
|
else:
|
||||||
|
self.tooltipItem.AppendTextLine("%s" % (item.GetItemName()), grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)).SetFeather()
|
||||||
|
|
||||||
|
if i < materialCount - 1:
|
||||||
|
self.tooltipItem.AppendTextLine(uiScriptLocale.CUBE_REQUIRE_MATERIAL_OR)
|
||||||
|
|
||||||
|
i = i + 1
|
||||||
|
|
||||||
|
self.tooltipItem.Show()
|
||||||
|
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.cubeItemInfo = {}
|
||||||
|
self.cubeResultInfos = []
|
||||||
|
self.cubeMaterialInfos = {}
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.isUsable = True
|
||||||
|
(self.xShopStart, self.yShopStart, z) = player.GetMainCharacterPosition()
|
||||||
|
|
||||||
|
def UpdateInfo(self, gold, itemVnum, count):
|
||||||
|
if self.needMoney:
|
||||||
|
self.needMoney.SetText(localeInfo.NumberToMoneyString(gold))
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.__OnCloseButtonClick()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
self.Hide()
|
||||||
|
self.cubeItemInfo = {}
|
||||||
|
self.cubeMaterialInfos = {}
|
||||||
|
self.cubeResultInfos = {}
|
||||||
|
self.firstSlotIndex = 0
|
||||||
|
self.contentScrollbar.SetPos(0)
|
||||||
|
|
||||||
|
if self.needMoney:
|
||||||
|
self.needMoney.SetText("0")
|
||||||
|
|
||||||
|
def Clear(self):
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
for slotPos in xrange(self.cubeSlot.GetSlotCount()):
|
||||||
|
|
||||||
|
if not slotPos in self.cubeItemInfo:
|
||||||
|
self.cubeSlot.ClearSlot(slotPos)
|
||||||
|
continue
|
||||||
|
|
||||||
|
invenPos = self.cubeItemInfo[slotPos]
|
||||||
|
itemCount = player.GetItemCount(invenPos)
|
||||||
|
if itemCount > 0:
|
||||||
|
self.cubeSlot.SetItemSlot(slotPos, player.GetItemIndex(invenPos), itemCount)
|
||||||
|
else:
|
||||||
|
del self.cubeItemInfo[slotPos]
|
||||||
|
self.cubeSlot.ClearSlot(slotPos)
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
for itemVnum, count in self.cubeResultInfos[self.firstSlotIndex:]:
|
||||||
|
currentSlot = self.resultSlots[i]
|
||||||
|
|
||||||
|
item.SelectItem(itemVnum)
|
||||||
|
|
||||||
|
currentSlot.SetItemSlot(0, itemVnum, count)
|
||||||
|
currentSlot.Show()
|
||||||
|
|
||||||
|
# Center Align
|
||||||
|
item.SelectItem(itemVnum)
|
||||||
|
sizeX, sizeY = item.GetItemSize()
|
||||||
|
localX, localY = currentSlot.GetLocalPosition()
|
||||||
|
|
||||||
|
currentSlot.SetSize(self.SLOT_SIZEX, self.SLOT_SIZEY * sizeY)
|
||||||
|
|
||||||
|
adjustLocalY = 0
|
||||||
|
if sizeY < 3:
|
||||||
|
adjustLocalY = int(32 / sizeY)
|
||||||
|
|
||||||
|
currentSlot.SetPosition(localX, 0 + adjustLocalY)
|
||||||
|
|
||||||
|
i = i + 1
|
||||||
|
if 3 <= i:
|
||||||
|
break
|
||||||
|
|
||||||
|
#print "self.cubeMaterialInfos : ", self.cubeMaterialInfos
|
||||||
|
if self.firstSlotIndex in self.cubeMaterialInfos:
|
||||||
|
for i in xrange(self.RESULT_SLOT_COUNT):
|
||||||
|
materialList = self.cubeMaterialInfos[self.firstSlotIndex + i]
|
||||||
|
#print "Refresh ::: ", materialList
|
||||||
|
j = 0
|
||||||
|
for materialInfo in materialList:
|
||||||
|
if 0 < len(materialInfo):
|
||||||
|
currentSlot = self.materialSlots[i][j]
|
||||||
|
itemVnum, itemCount = materialInfo[0]
|
||||||
|
currentSlot.SetItemSlot(0, itemVnum, itemCount)
|
||||||
|
j = j + 1
|
||||||
|
|
||||||
|
# Center Align
|
||||||
|
item.SelectItem(itemVnum)
|
||||||
|
sizeX, sizeY = item.GetItemSize()
|
||||||
|
localX, localY = currentSlot.GetLocalPosition()
|
||||||
|
|
||||||
|
currentSlot.SetSize(self.SLOT_SIZEX, self.SLOT_SIZEY * sizeY)
|
||||||
|
|
||||||
|
adjustLocalY = 0
|
||||||
|
if sizeY < 3:
|
||||||
|
adjustLocalY = int(32 / sizeY)
|
||||||
|
|
||||||
|
currentSlot.SetPosition(localX, 0 + adjustLocalY)
|
||||||
|
|
||||||
|
for k in xrange(5):
|
||||||
|
if k >= j:
|
||||||
|
self.materialSlots[i][k].ClearSlot(0)
|
||||||
|
|
||||||
|
if self.RESULT_SLOT_COUNT <= i:
|
||||||
|
break
|
||||||
|
|
||||||
|
self.cubeSlot.RefreshSlot()
|
||||||
|
|
||||||
|
def __OnCloseButtonClick(self):
|
||||||
|
if self.isUsable:
|
||||||
|
self.isUsable = False
|
||||||
|
|
||||||
|
print "큐브 닫기"
|
||||||
|
net.SendChatPacket("/cube close")
|
||||||
|
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def __OnAcceptButtonClick(self):
|
||||||
|
if len(self.cubeItemInfo) == 0:
|
||||||
|
"빈 큐브"
|
||||||
|
return
|
||||||
|
|
||||||
|
print "큐브 제작 시작"
|
||||||
|
#for invenPos in self.cubeItemInfo.values():
|
||||||
|
# net.SendChatPacket("/cube add " + str(invenPos))
|
||||||
|
net.SendChatPacket("/cube make")
|
||||||
|
|
||||||
|
def __OnSelectEmptySlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
if isAttached:
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
if player.SLOT_TYPE_INVENTORY != attachedSlotType:
|
||||||
|
return
|
||||||
|
|
||||||
|
for slotPos, invenPos in self.cubeItemInfo.items():
|
||||||
|
if invenPos == attachedSlotPos:
|
||||||
|
del self.cubeItemInfo[slotPos]
|
||||||
|
|
||||||
|
self.cubeItemInfo[selectedSlotPos] = attachedSlotPos
|
||||||
|
net.SendChatPacket("/cube add %d %d" % (selectedSlotPos, attachedSlotPos))
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def __OnSelectItemSlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
if isAttached:
|
||||||
|
snd.PlaySound("sound/ui/loginfail.wav")
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
else:
|
||||||
|
if not selectedSlotPos in self.cubeItemInfo:
|
||||||
|
return
|
||||||
|
|
||||||
|
snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
|
||||||
|
net.SendChatPacket("/cube del %d " % selectedSlotPos)
|
||||||
|
del self.cubeItemInfo[selectedSlotPos]
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def __OnOverInItem(self, slotIndex):
|
||||||
|
if self.tooltipItem:
|
||||||
|
if self.cubeItemInfo.has_key(slotIndex):
|
||||||
|
self.tooltipItem.SetInventoryItem(self.cubeItemInfo[slotIndex])
|
||||||
|
|
||||||
|
def __OnOverOutItem(self):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
USE_SHOP_LIMIT_RANGE = 1000
|
||||||
|
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE:
|
||||||
|
self.__OnCloseButtonClick()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import uiToolTip
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
class TestGame(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
localeInfo.LoadLocaleData()
|
||||||
|
|
||||||
|
self.tooltipItem = uiToolTip.ItemToolTip()
|
||||||
|
self.tooltipItem.Hide()
|
||||||
|
|
||||||
|
self.cubeWindow = CubeWindow()
|
||||||
|
self.cubeWindow.LoadWindow()
|
||||||
|
self.cubeWindow.SetItemToolTip(self.tooltipItem)
|
||||||
|
self.cubeWindow.Open()
|
||||||
|
|
||||||
|
self.cubeResultWindow = CubeResultWindow()
|
||||||
|
self.cubeResultWindow.LoadWindow()
|
||||||
|
self.cubeResultWindow.SetItemToolTip(self.tooltipItem)
|
||||||
|
self.cubeResultWindow.SetCubeResultItem(27001, 1)
|
||||||
|
self.cubeResultWindow.Open()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
app.UpdateGame()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
app.RenderGame()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
game = TestGame()
|
||||||
|
game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
game.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
|||||||
|
import ui
|
||||||
|
import chr
|
||||||
|
import player
|
||||||
|
|
||||||
|
class EquipmentDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW EQUIPMENT DIALOG ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadDialog()
|
||||||
|
|
||||||
|
self.vid = None
|
||||||
|
self.eventClose = None
|
||||||
|
self.itemDataDict = {}
|
||||||
|
self.tooltipItem = None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE EQUIPMENT DIALOG "
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadDialog(self):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/EquipmentDialog.py")
|
||||||
|
|
||||||
|
getObject = self.GetChild
|
||||||
|
self.board = getObject("Board")
|
||||||
|
self.slotWindow = getObject("EquipmentSlot")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("EquipmentDialog.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.slotWindow.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
|
||||||
|
self.slotWindow.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
|
||||||
|
def Open(self, vid):
|
||||||
|
|
||||||
|
self.vid = vid
|
||||||
|
self.itemDataDict = {}
|
||||||
|
|
||||||
|
name = chr.GetNameByVID(vid)
|
||||||
|
self.board.SetTitleName(name)
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.itemDataDict = {}
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
if self.eventClose:
|
||||||
|
self.eventClose(self.vid)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.eventClose = None
|
||||||
|
|
||||||
|
self.Close()
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.board = None
|
||||||
|
self.slotWindow = None
|
||||||
|
|
||||||
|
def SetEquipmentDialogItem(self, slotIndex, vnum, count):
|
||||||
|
if count <= 1:
|
||||||
|
count = 0
|
||||||
|
self.slotWindow.SetItemSlot(slotIndex, vnum, count)
|
||||||
|
|
||||||
|
emptySocketList = []
|
||||||
|
emptyAttrList = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
emptySocketList.append(0)
|
||||||
|
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
|
||||||
|
emptyAttrList.append((0, 0))
|
||||||
|
self.itemDataDict[slotIndex] = (vnum, count, emptySocketList, emptyAttrList)
|
||||||
|
|
||||||
|
def SetEquipmentDialogSocket(self, slotIndex, socketIndex, value):
|
||||||
|
if not slotIndex in self.itemDataDict:
|
||||||
|
return
|
||||||
|
if socketIndex < 0 or socketIndex > player.METIN_SOCKET_MAX_NUM:
|
||||||
|
return
|
||||||
|
self.itemDataDict[slotIndex][2][socketIndex] = value
|
||||||
|
|
||||||
|
def SetEquipmentDialogAttr(self, slotIndex, attrIndex, type, value):
|
||||||
|
if not slotIndex in self.itemDataDict:
|
||||||
|
return
|
||||||
|
if attrIndex < 0 or attrIndex > player.ATTRIBUTE_SLOT_MAX_NUM:
|
||||||
|
return
|
||||||
|
self.itemDataDict[slotIndex][3][attrIndex] = (type, value)
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def SetCloseEvent(self, event):
|
||||||
|
self.eventClose = event
|
||||||
|
|
||||||
|
def OverInItem(self, slotIndex):
|
||||||
|
|
||||||
|
if None == self.tooltipItem:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not slotIndex in self.itemDataDict:
|
||||||
|
return
|
||||||
|
|
||||||
|
itemVnum = self.itemDataDict[slotIndex][0]
|
||||||
|
if 0 == itemVnum:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.tooltipItem.ClearToolTip()
|
||||||
|
metinSlot = self.itemDataDict[slotIndex][2]
|
||||||
|
attrSlot = self.itemDataDict[slotIndex][3]
|
||||||
|
self.tooltipItem.AddItemData(itemVnum, metinSlot, attrSlot)
|
||||||
|
self.tooltipItem.ShowToolTip()
|
||||||
|
|
||||||
|
def OverOutItem(self):
|
||||||
|
if None != self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import ui
|
||||||
|
|
||||||
|
class Window(ui.Window):
|
||||||
|
def __init__(self, skinFileName = ""):
|
||||||
|
ui.Window.__init__(self, "UI")
|
||||||
|
|
||||||
|
self.children = []
|
||||||
|
self.childDict = {}
|
||||||
|
|
||||||
|
self.__LoadSkin(skinFileName)
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def ClearDictionary(self):
|
||||||
|
self.children = []
|
||||||
|
self.childDict = {}
|
||||||
|
|
||||||
|
def InsertChild(self, name, child):
|
||||||
|
self.childDict[name] = child
|
||||||
|
|
||||||
|
def IsChild(self, name):
|
||||||
|
return name in self.childDict
|
||||||
|
|
||||||
|
def GetChild(self, name):
|
||||||
|
return self.childDict[name]
|
||||||
|
|
||||||
|
def __LoadSkin(self, fileName):
|
||||||
|
loader = ui.PythonScriptLoader()
|
||||||
|
loader.LoadScriptFile(self, fileName)
|
||||||
|
|
||||||
|
|
||||||
|
#wndMgr.SetOutlineFlag(True)
|
||||||
|
|
||||||
|
class App:
|
||||||
|
def __init__(self, title = "METIN2 UI TEST"):
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
|
||||||
|
width = systemSetting.GetWidth()
|
||||||
|
height = systemSetting.GetHeight()
|
||||||
|
wndMgr.SetScreenSize(width, height)
|
||||||
|
app.Create(title, width, height, 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
self.OnInit()
|
||||||
|
|
||||||
|
def MainLoop(self):
|
||||||
|
app.Loop()
|
||||||
|
|
||||||
|
def OnInit(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
class TestWindow(Window):
|
||||||
|
def __init__(self, skinFileName):
|
||||||
|
Window.__init__(self, skinFileName)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
Window.__del__(self)
|
||||||
|
|
||||||
|
class TestApp(App):
|
||||||
|
def OnInit(self):
|
||||||
|
self.test = TestWindow("locale/ymir_ui/matrixwindow.py")
|
||||||
|
pass
|
||||||
|
|
||||||
|
TestApp().MainLoop()
|
||||||
@@ -0,0 +1,219 @@
|
|||||||
|
import player
|
||||||
|
import exchange
|
||||||
|
import net
|
||||||
|
import localeInfo
|
||||||
|
import chat
|
||||||
|
import item
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import mouseModule
|
||||||
|
import uiPickMoney
|
||||||
|
import wndMgr
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
## Exchange
|
||||||
|
class ExchangeDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.TitleName = 0
|
||||||
|
self.tooltipItem = 0
|
||||||
|
self.xStart = 0
|
||||||
|
self.yStart = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/exchangedialog.py")
|
||||||
|
|
||||||
|
## Owner
|
||||||
|
self.OwnerSlot = self.GetChild("Owner_Slot")
|
||||||
|
self.OwnerSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectOwnerEmptySlot))
|
||||||
|
self.OwnerSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectOwnerItemSlot))
|
||||||
|
self.OwnerSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInOwnerItem))
|
||||||
|
self.OwnerSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
self.OwnerMoney = self.GetChild("Owner_Money_Value")
|
||||||
|
self.OwnerAcceptLight = self.GetChild("Owner_Accept_Light")
|
||||||
|
self.OwnerAcceptLight.Disable()
|
||||||
|
self.OwnerMoneyButton = self.GetChild("Owner_Money")
|
||||||
|
self.OwnerMoneyButton.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
|
||||||
|
|
||||||
|
## Target
|
||||||
|
self.TargetSlot = self.GetChild("Target_Slot")
|
||||||
|
self.TargetSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInTargetItem))
|
||||||
|
self.TargetSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
self.TargetMoney = self.GetChild("Target_Money_Value")
|
||||||
|
self.TargetAcceptLight = self.GetChild("Target_Accept_Light")
|
||||||
|
self.TargetAcceptLight.Disable()
|
||||||
|
|
||||||
|
## PickMoneyDialog
|
||||||
|
dlgPickMoney = uiPickMoney.PickMoneyDialog()
|
||||||
|
dlgPickMoney.LoadDialog()
|
||||||
|
dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
|
||||||
|
dlgPickMoney.SetTitleName(localeInfo.EXCHANGE_MONEY)
|
||||||
|
dlgPickMoney.SetMax(7)
|
||||||
|
dlgPickMoney.Hide()
|
||||||
|
self.dlgPickMoney = dlgPickMoney
|
||||||
|
|
||||||
|
## Button
|
||||||
|
self.AcceptButton = self.GetChild("Owner_Accept_Button")
|
||||||
|
self.AcceptButton.SetToggleDownEvent(ui.__mem_func__(self.AcceptExchange))
|
||||||
|
|
||||||
|
self.TitleName = self.GetChild("TitleName")
|
||||||
|
self.GetChild("TitleBar").SetCloseEvent(net.SendExchangeExitPacket)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
print "---------------------------------------------------------------------------- DESTROY EXCHANGE"
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.dlgPickMoney.Destroy()
|
||||||
|
self.dlgPickMoney = 0
|
||||||
|
self.OwnerSlot = 0
|
||||||
|
self.OwnerMoney = 0
|
||||||
|
self.OwnerAcceptLight = 0
|
||||||
|
self.OwnerMoneyButton = 0
|
||||||
|
self.TargetSlot = 0
|
||||||
|
self.TargetMoney = 0
|
||||||
|
self.TargetAcceptLight = 0
|
||||||
|
self.TitleName = 0
|
||||||
|
self.AcceptButton = 0
|
||||||
|
self.tooltipItem = 0
|
||||||
|
|
||||||
|
def OpenDialog(self):
|
||||||
|
self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget()))
|
||||||
|
self.AcceptButton.Enable()
|
||||||
|
self.AcceptButton.SetUp()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
(self.xStart, self.yStart, z) = player.GetMainCharacterPosition()
|
||||||
|
|
||||||
|
def CloseDialog(self):
|
||||||
|
wndMgr.OnceIgnoreMouseLeftButtonUpEvent()
|
||||||
|
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
self.dlgPickMoney.Close()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def OpenPickMoneyDialog(self):
|
||||||
|
|
||||||
|
if exchange.GetElkFromSelf() > 0:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.EXCHANGE_CANT_EDIT_MONEY)
|
||||||
|
return
|
||||||
|
|
||||||
|
self.dlgPickMoney.Open(player.GetElk())
|
||||||
|
|
||||||
|
def OnPickMoney(self, money):
|
||||||
|
net.SendExchangeElkAddPacket(money)
|
||||||
|
|
||||||
|
def AcceptExchange(self):
|
||||||
|
net.SendExchangeAcceptPacket()
|
||||||
|
self.AcceptButton.Disable()
|
||||||
|
|
||||||
|
def SelectOwnerEmptySlot(self, SlotIndex):
|
||||||
|
|
||||||
|
if False == mouseModule.mouseController.isAttached():
|
||||||
|
return
|
||||||
|
|
||||||
|
if mouseModule.mouseController.IsAttachedMoney():
|
||||||
|
net.SendExchangeElkAddPacket(mouseModule.mouseController.GetAttachedMoneyAmount())
|
||||||
|
else:
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
if (player.SLOT_TYPE_INVENTORY == attachedSlotType
|
||||||
|
or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType):
|
||||||
|
|
||||||
|
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
|
||||||
|
SrcSlotNumber = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
DstSlotNumber = SlotIndex
|
||||||
|
|
||||||
|
itemID = player.GetItemIndex(attachedInvenType, SrcSlotNumber)
|
||||||
|
item.SelectItem(itemID)
|
||||||
|
|
||||||
|
if item.IsAntiFlag(item.ANTIFLAG_GIVE):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.EXCHANGE_CANNOT_GIVE)
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendExchangeItemAddPacket(attachedInvenType, SrcSlotNumber, DstSlotNumber)
|
||||||
|
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def SelectOwnerItemSlot(self, SlotIndex):
|
||||||
|
|
||||||
|
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
|
||||||
|
|
||||||
|
money = mouseModule.mouseController.GetAttachedItemCount()
|
||||||
|
net.SendExchangeElkAddPacket(money)
|
||||||
|
|
||||||
|
def RefreshOwnerSlot(self):
|
||||||
|
for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
|
||||||
|
itemIndex = exchange.GetItemVnumFromSelf(i)
|
||||||
|
itemCount = exchange.GetItemCountFromSelf(i)
|
||||||
|
if 1 == itemCount:
|
||||||
|
itemCount = 0
|
||||||
|
self.OwnerSlot.SetItemSlot(i, itemIndex, itemCount)
|
||||||
|
self.OwnerSlot.RefreshSlot()
|
||||||
|
|
||||||
|
def RefreshTargetSlot(self):
|
||||||
|
for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
|
||||||
|
itemIndex = exchange.GetItemVnumFromTarget(i)
|
||||||
|
itemCount = exchange.GetItemCountFromTarget(i)
|
||||||
|
if 1 == itemCount:
|
||||||
|
itemCount = 0
|
||||||
|
self.TargetSlot.SetItemSlot(i, itemIndex, itemCount)
|
||||||
|
self.TargetSlot.RefreshSlot()
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
|
||||||
|
self.RefreshOwnerSlot()
|
||||||
|
self.RefreshTargetSlot()
|
||||||
|
|
||||||
|
# self.OwnerMoney.SetText(str(exchange.GetElkFromSelf()))
|
||||||
|
# self.TargetMoney.SetText(str(exchange.GetElkFromTarget()))
|
||||||
|
|
||||||
|
self.OwnerMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromSelf())[:i] or str(exchange.GetElkFromSelf())[i-3:i] for i in range(len(str(exchange.GetElkFromSelf()))%3, len(str(exchange.GetElkFromSelf()))+1, 3) if i ]))))
|
||||||
|
self.TargetMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromTarget())[:i] or str(exchange.GetElkFromTarget())[i-3:i] for i in range(len(str(exchange.GetElkFromTarget()))%3, len(str(exchange.GetElkFromTarget()))+1, 3) if i ]))))
|
||||||
|
|
||||||
|
if True == exchange.GetAcceptFromSelf():
|
||||||
|
self.OwnerAcceptLight.Down()
|
||||||
|
else:
|
||||||
|
self.AcceptButton.Enable()
|
||||||
|
self.AcceptButton.SetUp()
|
||||||
|
self.OwnerAcceptLight.SetUp()
|
||||||
|
|
||||||
|
if True == exchange.GetAcceptFromTarget():
|
||||||
|
self.TargetAcceptLight.Down()
|
||||||
|
else:
|
||||||
|
self.TargetAcceptLight.SetUp()
|
||||||
|
|
||||||
|
def OverInOwnerItem(self, slotIndex):
|
||||||
|
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
self.tooltipItem.SetExchangeOwnerItem(slotIndex)
|
||||||
|
|
||||||
|
def OverInTargetItem(self, slotIndex):
|
||||||
|
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
self.tooltipItem.SetExchangeTargetItem(slotIndex)
|
||||||
|
|
||||||
|
def OverOutItem(self):
|
||||||
|
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnTop(self):
|
||||||
|
self.tooltipItem.SetTop()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
USE_EXCHANGE_LIMIT_RANGE = 1000
|
||||||
|
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
if abs(x - self.xStart) > USE_EXCHANGE_LIMIT_RANGE or abs(y - self.yStart) > USE_EXCHANGE_LIMIT_RANGE:
|
||||||
|
(self.xStart, self.yStart, z) = player.GetMainCharacterPosition()
|
||||||
|
net.SendExchangeExitPacket()
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import player
|
||||||
|
import net
|
||||||
|
|
||||||
|
class GameButtonWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadWindow("UIScript/gamewindow.py")
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadWindow(self, filename):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, filename)
|
||||||
|
except Exception, msg:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("GameButtonWindow.LoadScript - %s" % (msg))
|
||||||
|
app.Abort()
|
||||||
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.gameButtonDict={
|
||||||
|
"STATUS" : self.GetChild("StatusPlusButton"),
|
||||||
|
"SKILL" : self.GetChild("SkillPlusButton"),
|
||||||
|
"QUEST" : self.GetChild("QuestButton"),
|
||||||
|
"HELP" : self.GetChild("HelpButton"),
|
||||||
|
"BUILD" : self.GetChild("BuildGuildBuilding"),
|
||||||
|
"EXIT_OBSERVER" : self.GetChild("ExitObserver"),
|
||||||
|
}
|
||||||
|
|
||||||
|
self.gameButtonDict["EXIT_OBSERVER"].SetEvent(ui.__mem_func__(self.__OnClickExitObserver))
|
||||||
|
|
||||||
|
except Exception, msg:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("GameButtonWindow.LoadScript - %s" % (msg))
|
||||||
|
app.Abort()
|
||||||
|
return False
|
||||||
|
|
||||||
|
self.__HideAllGameButton()
|
||||||
|
self.SetObserverMode(player.IsObserverMode())
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
for key in self.gameButtonDict:
|
||||||
|
self.gameButtonDict[key].SetEvent(0)
|
||||||
|
|
||||||
|
self.gameButtonDict={}
|
||||||
|
|
||||||
|
def SetButtonEvent(self, name, event):
|
||||||
|
try:
|
||||||
|
self.gameButtonDict[name].SetEvent(event)
|
||||||
|
except Exception, msg:
|
||||||
|
print "GameButtonWindow.LoadScript - %s" % (msg)
|
||||||
|
app.Abort()
|
||||||
|
return
|
||||||
|
|
||||||
|
def ShowBuildButton(self):
|
||||||
|
self.gameButtonDict["BUILD"].Show()
|
||||||
|
|
||||||
|
def HideBuildButton(self):
|
||||||
|
self.gameButtonDict["BUILD"].Hide()
|
||||||
|
|
||||||
|
def CheckGameButton(self):
|
||||||
|
|
||||||
|
if not self.IsShow():
|
||||||
|
return
|
||||||
|
|
||||||
|
statusPlusButton=self.gameButtonDict["STATUS"]
|
||||||
|
skillPlusButton=self.gameButtonDict["SKILL"]
|
||||||
|
helpButton=self.gameButtonDict["HELP"]
|
||||||
|
|
||||||
|
if player.GetStatus(player.STAT) > 0:
|
||||||
|
statusPlusButton.Show()
|
||||||
|
else:
|
||||||
|
statusPlusButton.Hide()
|
||||||
|
|
||||||
|
if self.__IsSkillStat():
|
||||||
|
skillPlusButton.Show()
|
||||||
|
else:
|
||||||
|
skillPlusButton.Hide()
|
||||||
|
|
||||||
|
if 0 == player.GetPlayTime():
|
||||||
|
helpButton.Show()
|
||||||
|
else:
|
||||||
|
helpButton.Hide()
|
||||||
|
|
||||||
|
def __IsSkillStat(self):
|
||||||
|
if player.GetStatus(player.SKILL_ACTIVE) > 0:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def __OnClickExitObserver(self):
|
||||||
|
net.SendChatPacket("/observer_exit")
|
||||||
|
|
||||||
|
def __HideAllGameButton(self):
|
||||||
|
for btn in self.gameButtonDict.values():
|
||||||
|
btn.Hide()
|
||||||
|
|
||||||
|
def SetObserverMode(self, isEnable):
|
||||||
|
if isEnable:
|
||||||
|
self.gameButtonDict["EXIT_OBSERVER"].Show()
|
||||||
|
else:
|
||||||
|
self.gameButtonDict["EXIT_OBSERVER"].Hide()
|
||||||
@@ -0,0 +1,491 @@
|
|||||||
|
import ui
|
||||||
|
import snd
|
||||||
|
import systemSetting
|
||||||
|
import net
|
||||||
|
import chat
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
import chrmgr
|
||||||
|
import player
|
||||||
|
import uiPrivateShopBuilder # ±èÁØÈ£
|
||||||
|
import interfaceModule # ±èÁØÈ£
|
||||||
|
|
||||||
|
blockMode = 0
|
||||||
|
viewChatMode = 0
|
||||||
|
|
||||||
|
MOBILE = False
|
||||||
|
|
||||||
|
if localeInfo.IsYMIR():
|
||||||
|
MOBILE = True
|
||||||
|
|
||||||
|
|
||||||
|
class OptionDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__Initialize()
|
||||||
|
self.__Load()
|
||||||
|
self.RefreshViewChat()
|
||||||
|
self.RefreshAlwaysShowName()
|
||||||
|
self.RefreshShowDamage()
|
||||||
|
self.RefreshShowSalesText()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print " -------------------------------------- DELETE GAME OPTION DIALOG"
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.titleBar = 0
|
||||||
|
self.nameColorModeButtonList = []
|
||||||
|
self.viewTargetBoardButtonList = []
|
||||||
|
self.pvpModeButtonDict = {}
|
||||||
|
self.blockButtonList = []
|
||||||
|
self.viewChatButtonList = []
|
||||||
|
self.alwaysShowNameButtonList = []
|
||||||
|
self.showDamageButtonList = []
|
||||||
|
self.showsalesTextButtonList = []
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
print " -------------------------------------- DESTROY GAME OPTION DIALOG"
|
||||||
|
|
||||||
|
def __Load_LoadScript(self, fileName):
|
||||||
|
try:
|
||||||
|
pyScriptLoader = ui.PythonScriptLoader()
|
||||||
|
pyScriptLoader.LoadScriptFile(self, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("OptionDialog.__Load_LoadScript")
|
||||||
|
|
||||||
|
def __Load_BindObject(self):
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.titleBar = GetObject("titlebar")
|
||||||
|
self.nameColorModeButtonList.append(GetObject("name_color_normal"))
|
||||||
|
self.nameColorModeButtonList.append(GetObject("name_color_empire"))
|
||||||
|
self.viewTargetBoardButtonList.append(GetObject("target_board_no_view"))
|
||||||
|
self.viewTargetBoardButtonList.append(GetObject("target_board_view"))
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_PEACE] = GetObject("pvp_peace")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_REVENGE] = GetObject("pvp_revenge")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_GUILD] = GetObject("pvp_guild")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_FREE] = GetObject("pvp_free")
|
||||||
|
self.blockButtonList.append(GetObject("block_exchange_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_party_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_guild_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_whisper_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_friend_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_party_request_button"))
|
||||||
|
self.viewChatButtonList.append(GetObject("view_chat_on_button"))
|
||||||
|
self.viewChatButtonList.append(GetObject("view_chat_off_button"))
|
||||||
|
self.alwaysShowNameButtonList.append(GetObject("always_show_name_on_button"))
|
||||||
|
self.alwaysShowNameButtonList.append(GetObject("always_show_name_off_button"))
|
||||||
|
self.showDamageButtonList.append(GetObject("show_damage_on_button"))
|
||||||
|
self.showDamageButtonList.append(GetObject("show_damage_off_button"))
|
||||||
|
self.showsalesTextButtonList.append(GetObject("salestext_on_button"))
|
||||||
|
self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
|
||||||
|
|
||||||
|
global MOBILE
|
||||||
|
if MOBILE:
|
||||||
|
self.inputMobileButton = GetObject("input_mobile_button")
|
||||||
|
self.deleteMobileButton = GetObject("delete_mobile_button")
|
||||||
|
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("OptionDialog.__Load_BindObject")
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
global MOBILE
|
||||||
|
if MOBILE:
|
||||||
|
self.__Load_LoadScript("uiscript/gameoptiondialog_formobile.py")
|
||||||
|
else:
|
||||||
|
self.__Load_LoadScript("uiscript/gameoptiondialog.py")
|
||||||
|
|
||||||
|
self.__Load_BindObject()
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.nameColorModeButtonList[0].SAFE_SetEvent(self.__OnClickNameColorModeNormalButton)
|
||||||
|
self.nameColorModeButtonList[1].SAFE_SetEvent(self.__OnClickNameColorModeEmpireButton)
|
||||||
|
|
||||||
|
self.viewTargetBoardButtonList[0].SAFE_SetEvent(self.__OnClickTargetBoardViewButton)
|
||||||
|
self.viewTargetBoardButtonList[1].SAFE_SetEvent(self.__OnClickTargetBoardNoViewButton)
|
||||||
|
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent(self.__OnClickPvPModePeaceButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent(self.__OnClickPvPModeRevengeButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent(self.__OnClickPvPModeGuildButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent(self.__OnClickPvPModeFreeButton)
|
||||||
|
|
||||||
|
self.blockButtonList[0].SetToggleUpEvent(self.__OnClickBlockExchangeButton)
|
||||||
|
self.blockButtonList[1].SetToggleUpEvent(self.__OnClickBlockPartyButton)
|
||||||
|
self.blockButtonList[2].SetToggleUpEvent(self.__OnClickBlockGuildButton)
|
||||||
|
self.blockButtonList[3].SetToggleUpEvent(self.__OnClickBlockWhisperButton)
|
||||||
|
self.blockButtonList[4].SetToggleUpEvent(self.__OnClickBlockFriendButton)
|
||||||
|
self.blockButtonList[5].SetToggleUpEvent(self.__OnClickBlockPartyRequest)
|
||||||
|
|
||||||
|
self.blockButtonList[0].SetToggleDownEvent(self.__OnClickBlockExchangeButton)
|
||||||
|
self.blockButtonList[1].SetToggleDownEvent(self.__OnClickBlockPartyButton)
|
||||||
|
self.blockButtonList[2].SetToggleDownEvent(self.__OnClickBlockGuildButton)
|
||||||
|
self.blockButtonList[3].SetToggleDownEvent(self.__OnClickBlockWhisperButton)
|
||||||
|
self.blockButtonList[4].SetToggleDownEvent(self.__OnClickBlockFriendButton)
|
||||||
|
self.blockButtonList[5].SetToggleDownEvent(self.__OnClickBlockPartyRequest)
|
||||||
|
|
||||||
|
self.viewChatButtonList[0].SAFE_SetEvent(self.__OnClickViewChatOnButton)
|
||||||
|
self.viewChatButtonList[1].SAFE_SetEvent(self.__OnClickViewChatOffButton)
|
||||||
|
|
||||||
|
self.alwaysShowNameButtonList[0].SAFE_SetEvent(self.__OnClickAlwaysShowNameOnButton)
|
||||||
|
self.alwaysShowNameButtonList[1].SAFE_SetEvent(self.__OnClickAlwaysShowNameOffButton)
|
||||||
|
|
||||||
|
self.showDamageButtonList[0].SAFE_SetEvent(self.__OnClickShowDamageOnButton)
|
||||||
|
self.showDamageButtonList[1].SAFE_SetEvent(self.__OnClickShowDamageOffButton)
|
||||||
|
|
||||||
|
self.showsalesTextButtonList[0].SAFE_SetEvent(self.__OnClickSalesTextOnButton)
|
||||||
|
self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)
|
||||||
|
|
||||||
|
self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX())
|
||||||
|
self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD())
|
||||||
|
self.__SetPeacePKMode()
|
||||||
|
|
||||||
|
#global MOBILE
|
||||||
|
if MOBILE:
|
||||||
|
self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber))
|
||||||
|
self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
|
||||||
|
|
||||||
|
def __ClickRadioButton(self, buttonList, buttonIndex):
|
||||||
|
try:
|
||||||
|
selButton=buttonList[buttonIndex]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
|
for eachButton in buttonList:
|
||||||
|
eachButton.SetUp()
|
||||||
|
|
||||||
|
selButton.Down()
|
||||||
|
|
||||||
|
def __SetNameColorMode(self, index):
|
||||||
|
constInfo.SET_CHRNAME_COLOR_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.nameColorModeButtonList, index)
|
||||||
|
|
||||||
|
def __SetTargetBoardViewMode(self, flag):
|
||||||
|
constInfo.SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(flag)
|
||||||
|
self.__ClickRadioButton(self.viewTargetBoardButtonList, flag)
|
||||||
|
|
||||||
|
def __OnClickNameColorModeNormalButton(self):
|
||||||
|
self.__SetNameColorMode(0)
|
||||||
|
|
||||||
|
def __OnClickNameColorModeEmpireButton(self):
|
||||||
|
self.__SetNameColorMode(1)
|
||||||
|
|
||||||
|
def __OnClickTargetBoardViewButton(self):
|
||||||
|
self.__SetTargetBoardViewMode(0)
|
||||||
|
|
||||||
|
def __OnClickTargetBoardNoViewButton(self):
|
||||||
|
self.__SetTargetBoardViewMode(1)
|
||||||
|
|
||||||
|
def __OnClickCameraModeShortButton(self):
|
||||||
|
self.__SetCameraMode(0)
|
||||||
|
|
||||||
|
def __OnClickCameraModeLongButton(self):
|
||||||
|
self.__SetCameraMode(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel0Button(self):
|
||||||
|
self.__SetFogLevel(0)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel1Button(self):
|
||||||
|
self.__SetFogLevel(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel2Button(self):
|
||||||
|
self.__SetFogLevel(2)
|
||||||
|
|
||||||
|
def __OnClickBlockExchangeButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_EXCHANGE))
|
||||||
|
def __OnClickBlockPartyButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_PARTY))
|
||||||
|
def __OnClickBlockGuildButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_GUILD))
|
||||||
|
def __OnClickBlockWhisperButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_WHISPER))
|
||||||
|
def __OnClickBlockFriendButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_FRIEND))
|
||||||
|
def __OnClickBlockPartyRequest(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_PARTY_REQUEST))
|
||||||
|
|
||||||
|
def __OnClickViewChatOnButton(self):
|
||||||
|
global viewChatMode
|
||||||
|
viewChatMode = 1
|
||||||
|
systemSetting.SetViewChatFlag(viewChatMode)
|
||||||
|
self.RefreshViewChat()
|
||||||
|
def __OnClickViewChatOffButton(self):
|
||||||
|
global viewChatMode
|
||||||
|
viewChatMode = 0
|
||||||
|
systemSetting.SetViewChatFlag(viewChatMode)
|
||||||
|
self.RefreshViewChat()
|
||||||
|
|
||||||
|
def __OnClickAlwaysShowNameOnButton(self):
|
||||||
|
systemSetting.SetAlwaysShowNameFlag(True)
|
||||||
|
self.RefreshAlwaysShowName()
|
||||||
|
|
||||||
|
def __OnClickAlwaysShowNameOffButton(self):
|
||||||
|
systemSetting.SetAlwaysShowNameFlag(False)
|
||||||
|
self.RefreshAlwaysShowName()
|
||||||
|
|
||||||
|
def __OnClickShowDamageOnButton(self):
|
||||||
|
systemSetting.SetShowDamageFlag(True)
|
||||||
|
self.RefreshShowDamage()
|
||||||
|
|
||||||
|
def __OnClickShowDamageOffButton(self):
|
||||||
|
systemSetting.SetShowDamageFlag(False)
|
||||||
|
self.RefreshShowDamage()
|
||||||
|
|
||||||
|
def __OnClickSalesTextOnButton(self):
|
||||||
|
systemSetting.SetShowSalesTextFlag(True)
|
||||||
|
self.RefreshShowSalesText()
|
||||||
|
uiPrivateShopBuilder.UpdateADBoard()
|
||||||
|
|
||||||
|
def __OnClickSalesTextOffButton(self):
|
||||||
|
systemSetting.SetShowSalesTextFlag(False)
|
||||||
|
self.RefreshShowSalesText()
|
||||||
|
|
||||||
|
def __CheckPvPProtectedLevelPlayer(self):
|
||||||
|
if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
|
||||||
|
self.__SetPeacePKMode()
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def __SetPKMode(self, mode):
|
||||||
|
for btn in self.pvpModeButtonDict.values():
|
||||||
|
btn.SetUp()
|
||||||
|
if self.pvpModeButtonDict.has_key(mode):
|
||||||
|
self.pvpModeButtonDict[mode].Down()
|
||||||
|
|
||||||
|
def __SetPeacePKMode(self):
|
||||||
|
self.__SetPKMode(player.PK_MODE_PEACE)
|
||||||
|
|
||||||
|
def __RefreshPVPButtonList(self):
|
||||||
|
self.__SetPKMode(player.GetPKMode())
|
||||||
|
|
||||||
|
def __OnClickPvPModePeaceButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 0", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeRevengeButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 1", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeFreeButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeGuildButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if 0 == player.GetGuildID():
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
|
||||||
|
return
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 4", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def OnChangePKMode(self):
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
def __OnChangeMobilePhoneNumber(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
inputDialog = uiCommon.InputDialog()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_TITLE)
|
||||||
|
inputDialog.SetMaxLength(13)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobilePhoneNumber))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
|
||||||
|
def __OnDeleteMobilePhoneNumber(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
questionDialog = uiCommon.QuestionDialog()
|
||||||
|
questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE_PHONE_NUMBER)
|
||||||
|
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeleteMobile))
|
||||||
|
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||||
|
questionDialog.Open()
|
||||||
|
self.questionDialog = questionDialog
|
||||||
|
|
||||||
|
def OnInputMobilePhoneNumber(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return
|
||||||
|
|
||||||
|
text.replace('-', '')
|
||||||
|
net.SendChatPacket("/mobile " + text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnInputMobileAuthorityCode(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
net.SendChatPacket("/mobile_auth " + text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnDeleteMobile(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendChatPacket("/mobile")
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseInputDialog(self):
|
||||||
|
self.inputDialog.Close()
|
||||||
|
self.inputDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseQuestionDialog(self):
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def RefreshMobile(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
if player.HasMobilePhoneNumber():
|
||||||
|
self.inputMobileButton.Hide()
|
||||||
|
self.deleteMobileButton.Show()
|
||||||
|
else:
|
||||||
|
self.inputMobileButton.Show()
|
||||||
|
self.deleteMobileButton.Hide()
|
||||||
|
|
||||||
|
def OnMobileAuthority(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
inputDialog = uiCommon.InputDialogWithDescription()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_TITLE)
|
||||||
|
inputDialog.SetDescription(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_DESCRIPTION)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileAuthorityCode))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.SetMaxLength(4)
|
||||||
|
inputDialog.SetBoardWidth(310)
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
|
||||||
|
def RefreshBlock(self):
|
||||||
|
global blockMode
|
||||||
|
for i in xrange(len(self.blockButtonList)):
|
||||||
|
if 0 != (blockMode & (1 << i)):
|
||||||
|
self.blockButtonList[i].Down()
|
||||||
|
else:
|
||||||
|
self.blockButtonList[i].SetUp()
|
||||||
|
|
||||||
|
def RefreshViewChat(self):
|
||||||
|
if systemSetting.IsViewChat():
|
||||||
|
self.viewChatButtonList[0].Down()
|
||||||
|
self.viewChatButtonList[1].SetUp()
|
||||||
|
else:
|
||||||
|
self.viewChatButtonList[0].SetUp()
|
||||||
|
self.viewChatButtonList[1].Down()
|
||||||
|
|
||||||
|
def RefreshAlwaysShowName(self):
|
||||||
|
if systemSetting.IsAlwaysShowName():
|
||||||
|
self.alwaysShowNameButtonList[0].Down()
|
||||||
|
self.alwaysShowNameButtonList[1].SetUp()
|
||||||
|
else:
|
||||||
|
self.alwaysShowNameButtonList[0].SetUp()
|
||||||
|
self.alwaysShowNameButtonList[1].Down()
|
||||||
|
|
||||||
|
def RefreshShowDamage(self):
|
||||||
|
if systemSetting.IsShowDamage():
|
||||||
|
self.showDamageButtonList[0].Down()
|
||||||
|
self.showDamageButtonList[1].SetUp()
|
||||||
|
else:
|
||||||
|
self.showDamageButtonList[0].SetUp()
|
||||||
|
self.showDamageButtonList[1].Down()
|
||||||
|
|
||||||
|
def RefreshShowSalesText(self):
|
||||||
|
if systemSetting.IsShowSalesText():
|
||||||
|
self.showsalesTextButtonList[0].Down()
|
||||||
|
self.showsalesTextButtonList[1].SetUp()
|
||||||
|
else:
|
||||||
|
self.showsalesTextButtonList[0].SetUp()
|
||||||
|
self.showsalesTextButtonList[1].Down()
|
||||||
|
|
||||||
|
def OnBlockMode(self, mode):
|
||||||
|
global blockMode
|
||||||
|
blockMode = mode
|
||||||
|
self.RefreshBlock()
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
self.RefreshMobile()
|
||||||
|
self.RefreshBlock()
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
+2953
File diff suppressed because it is too large
Load Diff
+140
@@ -0,0 +1,140 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
ENABLE_HELP_MULTIPAGE = 0
|
||||||
|
|
||||||
|
class HelpWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self, "TOP_MOST")
|
||||||
|
self.eventClose = 0
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
if ENABLE_HELP_MULTIPAGE:
|
||||||
|
self.LoadDialogMultiPage()
|
||||||
|
else:
|
||||||
|
self.LoadDialogSinglePage()
|
||||||
|
|
||||||
|
def LoadDialogSinglePage(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "HelpWindow.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/HelpWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("HelpWindow.LoadDialogSinglePage.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.btnClose = GetObject("close_button")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("DialogWindow.LoadDialogSinglePage.BindObject")
|
||||||
|
|
||||||
|
|
||||||
|
def LoadDialogMultiPage(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/HelpWindow2.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("HelpWindow.LoadDialogMultiPage.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.btnClose = GetObject("close_button")
|
||||||
|
self.pages = {}
|
||||||
|
self.btnPages = {}
|
||||||
|
self.pages[0] = GetObject("page_1")
|
||||||
|
self.pages[1] = GetObject("page_2")
|
||||||
|
self.btnPages[0] = GetObject("page_1_button")
|
||||||
|
self.btnPages[1] = GetObject("page_2_button")
|
||||||
|
self.btnPages[0].SAFE_SetEvent(self.__OnClickPage1)
|
||||||
|
self.btnPages[1].SAFE_SetEvent(self.__OnClickPage2)
|
||||||
|
|
||||||
|
self.__SelectPage(0)
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("DialogWindow.LoadDialogMultiPage.BindObject")
|
||||||
|
|
||||||
|
def __OnClickPage1(self):
|
||||||
|
self.__SelectPage(0)
|
||||||
|
|
||||||
|
def __OnClickPage2(self):
|
||||||
|
self.__SelectPage(1)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.eventClose = 0
|
||||||
|
self.closeButton = 0
|
||||||
|
self.pages = {}
|
||||||
|
self.btnPages = {}
|
||||||
|
|
||||||
|
def SetCloseEvent(self, event):
|
||||||
|
self.eventClose = event
|
||||||
|
self.btnClose.SetEvent(event)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.Lock()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Unlock()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnKeyDown(self, key):
|
||||||
|
if app.DIK_H == key and 0 != self.eventClose:
|
||||||
|
self.eventClose()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnIMEReturn(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
if 0 != self.eventClose:
|
||||||
|
self.eventClose()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
if 0 != self.eventClose:
|
||||||
|
self.eventClose()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def __SelectPage(self, pageIndex):
|
||||||
|
for page in self.pages.values():
|
||||||
|
page.Hide()
|
||||||
|
for btn in self.btnPages.values():
|
||||||
|
btn.SetUp()
|
||||||
|
|
||||||
|
self.pages[pageIndex].Show()
|
||||||
|
self.btnPages[pageIndex].Down()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
wnd = HelpWindow()
|
||||||
|
wnd.LoadDialog()
|
||||||
|
wnd.Open()
|
||||||
|
app.Loop()
|
||||||
|
wnd = None
|
||||||
|
|
||||||
+1205
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,284 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
LOCALE_PATH = uiScriptLocale.MAPNAME_PATH
|
||||||
|
|
||||||
|
class MapNameShower(ui.ExpandedImageBox):
|
||||||
|
|
||||||
|
MAP_NAME_IMAGE = {}
|
||||||
|
|
||||||
|
STATE_HIDE = 0
|
||||||
|
STATE_FADE_IN = 1
|
||||||
|
STATE_SHOW = 2
|
||||||
|
STATE_FADE_OUT = 3
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.MAP_NAME_IMAGE = {
|
||||||
|
"metin2_map_a1" : LOCALE_PATH+"a1.tga",
|
||||||
|
"map_a2" : LOCALE_PATH+"a2.tga",
|
||||||
|
"season2/metin2_map_a2_1": LOCALE_PATH+"a2_2.tga",
|
||||||
|
"metin2_map_a3" : LOCALE_PATH+"a3.tga",
|
||||||
|
"metin2_map_b1" : LOCALE_PATH+"b1.tga",
|
||||||
|
"map_b2" : LOCALE_PATH+"b2.tga",
|
||||||
|
"metin2_map_b3" : LOCALE_PATH+"b3.tga",
|
||||||
|
"metin2_map_c1" : LOCALE_PATH+"c1.tga",
|
||||||
|
"map_c2" : LOCALE_PATH+"c2.tga",
|
||||||
|
"metin2_map_c3" : LOCALE_PATH+"c3.tga",
|
||||||
|
"metin2_map_deviltower1" : LOCALE_PATH+"devil1_title.tga",
|
||||||
|
"metin2_map_n_desert_01" : LOCALE_PATH+"desert1.tga",
|
||||||
|
"season2/metin2_map_n_desert_02": LOCALE_PATH+"desert2.tga",
|
||||||
|
"metin2_map_n_flame_01" : LOCALE_PATH+"frame1.tga",
|
||||||
|
"season2/metin2_map_n_flame_02": LOCALE_PATH+"frame2.tga",
|
||||||
|
"metin2_map_milgyo" : LOCALE_PATH+"milgyo.tga",
|
||||||
|
"season2/metin2_map_milgyo_a": LOCALE_PATH+"milgyo2.TGA",
|
||||||
|
"metin2_map_monkeydungeon" : LOCALE_PATH+"monkey1.tga",
|
||||||
|
"metin2_map_monkeydungeon_02" : LOCALE_PATH+"monkey2.tga",
|
||||||
|
"metin2_map_monkeydungeon_03" : LOCALE_PATH+"monkey3.tga",
|
||||||
|
"metin2_map_guild_01" : LOCALE_PATH+"guild1.tga",
|
||||||
|
"metin2_map_guild_02" : LOCALE_PATH+"guild2.tga",
|
||||||
|
"metin2_map_guild_03" : LOCALE_PATH+"guild3.tga",
|
||||||
|
"season2/metin2_map_skipia_dungeon_01": LOCALE_PATH+"skipia.tga",
|
||||||
|
"season2/metin2_map_skipia_dungeon_02": LOCALE_PATH+"skipia.tga",
|
||||||
|
"map_n_snowm_01" : LOCALE_PATH+"snow1.tga",
|
||||||
|
"season2/map_n_snowm_02": LOCALE_PATH+"snow2.tga",
|
||||||
|
"metin2_map_spiderdungeon" : LOCALE_PATH+"spider1.tga",
|
||||||
|
"metin2_map_trent" : LOCALE_PATH+"trent.tga",
|
||||||
|
"metin2_map_trent02" : LOCALE_PATH+"trent02.tga",
|
||||||
|
"season2/metin2_map_trent_a": LOCALE_PATH+"trent_a.tga",
|
||||||
|
"season2/metin2_map_trent02_a": LOCALE_PATH+"trent02_a.tga",
|
||||||
|
"metin2_map_dd" : LOCALE_PATH+"devil_basement.tga",
|
||||||
|
"metin2_map_devilsCatacomb" : LOCALE_PATH+"devil_basement.tga",
|
||||||
|
"metin2_map_dd" : LOCALE_PATH+"devil_basement.tga",
|
||||||
|
"season1/metin2_map_WL_01" : LOCALE_PATH+"wl.tga",
|
||||||
|
"season1/metin2_map_nusluck01": LOCALE_PATH+"nusluck.tga",
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
self.MAP_NAME_IMAGE = {
|
||||||
|
"metin2_map_a1" : LOCALE_PATH+"a1.tga",
|
||||||
|
"map_a2" : LOCALE_PATH+"a2.tga",
|
||||||
|
"metin2_map_a3" : LOCALE_PATH+"a3.tga",
|
||||||
|
"metin2_map_b1" : LOCALE_PATH+"b1.tga",
|
||||||
|
"map_b2" : LOCALE_PATH+"b2.tga",
|
||||||
|
"metin2_map_b3" : LOCALE_PATH+"b3.tga",
|
||||||
|
"metin2_map_c1" : LOCALE_PATH+"c1.tga",
|
||||||
|
"map_c2" : LOCALE_PATH+"c2.tga",
|
||||||
|
"metin2_map_c3" : LOCALE_PATH+"c3.tga",
|
||||||
|
"map_n_snowm_01" : LOCALE_PATH+"snow1.tga",
|
||||||
|
"metin2_map_deviltower1" : LOCALE_PATH+"devil1_title.tga",
|
||||||
|
"metin2_map_n_flame_01" : LOCALE_PATH+"frame1.tga",
|
||||||
|
"metin2_map_n_desert_01" : LOCALE_PATH+"desert1.tga",
|
||||||
|
"metin2_map_milgyo" : LOCALE_PATH+"milgyo.tga",
|
||||||
|
"metin2_map_monkeydungeon" : LOCALE_PATH+"monkey1.tga",
|
||||||
|
"metin2_map_monkeydungeon_02" : LOCALE_PATH+"monkey2.tga",
|
||||||
|
"metin2_map_monkeydungeon_03" : LOCALE_PATH+"monkey3.tga",
|
||||||
|
"metin2_map_guild_01" : LOCALE_PATH+"guild1.tga",
|
||||||
|
"metin2_map_guild_02" : LOCALE_PATH+"guild2.tga",
|
||||||
|
"metin2_map_guild_03" : LOCALE_PATH+"guild3.tga",
|
||||||
|
"metin2_map_trent" : LOCALE_PATH+"trent.tga",
|
||||||
|
"metin2_map_trent02" : LOCALE_PATH+"trent02.tga",
|
||||||
|
"season2/map_n_snowm_02": LOCALE_PATH+"snow2.tga",
|
||||||
|
"season2/metin2_map_a2_1": LOCALE_PATH+"a2_2.tga",
|
||||||
|
"season2/metin2_map_n_desert_02": LOCALE_PATH+"desert2.tga",
|
||||||
|
"season2/metin2_map_n_flame_02": LOCALE_PATH+"frame2.tga",
|
||||||
|
"season2/metin2_map_milgyo_a": LOCALE_PATH+"milgyo2.TGA",
|
||||||
|
"season2/metin2_map_trent_a": LOCALE_PATH+"trent_a.tga",
|
||||||
|
"season2/metin2_map_trent02_a": LOCALE_PATH+"trent02_a.tga",
|
||||||
|
"season2/metin2_map_skipia_dungeon_01": LOCALE_PATH+"skipia.tga",
|
||||||
|
"season2/metin2_map_skipia_dungeon_02": LOCALE_PATH+"skipia.tga",
|
||||||
|
"metin2_map_devilsCatacomb" : LOCALE_PATH+"devil_basement.tga",
|
||||||
|
"metin2_guild_village_01" : LOCALE_PATH+"a4.tga",
|
||||||
|
"metin2_guild_village_02" : LOCALE_PATH+"b4.tga",
|
||||||
|
"metin2_guild_village_03" : LOCALE_PATH+"c4.tga",
|
||||||
|
"metin2_map_BayBlackSand" : LOCALE_PATH+"bay.tga",
|
||||||
|
"metin2_map_Mt_Thunder" : LOCALE_PATH+"thunder.tga",
|
||||||
|
"metin2_map_dawnmistwood" : LOCALE_PATH+"dawn.tga",
|
||||||
|
"Metin2_map_CapeDragonHead" : LOCALE_PATH+"cape.tga",
|
||||||
|
"metin2_map_spiderdungeon" : LOCALE_PATH+"spider1.tga",
|
||||||
|
"metin2_map_spiderdungeon_02" : LOCALE_PATH+"spider1.tga",
|
||||||
|
"metin2_map_spiderdungeon_03" : LOCALE_PATH+"spider1.tga",
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.ExpandedImageBox.__init__(self, "TOP_MOST")
|
||||||
|
self.AddFlag("not_pick")
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ExpandedImageBox.__del__(self)
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.floorImage = None
|
||||||
|
self.objectiveImage = None
|
||||||
|
self.fadeStartTime = 0
|
||||||
|
self.state = self.STATE_HIDE
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.SetAlpha(0.0)
|
||||||
|
self.SetWindowHorizontalAlignCenter()
|
||||||
|
self.SetPosition(0, 80)
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __GetDevilTowerFloor(self, x, y):
|
||||||
|
if x > 10000 and y > 58000 and x < 25000 and y < 72000:
|
||||||
|
return 1
|
||||||
|
elif x > 10000 and y > 35000 and x < 25000 and y < 50000:
|
||||||
|
return 2
|
||||||
|
elif x > 10000 and y > 10000 and x < 25000 and y < 25000:
|
||||||
|
return 3
|
||||||
|
elif x > 35000 and y > 61000 and x < 43500 and y < 70500:
|
||||||
|
return 4
|
||||||
|
elif x > 35000 and y > 38000 and x < 43500 and y < 48000:
|
||||||
|
return 5
|
||||||
|
elif x > 14000 and y > 14000 and x < 43500 and y < 24500:
|
||||||
|
return 6
|
||||||
|
elif x > 56000 and y > 60000 and x < 68000 and y < 73000:
|
||||||
|
return 7
|
||||||
|
elif x > 56000 and y > 38000 and x < 68000 and y < 49000:
|
||||||
|
return 8
|
||||||
|
elif x > 56000 and y > 13000 and x < 68000 and y < 23000:
|
||||||
|
return 9
|
||||||
|
return 0
|
||||||
|
def __GetDevilBase(self, x, y):
|
||||||
|
if x > 3000 and y > 4500 and x < 45000 and y < 45000:
|
||||||
|
return 1
|
||||||
|
elif x > 54000 and y > 3900 and x < 100000 and y < 46200:
|
||||||
|
return 2
|
||||||
|
elif x > 104800 and y > 3500 and x < 145500 and y < 45800:
|
||||||
|
return 3
|
||||||
|
elif x > 3100 and y > 54100 and x < 56400 and y < 105800:
|
||||||
|
return 4
|
||||||
|
elif x > 65000 and y > 54000 and x < 105000 and y < 95500:
|
||||||
|
return 5
|
||||||
|
elif x > 117500 and y > 57600 and x < 142000 and y < 81000:
|
||||||
|
return 6
|
||||||
|
elif x > 5000 and y > 104900 and x < 15000 and y < 122000:
|
||||||
|
return 7
|
||||||
|
return 0
|
||||||
|
def ShowMapName(self, mapName, x, y):
|
||||||
|
if not self.MAP_NAME_IMAGE.has_key(mapName):
|
||||||
|
print " [ERROR] - There is no map name image", mapName
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.LoadImage(self.MAP_NAME_IMAGE[mapName])
|
||||||
|
except RuntimeError:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
if mapName == "metin2_map_deviltower1":
|
||||||
|
self.SetPosition(-60, 80)
|
||||||
|
|
||||||
|
self.floorImage = ui.ExpandedImageBox()
|
||||||
|
self.floorImage.AddFlag("not_pick")
|
||||||
|
self.floorImage.SetWindowHorizontalAlignCenter()
|
||||||
|
self.floorImage.SetPosition(100, 80)
|
||||||
|
self.floorImage.SetAlpha(0.0)
|
||||||
|
self.floorImage.Show()
|
||||||
|
# 맵이름 (ex: 아귀동굴) 이미지 로딩 & 표시
|
||||||
|
try:
|
||||||
|
floor = self.__GetDevilTowerFloor(x, y)
|
||||||
|
print x, y, floor
|
||||||
|
self.floorImage.LoadImage(LOCALE_PATH+"devil1_%df.tga" % floor)
|
||||||
|
except RuntimeError:
|
||||||
|
self.SetPosition(0, 80)
|
||||||
|
self.floorImage.Hide()
|
||||||
|
self.floorImage = None
|
||||||
|
|
||||||
|
if localeInfo.IsYMIR() or localeInfo.IsWE_KOREA():
|
||||||
|
self.objectiveImage = ui.ExpandedImageBox()
|
||||||
|
self.objectiveImage.AddFlag("not_pick")
|
||||||
|
self.objectiveImage.SetWindowHorizontalAlignCenter()
|
||||||
|
self.objectiveImage.SetPosition(0, 200)
|
||||||
|
self.objectiveImage.SetAlpha(0.0)
|
||||||
|
self.objectiveImage.Show()
|
||||||
|
|
||||||
|
# 층별 목표 이미지 로딩 & 표시
|
||||||
|
# 던전은 현재 몇층인지 알아오는 부분 때문에 하드코딩을 피하기가 힘들다...
|
||||||
|
try:
|
||||||
|
floor = self.__GetDevilTowerFloor(x, y)
|
||||||
|
print x, y, floor
|
||||||
|
self.objectiveImage.LoadImage(LOCALE_PATH + mapName + "/obj_%02df.tga" % floor)
|
||||||
|
except RuntimeError:
|
||||||
|
self.SetPosition(0, 80)
|
||||||
|
self.objectiveImage.Hide()
|
||||||
|
self.objectiveImage = None
|
||||||
|
|
||||||
|
if mapName == "metin2_map_devilsCatacomb":
|
||||||
|
self.SetPosition(-75, 80)
|
||||||
|
|
||||||
|
self.floorImage = ui.ExpandedImageBox()
|
||||||
|
self.floorImage.AddFlag("not_pick")
|
||||||
|
self.floorImage.SetWindowHorizontalAlignCenter()
|
||||||
|
self.floorImage.SetPosition(100, 80)
|
||||||
|
self.floorImage.SetAlpha(0.0)
|
||||||
|
self.floorImage.Show()
|
||||||
|
|
||||||
|
# 맵이름 (ex: 아귀동굴) 이미지 로딩 & 표시
|
||||||
|
try:
|
||||||
|
floor = self.__GetDevilBase(x, y)
|
||||||
|
print x, y, floor
|
||||||
|
self.floorImage.LoadImage(LOCALE_PATH+"devil1_%df.tga" % floor)
|
||||||
|
except RuntimeError:
|
||||||
|
self.SetPosition(0, 80)
|
||||||
|
self.floorImage.Hide()
|
||||||
|
self.floorImage = None
|
||||||
|
if localeInfo.IsYMIR() or localeInfo.IsWE_KOREA():
|
||||||
|
self.objectiveImage = ui.ExpandedImageBox()
|
||||||
|
self.objectiveImage.AddFlag("not_pick")
|
||||||
|
self.objectiveImage.SetWindowHorizontalAlignCenter()
|
||||||
|
self.objectiveImage.SetPosition(0, 200)
|
||||||
|
self.objectiveImage.SetAlpha(0.0)
|
||||||
|
self.objectiveImage.Show()
|
||||||
|
|
||||||
|
|
||||||
|
# 층별 목표 이미지 로딩 & 표시
|
||||||
|
# 던전은 현재 몇층인지 알아오는 부분 때문에 하드코딩을 피하기가 힘들다...
|
||||||
|
try:
|
||||||
|
floor = self.__GetDevilBase(x, y)
|
||||||
|
print x, y, floor
|
||||||
|
self.objectiveImage.LoadImage(LOCALE_PATH + mapName + "/obj_%02df.tga" % floor)
|
||||||
|
except RuntimeError:
|
||||||
|
self.SetPosition(0, 80)
|
||||||
|
self.objectiveImage.Hide()
|
||||||
|
self.objectiveImage = None
|
||||||
|
|
||||||
|
self.state = self.STATE_FADE_IN
|
||||||
|
self.fadeStartTime = app.GetTime() + 1.0
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Update(self):
|
||||||
|
|
||||||
|
self.SetAlpha(self.curAlpha)
|
||||||
|
if self.floorImage:
|
||||||
|
self.floorImage.SetAlpha(self.curAlpha)
|
||||||
|
|
||||||
|
if self.objectiveImage:
|
||||||
|
self.objectiveImage.SetAlpha(self.curAlpha)
|
||||||
|
|
||||||
|
if self.STATE_FADE_IN == self.state:
|
||||||
|
if app.GetTime() > self.fadeStartTime:
|
||||||
|
self.curAlpha += 0.05
|
||||||
|
|
||||||
|
if self.curAlpha > 0.9:
|
||||||
|
self.state = self.STATE_SHOW
|
||||||
|
self.fadeStartTime = app.GetTime() + 5.0
|
||||||
|
|
||||||
|
elif self.STATE_SHOW == self.state:
|
||||||
|
if app.GetTime() > self.fadeStartTime:
|
||||||
|
self.state = self.STATE_FADE_OUT
|
||||||
|
|
||||||
|
elif self.STATE_FADE_OUT == self.state:
|
||||||
|
self.curAlpha -= 0.05
|
||||||
|
|
||||||
|
if self.curAlpha < 0.0001:
|
||||||
|
self.Hide()
|
||||||
|
if self.floorImage:
|
||||||
|
self.floorImage.Hide()
|
||||||
|
self.floorImage = None
|
||||||
|
|
||||||
|
if self.objectiveImage:
|
||||||
|
self.objectiveImage.Hide()
|
||||||
|
self.objectiveImage = None
|
||||||
|
return
|
||||||
@@ -0,0 +1,854 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import grp
|
||||||
|
import net
|
||||||
|
import guild
|
||||||
|
import messenger
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
import uiToolTip
|
||||||
|
import uiGameOption
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
from _weakref import proxy
|
||||||
|
|
||||||
|
FRIEND = 0
|
||||||
|
GUILD = 1
|
||||||
|
|
||||||
|
class MessengerItem(ui.Window):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
self.SetParent(getParentEvent())
|
||||||
|
self.AddFlag("float")
|
||||||
|
|
||||||
|
self.name = ""
|
||||||
|
self.image = ui.ImageBox()
|
||||||
|
self.image.AddFlag("not_pick")
|
||||||
|
self.image.SetParent(self)
|
||||||
|
self.image.Show()
|
||||||
|
self.text = ui.TextLine()
|
||||||
|
self.text.SetParent(self)
|
||||||
|
self.text.SetPosition(20, 2)
|
||||||
|
self.text.Show()
|
||||||
|
|
||||||
|
self.lovePoint = -1
|
||||||
|
self.lovePointToolTip = None
|
||||||
|
|
||||||
|
self.isSelected = False
|
||||||
|
|
||||||
|
self.getParentEvent = getParentEvent
|
||||||
|
|
||||||
|
def SetName(self, name):
|
||||||
|
self.name = name
|
||||||
|
if name:
|
||||||
|
self.text.SetText(name)
|
||||||
|
self.SetSize(20 + 6*len(name) + 4, 16)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.text.SetPosition(20 + 6*len(name) + 4, 2)
|
||||||
|
|
||||||
|
def SetLovePoint(self, lovePoint):
|
||||||
|
self.lovePoint = lovePoint
|
||||||
|
|
||||||
|
def Select(self):
|
||||||
|
self.isSelected = True
|
||||||
|
|
||||||
|
def UnSelect(self):
|
||||||
|
self.isSelected = False
|
||||||
|
|
||||||
|
def GetName(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def GetStepWidth(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# Whisper
|
||||||
|
def CanWhisper(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def IsOnline(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def IsMobile(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnWhisper(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def OnMobileMessage(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Remove
|
||||||
|
def CanRemove(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnRemove(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Warp
|
||||||
|
def CanWarp(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnWarp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
if -1 != self.lovePoint:
|
||||||
|
if not self.lovePointToolTip:
|
||||||
|
self.lovePointToolTip = uiToolTip.ToolTip(100)
|
||||||
|
self.lovePointToolTip.SetTitle(self.name)
|
||||||
|
self.lovePointToolTip.AppendTextLine(localeInfo.AFF_LOVE_POINT % (self.lovePoint))
|
||||||
|
self.lovePointToolTip.ResizeToolTip()
|
||||||
|
self.lovePointToolTip.ShowToolTip()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
if self.lovePointToolTip:
|
||||||
|
self.lovePointToolTip.HideToolTip()
|
||||||
|
|
||||||
|
def OnMouseLeftButtonDown(self):
|
||||||
|
self.getParentEvent().OnSelectItem(self)
|
||||||
|
|
||||||
|
def OnMouseLeftButtonDoubleClick(self):
|
||||||
|
self.getParentEvent().OnDoubleClickItem(self)
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
if self.isSelected:
|
||||||
|
x, y = self.GetGlobalPosition()
|
||||||
|
grp.SetColor(grp.GenerateColor(0.0, 0.0, 0.7, 0.7))
|
||||||
|
grp.RenderBar(x+16, y, self.GetWidth()-16, self.GetHeight())
|
||||||
|
|
||||||
|
class MessengerMemberItem(MessengerItem):
|
||||||
|
|
||||||
|
STATE_OFFLINE = 0
|
||||||
|
STATE_ONLINE = 1
|
||||||
|
STATE_MOBILE = 2
|
||||||
|
|
||||||
|
IMAGE_FILE_NAME = { "ONLINE" : "d:/ymir work/ui/game/windows/messenger_list_online.sub",
|
||||||
|
"OFFLINE" : "d:/ymir work/ui/game/windows/messenger_list_offline.sub",
|
||||||
|
"MOBILE" : "d:/ymir work/ui/game/windows/messenger_list_mobile.sub", }
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerItem.__init__(self, getParentEvent)
|
||||||
|
self.key = None
|
||||||
|
self.state = self.STATE_OFFLINE
|
||||||
|
self.mobileFlag = False
|
||||||
|
self.Offline()
|
||||||
|
|
||||||
|
def GetStepWidth(self):
|
||||||
|
return 15
|
||||||
|
|
||||||
|
def SetKey(self, key):
|
||||||
|
self.key = key
|
||||||
|
|
||||||
|
def IsSameKey(self, key):
|
||||||
|
return self.key == key
|
||||||
|
|
||||||
|
def IsOnline(self):
|
||||||
|
if self.STATE_ONLINE == self.state:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def IsMobile(self):
|
||||||
|
if self.STATE_MOBILE == self.state:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def Online(self):
|
||||||
|
self.image.LoadImage(self.IMAGE_FILE_NAME["ONLINE"])
|
||||||
|
self.state = self.STATE_ONLINE
|
||||||
|
|
||||||
|
def Offline(self):
|
||||||
|
if self.mobileFlag:
|
||||||
|
self.image.LoadImage(self.IMAGE_FILE_NAME["MOBILE"])
|
||||||
|
self.state = self.STATE_MOBILE
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.image.LoadImage(self.IMAGE_FILE_NAME["OFFLINE"])
|
||||||
|
self.state = self.STATE_OFFLINE
|
||||||
|
|
||||||
|
def SetMobile(self, flag):
|
||||||
|
self.mobileFlag = flag
|
||||||
|
|
||||||
|
if not self.IsOnline():
|
||||||
|
self.Offline()
|
||||||
|
|
||||||
|
def CanWhisper(self):
|
||||||
|
if self.IsOnline():
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnWhisper(self):
|
||||||
|
if self.IsOnline():
|
||||||
|
self.getParentEvent().whisperButtonEvent(self.GetName())
|
||||||
|
|
||||||
|
def OnMobileMessage(self):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.IsMobile():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.getParentEvent().SendMobileMessage(self.GetName())
|
||||||
|
|
||||||
|
def Select(self):
|
||||||
|
MessengerItem.Select(self)
|
||||||
|
|
||||||
|
class MessengerGroupItem(MessengerItem):
|
||||||
|
|
||||||
|
IMAGE_FILE_NAME = { "OPEN" : "d:/ymir work/ui/game/windows/messenger_list_open.sub",
|
||||||
|
"CLOSE" : "d:/ymir work/ui/game/windows/messenger_list_close.sub", }
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
self.isOpen = False
|
||||||
|
self.memberList = []
|
||||||
|
|
||||||
|
MessengerItem.__init__(self, getParentEvent)
|
||||||
|
|
||||||
|
def AppendMember(self, member, key, name):
|
||||||
|
member.SetKey(key)
|
||||||
|
member.SetName(name)
|
||||||
|
self.memberList.append(member)
|
||||||
|
return member
|
||||||
|
|
||||||
|
def RemoveMember(self, item):
|
||||||
|
for i in xrange(len(self.memberList)):
|
||||||
|
if item == self.memberList[i]:
|
||||||
|
del self.memberList[i]
|
||||||
|
return
|
||||||
|
|
||||||
|
def ClearMember(self):
|
||||||
|
self.memberList = []
|
||||||
|
|
||||||
|
def FindMember(self, key):
|
||||||
|
list = filter(lambda argMember, argKey=key: argMember.IsSameKey(argKey), self.memberList)
|
||||||
|
if list:
|
||||||
|
return list[0]
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def GetLoginMemberList(self):
|
||||||
|
return filter(MessengerMemberItem.IsOnline, self.memberList)
|
||||||
|
|
||||||
|
def GetLogoutMemberList(self):
|
||||||
|
return filter(lambda arg: not arg.IsOnline(), self.memberList)
|
||||||
|
|
||||||
|
def IsOpen(self):
|
||||||
|
return self.isOpen
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.image.LoadImage(self.IMAGE_FILE_NAME["OPEN"])
|
||||||
|
self.isOpen = True
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.image.LoadImage(self.IMAGE_FILE_NAME["CLOSE"])
|
||||||
|
self.isOpen = False
|
||||||
|
|
||||||
|
map(ui.Window.Hide, self.memberList)
|
||||||
|
|
||||||
|
def Select(self):
|
||||||
|
|
||||||
|
if self.IsOpen():
|
||||||
|
self.Close()
|
||||||
|
else:
|
||||||
|
self.Open()
|
||||||
|
|
||||||
|
MessengerItem.Select(self)
|
||||||
|
self.getParentEvent().OnRefreshList()
|
||||||
|
|
||||||
|
class MessengerFriendItem(MessengerMemberItem):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerMemberItem.__init__(self, getParentEvent)
|
||||||
|
|
||||||
|
def CanRemove(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnRemove(self):
|
||||||
|
messenger.RemoveFriend(self.key)
|
||||||
|
net.SendMessengerRemovePacket(self.key, self.name)
|
||||||
|
return True
|
||||||
|
|
||||||
|
class MessengerGuildItem(MessengerMemberItem):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerMemberItem.__init__(self, getParentEvent)
|
||||||
|
|
||||||
|
def CanWarp(self):
|
||||||
|
if not self.IsOnline():
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnWarp(self):
|
||||||
|
net.SendGuildUseSkillPacket(155, self.key)
|
||||||
|
|
||||||
|
def CanRemove(self):
|
||||||
|
for i in xrange(guild.ENEMY_GUILD_SLOT_MAX_COUNT):
|
||||||
|
if guild.GetEnemyGuildName(i) != "":
|
||||||
|
return False
|
||||||
|
|
||||||
|
if guild.MainPlayerHasAuthority(guild.AUTH_REMOVE_MEMBER):
|
||||||
|
if guild.IsMemberByName(self.name):
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnRemove(self):
|
||||||
|
net.SendGuildRemoveMemberPacket(self.key)
|
||||||
|
return True
|
||||||
|
|
||||||
|
class MessengerFriendGroup(MessengerGroupItem):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerGroupItem.__init__(self, getParentEvent)
|
||||||
|
self.SetName(localeInfo.MESSENGER_FRIEND)
|
||||||
|
|
||||||
|
def AppendMember(self, key, name):
|
||||||
|
item = MessengerFriendItem(self.getParentEvent)
|
||||||
|
return MessengerGroupItem.AppendMember(self, item, key, name)
|
||||||
|
|
||||||
|
class MessengerGuildGroup(MessengerGroupItem):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerGroupItem.__init__(self, getParentEvent)
|
||||||
|
self.SetName(localeInfo.MESSENGER_GUILD)
|
||||||
|
self.AddFlag("float")
|
||||||
|
|
||||||
|
def AppendMember(self, key, name):
|
||||||
|
item = MessengerGuildItem(self.getParentEvent)
|
||||||
|
return MessengerGroupItem.AppendMember(self, item, key, name)
|
||||||
|
|
||||||
|
class MessengerFamilyGroup(MessengerGroupItem):
|
||||||
|
|
||||||
|
def __init__(self, getParentEvent):
|
||||||
|
MessengerGroupItem.__init__(self, getParentEvent)
|
||||||
|
self.SetName(localeInfo.MESSENGER_FAMILY)
|
||||||
|
self.AddFlag("float")
|
||||||
|
|
||||||
|
self.lover = None
|
||||||
|
|
||||||
|
def AppendMember(self, key, name):
|
||||||
|
item = MessengerGuildItem(self.getParentEvent)
|
||||||
|
self.lover = item
|
||||||
|
return MessengerGroupItem.AppendMember(self, item, key, name)
|
||||||
|
|
||||||
|
def GetLover(self):
|
||||||
|
return self.lover
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
###################################################################################################
|
||||||
|
###################################################################################################
|
||||||
|
|
||||||
|
class MessengerWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
START_POSITION = 40
|
||||||
|
|
||||||
|
class ResizeButton(ui.DragButton):
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
app.SetCursor(app.VSIZE)
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
app.SetCursor(app.NORMAL)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
messenger.SetMessengerHandler(self)
|
||||||
|
|
||||||
|
self.board = None
|
||||||
|
self.groupList = []
|
||||||
|
self.showingItemList = []
|
||||||
|
self.selectedItem = None
|
||||||
|
self.whisperButtonEvent = lambda *arg: None
|
||||||
|
self.familyGroup = None
|
||||||
|
|
||||||
|
self.guildButtonEvent = None
|
||||||
|
|
||||||
|
self.showingPageSize = 0
|
||||||
|
self.startLine = 0
|
||||||
|
self.hasMobilePhoneNumber = True
|
||||||
|
|
||||||
|
self.isLoaded = 0
|
||||||
|
|
||||||
|
self.__AddGroup()
|
||||||
|
messenger.RefreshGuildMember()
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
if self.isLoaded==0:
|
||||||
|
self.isLoaded=1
|
||||||
|
|
||||||
|
self.__LoadWindow()
|
||||||
|
self.OnRefreshList()
|
||||||
|
self.OnResizeDialog()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/MessengerWindow.py")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.scrollBar = self.GetChild("ScrollBar")
|
||||||
|
self.whisperButton = self.GetChild("WhisperButton")
|
||||||
|
self.mobileButton = self.GetChild("MobileButton")
|
||||||
|
self.removeButton = self.GetChild("RemoveButton")
|
||||||
|
self.addFriendButton = self.GetChild("AddFriendButton")
|
||||||
|
self.guildButton = self.GetChild("GuildButton")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MessengerWindow.__LoadWindow.__Bind")
|
||||||
|
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll))
|
||||||
|
self.whisperButton.SetEvent(ui.__mem_func__(self.OnPressWhisperButton))
|
||||||
|
self.mobileButton.SetEvent(ui.__mem_func__(self.OnPressMobileButton))
|
||||||
|
self.removeButton.SetEvent(ui.__mem_func__(self.OnPressRemoveButton))
|
||||||
|
self.addFriendButton.SetEvent(ui.__mem_func__(self.OnPressAddFriendButton))
|
||||||
|
self.guildButton.SetEvent(ui.__mem_func__(self.OnPressGuildButton))
|
||||||
|
|
||||||
|
if not uiGameOption.MOBILE: #constInfo.SEND_MOBILE_PHONE_MESSAGE_ENABLE:
|
||||||
|
self.mobileButton.Hide()
|
||||||
|
width = self.GetWidth()
|
||||||
|
height = self.GetHeight()
|
||||||
|
self.addFriendButton.SetPosition(-60, 30)
|
||||||
|
self.whisperButton.SetPosition(-20, 30)
|
||||||
|
self.removeButton.SetPosition(20, 30)
|
||||||
|
self.guildButton.SetPosition(60, 30)
|
||||||
|
|
||||||
|
self.whisperButton.Disable()
|
||||||
|
self.mobileButton.Disable()
|
||||||
|
self.removeButton.Disable()
|
||||||
|
|
||||||
|
resizeButton = self.ResizeButton()
|
||||||
|
resizeButton.AddFlag("restrict_x")
|
||||||
|
resizeButton.SetParent(self)
|
||||||
|
resizeButton.SetSize(self.GetWidth(), 10)
|
||||||
|
resizeButton.SetWindowVerticalAlignBottom()
|
||||||
|
resizeButton.SetPosition(0, 0)
|
||||||
|
resizeButton.Show()
|
||||||
|
self.resizeButton = resizeButton
|
||||||
|
self.resizeButton.SetMoveEvent(ui.__mem_func__(self.OnResizeDialog))
|
||||||
|
self.resizeButton.SetPosition(0, 300)
|
||||||
|
|
||||||
|
for list in self.groupList:
|
||||||
|
list.SetTop()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
messenger.SetMessengerHandler(None)
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.board = None
|
||||||
|
self.scrollBar = None
|
||||||
|
self.resizeButton = None
|
||||||
|
self.friendNameBoard = None
|
||||||
|
self.questionDialog = None
|
||||||
|
self.popupDialog = None
|
||||||
|
self.inputDialog = None
|
||||||
|
self.familyGroup = None
|
||||||
|
|
||||||
|
self.whisperButton = None
|
||||||
|
self.mobileButton = None
|
||||||
|
self.removeButton = None
|
||||||
|
|
||||||
|
def OnCloseQuestionDialog(self):
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.questionDialog = None
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetSize(self, width, height):
|
||||||
|
ui.ScriptWindow.SetSize(self, width, height)
|
||||||
|
if self.board:
|
||||||
|
self.board.SetSize(width, height)
|
||||||
|
|
||||||
|
def OnResizeDialog(self):
|
||||||
|
x, y = self.resizeButton.GetLocalPosition()
|
||||||
|
if y < 140:
|
||||||
|
self.resizeButton.SetPosition(x, 140)
|
||||||
|
return
|
||||||
|
self.SetSize(self.GetWidth(), y + self.resizeButton.GetHeight())
|
||||||
|
|
||||||
|
self.showingPageSize = y - (self.START_POSITION + 26)
|
||||||
|
self.scrollBar.SetScrollBarSize(self.showingPageSize)
|
||||||
|
|
||||||
|
self.__LocateMember()
|
||||||
|
|
||||||
|
self.resizeButton.TurnOffCallBack()
|
||||||
|
self.UpdateRect()
|
||||||
|
self.resizeButton.TurnOnCallBack()
|
||||||
|
|
||||||
|
def __LocateMember(self):
|
||||||
|
|
||||||
|
if self.isLoaded==0:
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.showingPageSize/20 >= len(self.showingItemList):
|
||||||
|
self.scrollBar.Hide()
|
||||||
|
self.startLine = 0
|
||||||
|
else:
|
||||||
|
if self.showingItemList:
|
||||||
|
self.scrollBar.SetMiddleBarSize(float(self.showingPageSize/20) / float(len(self.showingItemList)))
|
||||||
|
self.scrollBar.Show()
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
yPos = self.START_POSITION
|
||||||
|
heightLimit = self.GetHeight() - (self.START_POSITION + 13)
|
||||||
|
|
||||||
|
map(ui.Window.Hide, self.showingItemList)
|
||||||
|
|
||||||
|
for item in self.showingItemList[self.startLine:]:
|
||||||
|
item.SetPosition(20 + item.GetStepWidth(), yPos)
|
||||||
|
item.SetTop()
|
||||||
|
item.Show()
|
||||||
|
|
||||||
|
yPos += 20
|
||||||
|
if yPos > heightLimit:
|
||||||
|
break
|
||||||
|
|
||||||
|
def __AddGroup(self):
|
||||||
|
member = MessengerFriendGroup(ui.__mem_func__(self.GetSelf))
|
||||||
|
member.Open()
|
||||||
|
member.Show()
|
||||||
|
self.groupList.append(member)
|
||||||
|
|
||||||
|
member = MessengerGuildGroup(ui.__mem_func__(self.GetSelf))
|
||||||
|
member.Open()
|
||||||
|
member.Show()
|
||||||
|
self.groupList.append(member)
|
||||||
|
|
||||||
|
def __AddFamilyGroup(self):
|
||||||
|
member = MessengerFamilyGroup(ui.__mem_func__(self.GetSelf))
|
||||||
|
member.Open()
|
||||||
|
member.Show()
|
||||||
|
|
||||||
|
self.familyGroup = member
|
||||||
|
|
||||||
|
def ClearGuildMember(self):
|
||||||
|
self.groupList[GUILD].ClearMember()
|
||||||
|
|
||||||
|
def SetWhisperButtonEvent(self, event):
|
||||||
|
self.whisperButtonEvent=event
|
||||||
|
|
||||||
|
def SetGuildButtonEvent(self, event):
|
||||||
|
self.guildButtonEvent=event
|
||||||
|
|
||||||
|
def SendMobileMessage(self, name):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.hasMobilePhoneNumber:
|
||||||
|
questionDialog = uiCommon.QuestionDialog2()
|
||||||
|
questionDialog.SetText1(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_1)
|
||||||
|
questionDialog.SetText2(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_2)
|
||||||
|
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnAcceptInputMobilePhoneNumber))
|
||||||
|
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCancelInputMobilePhoneNumber))
|
||||||
|
questionDialog.SetWidth(400)
|
||||||
|
questionDialog.Open()
|
||||||
|
self.questionDialog = questionDialog
|
||||||
|
return
|
||||||
|
|
||||||
|
## Input Sending Mobile Message
|
||||||
|
inputDialog = uiCommon.InputDialog()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_SEND_MOBILE_MESSAGE_TITLE)
|
||||||
|
inputDialog.SetMaxLength(50)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileMessage))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.name = name
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
|
||||||
|
def OnAcceptInputMobilePhoneNumber(self):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
## Input Mobile Phone Number
|
||||||
|
inputDialog = uiCommon.InputDialog()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_TITLE)
|
||||||
|
inputDialog.SetMaxLength(13)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobilePhoneNumber))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
self.OnCancelInputMobilePhoneNumber()
|
||||||
|
|
||||||
|
def OnCancelInputMobilePhoneNumber(self):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnInputMobilePhoneNumber(self):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return
|
||||||
|
|
||||||
|
text.replace('-', '')
|
||||||
|
net.SendChatPacket("/mobile " + text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnInputMobileMessage(self):
|
||||||
|
if not uiGameOption.MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendMobileMessagePacket(self.inputDialog.name, text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseInputDialog(self):
|
||||||
|
self.inputDialog.Close()
|
||||||
|
self.inputDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressGuildButton(self):
|
||||||
|
self.guildButtonEvent()
|
||||||
|
|
||||||
|
def OnPressAddFriendButton(self):
|
||||||
|
friendNameBoard = uiCommon.InputDialog()
|
||||||
|
friendNameBoard.SetTitle(localeInfo.MESSENGER_ADD_FRIEND)
|
||||||
|
friendNameBoard.SetAcceptEvent(ui.__mem_func__(self.OnAddFriend))
|
||||||
|
friendNameBoard.SetCancelEvent(ui.__mem_func__(self.OnCancelAddFriend))
|
||||||
|
friendNameBoard.Open()
|
||||||
|
self.friendNameBoard = friendNameBoard
|
||||||
|
|
||||||
|
def OnAddFriend(self):
|
||||||
|
text = self.friendNameBoard.GetText()
|
||||||
|
if text:
|
||||||
|
net.SendMessengerAddByNamePacket(text)
|
||||||
|
self.friendNameBoard.Close()
|
||||||
|
self.friendNameBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCancelAddFriend(self):
|
||||||
|
self.friendNameBoard.Close()
|
||||||
|
self.friendNameBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressWhisperButton(self):
|
||||||
|
if self.selectedItem:
|
||||||
|
self.selectedItem.OnWhisper()
|
||||||
|
|
||||||
|
def OnPressMobileButton(self):
|
||||||
|
if self.selectedItem:
|
||||||
|
self.selectedItem.OnMobileMessage()
|
||||||
|
|
||||||
|
def OnPressRemoveButton(self):
|
||||||
|
if self.selectedItem:
|
||||||
|
if self.selectedItem.CanRemove():
|
||||||
|
self.questionDialog = uiCommon.QuestionDialog()
|
||||||
|
self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE)
|
||||||
|
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnRemove))
|
||||||
|
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||||
|
self.questionDialog.Open()
|
||||||
|
|
||||||
|
def OnRemove(self):
|
||||||
|
if self.selectedItem:
|
||||||
|
if self.selectedItem.CanRemove():
|
||||||
|
map(lambda arg, argDeletingItem=self.selectedItem: arg.RemoveMember(argDeletingItem), self.groupList)
|
||||||
|
self.selectedItem.OnRemove()
|
||||||
|
self.selectedItem.UnSelect()
|
||||||
|
self.selectedItem = None
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
|
||||||
|
def OnScroll(self):
|
||||||
|
scrollLineCount = len(self.showingItemList) - (self.showingPageSize/20)
|
||||||
|
startLine = int(scrollLineCount * self.scrollBar.GetPos())
|
||||||
|
|
||||||
|
if startLine != self.startLine:
|
||||||
|
self.startLine = startLine
|
||||||
|
self.__LocateMember()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
## CallBack
|
||||||
|
def OnSelectItem(self, item):
|
||||||
|
|
||||||
|
if self.selectedItem:
|
||||||
|
if item != self.selectedItem:
|
||||||
|
self.selectedItem.UnSelect()
|
||||||
|
|
||||||
|
self.selectedItem = item
|
||||||
|
|
||||||
|
if self.selectedItem:
|
||||||
|
self.selectedItem.Select()
|
||||||
|
|
||||||
|
if self.selectedItem.CanWhisper():
|
||||||
|
self.whisperButton.Enable()
|
||||||
|
else:
|
||||||
|
self.whisperButton.Disable()
|
||||||
|
|
||||||
|
if self.selectedItem.IsMobile():
|
||||||
|
self.mobileButton.Enable()
|
||||||
|
else:
|
||||||
|
self.mobileButton.Disable()
|
||||||
|
|
||||||
|
if self.selectedItem.CanRemove():
|
||||||
|
self.removeButton.Enable()
|
||||||
|
else:
|
||||||
|
self.removeButton.Disable()
|
||||||
|
|
||||||
|
def OnDoubleClickItem(self, item):
|
||||||
|
|
||||||
|
if not self.selectedItem:
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.selectedItem.IsOnline():
|
||||||
|
self.OnPressWhisperButton()
|
||||||
|
|
||||||
|
elif self.selectedItem.IsMobile():
|
||||||
|
self.OnPressMobileButton()
|
||||||
|
|
||||||
|
def GetSelf(self):
|
||||||
|
return self
|
||||||
|
|
||||||
|
def OnRefreshList(self):
|
||||||
|
self.showingItemList = []
|
||||||
|
|
||||||
|
if self.familyGroup:
|
||||||
|
self.showingItemList.append(self.familyGroup)
|
||||||
|
if self.familyGroup.GetLover():
|
||||||
|
self.showingItemList.append(self.familyGroup.GetLover())
|
||||||
|
|
||||||
|
for group in self.groupList:
|
||||||
|
|
||||||
|
self.showingItemList.append(group)
|
||||||
|
|
||||||
|
if group.IsOpen():
|
||||||
|
|
||||||
|
loginMemberList = group.GetLoginMemberList()
|
||||||
|
logoutMemberList = group.GetLogoutMemberList()
|
||||||
|
|
||||||
|
if loginMemberList or logoutMemberList:
|
||||||
|
for member in loginMemberList:
|
||||||
|
self.showingItemList.append(member)
|
||||||
|
for member in logoutMemberList:
|
||||||
|
self.showingItemList.append(member)
|
||||||
|
|
||||||
|
else:
|
||||||
|
item = MessengerItem(ui.__mem_func__(self.GetSelf))
|
||||||
|
item.SetName(localeInfo.MESSENGER_EMPTY_LIST)
|
||||||
|
self.showingItemList.append(item)
|
||||||
|
|
||||||
|
self.__LocateMember()
|
||||||
|
|
||||||
|
def RefreshMessenger(self):
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
## EventHandler
|
||||||
|
def __AddList(self, groupIndex, key, name):
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
member = group.FindMember(key)
|
||||||
|
if not member:
|
||||||
|
member = group.AppendMember(key, name)
|
||||||
|
self.OnSelectItem(None)
|
||||||
|
return member
|
||||||
|
|
||||||
|
def OnRemoveList(self, groupIndex, key):
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
group.RemoveMember(group.FindMember(key))
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnRemoveAllList(self, groupIndex):
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
group.ClearMember()
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnLogin(self, groupIndex, key, name=None):
|
||||||
|
if not name:
|
||||||
|
name = key
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
member = self.__AddList(groupIndex, key, name)
|
||||||
|
member.SetName(name)
|
||||||
|
member.Online()
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnLogout(self, groupIndex, key, name=None):
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
member = self.__AddList(groupIndex, key, name)
|
||||||
|
if not name:
|
||||||
|
name = key
|
||||||
|
member.SetName(name)
|
||||||
|
member.Offline()
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnMobile(self, groupIndex, key, mobileFlag):
|
||||||
|
group = self.groupList[groupIndex]
|
||||||
|
member = group.FindMember(key)
|
||||||
|
if not member:
|
||||||
|
return
|
||||||
|
member.SetMobile(mobileFlag)
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnAddLover(self, name, lovePoint):
|
||||||
|
if not self.familyGroup:
|
||||||
|
self.__AddFamilyGroup()
|
||||||
|
|
||||||
|
member = self.familyGroup.AppendMember(0, name)
|
||||||
|
|
||||||
|
member.SetName(name)
|
||||||
|
member.SetLovePoint(lovePoint)
|
||||||
|
member.Offline()
|
||||||
|
self.OnRefreshList()
|
||||||
|
|
||||||
|
def OnUpdateLovePoint(self, lovePoint):
|
||||||
|
if not self.familyGroup:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover = self.familyGroup.GetLover()
|
||||||
|
if not lover:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover.SetLovePoint(lovePoint)
|
||||||
|
|
||||||
|
def OnLoginLover(self):
|
||||||
|
if not self.familyGroup:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover = self.familyGroup.GetLover()
|
||||||
|
if not lover:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover.Online()
|
||||||
|
|
||||||
|
def OnLogoutLover(self):
|
||||||
|
if not self.familyGroup:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover = self.familyGroup.GetLover()
|
||||||
|
if not lover:
|
||||||
|
return
|
||||||
|
|
||||||
|
lover.Offline()
|
||||||
|
|
||||||
|
def ClearLoverInfo(self):
|
||||||
|
if not self.familyGroup:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.familyGroup.ClearMember()
|
||||||
|
self.familyGroup = None
|
||||||
|
self.OnRefreshList()
|
||||||
@@ -0,0 +1,489 @@
|
|||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
import wndMgr
|
||||||
|
import player
|
||||||
|
import miniMap
|
||||||
|
import localeInfo
|
||||||
|
import net
|
||||||
|
import app
|
||||||
|
import colorInfo
|
||||||
|
import constInfo
|
||||||
|
import background
|
||||||
|
|
||||||
|
class MapTextToolTip(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
textLine = ui.TextLine()
|
||||||
|
textLine.SetParent(self)
|
||||||
|
textLine.SetHorizontalAlignCenter()
|
||||||
|
textLine.SetOutline()
|
||||||
|
textLine.SetHorizontalAlignRight()
|
||||||
|
textLine.Show()
|
||||||
|
self.textLine = textLine
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def SetText(self, text):
|
||||||
|
self.textLine.SetText(text)
|
||||||
|
|
||||||
|
def SetTooltipPosition(self, PosX, PosY):
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
w, h = self.textLine.GetTextSize()
|
||||||
|
self.textLine.SetPosition(PosX - w - 5, PosY)
|
||||||
|
else:
|
||||||
|
self.textLine.SetPosition(PosX - 5, PosY)
|
||||||
|
|
||||||
|
def SetTextColor(self, TextColor):
|
||||||
|
self.textLine.SetPackedFontColor(TextColor)
|
||||||
|
|
||||||
|
def GetTextSize(self):
|
||||||
|
return self.textLine.GetTextSize()
|
||||||
|
|
||||||
|
class AtlasWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
class AtlasRenderer(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.AddFlag("not_pick")
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
miniMap.UpdateAtlas()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
fx = float(x)
|
||||||
|
fy = float(y)
|
||||||
|
miniMap.RenderAtlas(fx, fy)
|
||||||
|
|
||||||
|
def HideAtlas(self):
|
||||||
|
miniMap.HideAtlas()
|
||||||
|
|
||||||
|
def ShowAtlas(self):
|
||||||
|
miniMap.ShowAtlas()
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.tooltipInfo = MapTextToolTip()
|
||||||
|
self.tooltipInfo.Hide()
|
||||||
|
self.infoGuildMark = ui.MarkBox()
|
||||||
|
self.infoGuildMark.Hide()
|
||||||
|
self.AtlasMainWindow = None
|
||||||
|
self.mapName = ""
|
||||||
|
self.board = 0
|
||||||
|
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def SetMapName(self, mapName):
|
||||||
|
if 949==app.GetDefaultCodePage():
|
||||||
|
try:
|
||||||
|
self.board.SetTitleName(localeInfo.MINIMAP_ZONE_NAME_DICT[mapName])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/AtlasWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AtlasWindow.LoadWindow.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("AtlasWindow.LoadWindow.BindObject")
|
||||||
|
|
||||||
|
self.AtlasMainWindow = self.AtlasRenderer()
|
||||||
|
self.board.SetCloseEvent(self.Hide)
|
||||||
|
self.AtlasMainWindow.SetParent(self.board)
|
||||||
|
self.AtlasMainWindow.SetPosition(7, 30)
|
||||||
|
self.tooltipInfo.SetParent(self.board)
|
||||||
|
self.infoGuildMark.SetParent(self.board)
|
||||||
|
self.SetPosition(wndMgr.GetScreenWidth() - 136 - 256 - 10, 0)
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
miniMap.RegisterAtlasWindow(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
miniMap.UnregisterAtlasWindow()
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.AtlasMainWindow = None
|
||||||
|
self.tooltipAtlasClose = 0
|
||||||
|
self.tooltipInfo = None
|
||||||
|
self.infoGuildMark = None
|
||||||
|
self.board = None
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
if not self.tooltipInfo:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.infoGuildMark:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.infoGuildMark.Hide()
|
||||||
|
self.tooltipInfo.Hide()
|
||||||
|
|
||||||
|
if False == self.board.IsIn():
|
||||||
|
return
|
||||||
|
|
||||||
|
(mouseX, mouseY) = wndMgr.GetMousePosition()
|
||||||
|
(bFind, sName, iPosX, iPosY, dwTextColor, dwGuildID) = miniMap.GetAtlasInfo(mouseX, mouseY)
|
||||||
|
|
||||||
|
if False == bFind:
|
||||||
|
return
|
||||||
|
|
||||||
|
if "empty_guild_area" == sName:
|
||||||
|
sName = localeInfo.GUILD_EMPTY_AREA
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC() and sName[-1].isalnum():
|
||||||
|
self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY))
|
||||||
|
else:
|
||||||
|
self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY))
|
||||||
|
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
self.tooltipInfo.SetTooltipPosition(mouseX - x, mouseY - y)
|
||||||
|
self.tooltipInfo.SetTextColor(dwTextColor)
|
||||||
|
self.tooltipInfo.Show()
|
||||||
|
self.tooltipInfo.SetTop()
|
||||||
|
|
||||||
|
if 0 != dwGuildID:
|
||||||
|
textWidth, textHeight = self.tooltipInfo.GetTextSize()
|
||||||
|
self.infoGuildMark.SetIndex(dwGuildID)
|
||||||
|
self.infoGuildMark.SetPosition(mouseX - x - textWidth - 18 - 5, mouseY - y)
|
||||||
|
self.infoGuildMark.Show()
|
||||||
|
|
||||||
|
def Hide(self):
|
||||||
|
if self.AtlasMainWindow:
|
||||||
|
self.AtlasMainWindow.HideAtlas()
|
||||||
|
self.AtlasMainWindow.Hide()
|
||||||
|
ui.ScriptWindow.Hide(self)
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
if self.AtlasMainWindow:
|
||||||
|
(bGet, iSizeX, iSizeY) = miniMap.GetAtlasSize()
|
||||||
|
if bGet:
|
||||||
|
self.SetSize(iSizeX + 15, iSizeY + 38)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.board.SetPosition(iSizeX+15, 0)
|
||||||
|
|
||||||
|
self.board.SetSize(iSizeX + 15, iSizeY + 38)
|
||||||
|
#self.AtlasMainWindow.SetSize(iSizeX, iSizeY)
|
||||||
|
self.AtlasMainWindow.ShowAtlas()
|
||||||
|
self.AtlasMainWindow.Show()
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def SetCenterPositionAdjust(self, x, y):
|
||||||
|
self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y)
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Hide()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def __RegisterMiniMapColor(type, rgb):
|
||||||
|
miniMap.RegisterColor(type, rgb[0], rgb[1], rgb[2])
|
||||||
|
|
||||||
|
class MiniMap(ui.ScriptWindow):
|
||||||
|
|
||||||
|
CANNOT_SEE_INFO_MAP_DICT = {
|
||||||
|
"metin2_map_monkeydungeon" : False,
|
||||||
|
"metin2_map_monkeydungeon_02" : False,
|
||||||
|
"metin2_map_monkeydungeon_03" : False,
|
||||||
|
"metin2_map_devilsCatacomb" : False,
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
miniMap.Create()
|
||||||
|
miniMap.SetScale(2.0)
|
||||||
|
|
||||||
|
self.AtlasWindow = AtlasWindow()
|
||||||
|
self.AtlasWindow.LoadWindow()
|
||||||
|
self.AtlasWindow.Hide()
|
||||||
|
|
||||||
|
self.tooltipMiniMapOpen = MapTextToolTip()
|
||||||
|
self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP)
|
||||||
|
self.tooltipMiniMapOpen.Show()
|
||||||
|
self.tooltipMiniMapClose = MapTextToolTip()
|
||||||
|
self.tooltipMiniMapClose.SetText(localeInfo.UI_CLOSE)
|
||||||
|
self.tooltipMiniMapClose.Show()
|
||||||
|
self.tooltipScaleUp = MapTextToolTip()
|
||||||
|
self.tooltipScaleUp.SetText(localeInfo.MINIMAP_INC_SCALE)
|
||||||
|
self.tooltipScaleUp.Show()
|
||||||
|
self.tooltipScaleDown = MapTextToolTip()
|
||||||
|
self.tooltipScaleDown.SetText(localeInfo.MINIMAP_DEC_SCALE)
|
||||||
|
self.tooltipScaleDown.Show()
|
||||||
|
self.tooltipAtlasOpen = MapTextToolTip()
|
||||||
|
self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP)
|
||||||
|
self.tooltipAtlasOpen.Show()
|
||||||
|
self.tooltipInfo = MapTextToolTip()
|
||||||
|
self.tooltipInfo.Show()
|
||||||
|
|
||||||
|
if miniMap.IsAtlas():
|
||||||
|
self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP)
|
||||||
|
else:
|
||||||
|
self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_CAN_NOT_SHOW_AREAMAP)
|
||||||
|
|
||||||
|
self.tooltipInfo = MapTextToolTip()
|
||||||
|
self.tooltipInfo.Show()
|
||||||
|
|
||||||
|
self.mapName = ""
|
||||||
|
|
||||||
|
self.isLoaded = 0
|
||||||
|
self.canSeeInfo = True
|
||||||
|
|
||||||
|
# AUTOBAN
|
||||||
|
self.imprisonmentDuration = 0
|
||||||
|
self.imprisonmentEndTime = 0
|
||||||
|
self.imprisonmentEndTimeText = ""
|
||||||
|
# END_OF_AUTOBAN
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
miniMap.Destroy()
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.positionInfo = 0
|
||||||
|
self.observerCount = 0
|
||||||
|
|
||||||
|
self.OpenWindow = 0
|
||||||
|
self.CloseWindow = 0
|
||||||
|
self.ScaleUpButton = 0
|
||||||
|
self.ScaleDownButton = 0
|
||||||
|
self.MiniMapHideButton = 0
|
||||||
|
self.MiniMapShowButton = 0
|
||||||
|
self.AtlasShowButton = 0
|
||||||
|
|
||||||
|
self.tooltipMiniMapOpen = 0
|
||||||
|
self.tooltipMiniMapClose = 0
|
||||||
|
self.tooltipScaleUp = 0
|
||||||
|
self.tooltipScaleDown = 0
|
||||||
|
self.tooltipAtlasOpen = 0
|
||||||
|
self.tooltipInfo = None
|
||||||
|
self.serverInfo = None
|
||||||
|
|
||||||
|
def SetMapName(self, mapName):
|
||||||
|
self.mapName=mapName
|
||||||
|
self.AtlasWindow.SetMapName(mapName)
|
||||||
|
|
||||||
|
if self.CANNOT_SEE_INFO_MAP_DICT.has_key(mapName):
|
||||||
|
self.canSeeInfo = False
|
||||||
|
self.HideMiniMap()
|
||||||
|
self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP_CANNOT_SEE)
|
||||||
|
else:
|
||||||
|
self.canSeeInfo = True
|
||||||
|
self.ShowMiniMap()
|
||||||
|
self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP)
|
||||||
|
|
||||||
|
# AUTOBAN
|
||||||
|
def SetImprisonmentDuration(self, duration):
|
||||||
|
self.imprisonmentDuration = duration
|
||||||
|
self.imprisonmentEndTime = app.GetGlobalTimeStamp() + duration
|
||||||
|
|
||||||
|
self.__UpdateImprisonmentDurationText()
|
||||||
|
|
||||||
|
def __UpdateImprisonmentDurationText(self):
|
||||||
|
restTime = max(self.imprisonmentEndTime - app.GetGlobalTimeStamp(), 0)
|
||||||
|
|
||||||
|
imprisonmentEndTimeText = localeInfo.SecondToDHM(restTime)
|
||||||
|
if imprisonmentEndTimeText != self.imprisonmentEndTimeText:
|
||||||
|
self.imprisonmentEndTimeText = imprisonmentEndTimeText
|
||||||
|
self.serverInfo.SetText("%s: %s" % (uiScriptLocale.AUTOBAN_QUIZ_REST_TIME, self.imprisonmentEndTimeText))
|
||||||
|
# END_OF_AUTOBAN
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
if self.isLoaded == 1:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.isLoaded = 1
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "Minimap.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/MiniMap.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MiniMap.LoadWindow.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.OpenWindow = self.GetChild("OpenWindow")
|
||||||
|
self.MiniMapWindow = self.GetChild("MiniMapWindow")
|
||||||
|
self.ScaleUpButton = self.GetChild("ScaleUpButton")
|
||||||
|
self.ScaleDownButton = self.GetChild("ScaleDownButton")
|
||||||
|
self.MiniMapHideButton = self.GetChild("MiniMapHideButton")
|
||||||
|
self.AtlasShowButton = self.GetChild("AtlasShowButton")
|
||||||
|
self.CloseWindow = self.GetChild("CloseWindow")
|
||||||
|
self.MiniMapShowButton = self.GetChild("MiniMapShowButton")
|
||||||
|
self.positionInfo = self.GetChild("PositionInfo")
|
||||||
|
self.observerCount = self.GetChild("ObserverCount")
|
||||||
|
self.serverInfo = self.GetChild("ServerInfo")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MiniMap.LoadWindow.Bind")
|
||||||
|
|
||||||
|
if constInfo.MINIMAP_POSITIONINFO_ENABLE==0:
|
||||||
|
self.positionInfo.Hide()
|
||||||
|
|
||||||
|
self.serverInfo.SetText(net.GetServerInfo())
|
||||||
|
self.ScaleUpButton.SetEvent(ui.__mem_func__(self.ScaleUp))
|
||||||
|
self.ScaleDownButton.SetEvent(ui.__mem_func__(self.ScaleDown))
|
||||||
|
self.MiniMapHideButton.SetEvent(ui.__mem_func__(self.HideMiniMap))
|
||||||
|
self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap))
|
||||||
|
|
||||||
|
if miniMap.IsAtlas():
|
||||||
|
self.AtlasShowButton.SetEvent(ui.__mem_func__(self.ShowAtlas))
|
||||||
|
|
||||||
|
(ButtonPosX, ButtonPosY) = self.MiniMapShowButton.GetGlobalPosition()
|
||||||
|
self.tooltipMiniMapOpen.SetTooltipPosition(ButtonPosX, ButtonPosY)
|
||||||
|
|
||||||
|
(ButtonPosX, ButtonPosY) = self.MiniMapHideButton.GetGlobalPosition()
|
||||||
|
self.tooltipMiniMapClose.SetTooltipPosition(ButtonPosX, ButtonPosY)
|
||||||
|
|
||||||
|
(ButtonPosX, ButtonPosY) = self.ScaleUpButton.GetGlobalPosition()
|
||||||
|
self.tooltipScaleUp.SetTooltipPosition(ButtonPosX, ButtonPosY)
|
||||||
|
|
||||||
|
(ButtonPosX, ButtonPosY) = self.ScaleDownButton.GetGlobalPosition()
|
||||||
|
self.tooltipScaleDown.SetTooltipPosition(ButtonPosX, ButtonPosY)
|
||||||
|
|
||||||
|
(ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition()
|
||||||
|
self.tooltipAtlasOpen.SetTooltipPosition(ButtonPosX, ButtonPosY)
|
||||||
|
|
||||||
|
self.ShowMiniMap()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.HideMiniMap()
|
||||||
|
|
||||||
|
self.AtlasWindow.Destroy()
|
||||||
|
self.AtlasWindow = None
|
||||||
|
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
def UpdateObserverCount(self, observerCount):
|
||||||
|
if observerCount>0:
|
||||||
|
self.observerCount.Show()
|
||||||
|
elif observerCount<=0:
|
||||||
|
self.observerCount.Hide()
|
||||||
|
|
||||||
|
self.observerCount.SetText(localeInfo.MINIMAP_OBSERVER_COUNT % observerCount)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
miniMap.Update(x, y)
|
||||||
|
|
||||||
|
self.positionInfo.SetText("(%.0f, %.0f)" % (x/100, y/100))
|
||||||
|
|
||||||
|
if self.tooltipInfo:
|
||||||
|
if True == self.MiniMapWindow.IsIn():
|
||||||
|
(mouseX, mouseY) = wndMgr.GetMousePosition()
|
||||||
|
(bFind, sName, iPosX, iPosY, dwTextColor) = miniMap.GetInfo(mouseX, mouseY)
|
||||||
|
if bFind == 0:
|
||||||
|
self.tooltipInfo.Hide()
|
||||||
|
elif not self.canSeeInfo:
|
||||||
|
self.tooltipInfo.SetText("%s(%s)" % (sName, localeInfo.UI_POS_UNKNOWN))
|
||||||
|
self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY)
|
||||||
|
self.tooltipInfo.SetTextColor(dwTextColor)
|
||||||
|
self.tooltipInfo.Show()
|
||||||
|
else:
|
||||||
|
if localeInfo.IsARABIC() and sName[-1].isalnum():
|
||||||
|
self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY))
|
||||||
|
else:
|
||||||
|
self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY))
|
||||||
|
self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY)
|
||||||
|
self.tooltipInfo.SetTextColor(dwTextColor)
|
||||||
|
self.tooltipInfo.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipInfo.Hide()
|
||||||
|
|
||||||
|
# AUTOBAN
|
||||||
|
if self.imprisonmentDuration:
|
||||||
|
self.__UpdateImprisonmentDurationText()
|
||||||
|
# END_OF_AUTOBAN
|
||||||
|
|
||||||
|
if True == self.MiniMapShowButton.IsIn():
|
||||||
|
self.tooltipMiniMapOpen.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipMiniMapOpen.Hide()
|
||||||
|
|
||||||
|
if True == self.MiniMapHideButton.IsIn():
|
||||||
|
self.tooltipMiniMapClose.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipMiniMapClose.Hide()
|
||||||
|
|
||||||
|
if True == self.ScaleUpButton.IsIn():
|
||||||
|
self.tooltipScaleUp.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipScaleUp.Hide()
|
||||||
|
|
||||||
|
if True == self.ScaleDownButton.IsIn():
|
||||||
|
self.tooltipScaleDown.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipScaleDown.Hide()
|
||||||
|
|
||||||
|
if True == self.AtlasShowButton.IsIn():
|
||||||
|
self.tooltipAtlasOpen.Show()
|
||||||
|
else:
|
||||||
|
self.tooltipAtlasOpen.Hide()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
fx = float(x)
|
||||||
|
fy = float(y)
|
||||||
|
miniMap.Render(fx + 4.0, fy + 5.0)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.HideMiniMap()
|
||||||
|
|
||||||
|
def HideMiniMap(self):
|
||||||
|
miniMap.Hide()
|
||||||
|
self.OpenWindow.Hide()
|
||||||
|
self.CloseWindow.Show()
|
||||||
|
|
||||||
|
def ShowMiniMap(self):
|
||||||
|
if not self.canSeeInfo:
|
||||||
|
return
|
||||||
|
|
||||||
|
miniMap.Show()
|
||||||
|
self.OpenWindow.Show()
|
||||||
|
self.CloseWindow.Hide()
|
||||||
|
|
||||||
|
def isShowMiniMap(self):
|
||||||
|
return miniMap.isShow()
|
||||||
|
|
||||||
|
def ScaleUp(self):
|
||||||
|
miniMap.ScaleUp()
|
||||||
|
|
||||||
|
def ScaleDown(self):
|
||||||
|
miniMap.ScaleDown()
|
||||||
|
|
||||||
|
def ShowAtlas(self):
|
||||||
|
if not miniMap.IsAtlas():
|
||||||
|
return
|
||||||
|
if not self.AtlasWindow.IsShow():
|
||||||
|
self.AtlasWindow.Show()
|
||||||
|
|
||||||
|
def ToggleAtlasWindow(self):
|
||||||
|
if not miniMap.IsAtlas():
|
||||||
|
return
|
||||||
|
if self.AtlasWindow.IsShow():
|
||||||
|
self.AtlasWindow.Hide()
|
||||||
|
else:
|
||||||
|
self.AtlasWindow.Show()
|
||||||
@@ -0,0 +1,423 @@
|
|||||||
|
import ui
|
||||||
|
import snd
|
||||||
|
import systemSetting
|
||||||
|
import net
|
||||||
|
import chat
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
import chrmgr
|
||||||
|
import player
|
||||||
|
|
||||||
|
MOBILE = False
|
||||||
|
|
||||||
|
if localeInfo.IsYMIR():
|
||||||
|
MOBILE = True
|
||||||
|
|
||||||
|
blockMode = 0
|
||||||
|
|
||||||
|
class OptionDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__Initialize()
|
||||||
|
self.__LoadDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print " -------------------------------------- DELETE OPTION DIALOG"
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.titleBar = 0
|
||||||
|
self.ctrlMusicVolume = 0
|
||||||
|
self.ctrlSoundVolume = 0
|
||||||
|
self.nameColorModeButtonList = []
|
||||||
|
self.viewTargetBoardButtonList = []
|
||||||
|
self.cameraModeButtonList = []
|
||||||
|
self.pvpModeButtonDict = {}
|
||||||
|
self.fogModeButtonList = []
|
||||||
|
self.blockButtonList = []
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
print " -------------------------------------- DESTROY OPTION DIALOG"
|
||||||
|
|
||||||
|
def __LoadDialog(self):
|
||||||
|
global NO_MOBILE
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScriptLoader = ui.PythonScriptLoader()
|
||||||
|
|
||||||
|
if MOBILE:
|
||||||
|
pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog_formobile.py")
|
||||||
|
else:
|
||||||
|
pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("OptionDialog.__LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.titleBar = GetObject("titlebar")
|
||||||
|
self.ctrlMusicVolume = GetObject("music_volume_controller")
|
||||||
|
self.ctrlSoundVolume = GetObject("sound_volume_controller")
|
||||||
|
self.nameColorModeButtonList.append(GetObject("name_color_normal"))
|
||||||
|
self.nameColorModeButtonList.append(GetObject("name_color_empire"))
|
||||||
|
self.viewTargetBoardButtonList.append(GetObject("target_board_no_view"))
|
||||||
|
self.viewTargetBoardButtonList.append(GetObject("target_board_view"))
|
||||||
|
self.cameraModeButtonList.append(GetObject("camera_short"))
|
||||||
|
self.cameraModeButtonList.append(GetObject("camera_long"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level0"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level1"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level2"))
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_PEACE] = GetObject("pvp_peace")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_REVENGE] = GetObject("pvp_revenge")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_GUILD] = GetObject("pvp_guild")
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_FREE] = GetObject("pvp_free")
|
||||||
|
self.blockButtonList.append(GetObject("block_exchange_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_party_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_guild_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_whisper_button"))
|
||||||
|
self.blockButtonList.append(GetObject("block_friend_button"))
|
||||||
|
|
||||||
|
if MOBILE:
|
||||||
|
self.inputMobileButton = GetObject("input_mobile_button")
|
||||||
|
self.deleteMobileButton = GetObject("delete_mobile_button")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("OptionDialog.__LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.ctrlMusicVolume.SetSliderPos(float(systemSetting.GetMusicVolume()))
|
||||||
|
self.ctrlSoundVolume.SetSliderPos(float(systemSetting.GetSoundVolume()) / 5.0)
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.ctrlMusicVolume.SetEvent(ui.__mem_func__(self.OnChangeMusicVolume))
|
||||||
|
self.ctrlSoundVolume.SetEvent(ui.__mem_func__(self.OnChangeSoundVolume))
|
||||||
|
|
||||||
|
self.nameColorModeButtonList[0].SAFE_SetEvent(self.__OnClickNameColorModeNormalButton)
|
||||||
|
self.nameColorModeButtonList[1].SAFE_SetEvent(self.__OnClickNameColorModeEmpireButton)
|
||||||
|
|
||||||
|
self.viewTargetBoardButtonList[0].SAFE_SetEvent(self.__OnClickTargetBoardViewButton)
|
||||||
|
self.viewTargetBoardButtonList[1].SAFE_SetEvent(self.__OnClickTargetBoardNoViewButton)
|
||||||
|
|
||||||
|
self.cameraModeButtonList[0].SAFE_SetEvent(self.__OnClickCameraModeShortButton)
|
||||||
|
self.cameraModeButtonList[1].SAFE_SetEvent(self.__OnClickCameraModeLongButton)
|
||||||
|
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent(self.__OnClickPvPModePeaceButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent(self.__OnClickPvPModeRevengeButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent(self.__OnClickPvPModeGuildButton)
|
||||||
|
self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent(self.__OnClickPvPModeFreeButton)
|
||||||
|
|
||||||
|
self.fogModeButtonList[0].SAFE_SetEvent(self.__OnClickFogModeLevel0Button)
|
||||||
|
self.fogModeButtonList[1].SAFE_SetEvent(self.__OnClickFogModeLevel1Button)
|
||||||
|
self.fogModeButtonList[2].SAFE_SetEvent(self.__OnClickFogModeLevel2Button)
|
||||||
|
|
||||||
|
self.blockButtonList[0].SetToggleUpEvent(self.__OnClickBlockExchangeButton)
|
||||||
|
self.blockButtonList[1].SetToggleUpEvent(self.__OnClickBlockPartyButton)
|
||||||
|
self.blockButtonList[2].SetToggleUpEvent(self.__OnClickBlockGuildButton)
|
||||||
|
self.blockButtonList[3].SetToggleUpEvent(self.__OnClickBlockWhisperButton)
|
||||||
|
self.blockButtonList[4].SetToggleUpEvent(self.__OnClickBlockFriendButton)
|
||||||
|
self.blockButtonList[0].SetToggleDownEvent(self.__OnClickBlockExchangeButton)
|
||||||
|
self.blockButtonList[1].SetToggleDownEvent(self.__OnClickBlockPartyButton)
|
||||||
|
self.blockButtonList[2].SetToggleDownEvent(self.__OnClickBlockGuildButton)
|
||||||
|
self.blockButtonList[3].SetToggleDownEvent(self.__OnClickBlockWhisperButton)
|
||||||
|
self.blockButtonList[4].SetToggleDownEvent(self.__OnClickBlockFriendButton)
|
||||||
|
|
||||||
|
self.__ClickRadioButton(self.fogModeButtonList, constInfo.GET_FOG_LEVEL_INDEX())
|
||||||
|
self.__ClickRadioButton(self.cameraModeButtonList, constInfo.GET_CAMERA_MAX_DISTANCE_INDEX())
|
||||||
|
self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX())
|
||||||
|
self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD())
|
||||||
|
self.__SetPeacePKMode()
|
||||||
|
|
||||||
|
if MOBILE:
|
||||||
|
self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber))
|
||||||
|
self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
|
||||||
|
|
||||||
|
def __ClickRadioButton(self, buttonList, buttonIndex):
|
||||||
|
try:
|
||||||
|
selButton=buttonList[buttonIndex]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
|
for eachButton in buttonList:
|
||||||
|
eachButton.SetUp()
|
||||||
|
|
||||||
|
selButton.Down()
|
||||||
|
|
||||||
|
def __SetNameColorMode(self, index):
|
||||||
|
constInfo.SET_CHRNAME_COLOR_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.nameColorModeButtonList, index)
|
||||||
|
|
||||||
|
def __SetTargetBoardViewMode(self, flag):
|
||||||
|
constInfo.SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(flag)
|
||||||
|
self.__ClickRadioButton(self.viewTargetBoardButtonList, flag)
|
||||||
|
|
||||||
|
def __SetCameraMode(self, index):
|
||||||
|
constInfo.SET_CAMERA_MAX_DISTANCE_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.cameraModeButtonList, index)
|
||||||
|
|
||||||
|
def __SetFogLevel(self, index):
|
||||||
|
constInfo.SET_FOG_LEVEL_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.fogModeButtonList, index)
|
||||||
|
|
||||||
|
def __OnClickNameColorModeNormalButton(self):
|
||||||
|
self.__SetNameColorMode(0)
|
||||||
|
|
||||||
|
def __OnClickNameColorModeEmpireButton(self):
|
||||||
|
self.__SetNameColorMode(1)
|
||||||
|
|
||||||
|
def __OnClickTargetBoardViewButton(self):
|
||||||
|
self.__SetTargetBoardViewMode(0)
|
||||||
|
|
||||||
|
def __OnClickTargetBoardNoViewButton(self):
|
||||||
|
self.__SetTargetBoardViewMode(1)
|
||||||
|
|
||||||
|
def __OnClickCameraModeShortButton(self):
|
||||||
|
self.__SetCameraMode(0)
|
||||||
|
|
||||||
|
def __OnClickCameraModeLongButton(self):
|
||||||
|
self.__SetCameraMode(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel0Button(self):
|
||||||
|
self.__SetFogLevel(0)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel1Button(self):
|
||||||
|
self.__SetFogLevel(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel2Button(self):
|
||||||
|
self.__SetFogLevel(2)
|
||||||
|
|
||||||
|
def __OnClickBlockExchangeButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_EXCHANGE))
|
||||||
|
def __OnClickBlockPartyButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_PARTY))
|
||||||
|
def __OnClickBlockGuildButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_GUILD))
|
||||||
|
def __OnClickBlockWhisperButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_WHISPER))
|
||||||
|
def __OnClickBlockFriendButton(self):
|
||||||
|
self.RefreshBlock()
|
||||||
|
global blockMode
|
||||||
|
net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_FRIEND))
|
||||||
|
|
||||||
|
def __CheckPvPProtectedLevelPlayer(self):
|
||||||
|
if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
|
||||||
|
self.__SetPeacePKMode()
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def __SetPKMode(self, mode):
|
||||||
|
for btn in self.pvpModeButtonDict.values():
|
||||||
|
btn.SetUp()
|
||||||
|
if self.pvpModeButtonDict.has_key(mode):
|
||||||
|
self.pvpModeButtonDict[mode].Down()
|
||||||
|
|
||||||
|
def __SetPeacePKMode(self):
|
||||||
|
self.__SetPKMode(player.PK_MODE_PEACE)
|
||||||
|
|
||||||
|
def __RefreshPVPButtonList(self):
|
||||||
|
self.__SetPKMode(player.GetPKMode())
|
||||||
|
|
||||||
|
def __OnClickPvPModePeaceButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 0", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeRevengeButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 1", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeFreeButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def __OnClickPvPModeGuildButton(self):
|
||||||
|
if self.__CheckPvPProtectedLevelPlayer():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
if 0 == player.GetGuildID():
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
|
||||||
|
return
|
||||||
|
|
||||||
|
if constInfo.PVPMODE_ENABLE:
|
||||||
|
net.SendChatPacket("/pkmode 4", chat.CHAT_TYPE_TALKING)
|
||||||
|
else:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
|
||||||
|
|
||||||
|
def OnChangePKMode(self):
|
||||||
|
self.__RefreshPVPButtonList()
|
||||||
|
|
||||||
|
def OnChangeMusicVolume(self):
|
||||||
|
pos = self.ctrlMusicVolume.GetSliderPos()
|
||||||
|
snd.SetMusicVolume(pos * net.GetFieldMusicVolume())
|
||||||
|
systemSetting.SetMusicVolume(pos)
|
||||||
|
|
||||||
|
def OnChangeSoundVolume(self):
|
||||||
|
pos = self.ctrlSoundVolume.GetSliderPos()
|
||||||
|
snd.SetSoundVolumef(pos)
|
||||||
|
systemSetting.SetSoundVolumef(pos)
|
||||||
|
|
||||||
|
def __OnChangeMobilePhoneNumber(self):
|
||||||
|
|
||||||
|
import uiCommon
|
||||||
|
inputDialog = uiCommon.InputDialog()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_TITLE)
|
||||||
|
inputDialog.SetMaxLength(13)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobilePhoneNumber))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
|
||||||
|
def __OnDeleteMobilePhoneNumber(self):
|
||||||
|
import uiCommon
|
||||||
|
questionDialog = uiCommon.QuestionDialog()
|
||||||
|
questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE_PHONE_NUMBER)
|
||||||
|
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeleteMobile))
|
||||||
|
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||||
|
questionDialog.Open()
|
||||||
|
self.questionDialog = questionDialog
|
||||||
|
|
||||||
|
def OnInputMobilePhoneNumber(self):
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return
|
||||||
|
|
||||||
|
text.replace('-', '')
|
||||||
|
net.SendChatPacket("/mobile " + text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnInputMobileAuthorityCode(self):
|
||||||
|
text = self.inputDialog.GetText()
|
||||||
|
net.SendChatPacket("/mobile_auth " + text)
|
||||||
|
self.OnCloseInputDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnDeleteMobile(self):
|
||||||
|
net.SendChatPacket("/mobile")
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseInputDialog(self):
|
||||||
|
self.inputDialog.Close()
|
||||||
|
self.inputDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseQuestionDialog(self):
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def RefreshMobile(self):
|
||||||
|
global MOBILE
|
||||||
|
if not MOBILE:
|
||||||
|
return
|
||||||
|
|
||||||
|
if player.HasMobilePhoneNumber():
|
||||||
|
self.inputMobileButton.Hide()
|
||||||
|
self.deleteMobileButton.Show()
|
||||||
|
else:
|
||||||
|
self.inputMobileButton.Show()
|
||||||
|
self.deleteMobileButton.Hide()
|
||||||
|
|
||||||
|
def OnMobileAuthority(self):
|
||||||
|
import uiCommon
|
||||||
|
inputDialog = uiCommon.InputDialogWithDescription()
|
||||||
|
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_TITLE)
|
||||||
|
inputDialog.SetDescription(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_DESCRIPTION)
|
||||||
|
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileAuthorityCode))
|
||||||
|
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||||
|
inputDialog.SetMaxLength(4)
|
||||||
|
inputDialog.SetBoardWidth(310)
|
||||||
|
inputDialog.Open()
|
||||||
|
self.inputDialog = inputDialog
|
||||||
|
|
||||||
|
def RefreshBlock(self):
|
||||||
|
global blockMode
|
||||||
|
for i in xrange(len(self.blockButtonList)):
|
||||||
|
if 0 != (blockMode & (1 << i)):
|
||||||
|
self.blockButtonList[i].Down()
|
||||||
|
else:
|
||||||
|
self.blockButtonList[i].SetUp()
|
||||||
|
|
||||||
|
def OnBlockMode(self, mode):
|
||||||
|
global blockMode
|
||||||
|
blockMode = mode
|
||||||
|
self.RefreshBlock()
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
self.RefreshMobile()
|
||||||
|
self.RefreshBlock()
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import chr
|
||||||
|
import background
|
||||||
|
import player
|
||||||
|
|
||||||
|
#wndMgr.SetOutlineFlag(True)
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
|
||||||
|
wnd = OptionDialog()
|
||||||
|
wnd.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
+743
@@ -0,0 +1,743 @@
|
|||||||
|
import ui
|
||||||
|
import grp
|
||||||
|
import player
|
||||||
|
import uiToolTip
|
||||||
|
import net
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
import constInfo
|
||||||
|
import mouseModule
|
||||||
|
|
||||||
|
class PartyMemberInfoBoard(ui.ScriptWindow):
|
||||||
|
if localeInfo.IsJAPAN():
|
||||||
|
BOARD_WIDTH = 130
|
||||||
|
else:
|
||||||
|
BOARD_WIDTH = 106
|
||||||
|
BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.5)
|
||||||
|
GAUGE_OUT_LINE_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 0.3)
|
||||||
|
|
||||||
|
LINK_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
|
||||||
|
UNLINK_COLOR = grp.GenerateColor(0.5, 0.5, 0.5, 1.0)
|
||||||
|
#UNLINK_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
|
||||||
|
|
||||||
|
PARTY_AFFECT_EXPERIENCE = 0
|
||||||
|
PARTY_AFFECT_ATTACKER = 1
|
||||||
|
PARTY_AFFECT_TANKER = 2
|
||||||
|
PARTY_AFFECT_BUFFER = 3
|
||||||
|
PARTY_AFFECT_SKILL_MASTER = 4
|
||||||
|
PARTY_AFFECT_BERSERKER = 5
|
||||||
|
PARTY_AFFECT_DEFENDER = 6
|
||||||
|
#PARTY_AFFECT_TIME_BONUS = 5
|
||||||
|
#PARTY_AFFECT_REGEN_BONUS = 6
|
||||||
|
PARTY_AFFECT_INCREASE_AREA_150 = 7
|
||||||
|
PARTY_AFFECT_INCREASE_AREA_200 = 8
|
||||||
|
AFFECT_STRING_DICT = { PARTY_AFFECT_EXPERIENCE : localeInfo.PARTY_BONUS_EXP,
|
||||||
|
PARTY_AFFECT_ATTACKER : localeInfo.PARTY_BONUS_ATTACKER,
|
||||||
|
PARTY_AFFECT_TANKER : localeInfo.PARTY_BONUS_TANKER,
|
||||||
|
PARTY_AFFECT_BUFFER : localeInfo.PARTY_BONUS_BUFFER,
|
||||||
|
PARTY_AFFECT_SKILL_MASTER : localeInfo.PARTY_BONUS_SKILL_MASTER,
|
||||||
|
PARTY_AFFECT_BERSERKER : localeInfo.PARTY_BONUS_BERSERKER,
|
||||||
|
PARTY_AFFECT_DEFENDER : localeInfo.PARTY_BONUS_DEFENDER,
|
||||||
|
PARTY_AFFECT_INCREASE_AREA_150 : localeInfo.PARTY_INCREASE_AREA_150,
|
||||||
|
PARTY_AFFECT_INCREASE_AREA_200 : localeInfo.PARTY_INCREASE_AREA_200, }
|
||||||
|
|
||||||
|
PARTY_SKILL_HEAL = 1
|
||||||
|
PARTY_SKILL_WARP = 2
|
||||||
|
MEMBER_BUTTON_NORMAL = 10
|
||||||
|
MEMBER_BUTTON_WARP = 11
|
||||||
|
MEMBER_BUTTON_EXPEL = 12
|
||||||
|
MEMBER_BUTTON_PATH = "d:/ymir work/ui/game/windows/"
|
||||||
|
MEMBER_BUTTON_IMAGE_FILE_NAME_DICT = { player.PARTY_STATE_LEADER : "party_state_leader",
|
||||||
|
player.PARTY_STATE_ATTACKER : "party_state_attacker",
|
||||||
|
player.PARTY_STATE_BERSERKER : "party_state_berserker",
|
||||||
|
player.PARTY_STATE_TANKER : "party_state_tanker",
|
||||||
|
player.PARTY_STATE_DEFENDER : "party_state_defender",
|
||||||
|
player.PARTY_STATE_BUFFER : "party_state_buffer",
|
||||||
|
player.PARTY_STATE_SKILL_MASTER : "party_state_skill_master",
|
||||||
|
MEMBER_BUTTON_NORMAL : "party_state_normal",
|
||||||
|
MEMBER_BUTTON_WARP : "party_skill_warp",
|
||||||
|
MEMBER_BUTTON_EXPEL : "party_expel", }
|
||||||
|
|
||||||
|
STATE_NAME_DICT = { player.PARTY_STATE_ATTACKER : localeInfo.PARTY_SET_ATTACKER,
|
||||||
|
player.PARTY_STATE_BERSERKER : localeInfo.PARTY_SET_BERSERKER,
|
||||||
|
player.PARTY_STATE_TANKER : localeInfo.PARTY_SET_TANKER,
|
||||||
|
player.PARTY_STATE_DEFENDER : localeInfo.PARTY_SET_DEFENDER,
|
||||||
|
player.PARTY_STATE_BUFFER : localeInfo.PARTY_SET_BUFFER,
|
||||||
|
player.PARTY_STATE_SKILL_MASTER : localeInfo.PARTY_SET_SKILL_MASTER, }
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.pid = None
|
||||||
|
self.vid = None
|
||||||
|
self.partyAffectImageList = []
|
||||||
|
self.stateButtonDict = {}
|
||||||
|
self.affectValueDict = {}
|
||||||
|
self.state = -1
|
||||||
|
self.isShowStateButton = False
|
||||||
|
|
||||||
|
self.__LoadBoard()
|
||||||
|
self.__CreateAffectToolTip()
|
||||||
|
self.__CreateStateButton()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
print " =============================== DESTROIED PartyMemberInfoBoard"
|
||||||
|
|
||||||
|
def __LoadBoard(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if localeInfo.IsJAPAN():
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "PartyMemberInfoBoard.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/PartyMemberInfoBoard.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PartyMemberInfoBoard.__LoadBoard.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.nameTextLine = self.GetChild("NamePrint")
|
||||||
|
self.gauge = self.GetChild("Gauge")
|
||||||
|
self.stateButton = self.GetChild("StateButton")
|
||||||
|
self.partyAffectImageList.append(self.GetChild("ExperienceImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("AttackerImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("DefenderImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("BufferImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("SkillMasterImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("TimeBonusImage"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("RegenBonus"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("IncreaseArea150"))
|
||||||
|
self.partyAffectImageList.append(self.GetChild("IncreaseArea200"))
|
||||||
|
self.stateButton.SetEvent(ui.__mem_func__(self.OnMouseLeftButtonDown))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PartyMemberInfoBoard.__LoadBoard.BindObject")
|
||||||
|
|
||||||
|
self.__SetAffectsMouseEvent()
|
||||||
|
self.__HideAllAffects()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.nameTextLine = None
|
||||||
|
self.gauge = None
|
||||||
|
self.stateButton = None
|
||||||
|
self.partyAffectImageList = []
|
||||||
|
self.stateButtonDict = {}
|
||||||
|
|
||||||
|
self.leaderButton = None
|
||||||
|
self.attackerButton = None
|
||||||
|
self.tankerButton = None
|
||||||
|
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __SetAffectsMouseEvent(self):
|
||||||
|
for i in xrange(len(self.partyAffectImageList)):
|
||||||
|
self.partyAffectImageList[i].OnMouseOverIn = lambda selfArg = self, index = i: selfArg.OnAffectOverIn(index)
|
||||||
|
for i in xrange(len(self.partyAffectImageList)):
|
||||||
|
self.partyAffectImageList[i].OnMouseOverOut = lambda selfArg = self, index = i: selfArg.OnAffectOverOut(index)
|
||||||
|
|
||||||
|
def __HideAllAffects(self):
|
||||||
|
for img in self.partyAffectImageList:
|
||||||
|
img.Hide()
|
||||||
|
|
||||||
|
def __CreateAffectToolTip(self):
|
||||||
|
affectToolTip = uiToolTip.ToolTip(220)
|
||||||
|
affectToolTip.Hide()
|
||||||
|
self.affectToolTip = affectToolTip
|
||||||
|
|
||||||
|
def __CreateStateButton(self):
|
||||||
|
for key, name in self.MEMBER_BUTTON_IMAGE_FILE_NAME_DICT.items():
|
||||||
|
if key == player.PARTY_STATE_LEADER:
|
||||||
|
continue
|
||||||
|
button = ui.Button()
|
||||||
|
button.SetUpVisual(self.MEMBER_BUTTON_PATH + name + "_01.sub")
|
||||||
|
button.SetOverVisual(self.MEMBER_BUTTON_PATH + name + "_02.sub")
|
||||||
|
button.SetDownVisual(self.MEMBER_BUTTON_PATH + name + "_03.sub")
|
||||||
|
button.Hide()
|
||||||
|
self.stateButtonDict[key] = button
|
||||||
|
|
||||||
|
for state, name in self.STATE_NAME_DICT.items():
|
||||||
|
button = self.stateButtonDict[state]
|
||||||
|
button.SetToolTipText(name)
|
||||||
|
button.SetEvent(ui.__mem_func__(self.OnSelectState), state)
|
||||||
|
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_NORMAL].SetEvent(ui.__mem_func__(self.OnSelectState), -1)
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_NORMAL].SetToolTipText(localeInfo.PARTY_SET_NORMAL)
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_WARP].SetEvent(ui.__mem_func__(self.OnWarp))
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_WARP].SetToolTipText(localeInfo.PARTY_RECALL_MEMBER)
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_EXPEL].SetToolTipText(localeInfo.TARGET_BUTTON_EXCLUDE)
|
||||||
|
self.stateButtonDict[self.MEMBER_BUTTON_EXPEL].SetEvent(ui.__mem_func__(self.OnExpel))
|
||||||
|
|
||||||
|
def __GetPartySkillLevel(self):
|
||||||
|
slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_TONGSOL)
|
||||||
|
skillGrade = player.GetSkillGrade(slotIndex)
|
||||||
|
skillLevel = player.GetSkillLevel(slotIndex)
|
||||||
|
return skillLevel + skillGrade*20
|
||||||
|
|
||||||
|
def __AppendStateButton(self, x, y, state):
|
||||||
|
if state == self.state:
|
||||||
|
button = self.stateButtonDict[self.MEMBER_BUTTON_NORMAL]
|
||||||
|
else:
|
||||||
|
button = self.stateButtonDict[state]
|
||||||
|
|
||||||
|
button.SetPosition(x, y)
|
||||||
|
button.Show()
|
||||||
|
|
||||||
|
def __ShowStateButton(self):
|
||||||
|
self.isShowStateButton = True
|
||||||
|
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
xPos = x + 110
|
||||||
|
|
||||||
|
skillLevel = self.__GetPartySkillLevel()
|
||||||
|
|
||||||
|
## Tanker
|
||||||
|
if skillLevel >= 10:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_ATTACKER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Attacker
|
||||||
|
if skillLevel >= 20:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_BERSERKER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Tanker
|
||||||
|
if skillLevel >= 20:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_TANKER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Buffer
|
||||||
|
if skillLevel >= 25:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_BUFFER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Skill Master
|
||||||
|
if skillLevel >= 35:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_SKILL_MASTER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Defender
|
||||||
|
if skillLevel >= 40:
|
||||||
|
self.__AppendStateButton(xPos, y, player.PARTY_STATE_DEFENDER)
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
## Warp
|
||||||
|
#if skillLevel >= 35:
|
||||||
|
# if self.stateButtonDict.has_key(self.MEMBER_BUTTON_WARP):
|
||||||
|
# button = self.stateButtonDict[self.MEMBER_BUTTON_WARP]
|
||||||
|
# button.SetPosition(xPos, y)
|
||||||
|
# button.Show()
|
||||||
|
# xPos += 23
|
||||||
|
|
||||||
|
## Expel
|
||||||
|
if self.stateButtonDict.has_key(self.MEMBER_BUTTON_EXPEL):
|
||||||
|
button = self.stateButtonDict[self.MEMBER_BUTTON_EXPEL]
|
||||||
|
button.SetPosition(xPos, y)
|
||||||
|
button.Show()
|
||||||
|
xPos += 23
|
||||||
|
|
||||||
|
def __HideStateButton(self):
|
||||||
|
self.isShowStateButton = False
|
||||||
|
for button in self.stateButtonDict.values():
|
||||||
|
button.Hide()
|
||||||
|
|
||||||
|
def __GetAffectNumber(self, img):
|
||||||
|
for i in xrange(self.partyAffectImageList):
|
||||||
|
if img == self.partyAffectImageList[i]:
|
||||||
|
return i
|
||||||
|
|
||||||
|
return -1
|
||||||
|
|
||||||
|
def SetCharacterName(self, name):
|
||||||
|
self.nameTextLine.SetText(name)
|
||||||
|
|
||||||
|
def GetCharacterName(self):
|
||||||
|
return self.nameTextLine.GetText()
|
||||||
|
|
||||||
|
def SetCharacterPID(self, pid):
|
||||||
|
self.pid = pid
|
||||||
|
|
||||||
|
def SetCharacterVID(self, vid):
|
||||||
|
self.vid = vid
|
||||||
|
|
||||||
|
def GetCharacterPID(self):
|
||||||
|
return self.pid
|
||||||
|
|
||||||
|
def GetCharacterVID(self):
|
||||||
|
return self.vid
|
||||||
|
|
||||||
|
def SetCharacterHP(self, hpPercentage):
|
||||||
|
hpPercentage = max(0, hpPercentage)
|
||||||
|
self.gauge.SetPercentage(hpPercentage, 100)
|
||||||
|
|
||||||
|
def SetCharacterState(self, state):
|
||||||
|
|
||||||
|
if self.state == state:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.state = state
|
||||||
|
self.stateButton.Show()
|
||||||
|
|
||||||
|
name = self.MEMBER_BUTTON_IMAGE_FILE_NAME_DICT[self.MEMBER_BUTTON_NORMAL]
|
||||||
|
if self.MEMBER_BUTTON_IMAGE_FILE_NAME_DICT.has_key(state):
|
||||||
|
name = self.MEMBER_BUTTON_IMAGE_FILE_NAME_DICT[state]
|
||||||
|
|
||||||
|
self.stateButton.SetUpVisual(self.MEMBER_BUTTON_PATH + name + "_01.sub")
|
||||||
|
self.stateButton.SetOverVisual(self.MEMBER_BUTTON_PATH + name + "_02.sub")
|
||||||
|
self.stateButton.SetDownVisual(self.MEMBER_BUTTON_PATH + name + "_03.sub")
|
||||||
|
|
||||||
|
def SetAffect(self, affectSlotIndex, affectValue):
|
||||||
|
|
||||||
|
if affectSlotIndex >= len(self.partyAffectImageList):
|
||||||
|
return
|
||||||
|
|
||||||
|
if affectValue > 0:
|
||||||
|
self.partyAffectImageList[affectSlotIndex].Show()
|
||||||
|
else:
|
||||||
|
self.partyAffectImageList[affectSlotIndex].Hide()
|
||||||
|
|
||||||
|
self.affectValueDict[affectSlotIndex] = affectValue
|
||||||
|
|
||||||
|
def Link(self):
|
||||||
|
self.nameTextLine.SetPackedFontColor(self.LINK_COLOR)
|
||||||
|
self.gauge.Show()
|
||||||
|
|
||||||
|
def Unlink(self):
|
||||||
|
self.vid = None
|
||||||
|
self.nameTextLine.SetPackedFontColor(self.UNLINK_COLOR)
|
||||||
|
self.gauge.Hide()
|
||||||
|
self.__HideAllAffects()
|
||||||
|
|
||||||
|
def OnSelectState(self, state):
|
||||||
|
|
||||||
|
self.__HideStateButton()
|
||||||
|
if state <= 0:
|
||||||
|
net.SendPartySetStatePacket(self.pid, self.state, False)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
if self.state <= 0:
|
||||||
|
net.SendPartySetStatePacket(self.pid, state, True)
|
||||||
|
|
||||||
|
else:
|
||||||
|
net.SendPartySetStatePacket(self.pid, self.state, False)
|
||||||
|
net.SendPartySetStatePacket(self.pid, state, True)
|
||||||
|
|
||||||
|
def OnWarp(self):
|
||||||
|
self.__HideStateButton()
|
||||||
|
|
||||||
|
if self.vid:
|
||||||
|
net.SendPartyUseSkillPacket(self.PARTY_SKILL_WARP, self.vid)
|
||||||
|
|
||||||
|
def OnExpel(self):
|
||||||
|
self.__HideStateButton()
|
||||||
|
|
||||||
|
if not self.pid:
|
||||||
|
return
|
||||||
|
net.SendPartyRemovePacket(self.pid)
|
||||||
|
|
||||||
|
def OnMouseLeftButtonDown(self):
|
||||||
|
|
||||||
|
if self.vid:
|
||||||
|
player.SetTarget(self.vid)
|
||||||
|
player.OpenCharacterMenu(self.vid)
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
net.SendExchangeStartPacket(self.vid)
|
||||||
|
net.SendExchangeItemAddPacket(attachedSlotPos, 0)
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
if player.IsPartyLeader(player.GetMainCharacterIndex()):
|
||||||
|
if player.PARTY_STATE_LEADER != self.state:
|
||||||
|
|
||||||
|
if self.isShowStateButton:
|
||||||
|
self.__HideStateButton()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.__ShowStateButton()
|
||||||
|
|
||||||
|
def OnMouseLeftButtonUp(self):
|
||||||
|
|
||||||
|
if self.vid:
|
||||||
|
player.SetTarget(self.vid)
|
||||||
|
player.OpenCharacterMenu(self.vid)
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
net.SendExchangeStartPacket(self.vid)
|
||||||
|
net.SendExchangeItemAddPacket(attachedSlotPos, 0)
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def OnMouseRightButtonDown(self):
|
||||||
|
self.OnMouseLeftButtonDown()
|
||||||
|
|
||||||
|
def OnAffectOverIn(self, index):
|
||||||
|
|
||||||
|
if not self.AFFECT_STRING_DICT.has_key(index):
|
||||||
|
return
|
||||||
|
if not self.affectValueDict.has_key(index):
|
||||||
|
return
|
||||||
|
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
|
||||||
|
self.affectToolTip.ClearToolTip()
|
||||||
|
self.affectToolTip.SetTitle(self.AFFECT_STRING_DICT[index](self.affectValueDict[index]))
|
||||||
|
self.affectToolTip.SetToolTipPosition(x + index*12, y + 11)
|
||||||
|
self.affectToolTip.ShowToolTip()
|
||||||
|
|
||||||
|
def OnAffectOverOut(self, index):
|
||||||
|
self.affectToolTip.HideToolTip()
|
||||||
|
|
||||||
|
class PartyMenu(ui.ThinBoard):
|
||||||
|
|
||||||
|
BUTTON_NAME = ( localeInfo.PARTY_HEAL_ALL_MEMBER, localeInfo.PARTY_BREAK_UP, localeInfo.PARTY_LEAVE )
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ThinBoard.__init__(self)
|
||||||
|
self.buttonDict = {}
|
||||||
|
self.distributionMode = 0
|
||||||
|
self.isLeader = False
|
||||||
|
self.showingButtonList = []
|
||||||
|
self.modeButtonList = {}
|
||||||
|
self.__CreateButtons()
|
||||||
|
self.__CreateModeButtons()
|
||||||
|
def __del__(self):
|
||||||
|
ui.ThinBoard.__del__(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.buttonDict = {}
|
||||||
|
self.showingButtonList = []
|
||||||
|
self.modeButtonList = {}
|
||||||
|
|
||||||
|
def __CreateModeButtons(self):
|
||||||
|
|
||||||
|
self.modeTitle = ui.MakeTextLine(self)
|
||||||
|
self.modeTitle.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE)
|
||||||
|
|
||||||
|
self.modeButtonList = {}
|
||||||
|
|
||||||
|
level = ui.RadioButton()
|
||||||
|
level.SetParent(self)
|
||||||
|
level.SetWindowHorizontalAlignCenter()
|
||||||
|
level.SetEvent(ui.__mem_func__(self.OnClickEXPLevel))
|
||||||
|
level.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
|
||||||
|
level.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
|
||||||
|
level.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
|
||||||
|
level.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_LEVEL)
|
||||||
|
level.SetToolTipText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_LEVEL_TOOLTIP, 70)
|
||||||
|
level.Show()
|
||||||
|
self.modeButtonList[player.PARTY_EXP_NON_DISTRIBUTION] = level
|
||||||
|
|
||||||
|
parity = ui.RadioButton()
|
||||||
|
parity.SetParent(self)
|
||||||
|
parity.SetWindowHorizontalAlignCenter()
|
||||||
|
parity.SetEvent(ui.__mem_func__(self.OnClickEXPDistributeParity))
|
||||||
|
parity.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
|
||||||
|
parity.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
|
||||||
|
parity.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
|
||||||
|
parity.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_PARITY)
|
||||||
|
parity.SetToolTipText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_PARITY_TOOLTIP, 70)
|
||||||
|
parity.Show()
|
||||||
|
self.modeButtonList[player.PARTY_EXP_DISTRIBUTION_PARITY] = parity
|
||||||
|
|
||||||
|
self.ChangePartyParameter(self.distributionMode)
|
||||||
|
|
||||||
|
def __CreateButtons(self):
|
||||||
|
|
||||||
|
for name in self.BUTTON_NAME:
|
||||||
|
button = ui.Button()
|
||||||
|
button.SetParent(self)
|
||||||
|
button.SetWindowHorizontalAlignCenter()
|
||||||
|
button.SetToolTipText(name)
|
||||||
|
self.buttonDict[name] = button
|
||||||
|
|
||||||
|
self.buttonDict[localeInfo.PARTY_HEAL_ALL_MEMBER].SetEvent(ui.__mem_func__(self.OnPartyUseSkill))
|
||||||
|
self.buttonDict[localeInfo.PARTY_HEAL_ALL_MEMBER].SetUpVisual("d:/ymir work/ui/game/windows/Party_Skill_Heal_01.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_HEAL_ALL_MEMBER].SetOverVisual("d:/ymir work/ui/game/windows/Party_Skill_Heal_02.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_HEAL_ALL_MEMBER].SetDownVisual("d:/ymir work/ui/game/windows/Party_Skill_Heal_03.sub")
|
||||||
|
|
||||||
|
self.buttonDict[localeInfo.PARTY_BREAK_UP].SetEvent(net.SendPartyExitPacket)
|
||||||
|
self.buttonDict[localeInfo.PARTY_BREAK_UP].SetUpVisual("d:/ymir work/ui/game/windows/Party_Disband_01.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_BREAK_UP].SetOverVisual("d:/ymir work/ui/game/windows/Party_Disband_02.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_BREAK_UP].SetDownVisual("d:/ymir work/ui/game/windows/Party_Disband_03.sub")
|
||||||
|
|
||||||
|
self.buttonDict[localeInfo.PARTY_LEAVE].SetEvent(net.SendPartyExitPacket)
|
||||||
|
self.buttonDict[localeInfo.PARTY_LEAVE].SetUpVisual("d:/ymir work/ui/game/windows/Party_Exit_01.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_LEAVE].SetOverVisual("d:/ymir work/ui/game/windows/Party_Exit_02.sub")
|
||||||
|
self.buttonDict[localeInfo.PARTY_LEAVE].SetDownVisual("d:/ymir work/ui/game/windows/Party_Exit_03.sub")
|
||||||
|
|
||||||
|
def __ClearShowingButtons(self):
|
||||||
|
self.showingButtonList = []
|
||||||
|
|
||||||
|
def __ArrangeButtons(self):
|
||||||
|
|
||||||
|
STEP_SIZE = 37
|
||||||
|
|
||||||
|
showingButtonCount = len(self.showingButtonList)
|
||||||
|
xPos = (showingButtonCount-1) * (-STEP_SIZE/2)
|
||||||
|
for button in self.showingButtonList:
|
||||||
|
button.SetPosition(xPos, 15)
|
||||||
|
button.Show()
|
||||||
|
xPos += 37
|
||||||
|
|
||||||
|
yPos = 85
|
||||||
|
for button in self.modeButtonList.values():
|
||||||
|
button.SetPosition(0, yPos)
|
||||||
|
yPos += 25
|
||||||
|
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def __ShowButton(self, name):
|
||||||
|
if not self.buttonDict.has_key(name):
|
||||||
|
return
|
||||||
|
|
||||||
|
self.showingButtonList.append(self.buttonDict[name])
|
||||||
|
self.__ArrangeButtons()
|
||||||
|
|
||||||
|
def __HideButton(self, name):
|
||||||
|
if not self.buttonDict.has_key(name):
|
||||||
|
return
|
||||||
|
|
||||||
|
searchingButton = self.buttonDict[name]
|
||||||
|
searchingButton.Hide()
|
||||||
|
for btn in self.showingButtonList:
|
||||||
|
if btn == searchingButton:
|
||||||
|
self.showingButtonList.remove(btn)
|
||||||
|
|
||||||
|
self.__ArrangeButtons()
|
||||||
|
|
||||||
|
def ShowLeaderButton(self):
|
||||||
|
self.isLeader = True
|
||||||
|
self.__ClearShowingButtons()
|
||||||
|
self.__ShowButton(localeInfo.PARTY_BREAK_UP)
|
||||||
|
|
||||||
|
def ShowMemberButton(self):
|
||||||
|
self.isLeader = False
|
||||||
|
self.__ClearShowingButtons()
|
||||||
|
self.__ShowButton(localeInfo.PARTY_LEAVE)
|
||||||
|
|
||||||
|
def OnPartyUseSkill(self):
|
||||||
|
net.SendPartyUseSkillPacket(PartyMemberInfoBoard.PARTY_SKILL_HEAL, 0)
|
||||||
|
self.__HideButton(localeInfo.PARTY_HEAL_ALL_MEMBER)
|
||||||
|
|
||||||
|
def PartyHealReady(self):
|
||||||
|
self.__ShowButton(localeInfo.PARTY_HEAL_ALL_MEMBER)
|
||||||
|
|
||||||
|
def __UpAllModeButtons(self):
|
||||||
|
for button in self.modeButtonList.values():
|
||||||
|
button.SetUp()
|
||||||
|
|
||||||
|
def __SetModeButton(self, mode):
|
||||||
|
self.__UpAllModeButtons()
|
||||||
|
self.modeButtonList[mode].Down()
|
||||||
|
self.distributionMode = mode
|
||||||
|
|
||||||
|
def OnClickEXPLevel(self):
|
||||||
|
self.__SetModeButton(self.distributionMode)
|
||||||
|
if self.isLeader:
|
||||||
|
net.SendPartyParameterPacket(player.PARTY_EXP_NON_DISTRIBUTION)
|
||||||
|
|
||||||
|
def OnClickEXPDistributeParity(self):
|
||||||
|
self.__SetModeButton(self.distributionMode)
|
||||||
|
if self.isLeader:
|
||||||
|
net.SendPartyParameterPacket(player.PARTY_EXP_DISTRIBUTION_PARITY)
|
||||||
|
|
||||||
|
def ChangePartyParameter(self, distributionMode):
|
||||||
|
try:
|
||||||
|
self.__SetModeButton(distributionMode)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
class PartyWindow(ui.Window):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
self.SetPosition(10, 52)
|
||||||
|
self.partyMemberInfoBoardList = []
|
||||||
|
|
||||||
|
self.__CreatePartyMenuButton()
|
||||||
|
self.__CreatePartyMenu()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
print " =============================== DESTROIED PartyWindow"
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.DestroyPartyMemberInfoBoard()
|
||||||
|
self.partyMenu.Destroy()
|
||||||
|
self.partyMenuButton = None
|
||||||
|
self.partyMenu = None
|
||||||
|
|
||||||
|
def DestroyPartyMemberInfoBoard(self):
|
||||||
|
for board in self.partyMemberInfoBoardList:
|
||||||
|
board.Destroy()
|
||||||
|
|
||||||
|
self.partyMemberInfoBoardList = []
|
||||||
|
|
||||||
|
def __CreatePartyMenuButton(self):
|
||||||
|
partyMenuButton = ui.Button()
|
||||||
|
partyMenuButton.SetParent(self)
|
||||||
|
partyMenuButton.SetWindowHorizontalAlignCenter()
|
||||||
|
partyMenuButton.SetWindowVerticalAlignBottom()
|
||||||
|
partyMenuButton.SetPosition(0, 20)
|
||||||
|
partyMenuButton.SetUpVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_01.sub")
|
||||||
|
partyMenuButton.SetOverVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_02.sub")
|
||||||
|
partyMenuButton.SetDownVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_03.sub")
|
||||||
|
partyMenuButton.SetEvent(ui.__mem_func__(self.OnTogglePartyMenu))
|
||||||
|
partyMenuButton.Show()
|
||||||
|
self.partyMenuButton = partyMenuButton
|
||||||
|
|
||||||
|
def __CreatePartyMenu(self):
|
||||||
|
partyMenu = PartyMenu()
|
||||||
|
partyMenu.SetSize(106, 70 + 70)
|
||||||
|
partyMenu.Hide()
|
||||||
|
self.partyMenu = partyMenu
|
||||||
|
|
||||||
|
def AddPartyMember(self, pid, name):
|
||||||
|
|
||||||
|
board = self.__FindPartyMemberInfoBoardByPID(pid)
|
||||||
|
|
||||||
|
if None == board:
|
||||||
|
|
||||||
|
board = PartyMemberInfoBoard()
|
||||||
|
board.SetParent(self)
|
||||||
|
board.SetCharacterPID(pid)
|
||||||
|
|
||||||
|
self.partyMemberInfoBoardList.append(board)
|
||||||
|
self.__ArrangePartyMemberInfoBoard()
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
if not name:
|
||||||
|
name = localeInfo.PARTY_MEMBER_OFFLINE
|
||||||
|
|
||||||
|
board.SetCharacterName(name)
|
||||||
|
board.Unlink()
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def RemovePartyMember(self, pid):
|
||||||
|
|
||||||
|
board = self.__FindPartyMemberInfoBoardByPID(pid)
|
||||||
|
|
||||||
|
if None == board:
|
||||||
|
return
|
||||||
|
|
||||||
|
vid = board.GetCharacterVID()
|
||||||
|
|
||||||
|
if None != vid and player.IsMainCharacterIndex(vid):
|
||||||
|
|
||||||
|
self.ExitParty()
|
||||||
|
player.ExitParty()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
board.Destroy()
|
||||||
|
player.RemovePartyMember(pid)
|
||||||
|
self.partyMemberInfoBoardList.remove(board)
|
||||||
|
self.__ArrangePartyMemberInfoBoard()
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def UpdatePartyMemberInfo(self, pid):
|
||||||
|
|
||||||
|
board = self.__FindPartyMemberInfoBoardByPID(pid)
|
||||||
|
|
||||||
|
if None == board:
|
||||||
|
return
|
||||||
|
|
||||||
|
state = player.GetPartyMemberState(pid)
|
||||||
|
hpPercentage = player.GetPartyMemberHPPercentage(pid)
|
||||||
|
affectsList = player.GetPartyMemberAffects(pid)
|
||||||
|
|
||||||
|
board.SetCharacterState(state)
|
||||||
|
board.SetCharacterHP(hpPercentage)
|
||||||
|
for i in xrange(len(affectsList)):
|
||||||
|
board.SetAffect(i, affectsList[i])
|
||||||
|
|
||||||
|
vid = board.GetCharacterVID()
|
||||||
|
if None != vid:
|
||||||
|
if player.IsMainCharacterIndex(vid):
|
||||||
|
if player.PARTY_STATE_LEADER == player.GetPartyMemberState(pid):
|
||||||
|
self.partyMenu.ShowLeaderButton()
|
||||||
|
else:
|
||||||
|
self.partyMenu.ShowMemberButton()
|
||||||
|
|
||||||
|
def LinkPartyMember(self, pid, vid):
|
||||||
|
|
||||||
|
board = self.__FindPartyMemberInfoBoardByPID(pid)
|
||||||
|
|
||||||
|
if None == board:
|
||||||
|
return
|
||||||
|
|
||||||
|
board.Link()
|
||||||
|
board.SetCharacterVID(vid)
|
||||||
|
|
||||||
|
def UnlinkPartyMember(self, pid):
|
||||||
|
|
||||||
|
board = self.__FindPartyMemberInfoBoardByPID(pid)
|
||||||
|
|
||||||
|
if None == board:
|
||||||
|
return
|
||||||
|
|
||||||
|
board.Unlink()
|
||||||
|
|
||||||
|
def UnlinkAllPartyMember(self):
|
||||||
|
for board in self.partyMemberInfoBoardList:
|
||||||
|
board.Unlink()
|
||||||
|
|
||||||
|
def ExitParty(self):
|
||||||
|
self.partyMenu.Hide()
|
||||||
|
self.DestroyPartyMemberInfoBoard()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __ArrangePartyMemberInfoBoard(self):
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
newHeight = 20
|
||||||
|
|
||||||
|
for board in self.partyMemberInfoBoardList:
|
||||||
|
board.SetPosition(0, count * (board.GetHeight() + 2))
|
||||||
|
count += 1
|
||||||
|
newHeight += board.GetHeight() + 2
|
||||||
|
|
||||||
|
self.SetSize(PartyMemberInfoBoard.BOARD_WIDTH, newHeight)
|
||||||
|
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
self.partyMenu.SetPosition(10, y + newHeight + 2)
|
||||||
|
|
||||||
|
def __FindPartyMemberInfoBoardByVID(self, vid):
|
||||||
|
for board in self.partyMemberInfoBoardList:
|
||||||
|
if vid == board.GetCharacterVID():
|
||||||
|
return board
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def __FindPartyMemberInfoBoardByPID(self, pid):
|
||||||
|
for board in self.partyMemberInfoBoardList:
|
||||||
|
if pid == board.GetCharacterPID():
|
||||||
|
return board
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def PartyHealReady(self):
|
||||||
|
self.partyMenu.PartyHealReady()
|
||||||
|
|
||||||
|
def ChangePartyParameter(self, distributionMode):
|
||||||
|
self.partyMenu.ChangePartyParameter(distributionMode)
|
||||||
|
|
||||||
|
def OnTogglePartyMenu(self):
|
||||||
|
if self.partyMenu.IsShow():
|
||||||
|
self.partyMenuButton.SetUpVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_01.sub")
|
||||||
|
self.partyMenuButton.SetOverVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_02.sub")
|
||||||
|
self.partyMenuButton.SetDownVisual("d:/ymir work/ui/game/windows/Party_Menu_Open_03.sub")
|
||||||
|
self.partyMenu.Hide()
|
||||||
|
else:
|
||||||
|
self.partyMenuButton.SetUpVisual("d:/ymir work/ui/game/windows/Party_Menu_Close_01.sub")
|
||||||
|
self.partyMenuButton.SetOverVisual("d:/ymir work/ui/game/windows/Party_Menu_Close_02.sub")
|
||||||
|
self.partyMenuButton.SetDownVisual("d:/ymir work/ui/game/windows/Party_Menu_Close_03.sub")
|
||||||
|
self.partyMenu.Show()
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import wndMgr
|
||||||
|
import app
|
||||||
|
|
||||||
|
class PhaseCurtain(ui.Bar):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW CURTAIN ----------------------------------------------------------------------------"
|
||||||
|
ui.Bar.__init__(self, "CURTAIN")
|
||||||
|
self.speed = 0.1
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.event = 0
|
||||||
|
self.args = -1
|
||||||
|
self.FadeInFlag = False
|
||||||
|
self.SetWindowName("PhaseCurtain")
|
||||||
|
self.AddFlag("float")
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE CURTAIN"
|
||||||
|
ui.Bar.__del__(self)
|
||||||
|
|
||||||
|
def SAFE_FadeOut(self, event, args = -1):
|
||||||
|
self.FadeOut(ui.__mem_func__(event), args)
|
||||||
|
|
||||||
|
def FadeOut(self, event, args = -1):
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.SetAlpha(self.curAlpha)
|
||||||
|
#self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
self.event = event
|
||||||
|
self.args = args
|
||||||
|
|
||||||
|
def FadeIn(self):
|
||||||
|
self.event = 0
|
||||||
|
self.FadeInFlag = True
|
||||||
|
|
||||||
|
def SetAlpha(self, alpha):
|
||||||
|
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
|
||||||
|
|
||||||
|
color = grp.GenerateColor(0.0, 0.0, 0.0, alpha)
|
||||||
|
self.SetColor(color)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
if 0 != self.event:
|
||||||
|
|
||||||
|
self.curAlpha += self.speed
|
||||||
|
if self.curAlpha >= 1.0:
|
||||||
|
self.curAlpha = 1.0
|
||||||
|
|
||||||
|
# 이벤트 중간에 멈출경우를 대비해 미리 제거
|
||||||
|
event=self.event
|
||||||
|
self.event = 0
|
||||||
|
|
||||||
|
#print "페이드 아웃 완료 이벤트 실행"
|
||||||
|
|
||||||
|
if -1 != self.args:
|
||||||
|
event(self.args)
|
||||||
|
else:
|
||||||
|
event()
|
||||||
|
|
||||||
|
elif True == self.FadeInFlag:
|
||||||
|
|
||||||
|
self.curAlpha -= self.speed
|
||||||
|
if self.curAlpha <= 0.0:
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.eventFadeIn = 0
|
||||||
|
self.FadeInFlag = False
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
self.SetAlpha(self.curAlpha)
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
import wndMgr
|
||||||
|
import ui
|
||||||
|
import ime
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
class PickMoneyDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.unitValue = 1
|
||||||
|
self.maxValue = 0
|
||||||
|
self.eventAccept = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/PickMoneyDialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MoneyDialog.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("board")
|
||||||
|
self.maxValueTextLine = self.GetChild("max_value")
|
||||||
|
self.pickValueEditLine = self.GetChild("money_value")
|
||||||
|
self.acceptButton = self.GetChild("accept_button")
|
||||||
|
self.cancelButton = self.GetChild("cancel_button")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MoneyDialog.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.pickValueEditLine.SetReturnEvent(ui.__mem_func__(self.OnAccept))
|
||||||
|
self.pickValueEditLine.SetEscapeEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept))
|
||||||
|
self.cancelButton.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.eventAccept = 0
|
||||||
|
self.maxValue = 0
|
||||||
|
self.pickValueEditLine = 0
|
||||||
|
self.acceptButton = 0
|
||||||
|
self.cancelButton = 0
|
||||||
|
self.board = None
|
||||||
|
|
||||||
|
def SetTitleName(self, text):
|
||||||
|
self.board.SetTitleName(text)
|
||||||
|
|
||||||
|
def SetAcceptEvent(self, event):
|
||||||
|
self.eventAccept = event
|
||||||
|
|
||||||
|
def SetMax(self, max):
|
||||||
|
self.pickValueEditLine.SetMax(max)
|
||||||
|
|
||||||
|
def Open(self, maxValue, unitValue=1):
|
||||||
|
|
||||||
|
if localeInfo.IsYMIR() or localeInfo.IsCHEONMA() or localeInfo.IsHONGKONG():
|
||||||
|
unitValue = ""
|
||||||
|
|
||||||
|
width = self.GetWidth()
|
||||||
|
(mouseX, mouseY) = wndMgr.GetMousePosition()
|
||||||
|
|
||||||
|
if mouseX + width/2 > wndMgr.GetScreenWidth():
|
||||||
|
xPos = wndMgr.GetScreenWidth() - width
|
||||||
|
elif mouseX - width/2 < 0:
|
||||||
|
xPos = 0
|
||||||
|
else:
|
||||||
|
xPos = mouseX - width/2
|
||||||
|
|
||||||
|
self.SetPosition(xPos, mouseY - self.GetHeight() - 20)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.maxValueTextLine.SetText("/" + str(maxValue))
|
||||||
|
else:
|
||||||
|
self.maxValueTextLine.SetText(" / " + str(maxValue))
|
||||||
|
|
||||||
|
self.pickValueEditLine.SetText(str(unitValue))
|
||||||
|
self.pickValueEditLine.SetFocus()
|
||||||
|
|
||||||
|
ime.SetCursorPosition(1)
|
||||||
|
|
||||||
|
self.unitValue = unitValue
|
||||||
|
self.maxValue = maxValue
|
||||||
|
self.Show()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.pickValueEditLine.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnAccept(self):
|
||||||
|
|
||||||
|
text = self.pickValueEditLine.GetText()
|
||||||
|
|
||||||
|
if len(text) > 0 and text.isdigit():
|
||||||
|
|
||||||
|
money = int(text)
|
||||||
|
money = min(money, self.maxValue)
|
||||||
|
|
||||||
|
if money > 0:
|
||||||
|
if self.eventAccept:
|
||||||
|
self.eventAccept(money)
|
||||||
|
|
||||||
|
self.Close()
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
import ui
|
||||||
|
import player
|
||||||
|
import chr
|
||||||
|
import textTail
|
||||||
|
|
||||||
|
class PlayerGauge(ui.Gauge):
|
||||||
|
|
||||||
|
def __init__(self, parent):
|
||||||
|
ui.Gauge.__init__(self)
|
||||||
|
self.SetParent(parent)
|
||||||
|
self.AddFlag("not_pick")
|
||||||
|
self.MakeGauge(100, "red")
|
||||||
|
|
||||||
|
self.curHP = 0
|
||||||
|
self.maxHP = 0
|
||||||
|
|
||||||
|
self.showAlways = False
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Gauge.__del__(self)
|
||||||
|
|
||||||
|
def Hide(self):
|
||||||
|
self.SetPosition(-100, -100)
|
||||||
|
ui.Gauge.Hide(self)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
playerIndex = player.GetMainCharacterIndex()
|
||||||
|
|
||||||
|
(x, y, z)=textTail.GetPosition(playerIndex)
|
||||||
|
|
||||||
|
isChat = textTail.IsChat(playerIndex)
|
||||||
|
ui.Gauge.SetPosition(self, int(x - self.GetWidth()/2), int(y + 5) + isChat*17)
|
||||||
|
|
||||||
|
def RefreshGauge(self):
|
||||||
|
|
||||||
|
self.curHP = player.GetStatus(player.HP)
|
||||||
|
self.maxHP = player.GetStatus(player.MAX_HP)
|
||||||
|
self.SetPercentage(self.curHP, self.maxHP)
|
||||||
|
|
||||||
|
if self.showAlways:
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
if self.IsShow():
|
||||||
|
if self.curHP > self.maxHP / 2:
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
else:
|
||||||
|
if self.curHP < self.maxHP / 2:
|
||||||
|
self.OnUpdate()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def EnableShowAlways(self):
|
||||||
|
self.showAlways = True
|
||||||
|
self.RefreshGauge()
|
||||||
|
|
||||||
|
def DisableShowAlways(self):
|
||||||
|
self.showAlways = False
|
||||||
|
self.RefreshGauge()
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import net
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import networkModule
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
## PointReset
|
||||||
|
class PointResetDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.ConfirmDialog = ui.ScriptWindow()
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
|
||||||
|
PythonScriptLoader.LoadScriptFile(self.ConfirmDialog, "uiscript/questiondialog2.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PointResetDialog.LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject = self.ConfirmDialog.GetChild
|
||||||
|
self.ConfirmText = GetObject("message1")
|
||||||
|
self.ConfirmText2 = GetObject("message2")
|
||||||
|
self.ConfirmAcceptButton = GetObject("accept")
|
||||||
|
self.ConfirmCancelButton = GetObject("cancel")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PointResetDialog.LoadWindow.BindObject")
|
||||||
|
|
||||||
|
self.GetChild("message1").SetText("스탯/스킬 포인트를 초기화해주겠네.")
|
||||||
|
self.GetChild("message2").SetText("가격은 500원이야. 어때, 초기화할텐가?")
|
||||||
|
self.GetChild("accept").SetEvent(ui.__mem_func__(self.OpenConfirmDialog))
|
||||||
|
self.GetChild("cancel").SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
## Confirm Dialog
|
||||||
|
self.ConfirmText.SetText("현재 레벨의 경험치가 모두 없어진다네.")
|
||||||
|
self.ConfirmText.SetFontColor(1.0, 0.3, 0.3)
|
||||||
|
self.ConfirmText2.SetText("정말 초기화하고 싶은가?")
|
||||||
|
self.ConfirmAcceptButton.SetEvent(ui.__mem_func__(self.ResetPoint))
|
||||||
|
self.ConfirmCancelButton.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.ConfirmDialog.ClearDictionary()
|
||||||
|
self.ConfirmAcceptButton.SetEvent(0)
|
||||||
|
self.ConfirmCancelButton.SetEvent(0)
|
||||||
|
|
||||||
|
self.ConfirmDialog = 0
|
||||||
|
self.ConfirmText = 0
|
||||||
|
self.ConfirmAcceptButton = 0
|
||||||
|
self.ConfirmCancelButton = 0
|
||||||
|
|
||||||
|
def OpenDialog(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def OpenConfirmDialog(self):
|
||||||
|
self.ConfirmDialog.Show()
|
||||||
|
self.ConfirmDialog.SetTop()
|
||||||
|
|
||||||
|
def ResetPoint(self):
|
||||||
|
net.SendChatPacket("/pointreset")
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.ConfirmDialog.Hide()
|
||||||
|
self.Hide()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
@@ -0,0 +1,347 @@
|
|||||||
|
import ui
|
||||||
|
import snd
|
||||||
|
import shop
|
||||||
|
import mouseModule
|
||||||
|
import player
|
||||||
|
import chr
|
||||||
|
import net
|
||||||
|
import uiCommon
|
||||||
|
import localeInfo
|
||||||
|
import chat
|
||||||
|
import item
|
||||||
|
import systemSetting #김준호
|
||||||
|
import player #김준호
|
||||||
|
|
||||||
|
g_isBuildingPrivateShop = False
|
||||||
|
|
||||||
|
g_itemPriceDict={}
|
||||||
|
|
||||||
|
g_privateShopAdvertisementBoardDict={}
|
||||||
|
|
||||||
|
def Clear():
|
||||||
|
global g_itemPriceDict
|
||||||
|
global g_isBuildingPrivateShop
|
||||||
|
g_itemPriceDict={}
|
||||||
|
g_isBuildingPrivateShop = False
|
||||||
|
|
||||||
|
def IsPrivateShopItemPriceList():
|
||||||
|
global g_itemPriceDict
|
||||||
|
if g_itemPriceDict:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def IsBuildingPrivateShop():
|
||||||
|
global g_isBuildingPrivateShop
|
||||||
|
if player.IsOpenPrivateShop() or g_isBuildingPrivateShop:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def SetPrivateShopItemPrice(itemVNum, itemPrice):
|
||||||
|
global g_itemPriceDict
|
||||||
|
g_itemPriceDict[int(itemVNum)]=itemPrice
|
||||||
|
|
||||||
|
def GetPrivateShopItemPrice(itemVNum):
|
||||||
|
try:
|
||||||
|
global g_itemPriceDict
|
||||||
|
return g_itemPriceDict[itemVNum]
|
||||||
|
except KeyError:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def UpdateADBoard():
|
||||||
|
for key in g_privateShopAdvertisementBoardDict.keys():
|
||||||
|
g_privateShopAdvertisementBoardDict[key].Show()
|
||||||
|
|
||||||
|
def DeleteADBoard(vid):
|
||||||
|
if not g_privateShopAdvertisementBoardDict.has_key(vid):
|
||||||
|
return
|
||||||
|
|
||||||
|
del g_privateShopAdvertisementBoardDict[vid]
|
||||||
|
|
||||||
|
|
||||||
|
class PrivateShopAdvertisementBoard(ui.ThinBoard):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ThinBoard.__init__(self, "UI_BOTTOM")
|
||||||
|
self.vid = None
|
||||||
|
self.__MakeTextLine()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ThinBoard.__del__(self)
|
||||||
|
|
||||||
|
def __MakeTextLine(self):
|
||||||
|
self.textLine = ui.TextLine()
|
||||||
|
self.textLine.SetParent(self)
|
||||||
|
self.textLine.SetWindowHorizontalAlignCenter()
|
||||||
|
self.textLine.SetWindowVerticalAlignCenter()
|
||||||
|
self.textLine.SetHorizontalAlignCenter()
|
||||||
|
self.textLine.SetVerticalAlignCenter()
|
||||||
|
self.textLine.Show()
|
||||||
|
|
||||||
|
def Open(self, vid, text):
|
||||||
|
self.vid = vid
|
||||||
|
|
||||||
|
self.textLine.SetText(text)
|
||||||
|
self.textLine.UpdateRect()
|
||||||
|
self.SetSize(len(text)*6 + 10*2, 20)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
g_privateShopAdvertisementBoardDict[vid] = self
|
||||||
|
|
||||||
|
def OnMouseLeftButtonUp(self):
|
||||||
|
if not self.vid:
|
||||||
|
return
|
||||||
|
net.SendOnClickPacket(self.vid)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
if not self.vid:
|
||||||
|
return
|
||||||
|
|
||||||
|
if systemSetting.IsShowSalesText():
|
||||||
|
self.Show()
|
||||||
|
x, y = chr.GetProjectPosition(self.vid, 220)
|
||||||
|
self.SetPosition(x - self.GetWidth()/2, y - self.GetHeight()/2)
|
||||||
|
|
||||||
|
else:
|
||||||
|
for key in g_privateShopAdvertisementBoardDict.keys():
|
||||||
|
if player.GetMainCharacterIndex() == key: #상점풍선을 안보이게 감추는 경우에도, 플레이어 자신의 상점 풍선은 보이도록 함. by 김준호
|
||||||
|
g_privateShopAdvertisementBoardDict[key].Show()
|
||||||
|
x, y = chr.GetProjectPosition(player.GetMainCharacterIndex(), 220)
|
||||||
|
g_privateShopAdvertisementBoardDict[key].SetPosition(x - self.GetWidth()/2, y - self.GetHeight()/2)
|
||||||
|
else:
|
||||||
|
g_privateShopAdvertisementBoardDict[key].Hide()
|
||||||
|
|
||||||
|
class PrivateShopBuilder(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
#print "NEW MAKE_PRIVATE_SHOP_WINDOW ----------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__LoadWindow()
|
||||||
|
self.itemStock = {}
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.priceInputBoard = None
|
||||||
|
self.title = ""
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
#print "------------------------------------------------------------- DELETE MAKE_PRIVATE_SHOP_WINDOW"
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/PrivateShopBuilder.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PrivateShopBuilderWindow.LoadWindow.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.nameLine = GetObject("NameLine")
|
||||||
|
self.itemSlot = GetObject("ItemSlot")
|
||||||
|
self.btnOk = GetObject("OkButton")
|
||||||
|
self.btnClose = GetObject("CloseButton")
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PrivateShopBuilderWindow.LoadWindow.BindObject")
|
||||||
|
|
||||||
|
self.btnOk.SetEvent(ui.__mem_func__(self.OnOk))
|
||||||
|
self.btnClose.SetEvent(ui.__mem_func__(self.OnClose))
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.OnClose))
|
||||||
|
|
||||||
|
self.itemSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.OnSelectEmptySlot))
|
||||||
|
self.itemSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.OnSelectItemSlot))
|
||||||
|
self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OnOverInItem))
|
||||||
|
self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OnOverOutItem))
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.nameLine = None
|
||||||
|
self.itemSlot = None
|
||||||
|
self.btnOk = None
|
||||||
|
self.btnClose = None
|
||||||
|
self.titleBar = None
|
||||||
|
self.priceInputBoard = None
|
||||||
|
|
||||||
|
def Open(self, title):
|
||||||
|
|
||||||
|
self.title = title
|
||||||
|
|
||||||
|
if len(title) > 25:
|
||||||
|
title = title[:22] + "..."
|
||||||
|
|
||||||
|
self.itemStock = {}
|
||||||
|
shop.ClearPrivateShopStock()
|
||||||
|
self.nameLine.SetText(title)
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.Refresh()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
global g_isBuildingPrivateShop
|
||||||
|
g_isBuildingPrivateShop = True
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
global g_isBuildingPrivateShop
|
||||||
|
g_isBuildingPrivateShop = False
|
||||||
|
|
||||||
|
self.title = ""
|
||||||
|
self.itemStock = {}
|
||||||
|
shop.ClearPrivateShopStock()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
getitemVNum=player.GetItemIndex
|
||||||
|
getItemCount=player.GetItemCount
|
||||||
|
setitemVNum=self.itemSlot.SetItemSlot
|
||||||
|
delItem=self.itemSlot.ClearSlot
|
||||||
|
|
||||||
|
for i in xrange(shop.SHOP_SLOT_COUNT):
|
||||||
|
|
||||||
|
if not self.itemStock.has_key(i):
|
||||||
|
delItem(i)
|
||||||
|
continue
|
||||||
|
|
||||||
|
pos = self.itemStock[i]
|
||||||
|
|
||||||
|
itemCount = getItemCount(*pos)
|
||||||
|
if itemCount <= 1:
|
||||||
|
itemCount = 0
|
||||||
|
setitemVNum(i, getitemVNum(*pos), itemCount)
|
||||||
|
|
||||||
|
self.itemSlot.RefreshSlot()
|
||||||
|
|
||||||
|
def OnSelectEmptySlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
if isAttached:
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
if player.SLOT_TYPE_INVENTORY != attachedSlotType and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType:
|
||||||
|
return
|
||||||
|
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
|
||||||
|
|
||||||
|
itemVNum = player.GetItemIndex(attachedInvenType, attachedSlotPos)
|
||||||
|
item.SelectItem(itemVNum)
|
||||||
|
|
||||||
|
if item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.PRIVATE_SHOP_CANNOT_SELL_ITEM)
|
||||||
|
return
|
||||||
|
|
||||||
|
priceInputBoard = uiCommon.MoneyInputDialog()
|
||||||
|
priceInputBoard.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_PRICE_DIALOG_TITLE)
|
||||||
|
priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice))
|
||||||
|
priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice))
|
||||||
|
priceInputBoard.Open()
|
||||||
|
|
||||||
|
itemPrice=GetPrivateShopItemPrice(itemVNum)
|
||||||
|
|
||||||
|
if itemPrice>0:
|
||||||
|
priceInputBoard.SetValue(itemPrice)
|
||||||
|
|
||||||
|
self.priceInputBoard = priceInputBoard
|
||||||
|
self.priceInputBoard.itemVNum = itemVNum
|
||||||
|
self.priceInputBoard.sourceWindowType = attachedInvenType
|
||||||
|
self.priceInputBoard.sourceSlotPos = attachedSlotPos
|
||||||
|
self.priceInputBoard.targetSlotPos = selectedSlotPos
|
||||||
|
|
||||||
|
def OnSelectItemSlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
if isAttached:
|
||||||
|
snd.PlaySound("sound/ui/loginfail.wav")
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
else:
|
||||||
|
if not selectedSlotPos in self.itemStock:
|
||||||
|
return
|
||||||
|
|
||||||
|
invenType, invenPos = self.itemStock[selectedSlotPos]
|
||||||
|
shop.DelPrivateShopItemStock(invenType, invenPos)
|
||||||
|
snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
|
||||||
|
del self.itemStock[selectedSlotPos]
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def AcceptInputPrice(self):
|
||||||
|
|
||||||
|
if not self.priceInputBoard:
|
||||||
|
return True
|
||||||
|
|
||||||
|
text = self.priceInputBoard.GetText()
|
||||||
|
|
||||||
|
if not text:
|
||||||
|
return True
|
||||||
|
|
||||||
|
if not text.isdigit():
|
||||||
|
return True
|
||||||
|
|
||||||
|
if int(text) <= 0:
|
||||||
|
return True
|
||||||
|
|
||||||
|
attachedInvenType = self.priceInputBoard.sourceWindowType
|
||||||
|
sourceSlotPos = self.priceInputBoard.sourceSlotPos
|
||||||
|
targetSlotPos = self.priceInputBoard.targetSlotPos
|
||||||
|
|
||||||
|
for privatePos, (itemWindowType, itemSlotIndex) in self.itemStock.items():
|
||||||
|
if itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos:
|
||||||
|
shop.DelPrivateShopItemStock(itemWindowType, itemSlotIndex)
|
||||||
|
del self.itemStock[privatePos]
|
||||||
|
|
||||||
|
price = int(self.priceInputBoard.GetText())
|
||||||
|
|
||||||
|
if IsPrivateShopItemPriceList():
|
||||||
|
SetPrivateShopItemPrice(self.priceInputBoard.itemVNum, price)
|
||||||
|
|
||||||
|
shop.AddPrivateShopItemStock(attachedInvenType, sourceSlotPos, targetSlotPos, price)
|
||||||
|
self.itemStock[targetSlotPos] = (attachedInvenType, sourceSlotPos)
|
||||||
|
snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
self.priceInputBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def CancelInputPrice(self):
|
||||||
|
self.priceInputBoard = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnOk(self):
|
||||||
|
|
||||||
|
if not self.title:
|
||||||
|
return
|
||||||
|
|
||||||
|
if 0 == len(self.itemStock):
|
||||||
|
return
|
||||||
|
|
||||||
|
shop.BuildPrivateShop(self.title)
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnClose(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnOverInItem(self, slotIndex):
|
||||||
|
|
||||||
|
if self.tooltipItem:
|
||||||
|
if self.itemStock.has_key(slotIndex):
|
||||||
|
self.tooltipItem.SetPrivateShopBuilderItem(*self.itemStock[slotIndex] + (slotIndex,))
|
||||||
|
|
||||||
|
def OnOverOutItem(self):
|
||||||
|
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
+904
@@ -0,0 +1,904 @@
|
|||||||
|
import ui
|
||||||
|
import dbg
|
||||||
|
import app
|
||||||
|
import grp
|
||||||
|
import grpImage
|
||||||
|
import event
|
||||||
|
import time
|
||||||
|
import wndMgr
|
||||||
|
import net
|
||||||
|
import sys
|
||||||
|
|
||||||
|
QUEST_BOARD_IMAGE_DIR = 'd:/ymir work/ui/game/questboard/'
|
||||||
|
|
||||||
|
cur_questpage_number = 1
|
||||||
|
entire_questbutton_number = 0
|
||||||
|
entire_questpage_number = 1
|
||||||
|
|
||||||
|
|
||||||
|
# TOOLTIP_IMAGE_BOX
|
||||||
|
class ToolTipImageBox(ui.ImageBox):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ImageBox.__init__(self)
|
||||||
|
self.DestroyToolTip()
|
||||||
|
def __del__(self):
|
||||||
|
ui.ImageBox.__del__(self)
|
||||||
|
|
||||||
|
def CreateToolTip(self, parent, title, desc, x, y):
|
||||||
|
import uiToolTip
|
||||||
|
self.toolTip = uiToolTip.ToolTip()
|
||||||
|
self.toolTip.SetWindowHorizontalAlignCenter()
|
||||||
|
self.toolTip.SetFollow(False)
|
||||||
|
self.toolTip.SetTitle(title)
|
||||||
|
self.toolTip.SetPosition(x, y)
|
||||||
|
|
||||||
|
desc = desc.replace("|", "/")
|
||||||
|
for line in desc.split("/"):
|
||||||
|
self.toolTip.AutoAppendTextLine(line)
|
||||||
|
|
||||||
|
self.toolTip.ResizeToolTip()
|
||||||
|
self.toolTip.Hide()
|
||||||
|
|
||||||
|
def DestroyToolTip(self):
|
||||||
|
self.toolTip = None
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
if self.toolTip:
|
||||||
|
self.toolTip.SetTop()
|
||||||
|
self.toolTip.Show()
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
if self.toolTip:
|
||||||
|
self.toolTip.Hide()
|
||||||
|
# END_OF_TOOLTIP_IMAGE_BOX
|
||||||
|
|
||||||
|
class QuestCurtain(ui.Window):
|
||||||
|
CURTAIN_TIME = 0.25
|
||||||
|
CURTAIN_SPEED = 200
|
||||||
|
BarHeight = 60
|
||||||
|
OnDoneEventList = []
|
||||||
|
def __init__(self,layer="TOP_MOST"):
|
||||||
|
ui.Window.__init__(self,layer)
|
||||||
|
self.TopBar = ui.Bar("TOP_MOST")
|
||||||
|
self.BottomBar = ui.Bar("TOP_MOST")
|
||||||
|
|
||||||
|
self.TopBar.Show()
|
||||||
|
self.BottomBar.Show()
|
||||||
|
|
||||||
|
self.TopBar.SetColor(0xff000000)
|
||||||
|
self.BottomBar.SetColor(0xff000000)
|
||||||
|
|
||||||
|
self.TopBar.SetPosition(0,-self.BarHeight)
|
||||||
|
self.TopBar.SetSize(wndMgr.GetScreenWidth(),self.BarHeight)
|
||||||
|
|
||||||
|
self.BottomBar.SetPosition(0,wndMgr.GetScreenHeight())
|
||||||
|
self.BottomBar.SetSize(wndMgr.GetScreenWidth(),self.BarHeight)
|
||||||
|
|
||||||
|
self.CurtainMode = 0
|
||||||
|
|
||||||
|
self.lastclock = time.clock()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.CurtainMode = 0
|
||||||
|
self.TopBar.SetPosition(0, -self.BarHeight-1)
|
||||||
|
self.BottomBar.SetPosition(0, wndMgr.GetScreenHeight()+1)
|
||||||
|
for OnDoneEvent in QuestCurtain.OnDoneEventList:
|
||||||
|
apply(OnDoneEvent,(self,))
|
||||||
|
QuestCurtain.OnDoneEventList = []
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
dt = time.clock() - self.lastclock
|
||||||
|
if self.CurtainMode>0:
|
||||||
|
self.TopBar.SetPosition(0, int(self.TopBar.GetGlobalPosition()[1]+dt*self.CURTAIN_SPEED))
|
||||||
|
self.BottomBar.SetPosition(0, int(self.BottomBar.GetGlobalPosition()[1]-dt*self.CURTAIN_SPEED))
|
||||||
|
if self.TopBar.GetGlobalPosition()[1]>0:
|
||||||
|
self.TopBar.SetPosition(0,0)
|
||||||
|
self.BottomBar.SetPosition(0,wndMgr.GetScreenHeight()-self.BarHeight)
|
||||||
|
self.CurtainMode = 0
|
||||||
|
|
||||||
|
elif self.CurtainMode<0:
|
||||||
|
self.TopBar.SetPosition(0, int(self.TopBar.GetGlobalPosition()[1]-dt*self.CURTAIN_SPEED))
|
||||||
|
self.BottomBar.SetPosition(0, int(self.BottomBar.GetGlobalPosition()[1]+dt*self.CURTAIN_SPEED))
|
||||||
|
if self.TopBar.GetGlobalPosition()[1]<-self.BarHeight:
|
||||||
|
self.TopBar.SetPosition(0,-self.BarHeight-1)
|
||||||
|
self.BottomBar.SetPosition(0,wndMgr.GetScreenHeight()+1)
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
self.lastclock = time.clock()
|
||||||
|
|
||||||
|
class EventCurtain(ui.Bar):
|
||||||
|
|
||||||
|
COLOR_WHITE = 0.0
|
||||||
|
COLOR_BLACK = 1.0
|
||||||
|
|
||||||
|
DEFAULT_FADE_SPEED = 0.035
|
||||||
|
|
||||||
|
STATE_WAIT = 0
|
||||||
|
STATE_OUT = 1
|
||||||
|
STATE_IN = 2
|
||||||
|
|
||||||
|
def __init__(self, index):
|
||||||
|
print "NEW EVENT CURTAIN ----------------------------------------------------------------------------"
|
||||||
|
ui.Bar.__init__(self, "CURTAIN")
|
||||||
|
self.SetWindowName("EventCurtain")
|
||||||
|
self.AddFlag("float")
|
||||||
|
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
self.fadeColor = 1.0
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.FadeInFlag = False
|
||||||
|
self.state = self.STATE_WAIT
|
||||||
|
self.speed = 1.0
|
||||||
|
self.eventIndex = index
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE EVENT CURTAIN"
|
||||||
|
ui.Bar.__del__(self)
|
||||||
|
|
||||||
|
def SetAlpha(self, alpha):
|
||||||
|
color = grp.GenerateColor(self.fadeColor, self.fadeColor, self.fadeColor, alpha)
|
||||||
|
self.SetColor(color)
|
||||||
|
|
||||||
|
def FadeOut(self, speed):
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.__StartFade(self.STATE_OUT, 0.0, speed)
|
||||||
|
|
||||||
|
def FadeIn(self, speed):
|
||||||
|
self.curAlpha = 1.0
|
||||||
|
self.__StartFade(self.STATE_IN, 0.0, speed)
|
||||||
|
|
||||||
|
def WhiteOut(self, speed):
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.__StartFade(self.STATE_OUT, 1.0, speed)
|
||||||
|
|
||||||
|
def WhiteIn(self, speed):
|
||||||
|
self.curAlpha = 1.0
|
||||||
|
self.__StartFade(self.STATE_IN, 1.0, speed)
|
||||||
|
|
||||||
|
def __StartFade(self, state, color, speed):
|
||||||
|
self.state = state
|
||||||
|
self.fadeColor = color
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.speed = self.DEFAULT_FADE_SPEED
|
||||||
|
if 0 != speed:
|
||||||
|
self.speed = speed
|
||||||
|
|
||||||
|
def __EndFade(self):
|
||||||
|
event.EndEventProcess(self.eventIndex)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
if self.STATE_OUT == self.state:
|
||||||
|
|
||||||
|
self.curAlpha += self.speed
|
||||||
|
|
||||||
|
if self.curAlpha >= 1.0:
|
||||||
|
|
||||||
|
self.state = self.STATE_WAIT
|
||||||
|
self.curAlpha = 1.0
|
||||||
|
self.__EndFade()
|
||||||
|
|
||||||
|
elif self.STATE_IN == self.state:
|
||||||
|
|
||||||
|
self.curAlpha -= self.speed
|
||||||
|
|
||||||
|
if self.curAlpha <= 0.0:
|
||||||
|
|
||||||
|
self.state = self.STATE_WAIT
|
||||||
|
self.curAlpha = 0.0
|
||||||
|
self.__EndFade()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
self.SetAlpha(self.curAlpha)
|
||||||
|
|
||||||
|
class BarButton(ui.Button):
|
||||||
|
ColorUp = 0x40999999
|
||||||
|
ColorDown = 0x40aaaacc
|
||||||
|
ColorOver = 0x40ddddff
|
||||||
|
|
||||||
|
UP=0
|
||||||
|
DOWN=1
|
||||||
|
OVER=2
|
||||||
|
|
||||||
|
def __init__(self, layer = "UI",
|
||||||
|
aColorUp = ColorUp,
|
||||||
|
aColorDown = ColorDown,
|
||||||
|
aColorOver = ColorOver):
|
||||||
|
ui.Button.__init__(self,layer)
|
||||||
|
self.state = self.UP
|
||||||
|
self.colortable = aColorUp, aColorDown, aColorOver
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
x,y = self.GetGlobalPosition()
|
||||||
|
grp.SetColor(self.colortable[self.state])
|
||||||
|
grp.RenderBar(x,y,self.GetWidth(),self.GetHeight())
|
||||||
|
|
||||||
|
def CallEvent(self):
|
||||||
|
self.state = self.UP
|
||||||
|
ui.Button.CallEvent(self)
|
||||||
|
|
||||||
|
def DownEvent(self):
|
||||||
|
self.state = self.DOWN
|
||||||
|
|
||||||
|
def ShowToolTip(self):
|
||||||
|
self.state = self.OVER
|
||||||
|
|
||||||
|
def HideToolTip(self):
|
||||||
|
self.state = self.UP
|
||||||
|
|
||||||
|
class DescriptionWindow(ui.Window):
|
||||||
|
def __init__(self,idx):
|
||||||
|
ui.Window.__init__(self, "TOP_MOST")
|
||||||
|
self.descIndex = idx
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
def OnRender(self):
|
||||||
|
event.RenderEventSet(self.descIndex)
|
||||||
|
|
||||||
|
class QuestDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
TITLE_STATE_NONE = 0
|
||||||
|
TITLE_STATE_APPEAR = 1
|
||||||
|
TITLE_STATE_SHOW = 2
|
||||||
|
TITLE_STATE_DISAPPEAR = 3
|
||||||
|
|
||||||
|
SKIN_NONE = 0
|
||||||
|
SKIN_CINEMA = 5
|
||||||
|
|
||||||
|
QUEST_BUTTON_MAX_NUM = 8
|
||||||
|
|
||||||
|
def __init__(self,skin,idx):
|
||||||
|
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.SetWindowName("quest dialog")
|
||||||
|
|
||||||
|
self.focusIndex = 0
|
||||||
|
|
||||||
|
self.board = None
|
||||||
|
self.sx = 0
|
||||||
|
self.sy = 0
|
||||||
|
|
||||||
|
self.skin = skin
|
||||||
|
if skin == 3:
|
||||||
|
event.SetRestrictedCount(idx,36)
|
||||||
|
else:
|
||||||
|
event.SetRestrictedCount(idx,60)
|
||||||
|
|
||||||
|
QuestCurtain.BarHeight = (wndMgr.GetScreenHeight()-wndMgr.GetScreenWidth()*9/16)/2
|
||||||
|
|
||||||
|
if QuestCurtain.BarHeight<0:
|
||||||
|
QuestCurtain.BarHeight = 50
|
||||||
|
if not ('QuestCurtain' in QuestDialog.__dict__):
|
||||||
|
QuestDialog.QuestCurtain = QuestCurtain()
|
||||||
|
QuestDialog.QuestCurtain.Show()
|
||||||
|
|
||||||
|
QuestDialog.QuestCurtain.CurtainMode = 1
|
||||||
|
self.nextCurtainMode = 0
|
||||||
|
if self.skin:
|
||||||
|
QuestDialog.QuestCurtain.CurtainMode = 1
|
||||||
|
self.nextCurtainMode = 0
|
||||||
|
self.LoadDialog(self.skin)
|
||||||
|
else:
|
||||||
|
QuestDialog.QuestCurtain.CurtainMode = -1
|
||||||
|
self.nextCurtainMode = -1
|
||||||
|
|
||||||
|
self.descIndex = idx
|
||||||
|
self.descWindow = DescriptionWindow(idx)
|
||||||
|
self.descWindow.Show()
|
||||||
|
self.eventCurtain = EventCurtain(idx)
|
||||||
|
event.SetEventHandler(idx, self)
|
||||||
|
|
||||||
|
self.OnCloseEvent = None
|
||||||
|
self.btnAnswer = None
|
||||||
|
self.btnNext = None
|
||||||
|
self.imgLeft = None
|
||||||
|
self.imgTop = None
|
||||||
|
self.imgBackground = None
|
||||||
|
self.imgTitle = None
|
||||||
|
self.titleState = self.TITLE_STATE_NONE
|
||||||
|
self.titleShowTime = 0
|
||||||
|
self.images = []
|
||||||
|
self.prevbutton = None
|
||||||
|
self.nextbutton = None
|
||||||
|
|
||||||
|
# QUEST_INPUT
|
||||||
|
self.needInputString = False
|
||||||
|
self.editSlot = None
|
||||||
|
self.editLine = None
|
||||||
|
# END_OF_QUEST_INPUT
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self, skin):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "uiscript/questdialog.py")
|
||||||
|
except RuntimeError:
|
||||||
|
dbg.TraceError("QuestDialog.LoadDialog")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild('board')
|
||||||
|
except RuntimeError:
|
||||||
|
dbg.TraceError("QuestDialog.BindObject")
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
if self.SKIN_CINEMA == skin:
|
||||||
|
self.board.Hide()
|
||||||
|
|
||||||
|
# QUEST_CANCEL
|
||||||
|
def OnCancel(self):
|
||||||
|
self.nextCurtainMode = -1
|
||||||
|
self.CloseSelf()
|
||||||
|
# END_OF_QUEST_CANCEL
|
||||||
|
|
||||||
|
def CloseSelf(self):
|
||||||
|
QuestDialog.QuestCurtain.CurtainMode = self.nextCurtainMode
|
||||||
|
self.btnNext = None
|
||||||
|
self.descWindow = None
|
||||||
|
self.btnAnswer = None
|
||||||
|
self.Destroy()
|
||||||
|
if self.descIndex:
|
||||||
|
event.ClearEventSet(self.descIndex)
|
||||||
|
self.descIndex = None
|
||||||
|
|
||||||
|
self.focusIndex = 0
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
if self.OnCloseEvent:
|
||||||
|
self.OnCloseEvent()
|
||||||
|
self.OnCloseEvent = None
|
||||||
|
|
||||||
|
# QUEST_INPUT
|
||||||
|
if self.needInputString:
|
||||||
|
if self.editLine:
|
||||||
|
text = self.editLine.GetText()
|
||||||
|
net.SendQuestInputStringPacket(text)
|
||||||
|
# END_OF_QUEST_INPUT
|
||||||
|
|
||||||
|
self.imgTitle = None
|
||||||
|
self.images = None
|
||||||
|
self.eventCurtain = None
|
||||||
|
self.board = None
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
if self.skin == self.SKIN_CINEMA:
|
||||||
|
event.UpdateEventSet(self.descIndex, 50, -(wndMgr.GetScreenHeight() - 44))
|
||||||
|
|
||||||
|
# AUTO_RESIZE_BOARD
|
||||||
|
elif self.skin == 3:
|
||||||
|
if self.board:
|
||||||
|
event.UpdateEventSet(self.descIndex, self.board.GetGlobalPosition()[0]+20+self.sx, -self.board.GetGlobalPosition()[1]-20-self.sy)
|
||||||
|
event.SetEventSetWidth(self.descIndex, self.board.GetWidth()-40)
|
||||||
|
elif self.skin:
|
||||||
|
if self.board:
|
||||||
|
event.UpdateEventSet(self.descIndex, self.board.GetGlobalPosition()[0]+20, -self.board.GetGlobalPosition()[1]-20)
|
||||||
|
event.SetEventSetWidth(self.descIndex, self.board.GetWidth()-40)
|
||||||
|
# END_OF_AUTO_RESIZE_BOARD
|
||||||
|
else:
|
||||||
|
event.UpdateEventSet(self.descIndex, 0, 0)
|
||||||
|
|
||||||
|
if self.TITLE_STATE_NONE != self.titleState:
|
||||||
|
|
||||||
|
curTime = app.GetTime()
|
||||||
|
elapsedTime = app.GetTime() - self.titleShowTime
|
||||||
|
|
||||||
|
if self.TITLE_STATE_APPEAR == self.titleState:
|
||||||
|
self.imgTitle.SetAlpha(elapsedTime*2)
|
||||||
|
if elapsedTime > 0.5:
|
||||||
|
self.titleState = self.TITLE_STATE_SHOW
|
||||||
|
self.titleShowTime = curTime
|
||||||
|
|
||||||
|
elif self.TITLE_STATE_SHOW == self.titleState:
|
||||||
|
if elapsedTime > 1.0:
|
||||||
|
self.titleState = self.TITLE_STATE_DISAPPEAR
|
||||||
|
self.titleShowTime = curTime
|
||||||
|
|
||||||
|
elif self.TITLE_STATE_DISAPPEAR == self.titleState:
|
||||||
|
self.imgTitle.SetAlpha(1.0 - elapsedTime*2)
|
||||||
|
if elapsedTime > 0.5:
|
||||||
|
self.titleState = self.TITLE_STATE_NONE
|
||||||
|
self.titleShowTime = curTime
|
||||||
|
|
||||||
|
## Set Variables
|
||||||
|
|
||||||
|
def AddOnCloseEvent(self,f):
|
||||||
|
if self.OnCloseEvent:
|
||||||
|
self.OnCloseEvent = lambda z=[self.OnCloseEvent, f]:map(apply,z)
|
||||||
|
else:
|
||||||
|
self.OnCloseEvent = f
|
||||||
|
|
||||||
|
def AddOnDoneEvent(self,f):
|
||||||
|
QuestCurtain.OnDoneEventList.append(f)
|
||||||
|
|
||||||
|
def SetOnCloseEvent(self,f):
|
||||||
|
self.OnCloseEvent = f
|
||||||
|
|
||||||
|
def SetEventSetPosition(self, x, y):
|
||||||
|
self.sx = x
|
||||||
|
self.sy = y
|
||||||
|
|
||||||
|
def AdjustEventSetPosition(self, x, y):
|
||||||
|
self.sx += x
|
||||||
|
self.sy += y
|
||||||
|
|
||||||
|
## Event
|
||||||
|
# QUEST_CANCEL
|
||||||
|
def MakeNextButton(self, button_type):
|
||||||
|
if self.SKIN_NONE == self.skin:
|
||||||
|
return
|
||||||
|
|
||||||
|
yPos = event.GetEventSetLocalYPosition(self.descIndex)
|
||||||
|
|
||||||
|
b = BarButton()
|
||||||
|
b.SetParent(self.board)
|
||||||
|
|
||||||
|
b.SetSize(100,26)
|
||||||
|
b.SetPosition(self.sx+self.board.GetWidth()/2-50,self.sy+yPos)
|
||||||
|
|
||||||
|
self.nextButtonType = button_type;
|
||||||
|
|
||||||
|
import localeInfo
|
||||||
|
if event.BUTTON_TYPE_CANCEL == button_type:
|
||||||
|
b.SetEvent(lambda s=self:event.SelectAnswer(s.descIndex, 254) or s.OnCancel())
|
||||||
|
b.SetText(localeInfo.UI_CANCEL)
|
||||||
|
elif event.BUTTON_TYPE_DONE == button_type:
|
||||||
|
b.SetEvent(lambda s=self:s.CloseSelf())
|
||||||
|
b.SetText(localeInfo.UI_OK)
|
||||||
|
elif event.BUTTON_TYPE_NEXT == button_type:
|
||||||
|
b.SetEvent(lambda s=self:event.SelectAnswer(s.descIndex, 254) or s.CloseSelf())
|
||||||
|
b.SetText(localeInfo.UI_NEXT)
|
||||||
|
b.Show()
|
||||||
|
b.SetTextColor(0xffffffff)
|
||||||
|
self.btnNext = b
|
||||||
|
|
||||||
|
# END_OF_QUEST_CANCEL
|
||||||
|
|
||||||
|
def MakeQuestion(self, n): # n은 모든 퀘스트 대화창의 마지막 버튼인 "닫기"를 포함한 전체 퀘스트 버튼 개수. by 김준호
|
||||||
|
global entire_questbutton_number
|
||||||
|
global entire_questpage_number
|
||||||
|
global cur_questpage_number
|
||||||
|
entire_questpage_number = ((n-2)/7)+1
|
||||||
|
entire_questbutton_number = n
|
||||||
|
|
||||||
|
if not self.board:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.btnAnswer = [self.MakeEachButton(i) for i in xrange (n)]
|
||||||
|
|
||||||
|
import localeInfo
|
||||||
|
self.prevbutton = self.MakeNextPrevPageButton()
|
||||||
|
self.prevbutton.SetPosition(self.sx+self.board.GetWidth()/2-164, self.board.GetHeight()/2-16)
|
||||||
|
self.prevbutton.SetText(localeInfo.UI_PREVPAGE)
|
||||||
|
self.prevbutton.SetEvent(self.PrevQuestPageEvent, 1, n)
|
||||||
|
|
||||||
|
self.nextbutton = self.MakeNextPrevPageButton()
|
||||||
|
self.nextbutton.SetPosition(self.sx+self.board.GetWidth()/2+112, self.board.GetHeight()/2-16)
|
||||||
|
self.nextbutton.SetText(localeInfo.UI_NEXTPAGE)
|
||||||
|
self.nextbutton.SetEvent(self.NextQuestPageEvent, 1, n)
|
||||||
|
|
||||||
|
if cur_questpage_number != 1:
|
||||||
|
cur_questpage_number = 1
|
||||||
|
|
||||||
|
def MakeEachButton(self, i):
|
||||||
|
if self.skin == 3:
|
||||||
|
button = BarButton("TOP_MOST",0x50000000, 0x50404040, 0x50606060)
|
||||||
|
button.SetParent(self.board)
|
||||||
|
button.SetSize(106,26)
|
||||||
|
button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
|
||||||
|
button.SetText("a")
|
||||||
|
button.SetTextColor(0xff000000)
|
||||||
|
else:
|
||||||
|
i = i % 8
|
||||||
|
button = BarButton("TOP_MOST")
|
||||||
|
button.SetParent(self.board)
|
||||||
|
button.SetSize(200,26)
|
||||||
|
button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
|
||||||
|
button.SetText("a")
|
||||||
|
button.SetTextColor(0xffffffff)
|
||||||
|
return button
|
||||||
|
|
||||||
|
def MakeNextPrevPageButton(self):
|
||||||
|
button = BarButton("TOP_MOST")
|
||||||
|
button.SetParent(self.board)
|
||||||
|
button.SetSize(52,26)
|
||||||
|
button.SetText("a")
|
||||||
|
button.SetTextColor(0xffffffff)
|
||||||
|
return button
|
||||||
|
|
||||||
|
def RefreshQuestPage(self, n):
|
||||||
|
global cur_questpage_number
|
||||||
|
global entire_questpage_number
|
||||||
|
num = 0
|
||||||
|
Showing_button_inx = (cur_questpage_number-1)* self.QUEST_BUTTON_MAX_NUM
|
||||||
|
|
||||||
|
while num < n:
|
||||||
|
if num >= Showing_button_inx and num < Showing_button_inx + self.QUEST_BUTTON_MAX_NUM:
|
||||||
|
self.btnAnswer[num].Show()
|
||||||
|
else:
|
||||||
|
self.btnAnswer[num].Hide()
|
||||||
|
num = num + 1
|
||||||
|
|
||||||
|
if cur_questpage_number == 1:
|
||||||
|
self.prevbutton.Hide()
|
||||||
|
self.nextbutton.Show()
|
||||||
|
elif cur_questpage_number == entire_questpage_number:
|
||||||
|
self.prevbutton.Show()
|
||||||
|
self.nextbutton.Hide()
|
||||||
|
else:
|
||||||
|
self.prevbutton.Show()
|
||||||
|
self.nextbutton.Show()
|
||||||
|
|
||||||
|
def NextQuestPageEvent(self, one, n):
|
||||||
|
global cur_questpage_number
|
||||||
|
cur_questpage_number = cur_questpage_number + one
|
||||||
|
self.RefreshQuestPage(n)
|
||||||
|
|
||||||
|
def PrevQuestPageEvent(self, one, n):
|
||||||
|
global cur_questpage_number
|
||||||
|
cur_questpage_number = cur_questpage_number - one
|
||||||
|
self.RefreshQuestPage(n)
|
||||||
|
|
||||||
|
def ClickAnswerEvent(self, ai):
|
||||||
|
event.SelectAnswer(self.descIndex, ai)
|
||||||
|
self.nextbutton = None
|
||||||
|
self.prevbutton = None
|
||||||
|
self.CloseSelf()
|
||||||
|
|
||||||
|
def AppendQuestion(self, name, idx): # idx는 0부터 시작함. PythonEventManager.cpp line 881 참고. by 김준호
|
||||||
|
if not self.btnAnswer:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.btnAnswer[idx].SetText(name)
|
||||||
|
x, y= self.btnAnswer[idx].GetGlobalPosition()
|
||||||
|
|
||||||
|
self.btnAnswer[idx].SetEvent(self.ClickAnswerEvent, idx)
|
||||||
|
|
||||||
|
global entire_questbutton_number
|
||||||
|
|
||||||
|
Showing_button_idx = (cur_questpage_number-1)* self.QUEST_BUTTON_MAX_NUM
|
||||||
|
|
||||||
|
if Showing_button_idx <= idx and idx < Showing_button_idx + self.QUEST_BUTTON_MAX_NUM:
|
||||||
|
self.btnAnswer[idx].Show()
|
||||||
|
else:
|
||||||
|
self.btnAnswer[idx].Hide()
|
||||||
|
if entire_questbutton_number >= self.QUEST_BUTTON_MAX_NUM:
|
||||||
|
self.nextbutton.Show()
|
||||||
|
|
||||||
|
def FadeOut(self, speed):
|
||||||
|
self.eventCurtain.FadeOut(speed)
|
||||||
|
|
||||||
|
def FadeIn(self, speed):
|
||||||
|
self.eventCurtain.FadeIn(speed)
|
||||||
|
|
||||||
|
def WhiteOut(self, speed):
|
||||||
|
self.eventCurtain.WhiteOut(speed)
|
||||||
|
|
||||||
|
def WhiteIn(self, speed):
|
||||||
|
self.eventCurtain.WhiteIn(speed)
|
||||||
|
|
||||||
|
def DoneEvent(self):
|
||||||
|
self.nextCurtainMode = -1
|
||||||
|
if self.SKIN_NONE == self.skin or self.SKIN_CINEMA == self.skin:
|
||||||
|
self.CloseSelf()
|
||||||
|
|
||||||
|
def __GetQuestImageFileName(self, filename):
|
||||||
|
if len(filename) > 1:
|
||||||
|
if filename[1]!=':':
|
||||||
|
filename = QUEST_BOARD_IMAGE_DIR+filename
|
||||||
|
|
||||||
|
return filename
|
||||||
|
|
||||||
|
# QUEST_INPUT
|
||||||
|
def OnKeyDown(self, key):
|
||||||
|
if self.btnAnswer == None:
|
||||||
|
## 선택문이 없고 '다음', '확인' 등의 일방 버튼만 있는 경우에 대한 처리
|
||||||
|
if None != self.btnNext:
|
||||||
|
if app.DIK_RETURN == key:
|
||||||
|
self.OnPressEscapeKey()
|
||||||
|
|
||||||
|
if app.DIK_UP == key or app.DIK_DOWN == key:
|
||||||
|
self.btnNext.ShowToolTip()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
focusIndex = self.focusIndex;
|
||||||
|
lastFocusIndex = focusIndex;
|
||||||
|
|
||||||
|
#print "QuestDialog key down - focus, last : ", focusIndex, lastFocusIndex
|
||||||
|
|
||||||
|
answerCount = len(self.btnAnswer)
|
||||||
|
|
||||||
|
if app.DIK_DOWN == key:
|
||||||
|
focusIndex += 1
|
||||||
|
|
||||||
|
if app.DIK_UP == key:
|
||||||
|
focusIndex -= 1
|
||||||
|
|
||||||
|
if focusIndex < 0:
|
||||||
|
focusIndex = answerCount - 1
|
||||||
|
|
||||||
|
if focusIndex >= answerCount:
|
||||||
|
focusIndex = 0
|
||||||
|
|
||||||
|
self.focusIndex = focusIndex;
|
||||||
|
|
||||||
|
focusBtn = self.btnAnswer[focusIndex]
|
||||||
|
lastFocusBtn = self.btnAnswer[lastFocusIndex]
|
||||||
|
|
||||||
|
if focusIndex != lastFocusIndex:
|
||||||
|
focusBtn.ShowToolTip()
|
||||||
|
lastFocusBtn.HideToolTip()
|
||||||
|
|
||||||
|
if app.DIK_RETURN == key:
|
||||||
|
focusBtn.CallEvent()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
|
||||||
|
# ESC키가 눌린 경우 "다음" 버튼을 누른 것과 같은 효과를 내도록 함.
|
||||||
|
if None != self.btnNext:
|
||||||
|
##퀘스트문자들이 전부다 나왔을경우의 ESC버튼
|
||||||
|
if event.BUTTON_TYPE_CANCEL == self.nextButtonType:
|
||||||
|
event.SelectAnswer(self.descIndex, 254)
|
||||||
|
self.CloseSelf()
|
||||||
|
## 아무 작업을 하지 않을때
|
||||||
|
elif event.BUTTON_TYPE_DONE == self.nextButtonType:
|
||||||
|
self.CloseSelf()
|
||||||
|
## 엔터나 다음화면으로 넘어가려고 할경우
|
||||||
|
elif event.BUTTON_TYPE_NEXT == self.nextButtonType:
|
||||||
|
event.SelectAnswer(self.descIndex, 254)
|
||||||
|
self.CloseSelf()
|
||||||
|
else:
|
||||||
|
## 도중에 꺼버리거나, ESC버튼이 나왓을경우
|
||||||
|
event.SelectAnswer(self.descIndex, entire_questbutton_number -1 )
|
||||||
|
self.nextbutton = None
|
||||||
|
self.prevbutton = None
|
||||||
|
self.OnCancel()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnIMEReturn(self):
|
||||||
|
if self.needInputString:
|
||||||
|
self.CloseSelf()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnIMEUpdate(self):
|
||||||
|
if not self.needInputString:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.editLine:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.editLine.OnIMEUpdate()
|
||||||
|
|
||||||
|
def OnInput(self):
|
||||||
|
|
||||||
|
self.needInputString = True
|
||||||
|
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, 5+10)
|
||||||
|
yPos = event.GetEventSetLocalYPosition(self.descIndex)
|
||||||
|
|
||||||
|
self.editSlot = ui.SlotBar()
|
||||||
|
self.editSlot.SetSize(200, 18)
|
||||||
|
self.editSlot.SetPosition(0, yPos)
|
||||||
|
self.editSlot.SetParent(self.board)
|
||||||
|
self.editSlot.SetWindowHorizontalAlignCenter()
|
||||||
|
self.editSlot.Show()
|
||||||
|
|
||||||
|
self.editLine = ui.EditLine()
|
||||||
|
self.editLine.SetParent(self.editSlot)
|
||||||
|
self.editLine.SetPosition(3, 3)
|
||||||
|
self.editLine.SetSize(200, 17)
|
||||||
|
self.editLine.SetMax(30)
|
||||||
|
self.editLine.SetFocus()
|
||||||
|
self.editLine.Show()
|
||||||
|
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, 25+10)
|
||||||
|
|
||||||
|
self.MakeNextButton(event.BUTTON_TYPE_DONE)
|
||||||
|
|
||||||
|
self.editLine.UpdateRect()
|
||||||
|
self.editSlot.UpdateRect()
|
||||||
|
self.board.UpdateRect()
|
||||||
|
# END_OF_QUEST_INPUT
|
||||||
|
|
||||||
|
def OnImage(self, x, y, filename, desc=""):
|
||||||
|
filename = self.__GetQuestImageFileName(filename)
|
||||||
|
|
||||||
|
# IMAGE_EXCEPTION_BUG_FIX
|
||||||
|
try:
|
||||||
|
img = ui.MakeImageBox(self.board, filename, x, y)
|
||||||
|
self.images.append(img)
|
||||||
|
except RuntimeError:
|
||||||
|
pass
|
||||||
|
# END_OF_IMAGE_EXCEPTION_BUG_FIX
|
||||||
|
|
||||||
|
# QUEST_IMAGE
|
||||||
|
def OnInsertItemIcon(self, type, idx, title, desc, index=0, total=1):
|
||||||
|
if "item" != type:
|
||||||
|
return
|
||||||
|
|
||||||
|
import item
|
||||||
|
item.SelectItem(idx)
|
||||||
|
filename = item.GetIconImageFileName()
|
||||||
|
|
||||||
|
underTitle = title
|
||||||
|
|
||||||
|
if not title and not desc:
|
||||||
|
title = item.GetItemName()
|
||||||
|
desc = item.GetItemDescription()
|
||||||
|
|
||||||
|
tempDesc = desc
|
||||||
|
desc = ""
|
||||||
|
|
||||||
|
import grpText
|
||||||
|
lineCount = grpText.GetSplitingTextLineCount(tempDesc, 25)
|
||||||
|
for i in xrange(lineCount):
|
||||||
|
desc += grpText.GetSplitingTextLine(tempDesc, 25, i) + "/"
|
||||||
|
|
||||||
|
desc = desc[:-1]
|
||||||
|
|
||||||
|
self.OnInsertImage(filename, underTitle, title, desc, index, total)
|
||||||
|
|
||||||
|
def OnInsertImage(self, filename, underTitle, title, desc, index=0, total=1):
|
||||||
|
|
||||||
|
if index == 0:
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, 24)
|
||||||
|
|
||||||
|
y = event.GetEventSetLocalYPosition(self.descIndex)
|
||||||
|
xBoard, yBoard = self.board.GetGlobalPosition()
|
||||||
|
|
||||||
|
try:
|
||||||
|
img = ToolTipImageBox()
|
||||||
|
img.SetParent(self.board)
|
||||||
|
img.LoadImage(filename)
|
||||||
|
pos_x = (self.board.GetWidth() * (index + 1) / (total + 1)) - (img.GetWidth() / 2)
|
||||||
|
img.SetPosition(pos_x, y)
|
||||||
|
#img.SetWindowHorizontalAlignCenter()
|
||||||
|
img.DestroyToolTip()
|
||||||
|
if title and desc:
|
||||||
|
img.CreateToolTip(self.board, title, desc, 0, yBoard + y + img.GetHeight())
|
||||||
|
img.Show()
|
||||||
|
self.images.append(img)
|
||||||
|
except RuntimeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, img.GetHeight() - 20)
|
||||||
|
|
||||||
|
if underTitle:
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, 3)
|
||||||
|
event.InsertTextInline(self.descIndex, underTitle, (self.board.GetWidth() * (index + 1) / (total + 1)))
|
||||||
|
if index != total - 1:
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, -( 3 + 16 ))
|
||||||
|
else:
|
||||||
|
if index == total - 1:
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, 4)
|
||||||
|
|
||||||
|
if index != total - 1:
|
||||||
|
event.AddEventSetLocalYPosition(self.descIndex, -(img.GetHeight() - 20))
|
||||||
|
|
||||||
|
|
||||||
|
# END_OF_QUEST_IMAGE
|
||||||
|
|
||||||
|
def OnSize(self, width, height):
|
||||||
|
self.board.SetSize(width, height)
|
||||||
|
|
||||||
|
def OnTitleImage(self, filename):
|
||||||
|
img = ui.ImageBox("TOP_MOST")
|
||||||
|
|
||||||
|
try:
|
||||||
|
img.SetWindowHorizontalAlignCenter()
|
||||||
|
img.LoadImage(filename)
|
||||||
|
img.SetPosition(0, wndMgr.GetScreenHeight() - (75/2) - (32/2))
|
||||||
|
img.SetAlpha(0.0)
|
||||||
|
img.Show()
|
||||||
|
except RuntimeError:
|
||||||
|
dbg.TraceError("QuestDialog.OnTitleImage(%s)" % filename)
|
||||||
|
img.Hide()
|
||||||
|
|
||||||
|
self.imgTitle = img
|
||||||
|
self.titleState = self.TITLE_STATE_APPEAR
|
||||||
|
self.titleShowTime = app.GetTime()
|
||||||
|
|
||||||
|
def OnLeftImage(self, imgfile):
|
||||||
|
imgfile = self.__GetQuestImageFileName(imgfile)
|
||||||
|
if not self.imgLeft:
|
||||||
|
self.imgLeft = ui.ExpandedImageBox("TOP_MOST")
|
||||||
|
self.imgLeft.SetParent(self)
|
||||||
|
self.imgLeft.SetPosition(0,0)
|
||||||
|
bd = self.board
|
||||||
|
bx, by = bd.GetLocalPosition()
|
||||||
|
bd.SetPosition(160,by)
|
||||||
|
if self.imgTop:
|
||||||
|
tx, ty = self.imgTop.GetLocalPosition()
|
||||||
|
self.imgTop.SetPosition(160,ty)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.imgLeft.LoadImage(imgfile)
|
||||||
|
self.imgLeft.SetSize(400,450)
|
||||||
|
self.imgLeft.SetOrigin(self.imgLeft.GetWidth()/2,self.imgLeft.GetHeight()/2)
|
||||||
|
self.imgLeft.Show()
|
||||||
|
except RuntimeError:
|
||||||
|
import dbg
|
||||||
|
dbg.TraceError("QuestDialog.OnLeftImage(%s)" % imgfile)
|
||||||
|
self.imgLeft.Hide()
|
||||||
|
|
||||||
|
def OnTopImage(self, imgfile):
|
||||||
|
imgfile = self.__GetQuestImageFileName(imgfile)
|
||||||
|
|
||||||
|
bd = self.board
|
||||||
|
bx, by = bd.GetLocalPosition()
|
||||||
|
if not self.imgTop:
|
||||||
|
self.imgTop = ui.ExpandedImageBox("TOP_MOST")
|
||||||
|
self.imgTop.SetParent(self)
|
||||||
|
bd.SetPosition(bx,190)
|
||||||
|
self.imgTop.SetPosition(bx,10)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.imgTop.LoadImage(imgfile)
|
||||||
|
h = self.imgTop.GetHeight()
|
||||||
|
if h>170:
|
||||||
|
# need adjust board size
|
||||||
|
bd.SetPosition(bx,20+h)
|
||||||
|
bd.SetSize(350,420-h)
|
||||||
|
self.imgTop.SetSize(350,h)
|
||||||
|
else:
|
||||||
|
self.imgTop.SetSize(350,170)
|
||||||
|
bd.SetPosition(bx,190)
|
||||||
|
bd.SetSize(350,250)
|
||||||
|
self.imgTop.SetOrigin(self.imgTop.GetWidth()/2,self.imgTop.GetHeight()/2)
|
||||||
|
self.imgTop.Show()
|
||||||
|
except RuntimeError:
|
||||||
|
dbg.TraceError("QuestDialog.OnTopImage(%s)" % imgfile)
|
||||||
|
self.imgTop.Hide()
|
||||||
|
|
||||||
|
def OnBackgroundImage(self, imgfile):
|
||||||
|
imgfile = self.__GetQuestImageFileName(imgfile)
|
||||||
|
c = self.board
|
||||||
|
w = c.GetWidth()
|
||||||
|
h = c.GetHeight()
|
||||||
|
px, py = c.GetLocalPosition()
|
||||||
|
moved = 0
|
||||||
|
if not self.imgBackground:
|
||||||
|
self.imgBackground = ui.ExpandedImageBox("TOP_MOST")
|
||||||
|
self.imgBackground.SetParent(c)
|
||||||
|
self.imgBackground.SetPosition(0,0)
|
||||||
|
self.imgBackground.LoadImage(imgfile)
|
||||||
|
iw = self.imgBackground.GetWidth()
|
||||||
|
ih = self.imgBackground.GetHeight()
|
||||||
|
if self.skin==3:
|
||||||
|
iw = 256
|
||||||
|
ih = 333
|
||||||
|
self.imgBackground.SetSize(iw,ih)
|
||||||
|
if w < iw:
|
||||||
|
px -= (iw-w)/2
|
||||||
|
c.SetPosition(px,py)
|
||||||
|
w = iw
|
||||||
|
if h < ih:
|
||||||
|
py -= (ih-h)/2
|
||||||
|
c.SetPosition(px,py)
|
||||||
|
h = ih
|
||||||
|
if self.skin == 3:
|
||||||
|
w=256
|
||||||
|
h = 333
|
||||||
|
self.sx = 0
|
||||||
|
self.sy = 100
|
||||||
|
|
||||||
|
c.SetSize(w,h)
|
||||||
|
c.HideInternal()
|
||||||
|
|
||||||
|
c.SetWindowHorizontalAlignCenter()
|
||||||
|
c.SetWindowVerticalAlignCenter()
|
||||||
|
|
||||||
|
c.SetPosition(0,0)
|
||||||
|
if self.skin==3:
|
||||||
|
c.SetPosition(-190,0)
|
||||||
|
|
||||||
|
self.imgBackground.SetWindowHorizontalAlignCenter()
|
||||||
|
self.imgBackground.SetWindowVerticalAlignCenter()
|
||||||
|
self.imgBackground.SetPosition(0,0)
|
||||||
|
self.imgBackground.Show()
|
||||||
@@ -0,0 +1,424 @@
|
|||||||
|
import app
|
||||||
|
import net
|
||||||
|
import player
|
||||||
|
import item
|
||||||
|
import ui
|
||||||
|
import uiToolTip
|
||||||
|
import mouseModule
|
||||||
|
import localeInfo
|
||||||
|
import uiCommon
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
class RefineDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
makeSocketSuccessPercentage = ( 100, 33, 20, 15, 10, 5, 0 )
|
||||||
|
upgradeStoneSuccessPercentage = ( 30, 29, 28, 27, 26, 25, 24, 23, 22 )
|
||||||
|
upgradeArmorSuccessPercentage = ( 99, 66, 33, 33, 33, 33, 33, 33, 33 )
|
||||||
|
upgradeAccessorySuccessPercentage = ( 99, 88, 77, 66, 33, 33, 33, 33, 33 )
|
||||||
|
upgradeSuccessPercentage = ( 99, 66, 33, 33, 33, 33, 33, 33, 33 )
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadScript()
|
||||||
|
|
||||||
|
self.scrollItemPos = 0
|
||||||
|
self.targetItemPos = 0
|
||||||
|
|
||||||
|
def __LoadScript(self):
|
||||||
|
|
||||||
|
self.__LoadQuestionDialog()
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/refinedialog.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("RefineDialog.__LoadScript.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("Board")
|
||||||
|
self.titleBar = self.GetChild("TitleBar")
|
||||||
|
self.successPercentage = self.GetChild("SuccessPercentage")
|
||||||
|
self.GetChild("AcceptButton").SetEvent(self.OpenQuestionDialog)
|
||||||
|
self.GetChild("CancelButton").SetEvent(self.Close)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("RefineDialog.__LoadScript.BindObject")
|
||||||
|
|
||||||
|
## 936 : 개량 확률 표시 안함
|
||||||
|
##if 936 == app.GetDefaultCodePage():
|
||||||
|
self.successPercentage.Hide()
|
||||||
|
|
||||||
|
toolTip = uiToolTip.ItemToolTip()
|
||||||
|
toolTip.SetParent(self)
|
||||||
|
toolTip.SetPosition(15, 38)
|
||||||
|
toolTip.SetFollow(False)
|
||||||
|
toolTip.Show()
|
||||||
|
self.toolTip = toolTip
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadQuestionDialog(self):
|
||||||
|
self.dlgQuestion = ui.ScriptWindow()
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self.dlgQuestion, "uiscript/questiondialog2.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("RefineDialog.__LoadQuestionDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.dlgQuestion.GetChild
|
||||||
|
GetObject("message1").SetText(localeInfo.REFINE_DESTROY_WARNING)
|
||||||
|
GetObject("message2").SetText(localeInfo.REFINE_WARNING2)
|
||||||
|
GetObject("accept").SetEvent(ui.__mem_func__(self.Accept))
|
||||||
|
GetObject("cancel").SetEvent(ui.__mem_func__(self.dlgQuestion.Hide))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SelectCharacterWindow.__LoadQuestionDialog.BindObject")
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.board = 0
|
||||||
|
self.successPercentage = 0
|
||||||
|
self.titleBar = 0
|
||||||
|
self.toolTip = 0
|
||||||
|
self.dlgQuestion = 0
|
||||||
|
|
||||||
|
def GetRefineSuccessPercentage(self, scrollSlotIndex, itemSlotIndex):
|
||||||
|
|
||||||
|
if -1 != scrollSlotIndex:
|
||||||
|
if player.IsRefineGradeScroll(scrollSlotIndex):
|
||||||
|
curGrade = player.GetItemGrade(itemSlotIndex)
|
||||||
|
itemIndex = player.GetItemIndex(itemSlotIndex)
|
||||||
|
|
||||||
|
item.SelectItem(itemIndex)
|
||||||
|
itemType = item.GetItemType()
|
||||||
|
itemSubType = item.GetItemSubType()
|
||||||
|
|
||||||
|
if item.ITEM_TYPE_METIN == itemType:
|
||||||
|
|
||||||
|
if curGrade >= len(self.upgradeStoneSuccessPercentage):
|
||||||
|
return 0
|
||||||
|
return self.upgradeStoneSuccessPercentage[curGrade]
|
||||||
|
|
||||||
|
elif item.ITEM_TYPE_ARMOR == itemType:
|
||||||
|
|
||||||
|
if item.ARMOR_BODY == itemSubType:
|
||||||
|
if curGrade >= len(self.upgradeArmorSuccessPercentage):
|
||||||
|
return 0
|
||||||
|
return self.upgradeArmorSuccessPercentage[curGrade]
|
||||||
|
else:
|
||||||
|
if curGrade >= len(self.upgradeAccessorySuccessPercentage):
|
||||||
|
return 0
|
||||||
|
return self.upgradeAccessorySuccessPercentage[curGrade]
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
if curGrade >= len(self.upgradeSuccessPercentage):
|
||||||
|
return 0
|
||||||
|
return self.upgradeSuccessPercentage[curGrade]
|
||||||
|
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM+1):
|
||||||
|
if 0 == player.GetItemMetinSocket(itemSlotIndex, i):
|
||||||
|
break
|
||||||
|
|
||||||
|
return self.makeSocketSuccessPercentage[i]
|
||||||
|
|
||||||
|
def Open(self, scrollItemPos, targetItemPos):
|
||||||
|
self.scrollItemPos = scrollItemPos
|
||||||
|
self.targetItemPos = targetItemPos
|
||||||
|
|
||||||
|
percentage = self.GetRefineSuccessPercentage(scrollItemPos, targetItemPos)
|
||||||
|
if 0 == percentage:
|
||||||
|
return
|
||||||
|
self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (percentage))
|
||||||
|
|
||||||
|
itemIndex = player.GetItemIndex(targetItemPos)
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
metinSlot = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
|
||||||
|
self.toolTip.AddItemData(itemIndex, metinSlot)
|
||||||
|
|
||||||
|
self.UpdateDialog()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def UpdateDialog(self):
|
||||||
|
newWidth = self.toolTip.GetWidth() + 30
|
||||||
|
newHeight = self.toolTip.GetHeight() + 98
|
||||||
|
self.board.SetSize(newWidth, newHeight)
|
||||||
|
self.titleBar.SetWidth(newWidth-15)
|
||||||
|
self.SetSize(newWidth, newHeight)
|
||||||
|
|
||||||
|
(x, y) = self.GetLocalPosition()
|
||||||
|
self.SetPosition(x, y)
|
||||||
|
|
||||||
|
def OpenQuestionDialog(self):
|
||||||
|
percentage = self.GetRefineSuccessPercentage(-1, self.targetItemPos)
|
||||||
|
if 100 == percentage:
|
||||||
|
self.Accept()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.dlgQuestion.SetTop()
|
||||||
|
self.dlgQuestion.Show()
|
||||||
|
|
||||||
|
def Accept(self):
|
||||||
|
net.SendItemUseToItemPacket(self.scrollItemPos, self.targetItemPos)
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.dlgQuestion.Hide()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
class RefineDialogNew(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__Initialize()
|
||||||
|
self.isLoaded = False
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.dlgQuestion = None
|
||||||
|
self.children = []
|
||||||
|
self.vnum = 0
|
||||||
|
self.targetItemPos = 0
|
||||||
|
self.dialogHeight = 0
|
||||||
|
self.cost = 0
|
||||||
|
self.percentage = 0
|
||||||
|
self.type = 0
|
||||||
|
|
||||||
|
def __LoadScript(self):
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/refinedialog.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("RefineDialog.__LoadScript.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.board = self.GetChild("Board")
|
||||||
|
self.titleBar = self.GetChild("TitleBar")
|
||||||
|
self.probText = self.GetChild("SuccessPercentage")
|
||||||
|
self.costText = self.GetChild("Cost")
|
||||||
|
self.successPercentage = self.GetChild("SuccessPercentage")
|
||||||
|
self.GetChild("AcceptButton").SetEvent(self.OpenQuestionDialog)
|
||||||
|
self.GetChild("CancelButton").SetEvent(self.CancelRefine)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("RefineDialog.__LoadScript.BindObject")
|
||||||
|
|
||||||
|
## 936 : 개량 확률 표시 안함
|
||||||
|
##if 936 == app.GetDefaultCodePage():
|
||||||
|
self.successPercentage.Hide()
|
||||||
|
|
||||||
|
toolTip = uiToolTip.ItemToolTip()
|
||||||
|
toolTip.SetParent(self)
|
||||||
|
toolTip.SetFollow(False)
|
||||||
|
toolTip.SetPosition(15, 38)
|
||||||
|
toolTip.Show()
|
||||||
|
self.toolTip = toolTip
|
||||||
|
|
||||||
|
self.slotList = []
|
||||||
|
for i in xrange(3):
|
||||||
|
slot = self.__MakeSlot()
|
||||||
|
slot.SetParent(toolTip)
|
||||||
|
slot.SetWindowVerticalAlignCenter()
|
||||||
|
self.slotList.append(slot)
|
||||||
|
|
||||||
|
itemImage = self.__MakeItemImage()
|
||||||
|
itemImage.SetParent(toolTip)
|
||||||
|
itemImage.SetWindowVerticalAlignCenter()
|
||||||
|
itemImage.SetPosition(-35, 0)
|
||||||
|
self.itemImage = itemImage
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.CancelRefine))
|
||||||
|
self.isLoaded = True
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __MakeSlot(self):
|
||||||
|
slot = ui.ImageBox()
|
||||||
|
slot.LoadImage("d:/ymir work/ui/public/slot_base.sub")
|
||||||
|
slot.Show()
|
||||||
|
self.children.append(slot)
|
||||||
|
return slot
|
||||||
|
|
||||||
|
def __MakeItemImage(self):
|
||||||
|
itemImage = ui.ImageBox()
|
||||||
|
itemImage.Show()
|
||||||
|
self.children.append(itemImage)
|
||||||
|
return itemImage
|
||||||
|
|
||||||
|
def __MakeThinBoard(self):
|
||||||
|
thinBoard = ui.ThinBoard()
|
||||||
|
thinBoard.SetParent(self)
|
||||||
|
thinBoard.Show()
|
||||||
|
self.children.append(thinBoard)
|
||||||
|
return thinBoard
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.dlgQuestion = None
|
||||||
|
self.board = 0
|
||||||
|
self.probText = 0
|
||||||
|
self.costText = 0
|
||||||
|
self.titleBar = 0
|
||||||
|
self.toolTip = 0
|
||||||
|
self.successPercentage = None
|
||||||
|
self.slotList = []
|
||||||
|
self.children = []
|
||||||
|
|
||||||
|
def Open(self, targetItemPos, nextGradeItemVnum, cost, prob, type):
|
||||||
|
|
||||||
|
if False == self.isLoaded:
|
||||||
|
self.__LoadScript()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
self.targetItemPos = targetItemPos
|
||||||
|
self.vnum = nextGradeItemVnum
|
||||||
|
self.cost = cost
|
||||||
|
self.percentage = prob
|
||||||
|
self.type = type
|
||||||
|
|
||||||
|
self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage))
|
||||||
|
self.costText.SetText(localeInfo.REFINE_COST % (self.cost))
|
||||||
|
|
||||||
|
self.toolTip.ClearToolTip()
|
||||||
|
metinSlot = []
|
||||||
|
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||||
|
metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
|
||||||
|
|
||||||
|
attrSlot = []
|
||||||
|
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
|
||||||
|
attrSlot.append(player.GetItemAttribute(targetItemPos, i))
|
||||||
|
self.toolTip.AddRefineItemData(nextGradeItemVnum, metinSlot, attrSlot)
|
||||||
|
|
||||||
|
item.SelectItem(nextGradeItemVnum)
|
||||||
|
self.itemImage.LoadImage(item.GetIconImageFileName())
|
||||||
|
xSlotCount, ySlotCount = item.GetItemSize()
|
||||||
|
for slot in self.slotList:
|
||||||
|
slot.Hide()
|
||||||
|
for i in xrange(min(3, ySlotCount)):
|
||||||
|
self.slotList[i].SetPosition(-35, i*32 - (ySlotCount-1)*16)
|
||||||
|
self.slotList[i].Show()
|
||||||
|
|
||||||
|
self.dialogHeight = self.toolTip.GetHeight() + 46
|
||||||
|
self.UpdateDialog()
|
||||||
|
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.dlgQuestion = None
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def AppendMaterial(self, vnum, count):
|
||||||
|
slot = self.__MakeSlot()
|
||||||
|
slot.SetParent(self)
|
||||||
|
slot.SetPosition(15, self.dialogHeight)
|
||||||
|
|
||||||
|
itemImage = self.__MakeItemImage()
|
||||||
|
itemImage.SetParent(slot)
|
||||||
|
item.SelectItem(vnum)
|
||||||
|
itemImage.LoadImage(item.GetIconImageFileName())
|
||||||
|
|
||||||
|
thinBoard = self.__MakeThinBoard()
|
||||||
|
thinBoard.SetPosition(50, self.dialogHeight)
|
||||||
|
thinBoard.SetSize(191, 20)
|
||||||
|
|
||||||
|
textLine = ui.TextLine()
|
||||||
|
textLine.SetParent(thinBoard)
|
||||||
|
textLine.SetFontName(localeInfo.UI_DEF_FONT)
|
||||||
|
textLine.SetPackedFontColor(0xffdddddd)
|
||||||
|
textLine.SetText("%s x %02d" % (item.GetItemName(), count))
|
||||||
|
textLine.SetOutline()
|
||||||
|
textLine.SetFeather(False)
|
||||||
|
textLine.SetWindowVerticalAlignCenter()
|
||||||
|
textLine.SetVerticalAlignCenter()
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
(x,y) = textLine.GetTextSize()
|
||||||
|
textLine.SetPosition(x, 0)
|
||||||
|
else:
|
||||||
|
textLine.SetPosition(15, 0)
|
||||||
|
|
||||||
|
textLine.Show()
|
||||||
|
self.children.append(textLine)
|
||||||
|
|
||||||
|
self.dialogHeight += 34
|
||||||
|
self.UpdateDialog()
|
||||||
|
|
||||||
|
def UpdateDialog(self):
|
||||||
|
newWidth = self.toolTip.GetWidth() + 60
|
||||||
|
newHeight = self.dialogHeight + 69
|
||||||
|
|
||||||
|
## 936 : 개량 확률 표시 안함
|
||||||
|
##if 936 == app.GetDefaultCodePage():
|
||||||
|
newHeight -= 8
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.board.SetPosition( newWidth, 0 )
|
||||||
|
|
||||||
|
(x, y) = self.titleBar.GetLocalPosition()
|
||||||
|
self.titleBar.SetPosition( newWidth - 15, y )
|
||||||
|
|
||||||
|
self.board.SetSize(newWidth, newHeight)
|
||||||
|
self.toolTip.SetPosition(15 + 35, 38)
|
||||||
|
self.titleBar.SetWidth(newWidth-15)
|
||||||
|
self.SetSize(newWidth, newHeight)
|
||||||
|
|
||||||
|
(x, y) = self.GetLocalPosition()
|
||||||
|
self.SetPosition(x, y)
|
||||||
|
|
||||||
|
def OpenQuestionDialog(self):
|
||||||
|
|
||||||
|
if 100 == self.percentage:
|
||||||
|
self.Accept()
|
||||||
|
return
|
||||||
|
|
||||||
|
if 5 == self.type: ## 무신의 축복서
|
||||||
|
self.Accept()
|
||||||
|
return
|
||||||
|
|
||||||
|
dlgQuestion = uiCommon.QuestionDialog2()
|
||||||
|
dlgQuestion.SetText2(localeInfo.REFINE_WARNING2)
|
||||||
|
dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.Accept))
|
||||||
|
dlgQuestion.SetCancelEvent(ui.__mem_func__(dlgQuestion.Close))
|
||||||
|
|
||||||
|
if 3 == self.type: ## 현철
|
||||||
|
dlgQuestion.SetText1(localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_1)
|
||||||
|
dlgQuestion.SetText2(localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_2)
|
||||||
|
elif 2 == self.type: ## 축복서
|
||||||
|
dlgQuestion.SetText1(localeInfo.REFINE_DOWN_GRADE_WARNING)
|
||||||
|
else:
|
||||||
|
dlgQuestion.SetText1(localeInfo.REFINE_DESTROY_WARNING)
|
||||||
|
|
||||||
|
dlgQuestion.Open()
|
||||||
|
self.dlgQuestion = dlgQuestion
|
||||||
|
|
||||||
|
def Accept(self):
|
||||||
|
net.SendRefinePacket(self.targetItemPos, self.type)
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def CancelRefine(self):
|
||||||
|
net.SendRefinePacket(255, 255)
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.CancelRefine()
|
||||||
|
return True
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import dbg
|
||||||
|
import app
|
||||||
|
import net
|
||||||
|
|
||||||
|
import ui
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
## Restart
|
||||||
|
class RestartDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/restartdialog.py")
|
||||||
|
except Exception, msg:
|
||||||
|
import sys
|
||||||
|
(type, msg, tb)=sys.exc_info()
|
||||||
|
dbg.TraceError("RestartDialog.LoadDialog - %s:%s" % (type, msg))
|
||||||
|
app.Abort()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.restartHereButton=self.GetChild("restart_here_button")
|
||||||
|
self.restartTownButton=self.GetChild("restart_town_button")
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
(type, msg, tb)=sys.exc_info()
|
||||||
|
dbg.TraceError("RestartDialog.LoadDialog - %s:%s" % (type, msg))
|
||||||
|
app.Abort()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
self.restartHereButton.SetEvent(ui.__mem_func__(self.RestartHere))
|
||||||
|
self.restartTownButton.SetEvent(ui.__mem_func__(self.RestartTown))
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.restartHereButton=0
|
||||||
|
self.restartTownButton=0
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
def OpenDialog(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def RestartHere(self):
|
||||||
|
net.SendChatPacket("/restart_here")
|
||||||
|
|
||||||
|
def RestartTown(self):
|
||||||
|
net.SendChatPacket("/restart_town")
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
return True
|
||||||
@@ -0,0 +1,687 @@
|
|||||||
|
import ui
|
||||||
|
import mouseModule
|
||||||
|
import player
|
||||||
|
import net
|
||||||
|
import snd
|
||||||
|
import safebox
|
||||||
|
import chat
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
class PasswordDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadDialog()
|
||||||
|
|
||||||
|
self.sendMessage = "/safebox_password "
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadDialog(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
# if localeInfo.IsEUROPE()and app.GetLocalePath() != "locale/ca"and app.GetLocalePath() != "locale/sg" :
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "passworddialog.py")
|
||||||
|
# else:
|
||||||
|
# pyScrLoader.LoadScriptFile(self, "uiscript/passworddialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PasswordDialog.__LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.passwordValue = self.GetChild("password_value")
|
||||||
|
self.acceptButton = self.GetChild("accept_button")
|
||||||
|
self.cancelButton = self.GetChild("cancel_button")
|
||||||
|
self.titleName = self.GetChild("TitleName")
|
||||||
|
self.GetChild("titlebar").SetCloseEvent(ui.__mem_func__(self.CloseDialog))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PasswordDialog.__LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.passwordValue.OnIMEReturn = self.OnAccept
|
||||||
|
self.passwordValue.OnPressEscapeKey = self.OnCancel
|
||||||
|
self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept))
|
||||||
|
self.cancelButton.SetEvent(ui.__mem_func__(self.OnCancel))
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.passwordValue = None
|
||||||
|
self.acceptButton = None
|
||||||
|
self.cancelButton = None
|
||||||
|
self.titleName = None
|
||||||
|
|
||||||
|
def SetTitle(self, title):
|
||||||
|
self.titleName.SetText(title)
|
||||||
|
|
||||||
|
def SetSendMessage(self, msg):
|
||||||
|
self.sendMessage = msg
|
||||||
|
|
||||||
|
def ShowDialog(self):
|
||||||
|
self.passwordValue.SetText("")
|
||||||
|
self.passwordValue.SetFocus()
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def CloseDialog(self):
|
||||||
|
self.passwordValue.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnAccept(self):
|
||||||
|
net.SendChatPacket(self.sendMessage + self.passwordValue.GetText())
|
||||||
|
self.CloseDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCancel(self):
|
||||||
|
self.CloseDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
class ChangePasswordDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__LoadDialog()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __LoadDialog(self):
|
||||||
|
self.dlgMessage = ui.ScriptWindow()
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self.dlgMessage, "uiscript/popupdialog.py")
|
||||||
|
self.dlgMessage.GetChild("message").SetText(localeInfo.SAFEBOX_WRONG_PASSWORD)
|
||||||
|
self.dlgMessage.GetChild("accept").SetEvent(ui.__mem_func__(self.OnCloseMessageDialog))
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SafeboxWindow.__LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/changepassworddialog.py")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ChangePasswordDialog.LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.GetChild("accept_button").SetEvent(ui.__mem_func__(self.OnAccept))
|
||||||
|
self.GetChild("cancel_button").SetEvent(ui.__mem_func__(self.OnCancel))
|
||||||
|
self.GetChild("titlebar").SetCloseEvent(ui.__mem_func__(self.OnCancel))
|
||||||
|
oldPassword = self.GetChild("old_password_value")
|
||||||
|
newPassword = self.GetChild("new_password_value")
|
||||||
|
newPasswordCheck = self.GetChild("new_password_check_value")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ChangePasswordDialog.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
oldPassword.SetTabEvent(lambda arg=1: self.OnNextFocus(arg))
|
||||||
|
newPassword.SetTabEvent(lambda arg=2: self.OnNextFocus(arg))
|
||||||
|
newPasswordCheck.SetTabEvent(lambda arg=3: self.OnNextFocus(arg))
|
||||||
|
oldPassword.SetReturnEvent(lambda arg=1: self.OnNextFocus(arg))
|
||||||
|
newPassword.SetReturnEvent(lambda arg=2: self.OnNextFocus(arg))
|
||||||
|
newPasswordCheck.SetReturnEvent(ui.__mem_func__(self.OnAccept))
|
||||||
|
oldPassword.OnPressEscapeKey = self.OnCancel
|
||||||
|
newPassword.OnPressEscapeKey = self.OnCancel
|
||||||
|
newPasswordCheck.OnPressEscapeKey = self.OnCancel
|
||||||
|
|
||||||
|
self.oldPassword = oldPassword
|
||||||
|
self.newPassword = newPassword
|
||||||
|
self.newPasswordCheck = newPasswordCheck
|
||||||
|
|
||||||
|
def OnNextFocus(self, arg):
|
||||||
|
if 1 == arg:
|
||||||
|
self.oldPassword.KillFocus()
|
||||||
|
self.newPassword.SetFocus()
|
||||||
|
elif 2 == arg:
|
||||||
|
self.newPassword.KillFocus()
|
||||||
|
self.newPasswordCheck.SetFocus()
|
||||||
|
elif 3 == arg:
|
||||||
|
self.newPasswordCheck.KillFocus()
|
||||||
|
self.oldPassword.SetFocus()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.dlgMessage.ClearDictionary()
|
||||||
|
self.oldPassword = None
|
||||||
|
self.newPassword = None
|
||||||
|
self.newPasswordCheck = None
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.oldPassword.SetText("")
|
||||||
|
self.newPassword.SetText("")
|
||||||
|
self.newPasswordCheck.SetText("")
|
||||||
|
self.oldPassword.SetFocus()
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.oldPassword.SetText("")
|
||||||
|
self.newPassword.SetText("")
|
||||||
|
self.newPasswordCheck.SetText("")
|
||||||
|
self.oldPassword.KillFocus()
|
||||||
|
self.newPassword.KillFocus()
|
||||||
|
self.newPasswordCheck.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnAccept(self):
|
||||||
|
oldPasswordText = self.oldPassword.GetText()
|
||||||
|
newPasswordText = self.newPassword.GetText()
|
||||||
|
newPasswordCheckText = self.newPasswordCheck.GetText()
|
||||||
|
if newPasswordText != newPasswordCheckText:
|
||||||
|
self.dlgMessage.SetCenterPosition()
|
||||||
|
self.dlgMessage.SetTop()
|
||||||
|
self.dlgMessage.Show()
|
||||||
|
return True
|
||||||
|
net.SendChatPacket("/safebox_change_password %s %s" % (oldPasswordText, newPasswordText))
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCancel(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseMessageDialog(self):
|
||||||
|
self.newPassword.SetText("")
|
||||||
|
self.newPasswordCheck.SetText("")
|
||||||
|
self.newPassword.SetFocus()
|
||||||
|
self.dlgMessage.Hide()
|
||||||
|
|
||||||
|
class SafeboxWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
BOX_WIDTH = 176
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.sellingSlotNumber = -1
|
||||||
|
self.pageButtonList = []
|
||||||
|
self.curPageIndex = 0
|
||||||
|
self.isLoaded = 0
|
||||||
|
self.xSafeBoxStart = 0
|
||||||
|
self.ySafeBoxStart = 0
|
||||||
|
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.dlgPickMoney.Destroy()
|
||||||
|
self.dlgPickMoney = None
|
||||||
|
self.dlgChangePassword.Destroy()
|
||||||
|
self.dlgChangePassword = None
|
||||||
|
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.wndMoneySlot = None
|
||||||
|
self.wndMoney = None
|
||||||
|
self.wndBoard = None
|
||||||
|
self.wndItem = None
|
||||||
|
|
||||||
|
self.pageButtonList = []
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
if self.isLoaded == 1:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.isLoaded = 1
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/SafeboxWindow.py")
|
||||||
|
|
||||||
|
from _weakref import proxy
|
||||||
|
|
||||||
|
## Item
|
||||||
|
wndItem = ui.GridSlotWindow()
|
||||||
|
wndItem.SetParent(self)
|
||||||
|
wndItem.SetPosition(8, 35)
|
||||||
|
wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
|
||||||
|
wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
|
||||||
|
wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
|
||||||
|
wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
|
||||||
|
wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
|
||||||
|
wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
wndItem.Show()
|
||||||
|
|
||||||
|
## PickMoneyDialog
|
||||||
|
import uiPickMoney
|
||||||
|
dlgPickMoney = uiPickMoney.PickMoneyDialog()
|
||||||
|
dlgPickMoney.LoadDialog()
|
||||||
|
dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
|
||||||
|
dlgPickMoney.Hide()
|
||||||
|
|
||||||
|
## ChangePasswrod
|
||||||
|
dlgChangePassword = ChangePasswordDialog()
|
||||||
|
dlgChangePassword.LoadDialog()
|
||||||
|
dlgChangePassword.Hide()
|
||||||
|
|
||||||
|
## Close Button
|
||||||
|
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.GetChild("ChangePasswordButton").SetEvent(ui.__mem_func__(self.OnChangePassword))
|
||||||
|
self.GetChild("ExitButton").SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.wndItem = wndItem
|
||||||
|
self.dlgPickMoney = dlgPickMoney
|
||||||
|
self.dlgChangePassword = dlgChangePassword
|
||||||
|
self.wndBoard = self.GetChild("board")
|
||||||
|
#self.wndMoney = self.GetChild("Money")
|
||||||
|
#self.wndMoneySlot = self.GetChild("Money_Slot")
|
||||||
|
#self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
|
||||||
|
|
||||||
|
## Initialize
|
||||||
|
self.SetTableSize(3)
|
||||||
|
self.RefreshSafeboxMoney()
|
||||||
|
|
||||||
|
def OpenPickMoneyDialog(self):
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
if player.SLOT_TYPE_INVENTORY == mouseModule.mouseController.GetAttachedType():
|
||||||
|
|
||||||
|
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
|
||||||
|
net.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
|
||||||
|
snd.PlaySound("sound/ui/money.wav")
|
||||||
|
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
else:
|
||||||
|
curMoney = safebox.GetMoney()
|
||||||
|
|
||||||
|
if curMoney <= 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.dlgPickMoney.Open(curMoney)
|
||||||
|
|
||||||
|
def ShowWindow(self, size):
|
||||||
|
|
||||||
|
(self.xSafeBoxStart, self.ySafeBoxStart, z) = player.GetMainCharacterPosition()
|
||||||
|
|
||||||
|
self.SetTableSize(size)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def __MakePageButton(self, pageCount):
|
||||||
|
|
||||||
|
self.curPageIndex = 0
|
||||||
|
self.pageButtonList = []
|
||||||
|
|
||||||
|
text = "I"
|
||||||
|
pos = -int(float(pageCount-1)/2 * 52)
|
||||||
|
for i in xrange(pageCount):
|
||||||
|
button = ui.RadioButton()
|
||||||
|
button.SetParent(self)
|
||||||
|
button.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_middle_01.sub")
|
||||||
|
button.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_middle_02.sub")
|
||||||
|
button.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_middle_03.sub")
|
||||||
|
button.SetWindowHorizontalAlignCenter()
|
||||||
|
button.SetWindowVerticalAlignBottom()
|
||||||
|
button.SetPosition(pos, 85)
|
||||||
|
button.SetText(text)
|
||||||
|
button.SetEvent(lambda arg=i: self.SelectPage(arg))
|
||||||
|
button.Show()
|
||||||
|
self.pageButtonList.append(button)
|
||||||
|
|
||||||
|
pos += 52
|
||||||
|
text += "I"
|
||||||
|
|
||||||
|
self.pageButtonList[0].Down()
|
||||||
|
|
||||||
|
def SelectPage(self, index):
|
||||||
|
|
||||||
|
self.curPageIndex = index
|
||||||
|
|
||||||
|
for btn in self.pageButtonList:
|
||||||
|
btn.SetUp()
|
||||||
|
|
||||||
|
self.pageButtonList[index].Down()
|
||||||
|
self.RefreshSafebox()
|
||||||
|
|
||||||
|
def __LocalPosToGlobalPos(self, local):
|
||||||
|
return self.curPageIndex*safebox.SAFEBOX_PAGE_SIZE + local
|
||||||
|
|
||||||
|
def SetTableSize(self, size):
|
||||||
|
|
||||||
|
pageCount = max(1, size / safebox.SAFEBOX_SLOT_Y_COUNT)
|
||||||
|
pageCount = min(3, pageCount)
|
||||||
|
size = safebox.SAFEBOX_SLOT_Y_COUNT
|
||||||
|
|
||||||
|
self.__MakePageButton(pageCount)
|
||||||
|
|
||||||
|
self.wndItem.ArrangeSlot(0, safebox.SAFEBOX_SLOT_X_COUNT, size, 32, 32, 0, 0)
|
||||||
|
self.wndItem.RefreshSlot()
|
||||||
|
self.wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
|
||||||
|
|
||||||
|
wnd_height = 130 + 32 * size
|
||||||
|
self.wndBoard.SetSize(self.BOX_WIDTH, wnd_height)
|
||||||
|
self.SetSize(self.BOX_WIDTH, wnd_height)
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def RefreshSafebox(self):
|
||||||
|
getItemID=safebox.GetItemID
|
||||||
|
getItemCount=safebox.GetItemCount
|
||||||
|
setItemID=self.wndItem.SetItemSlot
|
||||||
|
|
||||||
|
for i in xrange(safebox.SAFEBOX_PAGE_SIZE):
|
||||||
|
slotIndex = self.__LocalPosToGlobalPos(i)
|
||||||
|
itemCount = getItemCount(slotIndex)
|
||||||
|
if itemCount <= 1:
|
||||||
|
itemCount = 0
|
||||||
|
setItemID(i, getItemID(slotIndex), itemCount)
|
||||||
|
|
||||||
|
self.wndItem.RefreshSlot()
|
||||||
|
|
||||||
|
def RefreshSafeboxMoney(self):
|
||||||
|
pass
|
||||||
|
#self.wndMoney.SetText(str(safebox.GetMoney()))
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltip):
|
||||||
|
self.tooltipItem = tooltip
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
net.SendChatPacket("/safebox_close")
|
||||||
|
|
||||||
|
def CommandCloseSafebox(self):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
self.dlgPickMoney.Close()
|
||||||
|
self.dlgChangePassword.Close()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
## Slot Event
|
||||||
|
def SelectEmptySlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
|
||||||
|
if player.SLOT_TYPE_SAFEBOX == attachedSlotType:
|
||||||
|
|
||||||
|
net.SendSafeboxItemMovePacket(attachedSlotPos, selectedSlotPos, 0)
|
||||||
|
#snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
else:
|
||||||
|
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
|
||||||
|
if player.RESERVED_WINDOW == attachedInvenType:
|
||||||
|
return
|
||||||
|
|
||||||
|
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
|
||||||
|
net.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
|
||||||
|
snd.PlaySound("sound/ui/money.wav")
|
||||||
|
|
||||||
|
else:
|
||||||
|
net.SendSafeboxCheckinPacket(attachedInvenType, attachedSlotPos, selectedSlotPos)
|
||||||
|
#snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def SelectItemSlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
|
||||||
|
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
|
||||||
|
|
||||||
|
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
|
||||||
|
net.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
|
||||||
|
snd.PlaySound("sound/ui/money.wav")
|
||||||
|
|
||||||
|
else:
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
#net.SendSafeboxCheckinPacket(attachedSlotPos, selectedSlotPos)
|
||||||
|
#snd.PlaySound("sound/ui/drop.wav")
|
||||||
|
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
curCursorNum = app.GetCursor()
|
||||||
|
if app.SELL == curCursorNum:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SAFEBOX_SELL_DISABLE_SAFEITEM)
|
||||||
|
|
||||||
|
elif app.BUY == curCursorNum:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
|
||||||
|
|
||||||
|
else:
|
||||||
|
selectedItemID = safebox.GetItemID(selectedSlotPos)
|
||||||
|
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SAFEBOX, selectedSlotPos, selectedItemID)
|
||||||
|
snd.PlaySound("sound/ui/pick.wav")
|
||||||
|
|
||||||
|
def UseItemSlot(self, slotIndex):
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def __ShowToolTip(self, slotIndex):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.SetSafeBoxItem(slotIndex)
|
||||||
|
|
||||||
|
def OverInItem(self, slotIndex):
|
||||||
|
slotIndex = self.__LocalPosToGlobalPos(slotIndex)
|
||||||
|
self.wndItem.SetUsableItem(False)
|
||||||
|
self.__ShowToolTip(slotIndex)
|
||||||
|
|
||||||
|
def OverOutItem(self):
|
||||||
|
self.wndItem.SetUsableItem(False)
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnPickMoney(self, money):
|
||||||
|
mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_SAFEBOX, money)
|
||||||
|
|
||||||
|
def OnChangePassword(self):
|
||||||
|
self.dlgChangePassword.Open()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
USE_SAFEBOX_LIMIT_RANGE = 1000
|
||||||
|
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
if abs(x - self.xSafeBoxStart) > USE_SAFEBOX_LIMIT_RANGE or abs(y - self.ySafeBoxStart) > USE_SAFEBOX_LIMIT_RANGE:
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
class MallWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
BOX_WIDTH = 176
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.sellingSlotNumber = -1
|
||||||
|
self.pageButtonList = []
|
||||||
|
self.curPageIndex = 0
|
||||||
|
self.isLoaded = 0
|
||||||
|
self.xSafeBoxStart = 0
|
||||||
|
self.ySafeBoxStart = 0
|
||||||
|
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
self.__LoadWindow()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.wndBoard = None
|
||||||
|
self.wndItem = None
|
||||||
|
|
||||||
|
self.pageButtonList = []
|
||||||
|
|
||||||
|
def __LoadWindow(self):
|
||||||
|
if self.isLoaded == 1:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.isLoaded = 1
|
||||||
|
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/MallWindow.py")
|
||||||
|
|
||||||
|
from _weakref import proxy
|
||||||
|
|
||||||
|
## Item
|
||||||
|
wndItem = ui.GridSlotWindow()
|
||||||
|
wndItem.SetParent(self)
|
||||||
|
wndItem.SetPosition(8, 35)
|
||||||
|
wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
|
||||||
|
wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
|
||||||
|
wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
|
||||||
|
wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
|
||||||
|
wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
|
||||||
|
wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
wndItem.Show()
|
||||||
|
|
||||||
|
## Close Button
|
||||||
|
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.GetChild("ExitButton").SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.wndItem = wndItem
|
||||||
|
self.wndBoard = self.GetChild("board")
|
||||||
|
|
||||||
|
## Initialize
|
||||||
|
self.SetTableSize(3)
|
||||||
|
|
||||||
|
def ShowWindow(self, size):
|
||||||
|
|
||||||
|
(self.xSafeBoxStart, self.ySafeBoxStart, z) = player.GetMainCharacterPosition()
|
||||||
|
|
||||||
|
self.SetTableSize(size)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def SetTableSize(self, size):
|
||||||
|
|
||||||
|
pageCount = max(1, size / safebox.SAFEBOX_SLOT_Y_COUNT)
|
||||||
|
pageCount = min(3, pageCount)
|
||||||
|
size = safebox.SAFEBOX_SLOT_Y_COUNT
|
||||||
|
|
||||||
|
self.wndItem.ArrangeSlot(0, safebox.SAFEBOX_SLOT_X_COUNT, size, 32, 32, 0, 0)
|
||||||
|
self.wndItem.RefreshSlot()
|
||||||
|
self.wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
|
||||||
|
|
||||||
|
self.wndBoard.SetSize(self.BOX_WIDTH, 82 + 32*size)
|
||||||
|
self.SetSize(self.BOX_WIDTH, 85 + 32*size)
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def RefreshMall(self):
|
||||||
|
getItemID=safebox.GetMallItemID
|
||||||
|
getItemCount=safebox.GetMallItemCount
|
||||||
|
setItemID=self.wndItem.SetItemSlot
|
||||||
|
|
||||||
|
for i in xrange(safebox.GetMallSize()):
|
||||||
|
itemID = getItemID(i)
|
||||||
|
itemCount = getItemCount(i)
|
||||||
|
if itemCount <= 1:
|
||||||
|
itemCount = 0
|
||||||
|
setItemID(i, itemID, itemCount)
|
||||||
|
|
||||||
|
self.wndItem.RefreshSlot()
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltip):
|
||||||
|
self.tooltipItem = tooltip
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
net.SendChatPacket("/mall_close")
|
||||||
|
|
||||||
|
def CommandCloseMall(self):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
## Slot Event
|
||||||
|
def SelectEmptySlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MALL_CANNOT_INSERT)
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def SelectItemSlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MALL_CANNOT_INSERT)
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
curCursorNum = app.GetCursor()
|
||||||
|
selectedItemID = safebox.GetMallItemID(selectedSlotPos)
|
||||||
|
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_MALL, selectedSlotPos, selectedItemID)
|
||||||
|
snd.PlaySound("sound/ui/pick.wav")
|
||||||
|
|
||||||
|
def UseItemSlot(self, slotIndex):
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def __ShowToolTip(self, slotIndex):
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.SetMallItem(slotIndex)
|
||||||
|
|
||||||
|
def OverInItem(self, slotIndex):
|
||||||
|
self.__ShowToolTip(slotIndex)
|
||||||
|
|
||||||
|
def OverOutItem(self):
|
||||||
|
self.wndItem.SetUsableItem(False)
|
||||||
|
if self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
USE_SAFEBOX_LIMIT_RANGE = 1000
|
||||||
|
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
if abs(x - self.xSafeBoxStart) > USE_SAFEBOX_LIMIT_RANGE or abs(y - self.ySafeBoxStart) > USE_SAFEBOX_LIMIT_RANGE:
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import chr
|
||||||
|
import background
|
||||||
|
import player
|
||||||
|
|
||||||
|
#wndMgr.SetOutlineFlag(True)
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
|
||||||
|
wnd = SafeboxWindow()
|
||||||
|
wnd.ShowWindow(1)
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import app
|
||||||
|
|
||||||
|
AUTOBAN_QUIZ_ANSWER = "ANSWER"
|
||||||
|
AUTOBAN_QUIZ_REFRESH = "REFRESH"
|
||||||
|
AUTOBAN_QUIZ_REST_TIME = "REST_TIME"
|
||||||
|
|
||||||
|
OPTION_SHADOW = "SHADOW"
|
||||||
|
|
||||||
|
CODEPAGE = str(app.GetDefaultCodePage())
|
||||||
|
|
||||||
|
#CUBE_TITLE = "Cube Window"
|
||||||
|
|
||||||
|
def LoadLocaleFile(srcFileName, localeDict):
|
||||||
|
localeDict["CUBE_INFO_TITLE"] = "Recipe"
|
||||||
|
localeDict["CUBE_REQUIRE_MATERIAL"] = "Requirements"
|
||||||
|
localeDict["CUBE_REQUIRE_MATERIAL_OR"] = "or"
|
||||||
|
|
||||||
|
try:
|
||||||
|
lines = pack_open(srcFileName, "r").readlines()
|
||||||
|
except IOError:
|
||||||
|
import dbg
|
||||||
|
dbg.LogBox("LoadUIScriptLocaleError(%(srcFileName)s)" % locals())
|
||||||
|
app.Abort()
|
||||||
|
|
||||||
|
for line in lines:
|
||||||
|
tokens = line[:-1].split("\t")
|
||||||
|
|
||||||
|
if len(tokens) >= 2:
|
||||||
|
localeDict[tokens[0]] = tokens[1]
|
||||||
|
|
||||||
|
else:
|
||||||
|
print len(tokens), lines.index(line), line
|
||||||
|
|
||||||
|
|
||||||
|
if "locale/ymir" == app.GetLocalePath():
|
||||||
|
|
||||||
|
LOCALE_UISCRIPT_PATH = "locale/ymir_ui/"
|
||||||
|
|
||||||
|
WINDOWS_PATH = "d:/ymir work/ui/game/949_windows/"
|
||||||
|
SELECT_PATH = "d:/ymir work/ui/intro/949_select/"
|
||||||
|
GUILD_PATH = "d:/ymir work/ui/game/949_guild/"
|
||||||
|
EMPIRE_PATH = "d:/ymir work/ui/intro/949_empire/"
|
||||||
|
MAPNAME_PATH = "locale/ymir_ui/mapname/"
|
||||||
|
LOGIN_PATH = "d:/ymir work/ui/intro/949_login/"
|
||||||
|
|
||||||
|
JOBDESC_WARRIOR_PATH = "locale/ymir/desc_warrior.txt"
|
||||||
|
JOBDESC_ASSASSIN_PATH = "locale/ymir/desc_assassin.txt"
|
||||||
|
JOBDESC_SURA_PATH = "locale/ymir/desc_sura.txt"
|
||||||
|
JOBDESC_SHAMAN_PATH = "locale/ymir/desc_shaman.txt"
|
||||||
|
|
||||||
|
EMPIREDESC_A = "locale/ymir/desc_empire_a.txt"
|
||||||
|
EMPIREDESC_B = "locale/ymir/desc_empire_b.txt"
|
||||||
|
EMPIREDESC_C = "locale/ymir/desc_empire_c.txt"
|
||||||
|
|
||||||
|
LOCALE_INTERFACE_FILE_NAME = "locale/ymir/locale_interface.txt"
|
||||||
|
else:
|
||||||
|
if "HONGKONG" == app.GetLocaleServiceName():
|
||||||
|
name = "locale/hongkong"
|
||||||
|
elif "JAPAN" == app.GetLocaleServiceName():
|
||||||
|
name = "locale/japan"
|
||||||
|
elif "TAIWAN" == app.GetLocaleServiceName():
|
||||||
|
name = "locale/taiwan"
|
||||||
|
elif "NEWCIBN" == app.GetLocaleServiceName():
|
||||||
|
name = "locale/newcibn"
|
||||||
|
elif "EUROPE" == app.GetLocaleServiceName():
|
||||||
|
name = app.GetLocalePath()
|
||||||
|
else:
|
||||||
|
name = "locale/ymir"
|
||||||
|
|
||||||
|
LOCALE_UISCRIPT_PATH = "%s/ui/" % (name)
|
||||||
|
LOGIN_PATH = "%s/ui/login/" % (name)
|
||||||
|
EMPIRE_PATH = "%s/ui/empire/" % (name)
|
||||||
|
GUILD_PATH = "%s/ui/guild/" % (name)
|
||||||
|
SELECT_PATH = "%s/ui/select/" % (name)
|
||||||
|
WINDOWS_PATH = "%s/ui/windows/" % (name)
|
||||||
|
MAPNAME_PATH = "%s/ui/mapname/" % (name)
|
||||||
|
|
||||||
|
JOBDESC_WARRIOR_PATH = "%s/jobdesc_warrior.txt" % (name)
|
||||||
|
JOBDESC_ASSASSIN_PATH = "%s/jobdesc_assassin.txt" % (name)
|
||||||
|
JOBDESC_SURA_PATH = "%s/jobdesc_sura.txt" % (name)
|
||||||
|
JOBDESC_SHAMAN_PATH = "%s/jobdesc_shaman.txt" % (name)
|
||||||
|
|
||||||
|
EMPIREDESC_A = "%s/empiredesc_a.txt" % (name)
|
||||||
|
EMPIREDESC_B = "%s/empiredesc_b.txt" % (name)
|
||||||
|
EMPIREDESC_C = "%s/empiredesc_c.txt" % (name)
|
||||||
|
|
||||||
|
LOCALE_INTERFACE_FILE_NAME = "%s/locale_interface.txt" % (name)
|
||||||
|
|
||||||
|
LoadLocaleFile(LOCALE_INTERFACE_FILE_NAME, locals())
|
||||||
|
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
import ui
|
||||||
|
import player
|
||||||
|
import item
|
||||||
|
import wndMgr
|
||||||
|
import net
|
||||||
|
|
||||||
|
class SelectItemWindow(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.tooltipItem = None
|
||||||
|
self.inventorySlotPosDict = {}
|
||||||
|
|
||||||
|
self.LoadWindow()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/selectitemwindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ItemSelectWindow.LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.board = GetObject("board")
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
self.itemSlot = GetObject("ItemSlot")
|
||||||
|
self.btnExit = GetObject("ExitButton")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ItemSelectWindow.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.btnExit.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.itemSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
|
||||||
|
self.itemSlot.SAFE_SetButtonEvent("LEFT", "EXIST", self.SelectItemSlot)
|
||||||
|
self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
|
||||||
|
self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.RefreshSlot()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
wndMgr.OnceIgnoreMouseLeftButtonUpEvent()
|
||||||
|
net.SendSelectItemPacket(0)
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def SelectItemSlot(self, slotPos):
|
||||||
|
wndMgr.OnceIgnoreMouseLeftButtonUpEvent()
|
||||||
|
inventorySlotPos = self.inventorySlotPosDict[slotPos]
|
||||||
|
net.SendSelectItemPacket(inventorySlotPos)
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def SetTableSize(self, size):
|
||||||
|
|
||||||
|
SLOT_X_COUNT = 5
|
||||||
|
self.itemSlot.ArrangeSlot(0, SLOT_X_COUNT, size, 32, 32, 0, 0)
|
||||||
|
self.itemSlot.RefreshSlot()
|
||||||
|
self.itemSlot.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
|
||||||
|
|
||||||
|
self.board.SetSize(self.board.GetWidth(), 76 + 32*size)
|
||||||
|
self.SetSize(self.board.GetWidth(), 76 + 32*size)
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
def RefreshSlot(self):
|
||||||
|
|
||||||
|
slotPos = 0
|
||||||
|
self.inventorySlotPosDict = {}
|
||||||
|
|
||||||
|
getItemVNum=player.GetItemIndex
|
||||||
|
getItemCount=player.GetItemCount
|
||||||
|
setItemVNum=self.itemSlot.SetItemSlot
|
||||||
|
|
||||||
|
for i in xrange(player.INVENTORY_PAGE_SIZE*2):
|
||||||
|
slotNumber = i
|
||||||
|
|
||||||
|
itemVNum = getItemVNum(slotNumber)
|
||||||
|
if 0 == itemVNum:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not item.IsMetin(itemVNum):
|
||||||
|
continue
|
||||||
|
|
||||||
|
itemGrade = player.GetItemGrade(slotNumber)
|
||||||
|
if itemGrade > 2:
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.inventorySlotPosDict[slotPos] = i
|
||||||
|
|
||||||
|
slotPos += 1
|
||||||
|
|
||||||
|
if slotPos > 54:
|
||||||
|
break
|
||||||
|
|
||||||
|
itemCount = len(self.inventorySlotPosDict)
|
||||||
|
if itemCount < 15:
|
||||||
|
self.SetTableSize(3)
|
||||||
|
|
||||||
|
else:
|
||||||
|
lineCount = 3
|
||||||
|
lineCount += (itemCount - 15) / 5
|
||||||
|
if itemCount % 5:
|
||||||
|
lineCount += 1
|
||||||
|
self.SetTableSize(lineCount)
|
||||||
|
|
||||||
|
for selectWndPos, inventoryPos in self.inventorySlotPosDict.items():
|
||||||
|
itemVNum = getItemVNum(inventoryPos)
|
||||||
|
itemCount = getItemCount(inventoryPos)
|
||||||
|
|
||||||
|
if itemCount <= 1:
|
||||||
|
itemCount = 0
|
||||||
|
|
||||||
|
setItemVNum(selectWndPos, itemVNum, itemCount)
|
||||||
|
|
||||||
|
self.itemSlot.RefreshSlot()
|
||||||
|
|
||||||
|
def OverOutItem(self):
|
||||||
|
if None != self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OverInItem(self, slotIndex):
|
||||||
|
if None != self.tooltipItem:
|
||||||
|
inventorySlotPos = self.inventorySlotPosDict[slotIndex]
|
||||||
|
self.tooltipItem.SetInventoryItem(inventorySlotPos)
|
||||||
|
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
FILE_NAME_LEN = 20
|
||||||
|
DEFAULT_THEMA = localeInfo.MUSIC_METIN2_DEFAULT_THEMA
|
||||||
|
|
||||||
|
class Item(ui.ListBoxEx.Item):
|
||||||
|
def __init__(self, fileName):
|
||||||
|
ui.ListBoxEx.Item.__init__(self)
|
||||||
|
self.canLoad=0
|
||||||
|
self.text=fileName
|
||||||
|
self.textLine=self.__CreateTextLine(fileName[:FILE_NAME_LEN])
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ListBoxEx.Item.__del__(self)
|
||||||
|
|
||||||
|
def GetText(self):
|
||||||
|
return self.text
|
||||||
|
|
||||||
|
def SetSize(self, width, height):
|
||||||
|
ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)
|
||||||
|
|
||||||
|
def __CreateTextLine(self, fileName):
|
||||||
|
textLine=ui.TextLine()
|
||||||
|
textLine.SetParent(self)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
textLine.SetPosition(6*len(fileName) + 6, 0)
|
||||||
|
else:
|
||||||
|
textLine.SetPosition(0, 0)
|
||||||
|
|
||||||
|
textLine.SetText(fileName)
|
||||||
|
textLine.Show()
|
||||||
|
return textLine
|
||||||
|
|
||||||
|
class PopupDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self, parent):
|
||||||
|
print "NEW POPUP WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__Load()
|
||||||
|
self.__Bind()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE POPUP WINDOW"
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PopupDialog.__Load")
|
||||||
|
|
||||||
|
def __Bind(self):
|
||||||
|
try:
|
||||||
|
self.textLine=self.GetChild("message")
|
||||||
|
self.okButton=self.GetChild("accept")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PopupDialog.__Bind")
|
||||||
|
|
||||||
|
self.okButton.SAFE_SetEvent(self.__OnOK)
|
||||||
|
|
||||||
|
def Open(self, msg):
|
||||||
|
self.textLine.SetText(msg)
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.Show()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
def __OnOK(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
class FileListDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW LIST DIALOG ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.isLoaded=0
|
||||||
|
self.selectEvent=None
|
||||||
|
self.fileListBox=None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE LIST DIALOG"
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
if self.isLoaded==0:
|
||||||
|
self.isLoaded=1
|
||||||
|
|
||||||
|
self.__Load()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
if self.fileListBox.IsEmpty():
|
||||||
|
self.__PopupMessage(localeInfo.MUSIC_EMPTY_MUSIC_LIST)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.popupDialog.Hide()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def SAFE_SetSelectEvent(self, event):
|
||||||
|
self.selectEvent=ui.__mem_func__(event)
|
||||||
|
|
||||||
|
def __CreateFileListBox(self):
|
||||||
|
fileListBox=ui.ListBoxEx()
|
||||||
|
fileListBox.SetParent(self)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
fileListBox.SetPosition( self.GetWidth() - fileListBox.GetWidth() - 10, 50)
|
||||||
|
else:
|
||||||
|
fileListBox.SetPosition(15, 50)
|
||||||
|
|
||||||
|
fileListBox.Show()
|
||||||
|
return fileListBox
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
self.popupDialog=PopupDialog(self)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.__Load_LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "MusicListWindow.py")
|
||||||
|
else:
|
||||||
|
self.__Load_LoadScript("UIScript/MusicListWindow.py")
|
||||||
|
|
||||||
|
self.__Load_BindObject()
|
||||||
|
|
||||||
|
self.refreshButton.SAFE_SetEvent(self.__OnRefresh)
|
||||||
|
self.cancelButton.SAFE_SetEvent(self.__OnCancel)
|
||||||
|
self.okButton.SAFE_SetEvent(self.__OnOK)
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.__OnCancel))
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __Load_LoadScript(self, fileName):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MusicListBox.__Load")
|
||||||
|
|
||||||
|
def __Load_BindObject(self):
|
||||||
|
try:
|
||||||
|
self.fileListBox=self.__CreateFileListBox()
|
||||||
|
self.fileListBox.SetScrollBar(self.GetChild("ScrollBar"))
|
||||||
|
|
||||||
|
self.board=self.GetChild("board")
|
||||||
|
self.okButton=self.GetChild("ok")
|
||||||
|
self.cancelButton=self.GetChild("cancel")
|
||||||
|
self.refreshButton=self.GetChild("refresh")
|
||||||
|
|
||||||
|
self.popupText = self.popupDialog.GetChild("message")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MusicListBox.__Bind")
|
||||||
|
|
||||||
|
def __PopupMessage(self, msg):
|
||||||
|
self.popupDialog.Open(msg)
|
||||||
|
|
||||||
|
def __OnOK(self):
|
||||||
|
selItem=self.fileListBox.GetSelectedItem()
|
||||||
|
if selItem:
|
||||||
|
if self.selectEvent:
|
||||||
|
self.selectEvent(selItem.GetText())
|
||||||
|
self.Hide()
|
||||||
|
else:
|
||||||
|
self.__PopupMessage(localeInfo.MUSIC_NOT_SELECT_MUSIC)
|
||||||
|
|
||||||
|
def __OnCancel(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __OnRefresh(self):
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __RefreshFileList(self):
|
||||||
|
self.__ClearFileList()
|
||||||
|
self.__AppendFile(DEFAULT_THEMA)
|
||||||
|
self.__AppendFileList("mp3")
|
||||||
|
|
||||||
|
def __ClearFileList(self):
|
||||||
|
self.fileListBox.RemoveAllItems()
|
||||||
|
|
||||||
|
def __AppendFileList(self, filter):
|
||||||
|
fileNameList=app.GetFileList("BGM/*."+filter)
|
||||||
|
for fileName in fileNameList:
|
||||||
|
self.__AppendFile(fileName)
|
||||||
|
|
||||||
|
def __AppendFile(self, fileName):
|
||||||
|
self.fileListBox.AppendItem(Item(fileName))
|
||||||
|
|
||||||
|
|
||||||
+504
@@ -0,0 +1,504 @@
|
|||||||
|
import net
|
||||||
|
import player
|
||||||
|
import item
|
||||||
|
import snd
|
||||||
|
import shop
|
||||||
|
import net
|
||||||
|
import wndMgr
|
||||||
|
import app
|
||||||
|
import chat
|
||||||
|
|
||||||
|
import ui
|
||||||
|
import uiCommon
|
||||||
|
import mouseModule
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
## Shop
|
||||||
|
class ShopDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.tooltipItem = 0
|
||||||
|
self.xShopStart = 0
|
||||||
|
self.yShopStart = 0
|
||||||
|
self.questionDialog = None
|
||||||
|
self.popup = None
|
||||||
|
self.itemBuyQuestionDialog = None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def __GetRealIndex(self, i):
|
||||||
|
return self.tabIdx * shop.SHOP_SLOT_COUNT + i
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
getItemID=shop.GetItemID
|
||||||
|
getItemCount=shop.GetItemCount
|
||||||
|
setItemID=self.itemSlotWindow.SetItemSlot
|
||||||
|
for i in xrange(shop.SHOP_SLOT_COUNT):
|
||||||
|
idx = self.__GetRealIndex(i)
|
||||||
|
itemCount = getItemCount(idx)
|
||||||
|
if itemCount <= 1:
|
||||||
|
itemCount = 0
|
||||||
|
setItemID(i, getItemID(idx), itemCount)
|
||||||
|
|
||||||
|
wndMgr.RefreshSlot(self.itemSlotWindow.GetWindowHandle())
|
||||||
|
|
||||||
|
def SetItemData(self, pos, itemID, itemCount, itemPrice):
|
||||||
|
shop.SetItemData(pos, itemID, itemCount, itemPrice)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
||||||
|
PythonScriptLoader.LoadScriptFile(self, "UIScript/shopdialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ShopDialog.LoadDialog.LoadObject")
|
||||||
|
|
||||||
|
smallTab1 = None
|
||||||
|
smallTab2 = None
|
||||||
|
smallTab3 = None
|
||||||
|
middleTab1 = None
|
||||||
|
middleTab2 = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.itemSlotWindow = GetObject("ItemSlot")
|
||||||
|
self.btnBuy = GetObject("BuyButton")
|
||||||
|
self.btnSell = GetObject("SellButton")
|
||||||
|
self.btnClose = GetObject("CloseButton")
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
middleTab1 = GetObject("MiddleTab1")
|
||||||
|
middleTab2 = GetObject("MiddleTab2")
|
||||||
|
smallTab1 = GetObject("SmallTab1")
|
||||||
|
smallTab2 = GetObject("SmallTab2")
|
||||||
|
smallTab3 = GetObject("SmallTab3")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("ShopDialog.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.itemSlotWindow.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
|
||||||
|
self.itemSlotWindow.SAFE_SetButtonEvent("LEFT", "EMPTY", self.SelectEmptySlot)
|
||||||
|
self.itemSlotWindow.SAFE_SetButtonEvent("LEFT", "EXIST", self.SelectItemSlot)
|
||||||
|
self.itemSlotWindow.SAFE_SetButtonEvent("RIGHT", "EXIST", self.UnselectItemSlot)
|
||||||
|
|
||||||
|
self.itemSlotWindow.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
|
||||||
|
self.itemSlotWindow.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
|
||||||
|
|
||||||
|
self.btnBuy.SetToggleUpEvent(ui.__mem_func__(self.CancelShopping))
|
||||||
|
self.btnBuy.SetToggleDownEvent(ui.__mem_func__(self.OnBuy))
|
||||||
|
|
||||||
|
self.btnSell.SetToggleUpEvent(ui.__mem_func__(self.CancelShopping))
|
||||||
|
self.btnSell.SetToggleDownEvent(ui.__mem_func__(self.OnSell))
|
||||||
|
|
||||||
|
self.btnClose.SetEvent(ui.__mem_func__(self.AskClosePrivateShop))
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.smallRadioButtonGroup = ui.RadioButtonGroup.Create([[smallTab1, lambda : self.OnClickTabButton(0), None], [smallTab2, lambda : self.OnClickTabButton(1), None], [smallTab3, lambda : self.OnClickTabButton(2), None]])
|
||||||
|
self.middleRadioButtonGroup = ui.RadioButtonGroup.Create([[middleTab1, lambda : self.OnClickTabButton(0), None], [middleTab2, lambda : self.OnClickTabButton(1), None]])
|
||||||
|
|
||||||
|
self.__HideMiddleTabs()
|
||||||
|
self.__HideSmallTabs()
|
||||||
|
|
||||||
|
self.tabIdx = 0
|
||||||
|
self.coinType = shop.SHOP_COIN_TYPE_GOLD
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def __ShowBuySellButton(self):
|
||||||
|
self.btnBuy.Show()
|
||||||
|
self.btnSell.Show()
|
||||||
|
|
||||||
|
def __ShowMiddleTabs(self):
|
||||||
|
self.middleRadioButtonGroup.Show()
|
||||||
|
|
||||||
|
def __ShowSmallTabs(self):
|
||||||
|
self.smallRadioButtonGroup.Show()
|
||||||
|
|
||||||
|
def __HideBuySellButton(self):
|
||||||
|
self.btnBuy.Hide()
|
||||||
|
self.btnSell.Hide()
|
||||||
|
|
||||||
|
def __HideMiddleTabs(self):
|
||||||
|
self.middleRadioButtonGroup.Hide()
|
||||||
|
|
||||||
|
def __HideSmallTabs(self):
|
||||||
|
self.smallRadioButtonGroup.Hide()
|
||||||
|
|
||||||
|
def __SetTabNames(self):
|
||||||
|
if shop.GetTabCount() == 2:
|
||||||
|
self.middleRadioButtonGroup.SetText(0, shop.GetTabName(0))
|
||||||
|
self.middleRadioButtonGroup.SetText(1, shop.GetTabName(1))
|
||||||
|
elif shop.GetTabCount() == 3:
|
||||||
|
self.smallRadioButtonGroup.SetText(0, shop.GetTabName(0))
|
||||||
|
self.smallRadioButtonGroup.SetText(1, shop.GetTabName(1))
|
||||||
|
self.smallRadioButtonGroup.SetText(2, shop.GetTabName(2))
|
||||||
|
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.Close()
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.tooltipItem = 0
|
||||||
|
self.itemSlotWindow = 0
|
||||||
|
self.btnBuy = 0
|
||||||
|
self.btnSell = 0
|
||||||
|
self.btnClose = 0
|
||||||
|
self.titleBar = 0
|
||||||
|
self.questionDialog = None
|
||||||
|
self.popup = None
|
||||||
|
|
||||||
|
def Open(self, vid):
|
||||||
|
|
||||||
|
isPrivateShop = False
|
||||||
|
isMainPlayerPrivateShop = False
|
||||||
|
|
||||||
|
import chr
|
||||||
|
if chr.IsNPC(vid):
|
||||||
|
isPrivateShop = False
|
||||||
|
else:
|
||||||
|
isPrivateShop = True
|
||||||
|
|
||||||
|
if player.IsMainCharacterIndex(vid):
|
||||||
|
|
||||||
|
isMainPlayerPrivateShop = True
|
||||||
|
|
||||||
|
self.btnBuy.Hide()
|
||||||
|
self.btnSell.Hide()
|
||||||
|
self.btnClose.Show()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
isMainPlayerPrivateShop = False
|
||||||
|
|
||||||
|
self.btnBuy.Show()
|
||||||
|
self.btnSell.Show()
|
||||||
|
self.btnClose.Hide()
|
||||||
|
|
||||||
|
shop.Open(isPrivateShop, isMainPlayerPrivateShop)
|
||||||
|
|
||||||
|
self.tabIdx = 0
|
||||||
|
|
||||||
|
if isPrivateShop:
|
||||||
|
self.__HideMiddleTabs()
|
||||||
|
self.__HideSmallTabs()
|
||||||
|
else:
|
||||||
|
if shop.GetTabCount() == 1:
|
||||||
|
self.__ShowBuySellButton()
|
||||||
|
self.__HideMiddleTabs()
|
||||||
|
self.__HideSmallTabs()
|
||||||
|
elif shop.GetTabCount() == 2:
|
||||||
|
self.__HideBuySellButton()
|
||||||
|
self.__ShowMiddleTabs()
|
||||||
|
self.__HideSmallTabs()
|
||||||
|
self.__SetTabNames()
|
||||||
|
self.middleRadioButtonGroup.OnClick(0)
|
||||||
|
elif shop.GetTabCount() == 3:
|
||||||
|
self.__HideBuySellButton()
|
||||||
|
self.__HideMiddleTabs()
|
||||||
|
self.__ShowSmallTabs()
|
||||||
|
self.__SetTabNames()
|
||||||
|
self.middleRadioButtonGroup.OnClick(1)
|
||||||
|
|
||||||
|
self.Refresh()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
(self.xShopStart, self.yShopStart, z) = player.GetMainCharacterPosition()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
if self.itemBuyQuestionDialog:
|
||||||
|
self.itemBuyQuestionDialog.Close()
|
||||||
|
self.itemBuyQuestionDialog = None
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||||
|
if self.questionDialog:
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
shop.Close()
|
||||||
|
net.SendShopEndPacket()
|
||||||
|
self.CancelShopping()
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def GetIndexFromSlotPos(self, slotPos):
|
||||||
|
return self.tabIdx * shop.SHOP_SLOT_COUNT + slotPos
|
||||||
|
|
||||||
|
def OnClickTabButton(self, idx):
|
||||||
|
self.tabIdx = idx
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def AskClosePrivateShop(self):
|
||||||
|
questionDialog = uiCommon.QuestionDialog()
|
||||||
|
questionDialog.SetText(localeInfo.PRIVATE_SHOP_CLOSE_QUESTION)
|
||||||
|
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnClosePrivateShop))
|
||||||
|
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||||
|
questionDialog.Open()
|
||||||
|
self.questionDialog = questionDialog
|
||||||
|
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnClosePrivateShop(self):
|
||||||
|
net.SendChatPacket("/close_shop")
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnBuy(self):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
|
||||||
|
app.SetCursor(app.BUY)
|
||||||
|
self.btnSell.SetUp()
|
||||||
|
|
||||||
|
def OnSell(self):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO)
|
||||||
|
app.SetCursor(app.SELL)
|
||||||
|
self.btnBuy.SetUp()
|
||||||
|
|
||||||
|
def CancelShopping(self):
|
||||||
|
self.btnBuy.SetUp()
|
||||||
|
self.btnSell.SetUp()
|
||||||
|
app.SetCursor(app.NORMAL)
|
||||||
|
|
||||||
|
def __OnClosePopupDialog(self):
|
||||||
|
self.pop = None
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||||
|
|
||||||
|
## ¿ëÈ¥¼® ÆÈ¸®´Â ±â´É Ãß°¡.
|
||||||
|
def SellAttachedItem(self):
|
||||||
|
|
||||||
|
if shop.IsPrivateShop():
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
return
|
||||||
|
|
||||||
|
attachedSlotType = mouseModule.mouseController.GetAttachedType()
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
attachedCount = mouseModule.mouseController.GetAttachedItemCount()
|
||||||
|
if localeInfo.IsBRAZIL() == 0:
|
||||||
|
attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
|
||||||
|
|
||||||
|
# if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
|
||||||
|
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
|
||||||
|
|
||||||
|
# if localeInfo.IsBRAZIL():
|
||||||
|
# itemIndex = player.GetItemIndex(attachedSlotPos)
|
||||||
|
# item.SelectItem(itemIndex)
|
||||||
|
# else:
|
||||||
|
# item.SelectItem(attachedItemIndex)
|
||||||
|
|
||||||
|
itemIndex = player.GetItemIndex(attachedSlotPos)
|
||||||
|
item.SelectItem(itemIndex)
|
||||||
|
|
||||||
|
if item.IsAntiFlag(item.ANTIFLAG_SELL):
|
||||||
|
popup = uiCommon.PopupDialog()
|
||||||
|
popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
|
||||||
|
popup.SetAcceptEvent(self.__OnClosePopupDialog)
|
||||||
|
popup.Open()
|
||||||
|
self.popup = popup
|
||||||
|
return
|
||||||
|
|
||||||
|
itemtype = player.INVENTORY
|
||||||
|
|
||||||
|
if localeInfo.IsBRAZIL() == 0:
|
||||||
|
if player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
|
||||||
|
itemtype = player.DRAGON_SOUL_INVENTORY
|
||||||
|
|
||||||
|
# if player.IsValuableItem(itemtype, attachedSlotPos):
|
||||||
|
if player.IsValuableItem(attachedSlotPos):
|
||||||
|
|
||||||
|
itemPrice = item.GetISellItemPrice()
|
||||||
|
|
||||||
|
if item.Is1GoldItem():
|
||||||
|
itemPrice = attachedCount / itemPrice / 5
|
||||||
|
else:
|
||||||
|
itemPrice = itemPrice * max(1, attachedCount) / 5
|
||||||
|
|
||||||
|
itemName = item.GetItemName()
|
||||||
|
|
||||||
|
questionDialog = uiCommon.QuestionDialog()
|
||||||
|
questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount, itemPrice))
|
||||||
|
|
||||||
|
questionDialog.SetAcceptEvent(lambda arg1=attachedSlotPos, arg2=attachedCount, arg3 = itemtype: self.OnSellItem(arg1, arg2, arg3))
|
||||||
|
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||||
|
questionDialog.Open()
|
||||||
|
self.questionDialog = questionDialog
|
||||||
|
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.OnSellItem(attachedSlotPos, attachedCount, itemtype)
|
||||||
|
|
||||||
|
else:
|
||||||
|
snd.PlaySound("sound/ui/loginfail.wav")
|
||||||
|
|
||||||
|
mouseModule.mouseController.DeattachObject()
|
||||||
|
|
||||||
|
def OnSellItem(self, slotPos, count, itemtype):
|
||||||
|
net.SendShopSellPacketNew(slotPos, count, itemtype)
|
||||||
|
snd.PlaySound("sound/ui/money.wav")
|
||||||
|
self.OnCloseQuestionDialog()
|
||||||
|
|
||||||
|
def OnCloseQuestionDialog(self):
|
||||||
|
if not self.questionDialog:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||||
|
|
||||||
|
def SelectEmptySlot(self, selectedSlotPos):
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
if isAttached:
|
||||||
|
self.SellAttachedItem()
|
||||||
|
|
||||||
|
def UnselectItemSlot(self, selectedSlotPos):
|
||||||
|
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
|
||||||
|
return
|
||||||
|
if shop.IsPrivateShop():
|
||||||
|
self.AskBuyItem(selectedSlotPos)
|
||||||
|
else:
|
||||||
|
net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))
|
||||||
|
|
||||||
|
def SelectItemSlot(self, selectedSlotPos):
|
||||||
|
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
|
||||||
|
return
|
||||||
|
|
||||||
|
isAttached = mouseModule.mouseController.isAttached()
|
||||||
|
selectedSlotPos = self.__GetRealIndex(selectedSlotPos)
|
||||||
|
if isAttached:
|
||||||
|
self.SellAttachedItem()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
if True == shop.IsMainPlayerPrivateShop():
|
||||||
|
return
|
||||||
|
|
||||||
|
curCursorNum = app.GetCursor()
|
||||||
|
if app.BUY == curCursorNum:
|
||||||
|
self.AskBuyItem(selectedSlotPos)
|
||||||
|
|
||||||
|
elif app.SELL == curCursorNum:
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO)
|
||||||
|
|
||||||
|
else:
|
||||||
|
selectedItemID = shop.GetItemID(selectedSlotPos)
|
||||||
|
itemCount = shop.GetItemCount(selectedSlotPos)
|
||||||
|
|
||||||
|
type = player.SLOT_TYPE_SHOP
|
||||||
|
if shop.IsPrivateShop():
|
||||||
|
type = player.SLOT_TYPE_PRIVATE_SHOP
|
||||||
|
|
||||||
|
mouseModule.mouseController.AttachObject(self, type, selectedSlotPos, selectedItemID, itemCount)
|
||||||
|
mouseModule.mouseController.SetCallBack("INVENTORY", ui.__mem_func__(self.DropToInventory))
|
||||||
|
snd.PlaySound("sound/ui/pick.wav")
|
||||||
|
|
||||||
|
def DropToInventory(self):
|
||||||
|
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
|
||||||
|
self.AskBuyItem(attachedSlotPos)
|
||||||
|
|
||||||
|
def AskBuyItem(self, slotPos):
|
||||||
|
slotPos = self.__GetRealIndex(slotPos)
|
||||||
|
|
||||||
|
itemIndex = shop.GetItemID(slotPos)
|
||||||
|
itemPrice = shop.GetItemPrice(slotPos)
|
||||||
|
itemCount = shop.GetItemCount(slotPos)
|
||||||
|
|
||||||
|
item.SelectItem(itemIndex)
|
||||||
|
itemName = item.GetItemName()
|
||||||
|
|
||||||
|
itemBuyQuestionDialog = uiCommon.QuestionDialog()
|
||||||
|
itemBuyQuestionDialog.SetText(localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, localeInfo.NumberToMoneyString(itemPrice)))
|
||||||
|
itemBuyQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerBuyItem(arg))
|
||||||
|
itemBuyQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerBuyItem(arg))
|
||||||
|
itemBuyQuestionDialog.Open()
|
||||||
|
itemBuyQuestionDialog.pos = slotPos
|
||||||
|
self.itemBuyQuestionDialog = itemBuyQuestionDialog
|
||||||
|
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
|
||||||
|
|
||||||
|
def AnswerBuyItem(self, flag):
|
||||||
|
|
||||||
|
if flag:
|
||||||
|
pos = self.itemBuyQuestionDialog.pos
|
||||||
|
net.SendShopBuyPacket(pos)
|
||||||
|
|
||||||
|
self.itemBuyQuestionDialog.Close()
|
||||||
|
self.itemBuyQuestionDialog = None
|
||||||
|
|
||||||
|
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||||
|
|
||||||
|
def SetItemToolTip(self, tooltipItem):
|
||||||
|
self.tooltipItem = tooltipItem
|
||||||
|
|
||||||
|
def OverInItem(self, slotIndex):
|
||||||
|
slotIndex = self.__GetRealIndex(slotIndex)
|
||||||
|
if mouseModule.mouseController.isAttached():
|
||||||
|
return
|
||||||
|
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
if shop.SHOP_COIN_TYPE_GOLD == shop.GetTabCoinType(self.tabIdx):
|
||||||
|
self.tooltipItem.SetShopItem(slotIndex)
|
||||||
|
else:
|
||||||
|
self.tooltipItem.SetShopItemBySecondaryCoin(slotIndex)
|
||||||
|
def OverOutItem(self):
|
||||||
|
if 0 != self.tooltipItem:
|
||||||
|
self.tooltipItem.HideToolTip()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
USE_SHOP_LIMIT_RANGE = 1000
|
||||||
|
|
||||||
|
(x, y, z) = player.GetMainCharacterPosition()
|
||||||
|
if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE:
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
|
||||||
|
class MallPageDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
scriptLoader = ui.PythonScriptLoader()
|
||||||
|
scriptLoader.LoadScriptFile(self, "uiscript/mallpagedialog.py")
|
||||||
|
|
||||||
|
self.GetChild("titlebar").SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
(x, y)=self.GetGlobalPosition()
|
||||||
|
x+=10
|
||||||
|
y+=30
|
||||||
|
|
||||||
|
MALL_PAGE_WIDTH = 600
|
||||||
|
MALL_PAGE_HEIGHT = 480
|
||||||
|
|
||||||
|
app.ShowWebPage(
|
||||||
|
"http://metin2.co.kr/08_mall/game_mall/login_fail.htm",
|
||||||
|
(x, y, x+MALL_PAGE_WIDTH, y+MALL_PAGE_HEIGHT))
|
||||||
|
|
||||||
|
self.Lock()
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
app.HideWebPage()
|
||||||
|
self.Unlock()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
import net
|
||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import uiOption
|
||||||
|
|
||||||
|
import uiSystemOption
|
||||||
|
import uiGameOption
|
||||||
|
import uiScriptLocale
|
||||||
|
import networkModule
|
||||||
|
import constInfo
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
SYSTEM_MENU_FOR_PORTAL = False
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
## System
|
||||||
|
class SystemDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.eventOpenHelpWindow = None
|
||||||
|
self.systemOptionDlg = None
|
||||||
|
self.gameOptionDlg = None
|
||||||
|
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
if SYSTEM_MENU_FOR_PORTAL:
|
||||||
|
self.__LoadSystemMenu_ForPortal()
|
||||||
|
else:
|
||||||
|
self.__LoadSystemMenu_Default()
|
||||||
|
|
||||||
|
def __LoadSystemMenu_Default(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if constInfo.IN_GAME_SHOP_ENABLE:
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "SystemDialog.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/systemdialog.py")
|
||||||
|
|
||||||
|
self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
|
||||||
|
self.GetChild("game_option_button").SAFE_SetEvent(self.__ClickGameOptionButton)
|
||||||
|
self.GetChild("change_button").SAFE_SetEvent(self.__ClickChangeCharacterButton)
|
||||||
|
self.GetChild("logout_button").SAFE_SetEvent(self.__ClickLogOutButton)
|
||||||
|
self.GetChild("exit_button").SAFE_SetEvent(self.__ClickExitButton)
|
||||||
|
self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
|
||||||
|
self.GetChild("cancel_button").SAFE_SetEvent(self.Close)
|
||||||
|
|
||||||
|
if constInfo.IN_GAME_SHOP_ENABLE:
|
||||||
|
self.GetChild("mall_button").SAFE_SetEvent(self.__ClickInGameShopButton)
|
||||||
|
|
||||||
|
|
||||||
|
def __LoadSystemMenu_ForPortal(self):
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "uiscript/systemdialog_forportal.py")
|
||||||
|
|
||||||
|
self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
|
||||||
|
self.GetChild("game_option_button").SAFE_SetEvent(self.__ClickGameOptionButton)
|
||||||
|
self.GetChild("change_button").SAFE_SetEvent(self.__ClickChangeCharacterButton)
|
||||||
|
self.GetChild("exit_button").SAFE_SetEvent(self.__ClickExitButton)
|
||||||
|
self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
|
||||||
|
self.GetChild("cancel_button").SAFE_SetEvent(self.Close)
|
||||||
|
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
if self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg.Destroy()
|
||||||
|
|
||||||
|
if self.systemOptionDlg:
|
||||||
|
self.systemOptionDlg.Destroy()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
def SetOpenHelpWindowEvent(self, event):
|
||||||
|
self.eventOpenHelpWindow = event
|
||||||
|
|
||||||
|
def OpenDialog(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def __ClickChangeCharacterButton(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
net.ExitGame()
|
||||||
|
|
||||||
|
def __OnClosePopupDialog(self):
|
||||||
|
self.popup = None
|
||||||
|
|
||||||
|
def __ClickLogOutButton(self):
|
||||||
|
if SYSTEM_MENU_FOR_PORTAL:
|
||||||
|
if app.loggined:
|
||||||
|
self.Close()
|
||||||
|
net.ExitApplication()
|
||||||
|
else:
|
||||||
|
self.Close()
|
||||||
|
net.LogOutGame()
|
||||||
|
else:
|
||||||
|
self.Close()
|
||||||
|
net.LogOutGame()
|
||||||
|
|
||||||
|
|
||||||
|
def __ClickExitButton(self):
|
||||||
|
self.Close()
|
||||||
|
net.ExitApplication()
|
||||||
|
|
||||||
|
def __ClickSystemOptionButton(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
if not self.systemOptionDlg:
|
||||||
|
self.systemOptionDlg = uiSystemOption.OptionDialog()
|
||||||
|
|
||||||
|
self.systemOptionDlg.Show()
|
||||||
|
|
||||||
|
def __ClickGameOptionButton(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
if not self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg = uiGameOption.OptionDialog()
|
||||||
|
|
||||||
|
self.gameOptionDlg.Show()
|
||||||
|
|
||||||
|
|
||||||
|
def __ClickHelpButton(self):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
if None != self.eventOpenHelpWindow:
|
||||||
|
self.eventOpenHelpWindow()
|
||||||
|
|
||||||
|
def __ClickInGameShopButton(self):
|
||||||
|
self.Close()
|
||||||
|
net.SendChatPacket("/in_game_mall")
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.Hide()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def RefreshMobile(self):
|
||||||
|
if self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg.RefreshMobile()
|
||||||
|
#self.optionDialog.RefreshMobile()
|
||||||
|
|
||||||
|
def OnMobileAuthority(self):
|
||||||
|
if self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg.OnMobileAuthority()
|
||||||
|
#self.optionDialog.OnMobileAuthority()
|
||||||
|
|
||||||
|
def OnBlockMode(self, mode):
|
||||||
|
uiGameOption.blockMode = mode
|
||||||
|
if self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg.OnBlockMode(mode)
|
||||||
|
#self.optionDialog.OnBlockMode(mode)
|
||||||
|
|
||||||
|
def OnChangePKMode(self):
|
||||||
|
if self.gameOptionDlg:
|
||||||
|
self.gameOptionDlg.OnChangePKMode()
|
||||||
|
#self.optionDialog.OnChangePKMode()
|
||||||
|
|
||||||
|
def OnPressExitKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import chr
|
||||||
|
import background
|
||||||
|
import player
|
||||||
|
|
||||||
|
#wndMgr.SetOutlineFlag(True)
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
|
||||||
|
wnd = SystemDialog()
|
||||||
|
wnd.LoadDialog()
|
||||||
|
wnd.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
|
|
||||||
@@ -0,0 +1,250 @@
|
|||||||
|
import dbg
|
||||||
|
import ui
|
||||||
|
import snd
|
||||||
|
import systemSetting
|
||||||
|
import net
|
||||||
|
import chat
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
import chrmgr
|
||||||
|
import player
|
||||||
|
import musicInfo
|
||||||
|
|
||||||
|
import uiSelectMusic
|
||||||
|
import background
|
||||||
|
|
||||||
|
MUSIC_FILENAME_MAX_LEN = 25
|
||||||
|
|
||||||
|
blockMode = 0
|
||||||
|
|
||||||
|
class OptionDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.__Initialize()
|
||||||
|
self.__Load()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print " -------------------------------------- DELETE SYSTEM OPTION DIALOG"
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.tilingMode = 0
|
||||||
|
self.titleBar = 0
|
||||||
|
self.changeMusicButton = 0
|
||||||
|
self.selectMusicFile = 0
|
||||||
|
self.ctrlMusicVolume = 0
|
||||||
|
self.ctrlSoundVolume = 0
|
||||||
|
self.musicListDlg = 0
|
||||||
|
self.tilingApplyButton = 0
|
||||||
|
self.cameraModeButtonList = []
|
||||||
|
self.fogModeButtonList = []
|
||||||
|
self.tilingModeButtonList = []
|
||||||
|
self.ctrlShadowQuality = 0
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.ClearDictionary()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
print " -------------------------------------- DESTROY SYSTEM OPTION DIALOG"
|
||||||
|
|
||||||
|
def __Load_LoadScript(self, fileName):
|
||||||
|
try:
|
||||||
|
pyScriptLoader = ui.PythonScriptLoader()
|
||||||
|
pyScriptLoader.LoadScriptFile(self, fileName)
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("System.OptionDialog.__Load_LoadScript")
|
||||||
|
|
||||||
|
def __Load_BindObject(self):
|
||||||
|
try:
|
||||||
|
GetObject = self.GetChild
|
||||||
|
self.titleBar = GetObject("titlebar")
|
||||||
|
self.selectMusicFile = GetObject("bgm_file")
|
||||||
|
self.changeMusicButton = GetObject("bgm_button")
|
||||||
|
self.ctrlMusicVolume = GetObject("music_volume_controller")
|
||||||
|
self.ctrlSoundVolume = GetObject("sound_volume_controller")
|
||||||
|
self.cameraModeButtonList.append(GetObject("camera_short"))
|
||||||
|
self.cameraModeButtonList.append(GetObject("camera_long"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level0"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level1"))
|
||||||
|
self.fogModeButtonList.append(GetObject("fog_level2"))
|
||||||
|
self.tilingModeButtonList.append(GetObject("tiling_cpu"))
|
||||||
|
self.tilingModeButtonList.append(GetObject("tiling_gpu"))
|
||||||
|
self.tilingApplyButton=GetObject("tiling_apply")
|
||||||
|
#self.ctrlShadowQuality = GetObject("shadow_bar")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("OptionDialog.__Load_BindObject")
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
self.__Load_LoadScript("uiscript/systemoptiondialog.py")
|
||||||
|
self.__Load_BindObject()
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||||
|
|
||||||
|
self.ctrlMusicVolume.SetSliderPos(float(systemSetting.GetMusicVolume()))
|
||||||
|
self.ctrlMusicVolume.SetEvent(ui.__mem_func__(self.OnChangeMusicVolume))
|
||||||
|
|
||||||
|
self.ctrlSoundVolume.SetSliderPos(float(systemSetting.GetSoundVolume()) / 5.0)
|
||||||
|
self.ctrlSoundVolume.SetEvent(ui.__mem_func__(self.OnChangeSoundVolume))
|
||||||
|
|
||||||
|
# self.ctrlShadowQuality.SetSliderPos(float(systemSetting.GetShadowLevel()) / 5.0)
|
||||||
|
# self.ctrlShadowQuality.SetEvent(ui.__mem_func__(self.OnChangeShadowQuality))
|
||||||
|
|
||||||
|
self.changeMusicButton.SAFE_SetEvent(self.__OnClickChangeMusicButton)
|
||||||
|
|
||||||
|
self.cameraModeButtonList[0].SAFE_SetEvent(self.__OnClickCameraModeShortButton)
|
||||||
|
self.cameraModeButtonList[1].SAFE_SetEvent(self.__OnClickCameraModeLongButton)
|
||||||
|
|
||||||
|
self.fogModeButtonList[0].SAFE_SetEvent(self.__OnClickFogModeLevel0Button)
|
||||||
|
self.fogModeButtonList[1].SAFE_SetEvent(self.__OnClickFogModeLevel1Button)
|
||||||
|
self.fogModeButtonList[2].SAFE_SetEvent(self.__OnClickFogModeLevel2Button)
|
||||||
|
|
||||||
|
self.tilingModeButtonList[0].SAFE_SetEvent(self.__OnClickTilingModeCPUButton)
|
||||||
|
self.tilingModeButtonList[1].SAFE_SetEvent(self.__OnClickTilingModeGPUButton)
|
||||||
|
|
||||||
|
self.tilingApplyButton.SAFE_SetEvent(self.__OnClickTilingApplyButton)
|
||||||
|
|
||||||
|
self.__SetCurTilingMode()
|
||||||
|
|
||||||
|
self.__ClickRadioButton(self.fogModeButtonList, constInfo.GET_FOG_LEVEL_INDEX())
|
||||||
|
self.__ClickRadioButton(self.cameraModeButtonList, constInfo.GET_CAMERA_MAX_DISTANCE_INDEX())
|
||||||
|
|
||||||
|
if musicInfo.fieldMusic==musicInfo.METIN2THEMA:
|
||||||
|
self.selectMusicFile.SetText(uiSelectMusic.DEFAULT_THEMA)
|
||||||
|
else:
|
||||||
|
self.selectMusicFile.SetText(musicInfo.fieldMusic[:MUSIC_FILENAME_MAX_LEN])
|
||||||
|
|
||||||
|
def __OnClickTilingModeCPUButton(self):
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_1)
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_2)
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_3)
|
||||||
|
self.__SetTilingMode(0)
|
||||||
|
|
||||||
|
def __OnClickTilingModeGPUButton(self):
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_1)
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_2)
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_3)
|
||||||
|
self.__SetTilingMode(1)
|
||||||
|
|
||||||
|
def __OnClickTilingApplyButton(self):
|
||||||
|
self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_TILING_EXIT)
|
||||||
|
if 0==self.tilingMode:
|
||||||
|
background.EnableSoftwareTiling(1)
|
||||||
|
else:
|
||||||
|
background.EnableSoftwareTiling(0)
|
||||||
|
|
||||||
|
net.ExitGame()
|
||||||
|
|
||||||
|
def __OnClickChangeMusicButton(self):
|
||||||
|
if not self.musicListDlg:
|
||||||
|
|
||||||
|
self.musicListDlg=uiSelectMusic.FileListDialog()
|
||||||
|
self.musicListDlg.SAFE_SetSelectEvent(self.__OnChangeMusic)
|
||||||
|
|
||||||
|
self.musicListDlg.Open()
|
||||||
|
|
||||||
|
|
||||||
|
def __ClickRadioButton(self, buttonList, buttonIndex):
|
||||||
|
try:
|
||||||
|
selButton=buttonList[buttonIndex]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
|
for eachButton in buttonList:
|
||||||
|
eachButton.SetUp()
|
||||||
|
|
||||||
|
selButton.Down()
|
||||||
|
|
||||||
|
|
||||||
|
def __SetTilingMode(self, index):
|
||||||
|
self.__ClickRadioButton(self.tilingModeButtonList, index)
|
||||||
|
self.tilingMode=index
|
||||||
|
|
||||||
|
def __SetCameraMode(self, index):
|
||||||
|
constInfo.SET_CAMERA_MAX_DISTANCE_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.cameraModeButtonList, index)
|
||||||
|
|
||||||
|
def __SetFogLevel(self, index):
|
||||||
|
constInfo.SET_FOG_LEVEL_INDEX(index)
|
||||||
|
self.__ClickRadioButton(self.fogModeButtonList, index)
|
||||||
|
|
||||||
|
def __OnClickCameraModeShortButton(self):
|
||||||
|
self.__SetCameraMode(0)
|
||||||
|
|
||||||
|
def __OnClickCameraModeLongButton(self):
|
||||||
|
self.__SetCameraMode(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel0Button(self):
|
||||||
|
self.__SetFogLevel(0)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel1Button(self):
|
||||||
|
self.__SetFogLevel(1)
|
||||||
|
|
||||||
|
def __OnClickFogModeLevel2Button(self):
|
||||||
|
self.__SetFogLevel(2)
|
||||||
|
|
||||||
|
def __OnChangeMusic(self, fileName):
|
||||||
|
self.selectMusicFile.SetText(fileName[:MUSIC_FILENAME_MAX_LEN])
|
||||||
|
|
||||||
|
if musicInfo.fieldMusic != "":
|
||||||
|
snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
|
||||||
|
|
||||||
|
if fileName==uiSelectMusic.DEFAULT_THEMA:
|
||||||
|
musicInfo.fieldMusic=musicInfo.METIN2THEMA
|
||||||
|
else:
|
||||||
|
musicInfo.fieldMusic=fileName
|
||||||
|
|
||||||
|
musicInfo.SaveLastPlayFieldMusic()
|
||||||
|
|
||||||
|
if musicInfo.fieldMusic != "":
|
||||||
|
snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
|
||||||
|
|
||||||
|
def OnChangeMusicVolume(self):
|
||||||
|
pos = self.ctrlMusicVolume.GetSliderPos()
|
||||||
|
snd.SetMusicVolume(pos * net.GetFieldMusicVolume())
|
||||||
|
systemSetting.SetMusicVolume(pos)
|
||||||
|
|
||||||
|
def OnChangeSoundVolume(self):
|
||||||
|
pos = self.ctrlSoundVolume.GetSliderPos()
|
||||||
|
snd.SetSoundVolumef(pos)
|
||||||
|
systemSetting.SetSoundVolumef(pos)
|
||||||
|
|
||||||
|
def OnChangeShadowQuality(self):
|
||||||
|
pos = self.ctrlShadowQuality.GetSliderPos()
|
||||||
|
systemSetting.SetShadowLevel(int(pos / 0.2))
|
||||||
|
|
||||||
|
def OnCloseInputDialog(self):
|
||||||
|
self.inputDialog.Close()
|
||||||
|
self.inputDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnCloseQuestionDialog(self):
|
||||||
|
self.questionDialog.Close()
|
||||||
|
self.questionDialog = None
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.__SetCurTilingMode()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __SetCurTilingMode(self):
|
||||||
|
if background.IsSoftwareTiling():
|
||||||
|
self.__SetTilingMode(0)
|
||||||
|
else:
|
||||||
|
self.__SetTilingMode(1)
|
||||||
|
|
||||||
|
def __NotifyChatLine(self, text):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, text)
|
||||||
|
|
||||||
@@ -0,0 +1,473 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import player
|
||||||
|
import net
|
||||||
|
import wndMgr
|
||||||
|
import messenger
|
||||||
|
import guild
|
||||||
|
import chr
|
||||||
|
import nonplayer
|
||||||
|
import localeInfo
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
class TargetBoard(ui.ThinBoard):
|
||||||
|
|
||||||
|
BUTTON_NAME_LIST = (
|
||||||
|
localeInfo.TARGET_BUTTON_WHISPER,
|
||||||
|
localeInfo.TARGET_BUTTON_EXCHANGE,
|
||||||
|
localeInfo.TARGET_BUTTON_FIGHT,
|
||||||
|
localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
|
||||||
|
localeInfo.TARGET_BUTTON_AVENGE,
|
||||||
|
localeInfo.TARGET_BUTTON_FRIEND,
|
||||||
|
localeInfo.TARGET_BUTTON_INVITE_PARTY,
|
||||||
|
localeInfo.TARGET_BUTTON_LEAVE_PARTY,
|
||||||
|
localeInfo.TARGET_BUTTON_EXCLUDE,
|
||||||
|
localeInfo.TARGET_BUTTON_INVITE_GUILD,
|
||||||
|
localeInfo.TARGET_BUTTON_DISMOUNT,
|
||||||
|
localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
|
||||||
|
localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
|
||||||
|
localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
|
||||||
|
localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
|
||||||
|
localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
|
||||||
|
"VOTE_BLOCK_CHAT",
|
||||||
|
)
|
||||||
|
|
||||||
|
GRADE_NAME = {
|
||||||
|
nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
|
||||||
|
nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
|
||||||
|
nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
|
||||||
|
nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
|
||||||
|
nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
|
||||||
|
nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
|
||||||
|
}
|
||||||
|
EXCHANGE_LIMIT_RANGE = 3000
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.ThinBoard.__init__(self)
|
||||||
|
|
||||||
|
name = ui.TextLine()
|
||||||
|
name.SetParent(self)
|
||||||
|
name.SetDefaultFontName()
|
||||||
|
name.SetOutline()
|
||||||
|
name.Show()
|
||||||
|
|
||||||
|
hpGauge = ui.Gauge()
|
||||||
|
hpGauge.SetParent(self)
|
||||||
|
hpGauge.MakeGauge(130, "red")
|
||||||
|
hpGauge.Hide()
|
||||||
|
|
||||||
|
closeButton = ui.Button()
|
||||||
|
closeButton.SetParent(self)
|
||||||
|
closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
|
||||||
|
closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
|
||||||
|
closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
|
||||||
|
closeButton.SetPosition(30, 13)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
hpGauge.SetPosition(55, 17)
|
||||||
|
hpGauge.SetWindowHorizontalAlignLeft()
|
||||||
|
closeButton.SetWindowHorizontalAlignLeft()
|
||||||
|
else:
|
||||||
|
hpGauge.SetPosition(175, 17)
|
||||||
|
hpGauge.SetWindowHorizontalAlignRight()
|
||||||
|
closeButton.SetWindowHorizontalAlignRight()
|
||||||
|
|
||||||
|
closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
|
||||||
|
closeButton.Show()
|
||||||
|
|
||||||
|
self.buttonDict = {}
|
||||||
|
self.showingButtonList = []
|
||||||
|
for buttonName in self.BUTTON_NAME_LIST:
|
||||||
|
button = ui.Button()
|
||||||
|
button.SetParent(self)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
|
||||||
|
button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
|
||||||
|
button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
|
||||||
|
else:
|
||||||
|
button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
|
||||||
|
button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
|
||||||
|
button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
|
||||||
|
|
||||||
|
button.SetWindowHorizontalAlignCenter()
|
||||||
|
button.SetText(buttonName)
|
||||||
|
button.Hide()
|
||||||
|
self.buttonDict[buttonName] = button
|
||||||
|
self.showingButtonList.append(button)
|
||||||
|
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))
|
||||||
|
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
|
||||||
|
self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
|
||||||
|
|
||||||
|
self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))
|
||||||
|
|
||||||
|
self.name = name
|
||||||
|
self.hpGauge = hpGauge
|
||||||
|
self.closeButton = closeButton
|
||||||
|
self.nameString = 0
|
||||||
|
self.nameLength = 0
|
||||||
|
self.vid = 0
|
||||||
|
self.eventWhisper = None
|
||||||
|
self.isShowButton = False
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
self.ResetTargetBoard()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ThinBoard.__del__(self)
|
||||||
|
|
||||||
|
print "===================================================== DESTROYED TARGET BOARD"
|
||||||
|
|
||||||
|
def __Initialize(self):
|
||||||
|
self.nameString = ""
|
||||||
|
self.nameLength = 0
|
||||||
|
self.vid = 0
|
||||||
|
self.isShowButton = False
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
self.eventWhisper = None
|
||||||
|
self.closeButton = None
|
||||||
|
self.showingButtonList = None
|
||||||
|
self.buttonDict = None
|
||||||
|
self.name = None
|
||||||
|
self.hpGauge = None
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
def OnPressedCloseButton(self):
|
||||||
|
player.ClearTarget()
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.__Initialize()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def Open(self, vid, name):
|
||||||
|
if vid:
|
||||||
|
if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
|
||||||
|
if not player.IsSameEmpire(vid):
|
||||||
|
self.Hide()
|
||||||
|
return
|
||||||
|
|
||||||
|
if vid != self.GetTargetVID():
|
||||||
|
self.ResetTargetBoard()
|
||||||
|
self.SetTargetVID(vid)
|
||||||
|
self.SetTargetName(name)
|
||||||
|
|
||||||
|
if player.IsMainCharacterIndex(vid):
|
||||||
|
self.__ShowMainCharacterMenu()
|
||||||
|
elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
|
||||||
|
self.Hide()
|
||||||
|
else:
|
||||||
|
self.RefreshButton()
|
||||||
|
self.Show()
|
||||||
|
else:
|
||||||
|
self.HideAllButton()
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
|
||||||
|
self.__ShowButton("VOTE_BLOCK_CHAT")
|
||||||
|
self.__ArrangeButtonPosition()
|
||||||
|
self.SetTargetName(name)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
if self.IsShow():
|
||||||
|
if self.IsShowButton():
|
||||||
|
self.RefreshButton()
|
||||||
|
|
||||||
|
def RefreshByVID(self, vid):
|
||||||
|
if vid == self.GetTargetVID():
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def RefreshByName(self, name):
|
||||||
|
if name == self.GetTargetName():
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def __ShowMainCharacterMenu(self):
|
||||||
|
canShow=0
|
||||||
|
|
||||||
|
self.HideAllButton()
|
||||||
|
|
||||||
|
if player.IsMountingHorse():
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
|
||||||
|
canShow=1
|
||||||
|
|
||||||
|
if player.IsObserverMode():
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
|
||||||
|
canShow=1
|
||||||
|
|
||||||
|
if canShow:
|
||||||
|
self.__ArrangeButtonPosition()
|
||||||
|
self.Show()
|
||||||
|
else:
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __ShowNameOnlyMenu(self):
|
||||||
|
self.HideAllButton()
|
||||||
|
|
||||||
|
def SetWhisperEvent(self, event):
|
||||||
|
self.eventWhisper = event
|
||||||
|
|
||||||
|
def UpdatePosition(self):
|
||||||
|
self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)
|
||||||
|
|
||||||
|
def ResetTargetBoard(self):
|
||||||
|
|
||||||
|
for btn in self.buttonDict.values():
|
||||||
|
btn.Hide()
|
||||||
|
|
||||||
|
self.__Initialize()
|
||||||
|
|
||||||
|
self.name.SetPosition(0, 13)
|
||||||
|
self.name.SetHorizontalAlignCenter()
|
||||||
|
self.name.SetWindowHorizontalAlignCenter()
|
||||||
|
self.hpGauge.Hide()
|
||||||
|
self.SetSize(250, 40)
|
||||||
|
|
||||||
|
def SetTargetVID(self, vid):
|
||||||
|
self.vid = vid
|
||||||
|
|
||||||
|
def SetEnemyVID(self, vid):
|
||||||
|
self.SetTargetVID(vid)
|
||||||
|
|
||||||
|
name = chr.GetNameByVID(vid)
|
||||||
|
level = nonplayer.GetLevelByVID(vid)
|
||||||
|
grade = nonplayer.GetGradeByVID(vid)
|
||||||
|
|
||||||
|
nameFront = ""
|
||||||
|
if -1 != level:
|
||||||
|
nameFront += "Lv." + str(level) + " "
|
||||||
|
if self.GRADE_NAME.has_key(grade):
|
||||||
|
nameFront += "(" + self.GRADE_NAME[grade] + ") "
|
||||||
|
|
||||||
|
self.SetTargetName(nameFront + name)
|
||||||
|
|
||||||
|
def GetTargetVID(self):
|
||||||
|
return self.vid
|
||||||
|
|
||||||
|
def GetTargetName(self):
|
||||||
|
return self.nameString
|
||||||
|
|
||||||
|
def SetTargetName(self, name):
|
||||||
|
self.nameString = name
|
||||||
|
self.nameLength = len(name)
|
||||||
|
self.name.SetText(name)
|
||||||
|
|
||||||
|
def SetHP(self, hpPercentage):
|
||||||
|
if not self.hpGauge.IsShow():
|
||||||
|
|
||||||
|
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.name.SetPosition( self.GetWidth()-23, 13)
|
||||||
|
else:
|
||||||
|
self.name.SetPosition(23, 13)
|
||||||
|
|
||||||
|
self.name.SetWindowHorizontalAlignLeft()
|
||||||
|
self.name.SetHorizontalAlignLeft()
|
||||||
|
self.hpGauge.Show()
|
||||||
|
self.UpdatePosition()
|
||||||
|
|
||||||
|
self.hpGauge.SetPercentage(hpPercentage, 100)
|
||||||
|
|
||||||
|
def ShowDefaultButton(self):
|
||||||
|
|
||||||
|
self.isShowButton = True
|
||||||
|
self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
|
||||||
|
self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
|
||||||
|
self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
|
||||||
|
self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
|
||||||
|
for button in self.showingButtonList:
|
||||||
|
button.Show()
|
||||||
|
|
||||||
|
def HideAllButton(self):
|
||||||
|
self.isShowButton = False
|
||||||
|
for button in self.showingButtonList:
|
||||||
|
button.Hide()
|
||||||
|
self.showingButtonList = []
|
||||||
|
|
||||||
|
def __ShowButton(self, name):
|
||||||
|
|
||||||
|
if not self.buttonDict.has_key(name):
|
||||||
|
return
|
||||||
|
|
||||||
|
self.buttonDict[name].Show()
|
||||||
|
self.showingButtonList.append(self.buttonDict[name])
|
||||||
|
|
||||||
|
def __HideButton(self, name):
|
||||||
|
|
||||||
|
if not self.buttonDict.has_key(name):
|
||||||
|
return
|
||||||
|
|
||||||
|
button = self.buttonDict[name]
|
||||||
|
button.Hide()
|
||||||
|
|
||||||
|
for btnInList in self.showingButtonList:
|
||||||
|
if btnInList == button:
|
||||||
|
self.showingButtonList.remove(button)
|
||||||
|
break
|
||||||
|
|
||||||
|
def OnWhisper(self):
|
||||||
|
if None != self.eventWhisper:
|
||||||
|
self.eventWhisper(self.nameString)
|
||||||
|
|
||||||
|
def OnExchange(self):
|
||||||
|
net.SendExchangeStartPacket(self.vid)
|
||||||
|
|
||||||
|
def OnPVP(self):
|
||||||
|
net.SendChatPacket("/pvp %d" % (self.vid))
|
||||||
|
|
||||||
|
def OnAppendToMessenger(self):
|
||||||
|
net.SendMessengerAddByVIDPacket(self.vid)
|
||||||
|
|
||||||
|
def OnPartyInvite(self):
|
||||||
|
net.SendPartyInvitePacket(self.vid)
|
||||||
|
|
||||||
|
def OnPartyExit(self):
|
||||||
|
net.SendPartyExitPacket()
|
||||||
|
|
||||||
|
def OnPartyRemove(self):
|
||||||
|
net.SendPartyRemovePacket(self.vid)
|
||||||
|
|
||||||
|
def __OnGuildAddMember(self):
|
||||||
|
net.SendGuildAddMemberPacket(self.vid)
|
||||||
|
|
||||||
|
def __OnDismount(self):
|
||||||
|
net.SendChatPacket("/unmount")
|
||||||
|
|
||||||
|
def __OnExitObserver(self):
|
||||||
|
net.SendChatPacket("/observer_exit")
|
||||||
|
|
||||||
|
def __OnViewEquipment(self):
|
||||||
|
net.SendChatPacket("/view_equip " + str(self.vid))
|
||||||
|
|
||||||
|
def __OnRequestParty(self):
|
||||||
|
net.SendChatPacket("/party_request " + str(self.vid))
|
||||||
|
|
||||||
|
def __OnDestroyBuilding(self):
|
||||||
|
net.SendChatPacket("/build d %d" % (self.vid))
|
||||||
|
|
||||||
|
def __OnEmotionAllow(self):
|
||||||
|
net.SendChatPacket("/emotion_allow %d" % (self.vid))
|
||||||
|
|
||||||
|
def __OnVoteBlockChat(self):
|
||||||
|
cmd = "/vote_block_chat %s" % (self.nameString)
|
||||||
|
net.SendChatPacket(cmd)
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.OnPressedCloseButton()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def IsShowButton(self):
|
||||||
|
return self.isShowButton
|
||||||
|
|
||||||
|
def RefreshButton(self):
|
||||||
|
|
||||||
|
self.HideAllButton()
|
||||||
|
|
||||||
|
if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
|
||||||
|
#self.__ShowButton(localeInfo.TARGET_BUTTON_BUILDING_DESTROY)
|
||||||
|
#self.__ArrangeButtonPosition()
|
||||||
|
return
|
||||||
|
|
||||||
|
if player.IsPVPInstance(self.vid) or player.IsObserverMode():
|
||||||
|
# PVP_INFO_SIZE_BUG_FIX
|
||||||
|
self.SetSize(200 + 7*self.nameLength, 40)
|
||||||
|
self.UpdatePosition()
|
||||||
|
# END_OF_PVP_INFO_SIZE_BUG_FIX
|
||||||
|
return
|
||||||
|
|
||||||
|
self.ShowDefaultButton()
|
||||||
|
|
||||||
|
if guild.MainPlayerHasAuthority(guild.AUTH_ADD_MEMBER):
|
||||||
|
if not guild.IsMemberByName(self.nameString):
|
||||||
|
if 0 == chr.GetGuildID(self.vid):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_INVITE_GUILD)
|
||||||
|
|
||||||
|
if not messenger.IsFriendByName(self.nameString):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_FRIEND)
|
||||||
|
|
||||||
|
if player.IsPartyMember(self.vid):
|
||||||
|
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)
|
||||||
|
|
||||||
|
if player.IsPartyLeader(self.vid):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_LEAVE_PARTY)
|
||||||
|
elif player.IsPartyLeader(player.GetMainCharacterIndex()):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_EXCLUDE)
|
||||||
|
|
||||||
|
else:
|
||||||
|
if player.IsPartyMember(player.GetMainCharacterIndex()):
|
||||||
|
if player.IsPartyLeader(player.GetMainCharacterIndex()):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_INVITE_PARTY)
|
||||||
|
else:
|
||||||
|
if chr.IsPartyMember(self.vid):
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY)
|
||||||
|
else:
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_INVITE_PARTY)
|
||||||
|
|
||||||
|
if player.IsRevengeInstance(self.vid):
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_AVENGE)
|
||||||
|
elif player.IsChallengeInstance(self.vid):
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)
|
||||||
|
self.__ShowButton(localeInfo.TARGET_BUTTON_ACCEPT_FIGHT)
|
||||||
|
elif player.IsCantFightInstance(self.vid):
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)
|
||||||
|
|
||||||
|
if not player.IsSameEmpire(self.vid):
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_INVITE_PARTY)
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FRIEND)
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)
|
||||||
|
|
||||||
|
distance = player.GetCharacterDistance(self.vid)
|
||||||
|
if distance > self.EXCHANGE_LIMIT_RANGE:
|
||||||
|
self.__HideButton(localeInfo.TARGET_BUTTON_EXCHANGE)
|
||||||
|
self.__ArrangeButtonPosition()
|
||||||
|
|
||||||
|
self.__ArrangeButtonPosition()
|
||||||
|
|
||||||
|
def __ArrangeButtonPosition(self):
|
||||||
|
showingButtonCount = len(self.showingButtonList)
|
||||||
|
|
||||||
|
pos = -(showingButtonCount / 2) * 68
|
||||||
|
if 0 == showingButtonCount % 2:
|
||||||
|
pos += 34
|
||||||
|
|
||||||
|
for button in self.showingButtonList:
|
||||||
|
button.SetPosition(pos, 33)
|
||||||
|
pos += 68
|
||||||
|
|
||||||
|
self.SetSize(max(150, showingButtonCount * 75), 65)
|
||||||
|
self.UpdatePosition()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
if self.isShowButton:
|
||||||
|
|
||||||
|
exchangeButton = self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE]
|
||||||
|
distance = player.GetCharacterDistance(self.vid)
|
||||||
|
|
||||||
|
if distance < 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
if exchangeButton.IsShow():
|
||||||
|
if distance > self.EXCHANGE_LIMIT_RANGE:
|
||||||
|
self.RefreshButton()
|
||||||
|
|
||||||
|
else:
|
||||||
|
if distance < self.EXCHANGE_LIMIT_RANGE:
|
||||||
|
self.RefreshButton()
|
||||||
+1139
File diff suppressed because it is too large
Load Diff
+327
@@ -0,0 +1,327 @@
|
|||||||
|
import ui
|
||||||
|
import grp
|
||||||
|
import app
|
||||||
|
|
||||||
|
import wndMgr
|
||||||
|
|
||||||
|
class TextBar(ui.Window):
|
||||||
|
def __init__(self, width, height):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.handle = grp.CreateTextBar(width, height)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
grp.DestroyTextBar(self.handle)
|
||||||
|
|
||||||
|
def ClearBar(self):
|
||||||
|
grp.ClearTextBar(self.handle)
|
||||||
|
|
||||||
|
def SetClipRect(self, x1, y1, x2, y2):
|
||||||
|
grp.SetTextBarClipRect(self.handle, x1, y1, x2, y2)
|
||||||
|
|
||||||
|
def TextOut(self, x, y, text):
|
||||||
|
grp.TextBarTextOut(self.handle, x, y, text)
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
x, y = self.GetGlobalPosition()
|
||||||
|
grp.RenderTextBar(self.handle, x, y)
|
||||||
|
|
||||||
|
def SetTextColor(self, r, g, b):
|
||||||
|
grp.TextBarSetTextColor(self.handle, r, g, b)
|
||||||
|
|
||||||
|
def GetTextExtent(self, text):
|
||||||
|
return grp.TextBarGetTextExtent(self.handle, text)
|
||||||
|
|
||||||
|
class TipBoard(ui.Bar):
|
||||||
|
|
||||||
|
SCROLL_WAIT_TIME = 3.0
|
||||||
|
TIP_DURATION = 5.0
|
||||||
|
STEP_HEIGHT = 17
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Bar.__init__(self)
|
||||||
|
|
||||||
|
self.AddFlag("not_pick")
|
||||||
|
self.tipList = []
|
||||||
|
self.curPos = 0
|
||||||
|
self.dstPos = 0
|
||||||
|
self.nextScrollTime = 0
|
||||||
|
|
||||||
|
self.width = 370
|
||||||
|
|
||||||
|
self.SetPosition(0, 70)
|
||||||
|
self.SetSize(370, 20)
|
||||||
|
self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.5))
|
||||||
|
self.SetWindowHorizontalAlignCenter()
|
||||||
|
|
||||||
|
self.__CreateTextBar()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Bar.__del__(self)
|
||||||
|
|
||||||
|
def __CreateTextBar(self):
|
||||||
|
|
||||||
|
x, y = self.GetGlobalPosition()
|
||||||
|
|
||||||
|
self.textBar = TextBar(370, 300)
|
||||||
|
self.textBar.SetParent(self)
|
||||||
|
self.textBar.SetPosition(3, 5)
|
||||||
|
self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+18)
|
||||||
|
self.textBar.Show()
|
||||||
|
|
||||||
|
def __CleanOldTip(self):
|
||||||
|
leaveList = []
|
||||||
|
for tip in self.tipList:
|
||||||
|
madeTime = tip[0]
|
||||||
|
if app.GetTime() - madeTime > self.TIP_DURATION:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
leaveList.append(tip)
|
||||||
|
|
||||||
|
self.tipList = leaveList
|
||||||
|
|
||||||
|
if not leaveList:
|
||||||
|
self.textBar.ClearBar()
|
||||||
|
self.Hide()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshBoard()
|
||||||
|
|
||||||
|
def __RefreshBoard(self):
|
||||||
|
|
||||||
|
self.textBar.ClearBar()
|
||||||
|
|
||||||
|
index = 0
|
||||||
|
for tip in self.tipList:
|
||||||
|
text = tip[1]
|
||||||
|
self.textBar.TextOut(0, index*self.STEP_HEIGHT, text)
|
||||||
|
index += 1
|
||||||
|
|
||||||
|
def SetTip(self, text):
|
||||||
|
|
||||||
|
if not app.IsVisibleNotice():
|
||||||
|
return
|
||||||
|
|
||||||
|
curTime = app.GetTime()
|
||||||
|
self.tipList.append((curTime, text))
|
||||||
|
self.__RefreshBoard()
|
||||||
|
|
||||||
|
self.nextScrollTime = app.GetTime() + 1.0
|
||||||
|
|
||||||
|
if not self.IsShow():
|
||||||
|
self.curPos = -self.STEP_HEIGHT
|
||||||
|
self.dstPos = -self.STEP_HEIGHT
|
||||||
|
self.textBar.SetPosition(3, 5 - self.curPos)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
if not self.tipList:
|
||||||
|
self.Hide()
|
||||||
|
return
|
||||||
|
|
||||||
|
if app.GetTime() > self.nextScrollTime:
|
||||||
|
self.nextScrollTime = app.GetTime() + self.SCROLL_WAIT_TIME
|
||||||
|
|
||||||
|
self.dstPos = self.curPos + self.STEP_HEIGHT
|
||||||
|
|
||||||
|
if self.dstPos > self.curPos:
|
||||||
|
self.curPos += 1
|
||||||
|
self.textBar.SetPosition(3, 5 - self.curPos)
|
||||||
|
|
||||||
|
if self.curPos > len(self.tipList)*self.STEP_HEIGHT:
|
||||||
|
self.curPos = -self.STEP_HEIGHT
|
||||||
|
self.dstPos = -self.STEP_HEIGHT
|
||||||
|
|
||||||
|
self.__CleanOldTip()
|
||||||
|
|
||||||
|
|
||||||
|
class BigTextBar(TextBar):
|
||||||
|
def __init__(self, width, height, fontSize):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
self.handle = grp.CreateBigTextBar(width, height, fontSize)
|
||||||
|
|
||||||
|
|
||||||
|
class BigBoard(ui.Bar):
|
||||||
|
|
||||||
|
SCROLL_WAIT_TIME = 5.0
|
||||||
|
TIP_DURATION = 10.0
|
||||||
|
FONT_WIDTH = 18
|
||||||
|
FONT_HEIGHT = 18
|
||||||
|
LINE_WIDTH = 500
|
||||||
|
LINE_HEIGHT = FONT_HEIGHT + 5
|
||||||
|
STEP_HEIGHT = LINE_HEIGHT * 2
|
||||||
|
LINE_CHANGE_LIMIT_WIDTH = 350
|
||||||
|
|
||||||
|
FRAME_IMAGE_FILE_NAME_LIST = [
|
||||||
|
"season1/interface/oxevent/frame_0.sub",
|
||||||
|
"season1/interface/oxevent/frame_1.sub",
|
||||||
|
"season1/interface/oxevent/frame_2.sub",
|
||||||
|
]
|
||||||
|
|
||||||
|
FRAME_IMAGE_STEP = 256
|
||||||
|
|
||||||
|
FRAME_BASE_X = -20
|
||||||
|
FRAME_BASE_Y = -12
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.Bar.__init__(self)
|
||||||
|
|
||||||
|
self.AddFlag("not_pick")
|
||||||
|
self.tipList = []
|
||||||
|
self.curPos = 0
|
||||||
|
self.dstPos = 0
|
||||||
|
self.nextScrollTime = 0
|
||||||
|
|
||||||
|
self.SetPosition(0, 150)
|
||||||
|
self.SetSize(512, 55)
|
||||||
|
self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.5))
|
||||||
|
self.SetWindowHorizontalAlignCenter()
|
||||||
|
|
||||||
|
self.__CreateTextBar()
|
||||||
|
self.__LoadFrameImages()
|
||||||
|
|
||||||
|
|
||||||
|
def __LoadFrameImages(self):
|
||||||
|
x = self.FRAME_BASE_X
|
||||||
|
y = self.FRAME_BASE_Y
|
||||||
|
self.imgList = []
|
||||||
|
for imgFileName in self.FRAME_IMAGE_FILE_NAME_LIST:
|
||||||
|
self.imgList.append(self.__LoadImage(x, y, imgFileName))
|
||||||
|
x += self.FRAME_IMAGE_STEP
|
||||||
|
|
||||||
|
def __LoadImage(self, x, y, fileName):
|
||||||
|
img = ui.ImageBox()
|
||||||
|
img.SetParent(self)
|
||||||
|
img.AddFlag("not_pick")
|
||||||
|
img.LoadImage(fileName)
|
||||||
|
img.SetPosition(x, y)
|
||||||
|
img.Show()
|
||||||
|
return img
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Bar.__del__(self)
|
||||||
|
|
||||||
|
def __CreateTextBar(self):
|
||||||
|
|
||||||
|
x, y = self.GetGlobalPosition()
|
||||||
|
|
||||||
|
self.textBar = BigTextBar(self.LINE_WIDTH, 300, self.FONT_HEIGHT)
|
||||||
|
self.textBar.SetParent(self)
|
||||||
|
self.textBar.SetPosition(6, 8)
|
||||||
|
self.textBar.SetTextColor(242, 231, 193)
|
||||||
|
self.textBar.SetClipRect(0, y+8, wndMgr.GetScreenWidth(), y+8+self.STEP_HEIGHT)
|
||||||
|
self.textBar.Show()
|
||||||
|
|
||||||
|
def __CleanOldTip(self):
|
||||||
|
curTime = app.GetTime()
|
||||||
|
leaveList = []
|
||||||
|
for madeTime, text in self.tipList:
|
||||||
|
if curTime + self.TIP_DURATION <= madeTime:
|
||||||
|
leaveList.append(text)
|
||||||
|
|
||||||
|
self.tipList = leaveList
|
||||||
|
|
||||||
|
if not leaveList:
|
||||||
|
self.textBar.ClearBar()
|
||||||
|
self.Hide()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__RefreshBoard()
|
||||||
|
|
||||||
|
def __RefreshBoard(self):
|
||||||
|
|
||||||
|
self.textBar.ClearBar()
|
||||||
|
|
||||||
|
if len(self.tipList) == 1:
|
||||||
|
checkTime, text = self.tipList[0]
|
||||||
|
(text_width, text_height) = self.textBar.GetTextExtent(text)
|
||||||
|
self.textBar.TextOut((500-text_width)/2, (self.STEP_HEIGHT-8-text_height)/2, text)
|
||||||
|
|
||||||
|
else:
|
||||||
|
index = 0
|
||||||
|
for checkTime, text in self.tipList:
|
||||||
|
(text_width, text_height) = self.textBar.GetTextExtent(text)
|
||||||
|
self.textBar.TextOut((500-text_width)/2, index*self.LINE_HEIGHT, text)
|
||||||
|
index += 1
|
||||||
|
|
||||||
|
def SetTip(self, text):
|
||||||
|
|
||||||
|
if not app.IsVisibleNotice():
|
||||||
|
return
|
||||||
|
|
||||||
|
curTime = app.GetTime()
|
||||||
|
self.__AppendText(curTime, text)
|
||||||
|
self.__RefreshBoard()
|
||||||
|
|
||||||
|
self.nextScrollTime = curTime + 1.0
|
||||||
|
|
||||||
|
if not self.IsShow():
|
||||||
|
self.curPos = -self.STEP_HEIGHT
|
||||||
|
self.dstPos = -self.STEP_HEIGHT
|
||||||
|
self.textBar.SetPosition(3, 8 - self.curPos)
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
def __AppendText(self, curTime, text):
|
||||||
|
import dbg
|
||||||
|
prevPos = 0
|
||||||
|
while 1:
|
||||||
|
curPos = text.find(" ", prevPos)
|
||||||
|
if curPos < 0:
|
||||||
|
break
|
||||||
|
|
||||||
|
(text_width, text_height) = self.textBar.GetTextExtent(text[:curPos])
|
||||||
|
if text_width > self.LINE_CHANGE_LIMIT_WIDTH:
|
||||||
|
self.tipList.append((curTime, text[:prevPos]))
|
||||||
|
self.tipList.append((curTime, text[prevPos:]))
|
||||||
|
return
|
||||||
|
|
||||||
|
prevPos = curPos + 1
|
||||||
|
|
||||||
|
self.tipList.append((curTime, text))
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
|
||||||
|
if not self.tipList:
|
||||||
|
self.Hide()
|
||||||
|
return
|
||||||
|
|
||||||
|
if app.GetTime() > self.nextScrollTime:
|
||||||
|
self.nextScrollTime = app.GetTime() + self.SCROLL_WAIT_TIME
|
||||||
|
|
||||||
|
self.dstPos = self.curPos + self.STEP_HEIGHT
|
||||||
|
|
||||||
|
if self.dstPos > self.curPos:
|
||||||
|
self.curPos += 1
|
||||||
|
self.textBar.SetPosition(3, 8 - self.curPos)
|
||||||
|
|
||||||
|
if self.curPos > len(self.tipList)*self.LINE_HEIGHT:
|
||||||
|
self.curPos = -self.STEP_HEIGHT
|
||||||
|
self.dstPos = -self.STEP_HEIGHT
|
||||||
|
|
||||||
|
self.__CleanOldTip()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
|
||||||
|
#wndMgr.SetOutlineFlag(True)
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
wnd = BigBoard()
|
||||||
|
wnd.Show()
|
||||||
|
wnd.SetTip("안녕하세요")
|
||||||
|
wnd.SetTip("저는 빗자루 입니다")
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
|
|
||||||
+2344
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,355 @@
|
|||||||
|
import app
|
||||||
|
import ui
|
||||||
|
import localeInfo
|
||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
class MarkItem(ui.ListBoxEx.Item):
|
||||||
|
def __init__(self, fileName):
|
||||||
|
ui.ListBoxEx.Item.__init__(self)
|
||||||
|
self.imgWidth=0
|
||||||
|
self.imgHeight=0
|
||||||
|
self.canLoad=0
|
||||||
|
self.textLine=self.__CreateTextLine(fileName)
|
||||||
|
self.imgBox=self.__CreateImageBox("upload/"+fileName)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ListBoxEx.Item.__del__(self)
|
||||||
|
|
||||||
|
def GetText(self):
|
||||||
|
return self.textLine.GetText()
|
||||||
|
|
||||||
|
def SetSize(self, width, height):
|
||||||
|
ui.ListBoxEx.Item.SetSize(self, 20 + 6*len(self.textLine.GetText()) + 4, height)
|
||||||
|
|
||||||
|
def __CreateTextLine(self, fileName):
|
||||||
|
textLine=ui.TextLine()
|
||||||
|
textLine.SetParent(self)
|
||||||
|
textLine.SetPosition(20, 0)
|
||||||
|
textLine.SetText(fileName)
|
||||||
|
textLine.Show()
|
||||||
|
return textLine
|
||||||
|
|
||||||
|
def __CreateImageBox(self, fileName):
|
||||||
|
(self.canLoad, self.imgWidth, self.imgHeight)=app.GetImageInfo(fileName)
|
||||||
|
|
||||||
|
if 1==self.canLoad:
|
||||||
|
if 16==self.imgWidth and 12==self.imgHeight:
|
||||||
|
imgBox=ui.ImageBox()
|
||||||
|
imgBox.AddFlag("not_pick")
|
||||||
|
imgBox.SetParent(self)
|
||||||
|
imgBox.SetPosition(0, 2)
|
||||||
|
imgBox.LoadImage(fileName)
|
||||||
|
imgBox.Show()
|
||||||
|
return imgBox
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
class SymbolItem(ui.ListBoxEx.Item):
|
||||||
|
def __init__(self, fileName):
|
||||||
|
ui.ListBoxEx.Item.__init__(self)
|
||||||
|
self.textLine=self.__CreateTextLine(fileName)
|
||||||
|
(self.canLoad, self.imgWidth, self.imgHeight)=app.GetImageInfo("upload/"+fileName)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ListBoxEx.Item.__del__(self)
|
||||||
|
|
||||||
|
def GetText(self):
|
||||||
|
return self.textLine.GetText()
|
||||||
|
|
||||||
|
def SetSize(self, width, height):
|
||||||
|
ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)
|
||||||
|
|
||||||
|
def __CreateTextLine(self, fileName):
|
||||||
|
textLine=ui.TextLine()
|
||||||
|
textLine.SetParent(self)
|
||||||
|
textLine.SetPosition(1, 2)
|
||||||
|
textLine.SetText(fileName)
|
||||||
|
textLine.Show()
|
||||||
|
return textLine
|
||||||
|
|
||||||
|
class PopupDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self, parent):
|
||||||
|
print "NEW POPUP WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.__Load()
|
||||||
|
self.__Bind()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE POPUP WINDOW"
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PopupDialog.__Load")
|
||||||
|
|
||||||
|
def __Bind(self):
|
||||||
|
try:
|
||||||
|
self.textLine=self.GetChild("message")
|
||||||
|
self.okButton=self.GetChild("accept")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("PopupDialog.__Bind")
|
||||||
|
|
||||||
|
self.okButton.SetEvent(ui.__mem_func__(self.__OnOK))
|
||||||
|
|
||||||
|
def Open(self, msg):
|
||||||
|
self.textLine.SetText(msg)
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.Show()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
def __OnOK(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
class MarkSelectDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW MARK LIST WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.selectEvent=None
|
||||||
|
self.isLoaded=0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE MARK LIST WINDOW"
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
if self.isLoaded==0:
|
||||||
|
self.isLoaded=1
|
||||||
|
|
||||||
|
self.__Load()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
if self.markListBox.IsEmpty():
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_PATH)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.popupDialog.Hide()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def SAFE_SetSelectEvent(self, event):
|
||||||
|
self.selectEvent=ui.__mem_func__(event)
|
||||||
|
|
||||||
|
def __CreateMarkListBox(self):
|
||||||
|
markListBox=ui.ListBoxEx()
|
||||||
|
markListBox.SetParent(self)
|
||||||
|
markListBox.SetPosition(15, 50)
|
||||||
|
markListBox.Show()
|
||||||
|
return markListBox
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
self.popupDialog=PopupDialog(self)
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if localeInfo.IsVIETNAM():
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "MarkListWindow.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/MarkListWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MarkListBox.__Load")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.markListBox=self.__CreateMarkListBox()
|
||||||
|
self.markListBox.SetScrollBar(self.GetChild("ScrollBar"))
|
||||||
|
|
||||||
|
self.popupText = self.popupDialog.GetChild("message")
|
||||||
|
self.popupDialog.GetChild("accept").SetEvent(ui.__mem_func__(self.popupDialog.Hide))
|
||||||
|
|
||||||
|
self.board=self.GetChild("board")
|
||||||
|
self.okButton=self.GetChild("ok")
|
||||||
|
self.cancelButton=self.GetChild("cancel")
|
||||||
|
self.refreshButton=self.GetChild("refresh")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("MarkListBox.__Bind")
|
||||||
|
|
||||||
|
self.refreshButton.SetEvent(ui.__mem_func__(self.__OnRefresh))
|
||||||
|
self.cancelButton.SetEvent(ui.__mem_func__(self.__OnCancel))
|
||||||
|
self.okButton.SetEvent(ui.__mem_func__(self.__OnOK))
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.__OnCancel))
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __PopupMessage(self, msg):
|
||||||
|
self.popupDialog.Open(msg)
|
||||||
|
|
||||||
|
def __OnOK(self):
|
||||||
|
selItem=self.markListBox.GetSelectedItem()
|
||||||
|
if selItem:
|
||||||
|
if selItem.canLoad!=1:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_FILE_FORMAT)
|
||||||
|
elif selItem.imgWidth!=16:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_16_WIDTH)
|
||||||
|
elif selItem.imgHeight!=12:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_12_HEIGHT)
|
||||||
|
else:
|
||||||
|
self.selectEvent(selItem.GetText())
|
||||||
|
self.Hide()
|
||||||
|
else:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_SELECT)
|
||||||
|
|
||||||
|
def __OnCancel(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __OnRefresh(self):
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __RefreshFileList(self):
|
||||||
|
self.__ClearFileList()
|
||||||
|
self.__AppendFileList("bmp")
|
||||||
|
self.__AppendFileList("tga")
|
||||||
|
self.__AppendFileList("jpg")
|
||||||
|
|
||||||
|
def __ClearFileList(self):
|
||||||
|
self.markListBox.RemoveAllItems()
|
||||||
|
|
||||||
|
def __AppendFileList(self, filter):
|
||||||
|
fileNameList=app.GetFileList("upload/*."+filter)
|
||||||
|
for fileName in fileNameList:
|
||||||
|
self.__AppendFile(fileName)
|
||||||
|
|
||||||
|
def __AppendFile(self, fileName):
|
||||||
|
self.markListBox.AppendItem(MarkItem(fileName))
|
||||||
|
|
||||||
|
class SymbolSelectDialog(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
print "NEW SYMBOL LIST WINDOW ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
|
||||||
|
self.selectEvent=None
|
||||||
|
self.isLoaded=0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
print "---------------------------------------------------------------------------- DELETE SYMBOL LIST WINDOW"
|
||||||
|
|
||||||
|
def Show(self):
|
||||||
|
if self.isLoaded==0:
|
||||||
|
self.isLoaded=1
|
||||||
|
|
||||||
|
self.__Load()
|
||||||
|
|
||||||
|
ui.ScriptWindow.Show(self)
|
||||||
|
|
||||||
|
def Open(self):
|
||||||
|
self.Show()
|
||||||
|
|
||||||
|
self.SetCenterPosition()
|
||||||
|
self.SetTop()
|
||||||
|
|
||||||
|
if self.symbolListBox.IsEmpty():
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_PATH)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
self.popupDialog.Hide()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def SAFE_SetSelectEvent(self, event):
|
||||||
|
self.selectEvent=ui.__mem_func__(event)
|
||||||
|
|
||||||
|
def __CreateSymbolListBox(self):
|
||||||
|
symbolListBox=ui.ListBoxEx()
|
||||||
|
symbolListBox.SetParent(self)
|
||||||
|
symbolListBox.SetPosition(15, 50)
|
||||||
|
symbolListBox.Show()
|
||||||
|
return symbolListBox
|
||||||
|
|
||||||
|
def __Load(self):
|
||||||
|
self.popupDialog=PopupDialog(self)
|
||||||
|
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/MarkListWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SymbolListBox.__Load")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.symbolListBox=self.__CreateSymbolListBox()
|
||||||
|
self.symbolListBox.SetScrollBar(self.GetChild("ScrollBar"))
|
||||||
|
|
||||||
|
self.popupText = self.popupDialog.GetChild("message")
|
||||||
|
self.popupDialog.GetChild("accept").SetEvent(ui.__mem_func__(self.popupDialog.Hide))
|
||||||
|
|
||||||
|
self.board=self.GetChild("board")
|
||||||
|
self.okButton=self.GetChild("ok")
|
||||||
|
self.cancelButton=self.GetChild("cancel")
|
||||||
|
self.refreshButton=self.GetChild("refresh")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("SymbolListBox.__Bind")
|
||||||
|
|
||||||
|
self.refreshButton.SetEvent(ui.__mem_func__(self.__OnRefresh))
|
||||||
|
self.cancelButton.SetEvent(ui.__mem_func__(self.__OnCancel))
|
||||||
|
self.okButton.SetEvent(ui.__mem_func__(self.__OnOK))
|
||||||
|
self.board.SetCloseEvent(ui.__mem_func__(self.__OnCancel))
|
||||||
|
self.board.SetTitleName(localeInfo.SYMBOLLIST_TITLE)
|
||||||
|
self.UpdateRect()
|
||||||
|
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __PopupMessage(self, msg):
|
||||||
|
self.popupDialog.Open(msg)
|
||||||
|
|
||||||
|
def __OnOK(self):
|
||||||
|
selItem=self.symbolListBox.GetSelectedItem()
|
||||||
|
if selItem:
|
||||||
|
if selItem.canLoad!=1:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_FILE_FORMAT)
|
||||||
|
elif selItem.imgWidth!=64:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_64_WIDTH)
|
||||||
|
elif selItem.imgHeight!=128:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_128_HEIGHT)
|
||||||
|
else:
|
||||||
|
self.selectEvent(selItem.GetText())
|
||||||
|
self.Hide()
|
||||||
|
else:
|
||||||
|
self.__PopupMessage(localeInfo.GUILDMARK_UPLOADER_ERROR_SELECT)
|
||||||
|
|
||||||
|
def __OnCancel(self):
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def __OnRefresh(self):
|
||||||
|
self.__RefreshFileList()
|
||||||
|
|
||||||
|
def __RefreshFileList(self):
|
||||||
|
self.__ClearFileList()
|
||||||
|
self.__AppendFileList("jpg")
|
||||||
|
|
||||||
|
def __ClearFileList(self):
|
||||||
|
self.symbolListBox.RemoveAllItems()
|
||||||
|
|
||||||
|
def __AppendFileList(self, filter):
|
||||||
|
fileNameList=app.GetFileList("upload/*."+filter)
|
||||||
|
for fileName in fileNameList:
|
||||||
|
self.__AppendFile(fileName)
|
||||||
|
|
||||||
|
def __AppendFile(self, fileName):
|
||||||
|
self.symbolListBox.AppendItem(SymbolItem(fileName))
|
||||||
+130
@@ -0,0 +1,130 @@
|
|||||||
|
import ui
|
||||||
|
import uiScriptLocale
|
||||||
|
import net
|
||||||
|
import snd
|
||||||
|
import app
|
||||||
|
import mouseModule
|
||||||
|
import constInfo
|
||||||
|
|
||||||
|
class WebWindow(ui.ScriptWindow):
|
||||||
|
def __init__(self):
|
||||||
|
ui.ScriptWindow.__init__(self, "TOP_MOST")
|
||||||
|
|
||||||
|
self.oldPos = None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadWindow(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
if constInfo.IN_GAME_SHOP_ENABLE:
|
||||||
|
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "WebWindow.py")
|
||||||
|
else:
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/WebWindow.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("WebWindow.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.titleBar = GetObject("TitleBar")
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("WebWindow.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.titleBar.SetCloseEvent(ui.__mem_func__(self.__OnCloseButtonClick))
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
app.HideWebPage()
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.titleBar = None
|
||||||
|
|
||||||
|
def Open(self, url):
|
||||||
|
self.Refresh()
|
||||||
|
self.Show()
|
||||||
|
self.SetCenterPosition()
|
||||||
|
|
||||||
|
x, y = self.GetGlobalPosition()
|
||||||
|
sx, sy = x + 10, y + 30
|
||||||
|
ex, ey = sx + self.GetWidth() - 20, sy + self.GetHeight() - 40
|
||||||
|
|
||||||
|
app.ShowWebPage(url, (sx, sy, ex, ey))
|
||||||
|
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
app.HideWebPage()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
def Clear(self):
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def Refresh(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __OnCloseButtonClick(self):
|
||||||
|
print "close_web:click_close_button"
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnPressEscapeKey(self):
|
||||||
|
print "close_web:esc_key"
|
||||||
|
self.Close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
newPos = self.GetGlobalPosition()
|
||||||
|
if newPos == self.oldPos:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.oldPos = newPos
|
||||||
|
|
||||||
|
x, y = newPos
|
||||||
|
sx, sy = x + 10, y + 30
|
||||||
|
ex, ey = sx + self.GetWidth() - 20, sy + self.GetHeight() - 40
|
||||||
|
app.MoveWebPage((sx, sy, ex, ey))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
import app
|
||||||
|
import wndMgr
|
||||||
|
import systemSetting
|
||||||
|
import mouseModule
|
||||||
|
import grp
|
||||||
|
import ui
|
||||||
|
import uiToolTip
|
||||||
|
import localeInfo
|
||||||
|
|
||||||
|
app.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
app.SetHairColorEnable(True)
|
||||||
|
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||||
|
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
app.Create("METIN2", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||||
|
mouseModule.mouseController.Create()
|
||||||
|
|
||||||
|
class TestGame(ui.Window):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Window.__init__(self)
|
||||||
|
|
||||||
|
localeInfo.LoadLocaleData()
|
||||||
|
|
||||||
|
self.mallWindow = WebWindow()
|
||||||
|
self.mallWindow.LoadWindow()
|
||||||
|
self.mallWindow.Open()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Window.__del__(self)
|
||||||
|
|
||||||
|
def OnUpdate(self):
|
||||||
|
app.UpdateGame()
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
app.RenderGame()
|
||||||
|
grp.PopState()
|
||||||
|
grp.SetInterfaceRenderState()
|
||||||
|
|
||||||
|
game = TestGame()
|
||||||
|
game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||||
|
game.Show()
|
||||||
|
|
||||||
|
app.Loop()
|
||||||
@@ -0,0 +1,333 @@
|
|||||||
|
import ui
|
||||||
|
import net
|
||||||
|
import chat
|
||||||
|
import player
|
||||||
|
import app
|
||||||
|
import localeInfo
|
||||||
|
import ime
|
||||||
|
import chr
|
||||||
|
|
||||||
|
class WhisperButton(ui.Button):
|
||||||
|
def __init__(self):
|
||||||
|
ui.Button.__init__(self, "TOP_MOST")
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.Button.__del__(self)
|
||||||
|
|
||||||
|
def SetToolTipText(self, text, x=0, y = 32):
|
||||||
|
ui.Button.SetToolTipText(self, text, x, y)
|
||||||
|
self.ToolTipText.Show()
|
||||||
|
|
||||||
|
def SetToolTipTextWithColor(self, text, color, x=0, y = 32):
|
||||||
|
ui.Button.SetToolTipText(self, text, x, y)
|
||||||
|
self.ToolTipText.SetPackedFontColor(color)
|
||||||
|
self.ToolTipText.Show()
|
||||||
|
|
||||||
|
def ShowToolTip(self):
|
||||||
|
if 0 != self.ToolTipText:
|
||||||
|
self.ToolTipText.Show()
|
||||||
|
|
||||||
|
def HideToolTip(self):
|
||||||
|
if 0 != self.ToolTipText:
|
||||||
|
self.ToolTipText.Show()
|
||||||
|
|
||||||
|
class WhisperDialog(ui.ScriptWindow):
|
||||||
|
|
||||||
|
class TextRenderer(ui.Window):
|
||||||
|
def SetTargetName(self, targetName):
|
||||||
|
self.targetName = targetName
|
||||||
|
|
||||||
|
def OnRender(self):
|
||||||
|
(x, y) = self.GetGlobalPosition()
|
||||||
|
chat.RenderWhisper(self.targetName, x, y)
|
||||||
|
|
||||||
|
class ResizeButton(ui.DragButton):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ui.DragButton.__init__(self)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
ui.DragButton.__del__(self)
|
||||||
|
|
||||||
|
def OnMouseOverIn(self):
|
||||||
|
app.SetCursor(app.HVSIZE)
|
||||||
|
|
||||||
|
def OnMouseOverOut(self):
|
||||||
|
app.SetCursor(app.NORMAL)
|
||||||
|
|
||||||
|
def __init__(self, eventMinimize, eventClose):
|
||||||
|
print "NEW WHISPER DIALOG ----------------------------------------------------------------------------"
|
||||||
|
ui.ScriptWindow.__init__(self)
|
||||||
|
self.targetName = ""
|
||||||
|
self.eventMinimize = eventMinimize
|
||||||
|
self.eventClose = eventClose
|
||||||
|
self.eventAcceptTarget = None
|
||||||
|
def __del__(self):
|
||||||
|
print "---------------------------------------------------------------------------- DELETE WHISPER DIALOG"
|
||||||
|
ui.ScriptWindow.__del__(self)
|
||||||
|
|
||||||
|
def LoadDialog(self):
|
||||||
|
try:
|
||||||
|
pyScrLoader = ui.PythonScriptLoader()
|
||||||
|
pyScrLoader.LoadScriptFile(self, "UIScript/WhisperDialog.py")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("WhisperDialog.LoadDialog.LoadScript")
|
||||||
|
|
||||||
|
try:
|
||||||
|
GetObject=self.GetChild
|
||||||
|
self.titleName = GetObject("titlename")
|
||||||
|
self.titleNameEdit = GetObject("titlename_edit")
|
||||||
|
self.closeButton = GetObject("closebutton")
|
||||||
|
self.scrollBar = GetObject("scrollbar")
|
||||||
|
self.chatLine = GetObject("chatline")
|
||||||
|
self.minimizeButton = GetObject("minimizebutton")
|
||||||
|
self.ignoreButton = GetObject("ignorebutton")
|
||||||
|
self.reportViolentWhisperButton = GetObject("reportviolentwhisperbutton")
|
||||||
|
self.acceptButton = GetObject("acceptbutton")
|
||||||
|
self.sendButton = GetObject("sendbutton")
|
||||||
|
self.board = GetObject("board")
|
||||||
|
self.editBar = GetObject("editbar")
|
||||||
|
self.gamemasterMark = GetObject("gamemastermark")
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("DialogWindow.LoadDialog.BindObject")
|
||||||
|
|
||||||
|
self.gamemasterMark.Hide()
|
||||||
|
self.titleName.SetText("")
|
||||||
|
self.titleNameEdit.SetText("")
|
||||||
|
self.minimizeButton.SetEvent(ui.__mem_func__(self.Minimize))
|
||||||
|
self.closeButton.SetEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.scrollBar.SetPos(1.0)
|
||||||
|
self.scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll))
|
||||||
|
self.chatLine.SetReturnEvent(ui.__mem_func__(self.SendWhisper))
|
||||||
|
self.chatLine.SetEscapeEvent(ui.__mem_func__(self.Minimize))
|
||||||
|
self.chatLine.SetMultiLine()
|
||||||
|
self.sendButton.SetEvent(ui.__mem_func__(self.SendWhisper))
|
||||||
|
self.titleNameEdit.SetReturnEvent(ui.__mem_func__(self.AcceptTarget))
|
||||||
|
self.titleNameEdit.SetEscapeEvent(ui.__mem_func__(self.Close))
|
||||||
|
self.ignoreButton.SetToggleDownEvent(ui.__mem_func__(self.IgnoreTarget))
|
||||||
|
self.ignoreButton.SetToggleUpEvent(ui.__mem_func__(self.IgnoreTarget))
|
||||||
|
self.reportViolentWhisperButton.SetEvent(ui.__mem_func__(self.ReportViolentWhisper))
|
||||||
|
self.acceptButton.SetEvent(ui.__mem_func__(self.AcceptTarget))
|
||||||
|
|
||||||
|
self.textRenderer = self.TextRenderer()
|
||||||
|
self.textRenderer.SetParent(self)
|
||||||
|
self.textRenderer.SetPosition(20, 28)
|
||||||
|
self.textRenderer.SetTargetName("")
|
||||||
|
self.textRenderer.Show()
|
||||||
|
|
||||||
|
self.resizeButton = self.ResizeButton()
|
||||||
|
self.resizeButton.SetParent(self)
|
||||||
|
self.resizeButton.SetSize(20, 20)
|
||||||
|
self.resizeButton.SetPosition(280, 180)
|
||||||
|
self.resizeButton.SetMoveEvent(ui.__mem_func__(self.ResizeWhisperDialog))
|
||||||
|
self.resizeButton.Show()
|
||||||
|
|
||||||
|
self.ResizeWhisperDialog()
|
||||||
|
|
||||||
|
def Destroy(self):
|
||||||
|
|
||||||
|
self.eventMinimize = None
|
||||||
|
self.eventClose = None
|
||||||
|
self.eventAcceptTarget = None
|
||||||
|
|
||||||
|
self.ClearDictionary()
|
||||||
|
self.scrollBar.Destroy()
|
||||||
|
self.titleName = None
|
||||||
|
self.titleNameEdit = None
|
||||||
|
self.closeButton = None
|
||||||
|
self.scrollBar = None
|
||||||
|
self.chatLine = None
|
||||||
|
self.sendButton = None
|
||||||
|
self.ignoreButton = None
|
||||||
|
self.reportViolentWhisperButton = None
|
||||||
|
self.acceptButton = None
|
||||||
|
self.minimizeButton = None
|
||||||
|
self.textRenderer = None
|
||||||
|
self.board = None
|
||||||
|
self.editBar = None
|
||||||
|
self.resizeButton = None
|
||||||
|
|
||||||
|
def ResizeWhisperDialog(self):
|
||||||
|
(xPos, yPos) = self.resizeButton.GetLocalPosition()
|
||||||
|
if xPos < 280:
|
||||||
|
self.resizeButton.SetPosition(280, yPos)
|
||||||
|
return
|
||||||
|
if yPos < 150:
|
||||||
|
self.resizeButton.SetPosition(xPos, 150)
|
||||||
|
return
|
||||||
|
self.SetWhisperDialogSize(xPos + 20, yPos + 20)
|
||||||
|
|
||||||
|
def SetWhisperDialogSize(self, width, height):
|
||||||
|
try:
|
||||||
|
|
||||||
|
max = int((width-90)/6) * 3 - 6
|
||||||
|
|
||||||
|
self.board.SetSize(width, height)
|
||||||
|
self.scrollBar.SetPosition(width-25, 35)
|
||||||
|
self.scrollBar.SetScrollBarSize(height-100)
|
||||||
|
self.scrollBar.SetPos(1.0)
|
||||||
|
self.editBar.SetSize(width-18, 50)
|
||||||
|
self.chatLine.SetSize(width-90, 40)
|
||||||
|
self.chatLine.SetLimitWidth(width-90)
|
||||||
|
self.SetSize(width, height)
|
||||||
|
|
||||||
|
if 0 != self.targetName:
|
||||||
|
chat.SetWhisperBoxSize(self.targetName, width - 50, height - 90)
|
||||||
|
|
||||||
|
if localeInfo.IsARABIC():
|
||||||
|
self.textRenderer.SetPosition(width-20, 28)
|
||||||
|
self.scrollBar.SetPosition(width-25+self.scrollBar.GetWidth(), 35)
|
||||||
|
self.editBar.SetPosition(10 + self.editBar.GetWidth(), height-60)
|
||||||
|
self.sendButton.SetPosition(width - 80 + self.sendButton.GetWidth(), 10)
|
||||||
|
self.minimizeButton.SetPosition(width-42 + self.minimizeButton.GetWidth(), 12)
|
||||||
|
self.closeButton.SetPosition(width-24+self.closeButton.GetWidth(), 12)
|
||||||
|
self.chatLine.SetPosition(5 + self.chatLine.GetWidth(), 5)
|
||||||
|
self.board.SetPosition(self.board.GetWidth(), 0)
|
||||||
|
else:
|
||||||
|
self.textRenderer.SetPosition(20, 28)
|
||||||
|
self.scrollBar.SetPosition(width-25, 35)
|
||||||
|
self.editBar.SetPosition(10, height-60)
|
||||||
|
self.sendButton.SetPosition(width-80, 10)
|
||||||
|
self.minimizeButton.SetPosition(width-42, 12)
|
||||||
|
self.closeButton.SetPosition(width-24, 12)
|
||||||
|
|
||||||
|
self.SetChatLineMax(max)
|
||||||
|
|
||||||
|
except:
|
||||||
|
import exception
|
||||||
|
exception.Abort("WhisperDialog.SetWhisperDialogSize.BindObject")
|
||||||
|
|
||||||
|
def SetChatLineMax(self, max):
|
||||||
|
self.chatLine.SetMax(max)
|
||||||
|
|
||||||
|
from grpText import GetSplitingTextLine
|
||||||
|
|
||||||
|
text = self.chatLine.GetText()
|
||||||
|
if text:
|
||||||
|
self.chatLine.SetText(GetSplitingTextLine(text, max, 0))
|
||||||
|
|
||||||
|
def OpenWithTarget(self, targetName):
|
||||||
|
chat.CreateWhisper(targetName)
|
||||||
|
chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90)
|
||||||
|
self.chatLine.SetFocus()
|
||||||
|
self.titleName.SetText(targetName)
|
||||||
|
self.targetName = targetName
|
||||||
|
self.textRenderer.SetTargetName(targetName)
|
||||||
|
self.titleNameEdit.Hide()
|
||||||
|
self.ignoreButton.Hide()
|
||||||
|
if app.IsDevStage():
|
||||||
|
self.reportViolentWhisperButton.Show()
|
||||||
|
else:
|
||||||
|
self.reportViolentWhisperButton.Hide()
|
||||||
|
self.acceptButton.Hide()
|
||||||
|
self.gamemasterMark.Hide()
|
||||||
|
self.minimizeButton.Show()
|
||||||
|
|
||||||
|
def OpenWithoutTarget(self, event):
|
||||||
|
self.eventAcceptTarget = event
|
||||||
|
self.titleName.SetText("")
|
||||||
|
self.titleNameEdit.SetText("")
|
||||||
|
self.titleNameEdit.SetFocus()
|
||||||
|
self.targetName = 0
|
||||||
|
self.titleNameEdit.Show()
|
||||||
|
self.ignoreButton.Hide()
|
||||||
|
self.reportViolentWhisperButton.Hide()
|
||||||
|
self.acceptButton.Show()
|
||||||
|
self.minimizeButton.Hide()
|
||||||
|
self.gamemasterMark.Hide()
|
||||||
|
|
||||||
|
def SetGameMasterLook(self):
|
||||||
|
self.gamemasterMark.Show()
|
||||||
|
self.reportViolentWhisperButton.Hide()
|
||||||
|
|
||||||
|
def Minimize(self):
|
||||||
|
self.titleNameEdit.KillFocus()
|
||||||
|
self.chatLine.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
if None != self.eventMinimize:
|
||||||
|
self.eventMinimize(self.targetName)
|
||||||
|
|
||||||
|
def Close(self):
|
||||||
|
chat.ClearWhisper(self.targetName)
|
||||||
|
self.titleNameEdit.KillFocus()
|
||||||
|
self.chatLine.KillFocus()
|
||||||
|
self.Hide()
|
||||||
|
|
||||||
|
if None != self.eventClose:
|
||||||
|
self.eventClose(self.targetName)
|
||||||
|
|
||||||
|
def ReportViolentWhisper(self):
|
||||||
|
net.SendChatPacket("/reportviolentwhisper " + self.targetName)
|
||||||
|
|
||||||
|
def IgnoreTarget(self):
|
||||||
|
net.SendChatPacket("/ignore " + self.targetName)
|
||||||
|
|
||||||
|
def AcceptTarget(self):
|
||||||
|
name = self.titleNameEdit.GetText()
|
||||||
|
if len(name) <= 0:
|
||||||
|
self.Close()
|
||||||
|
return
|
||||||
|
|
||||||
|
if None != self.eventAcceptTarget:
|
||||||
|
self.titleNameEdit.KillFocus()
|
||||||
|
self.eventAcceptTarget(name)
|
||||||
|
|
||||||
|
def OnScroll(self):
|
||||||
|
chat.SetWhisperPosition(self.targetName, self.scrollBar.GetPos())
|
||||||
|
|
||||||
|
def SendWhisper(self):
|
||||||
|
|
||||||
|
text = self.chatLine.GetText()
|
||||||
|
textLength = len(text)
|
||||||
|
|
||||||
|
if textLength > 0:
|
||||||
|
if net.IsInsultIn(text):
|
||||||
|
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
|
||||||
|
return
|
||||||
|
|
||||||
|
net.SendWhisperPacket(self.targetName, text)
|
||||||
|
self.chatLine.SetText("")
|
||||||
|
|
||||||
|
chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
|
||||||
|
|
||||||
|
def OnTop(self):
|
||||||
|
self.chatLine.SetFocus()
|
||||||
|
|
||||||
|
def BindInterface(self, interface):
|
||||||
|
self.interface = interface
|
||||||
|
|
||||||
|
def OnMouseLeftButtonDown(self):
|
||||||
|
hyperlink = ui.GetHyperlink()
|
||||||
|
if hyperlink:
|
||||||
|
if app.IsPressed(app.DIK_LALT):
|
||||||
|
link = chat.GetLinkFromHyperlink(hyperlink)
|
||||||
|
ime.PasteString(link)
|
||||||
|
else:
|
||||||
|
self.interface.MakeHyperlinkTooltip(hyperlink)
|
||||||
|
|
||||||
|
if "__main__" == __name__:
|
||||||
|
import uiTest
|
||||||
|
|
||||||
|
class TestApp(uiTest.App):
|
||||||
|
def OnInit(self):
|
||||||
|
wnd = WhisperDialog(self.OnMax, self.OnMin)
|
||||||
|
wnd.LoadDialog()
|
||||||
|
wnd.OpenWithoutTarget(self.OnNew)
|
||||||
|
wnd.SetPosition(0, 0)
|
||||||
|
wnd.Show()
|
||||||
|
|
||||||
|
self.wnd = wnd
|
||||||
|
|
||||||
|
def OnMax(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def OnMin(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def OnNew(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
TestApp().MainLoop()
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
class Sandbox(object):
|
||||||
|
# DO NOT REMOVE ANY ENTRY OF WHITE LIST
|
||||||
|
# THIS ENTIES ARE USED FOR Sandbox.
|
||||||
|
# (If sys.modules['__main__'] is changed, you can see the hell.)
|
||||||
|
WHITE_LIST = ['__builtin__', 'types', __name__, '__main__', 'sys']
|
||||||
|
def __init__(self, prevent_imported_modules = False, allowed_modules = [], prevented_modules = [], allowed_paths = []):
|
||||||
|
self.prevent_imported_modules = prevent_imported_modules
|
||||||
|
self.allowed_modules = allowed_modules
|
||||||
|
self.prevented_modules = prevented_modules
|
||||||
|
self.allowed_paths = allowed_paths
|
||||||
|
|
||||||
|
def add_allowed_modules(self, allowed_modules):
|
||||||
|
self.allowed_modules = self.allowed_modules + allowed_modules
|
||||||
|
|
||||||
|
def add_prevented_modules(self, prevented_modules):
|
||||||
|
self.prevented_modules = self.prevented_modules + prevented_modules
|
||||||
|
|
||||||
|
def execfile(self, filename, dic):
|
||||||
|
import sys
|
||||||
|
import copy
|
||||||
|
|
||||||
|
for allowed_module_name in self.allowed_modules:
|
||||||
|
try:
|
||||||
|
exec 'import {0}'.format(allowed_module_name)
|
||||||
|
except:
|
||||||
|
# Just now, pass the exception.
|
||||||
|
# (filename could not use this module)
|
||||||
|
sys.stderr.write("Could not import %s" % allowed_module_name)
|
||||||
|
pass
|
||||||
|
# shallow copy of sys.modules
|
||||||
|
old_modules = copy.copy(sys.modules)
|
||||||
|
|
||||||
|
old_path = sys.path
|
||||||
|
sys.path = self.allowed_paths
|
||||||
|
|
||||||
|
# set current imported modules None
|
||||||
|
if self.prevent_imported_modules:
|
||||||
|
import types
|
||||||
|
for k, v in old_modules.items():
|
||||||
|
if type(v) == types.ModuleType:
|
||||||
|
if not (k in self.WHITE_LIST or k in self.allowed_modules):
|
||||||
|
sys.modules[k] = None
|
||||||
|
|
||||||
|
# set prevented modules None.
|
||||||
|
for prevented_module_name in self.prevented_modules:
|
||||||
|
sys.modules[prevented_module_name] = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
f = open(filename, 'rb')
|
||||||
|
data = f.read()
|
||||||
|
code = compile(data, filename, 'exec')
|
||||||
|
exec code in dic
|
||||||
|
except Exception, e:
|
||||||
|
sys.stderr.write(e)
|
||||||
|
finally:
|
||||||
|
# Restore original settings.
|
||||||
|
#sys.modules = old_modules# <- This is not effective. I don't know why, but I guess some where got old sys.modules reference and access old one.
|
||||||
|
for k, v in sys.modules.items():
|
||||||
|
if not k in old_modules:
|
||||||
|
del sys.modules[k]
|
||||||
|
for k, v in old_modules.items():
|
||||||
|
sys.modules[k] = v
|
||||||
|
|
||||||
|
sys.path = old_path
|
||||||
|
|
||||||
|
|
||||||
+1605
File diff suppressed because it is too large
Load Diff
+1690
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,586 @@
|
|||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
ROOT_PATH = "d:/ymir work/ui/public/"
|
||||||
|
LOCALE_PATH = "d:/ymir work/ui/intro/"+uiScriptLocale.CODEPAGE+"_select/"
|
||||||
|
|
||||||
|
BOARD_X = SCREEN_WIDTH * (65) / 800
|
||||||
|
BOARD_Y = SCREEN_HEIGHT * (215) / 600
|
||||||
|
|
||||||
|
PLUS_BUTTON_WIDTH = 20
|
||||||
|
TEMPORARY_HEIGHT = 5
|
||||||
|
|
||||||
|
window = {
|
||||||
|
"name" : "CreateCharacterWindow",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"width" : SCREEN_WIDTH,
|
||||||
|
"height" : SCREEN_HEIGHT,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
## Board
|
||||||
|
{
|
||||||
|
"name" : "BackGroundPattern",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 42,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/background_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 128) / 128.0, float(SCREEN_HEIGHT - 128 - 42*2) / 128.0),
|
||||||
|
},
|
||||||
|
|
||||||
|
## Alpha
|
||||||
|
{
|
||||||
|
"name" : "Alpha",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/select/background_alpha.sub",
|
||||||
|
|
||||||
|
"x_scale" : float(SCREEN_WIDTH) / 100.0,
|
||||||
|
"y_scale" : float(SCREEN_HEIGHT) / 69.0,
|
||||||
|
"x_origin" : 0.0,
|
||||||
|
"y_origin" : 0.0,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Top & Bottom Line
|
||||||
|
{
|
||||||
|
"name" : "Top_Line",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/line_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 50) / 50.0, 0.0),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "Bottom_Line",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : SCREEN_HEIGHT - 42,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/line_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 50) / 50.0, 0.0),
|
||||||
|
},
|
||||||
|
|
||||||
|
## BackGround
|
||||||
|
{
|
||||||
|
"name" : "BackGround",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"x_scale" : float(SCREEN_WIDTH) / 800.0,
|
||||||
|
"y_scale" : float(SCREEN_HEIGHT) / 600.0,
|
||||||
|
"mode" : "MODULATE",
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/intro_background.dds",
|
||||||
|
},
|
||||||
|
|
||||||
|
## Buttons
|
||||||
|
{
|
||||||
|
"name" : "left_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : SCREEN_WIDTH * (440 - 22*3) / 800,
|
||||||
|
"y" : SCREEN_HEIGHT * (510) / 600,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/intro/select/dragon_left_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/intro/select/dragon_left_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/intro/select/dragon_left_button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "right_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : SCREEN_WIDTH * (570 - 22) / 800,
|
||||||
|
"y" : SCREEN_HEIGHT * (510) / 600,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/intro/select/dragon_right_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/intro/select/dragon_right_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/intro/select/dragon_right_button_03.sub",
|
||||||
|
},
|
||||||
|
|
||||||
|
## Name
|
||||||
|
{
|
||||||
|
"name" : "name_warrior",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : BOARD_X - 27,
|
||||||
|
"y" : BOARD_Y - 174 + 25,
|
||||||
|
|
||||||
|
"image" : LOCALE_PATH+"name_warrior.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "name_assassin",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : BOARD_X - 27,
|
||||||
|
"y" : BOARD_Y - 174 + 25,
|
||||||
|
|
||||||
|
"image" : LOCALE_PATH+"name_assassin.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "name_sura",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : BOARD_X - 27,
|
||||||
|
"y" : BOARD_Y - 174 + 25,
|
||||||
|
|
||||||
|
"image" : LOCALE_PATH+"name_sura.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "name_shaman",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : BOARD_X - 27,
|
||||||
|
"y" : BOARD_Y - 174 + 25,
|
||||||
|
|
||||||
|
"image" : LOCALE_PATH+"name_shaman.sub",
|
||||||
|
},
|
||||||
|
|
||||||
|
## Character Board
|
||||||
|
{
|
||||||
|
"name" : "character_board",
|
||||||
|
"type" : "thinboard",
|
||||||
|
|
||||||
|
"x" : BOARD_X,
|
||||||
|
"y" : BOARD_Y,
|
||||||
|
|
||||||
|
"width" : 208,
|
||||||
|
"height" : 300 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "text_board",
|
||||||
|
"type" : "bar",
|
||||||
|
|
||||||
|
"x" : 8,
|
||||||
|
"y" : 10,
|
||||||
|
|
||||||
|
"width" : 189,
|
||||||
|
"height" : 122,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "prev_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 95,
|
||||||
|
"y" : 95,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_PREV,
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Small_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Small_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Small_Button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "next_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 140,
|
||||||
|
"y" : 95,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_NEXT,
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Small_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Small_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Small_Button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "right_line",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 189-1,
|
||||||
|
"y" : -1,
|
||||||
|
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 122,
|
||||||
|
|
||||||
|
"color" : 0xffAAA6A1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "bottom_line",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 122-1,
|
||||||
|
|
||||||
|
"width" : 189,
|
||||||
|
"height" : 0,
|
||||||
|
|
||||||
|
"color" : 0xffAAA6A1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "left_line",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 122-1,
|
||||||
|
|
||||||
|
"color" : 0xff2A2521,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "top_line",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"width" : 189,
|
||||||
|
"height" : 0,
|
||||||
|
|
||||||
|
"color" : 0xff2A2521,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "hth",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 15,
|
||||||
|
"y" : 138,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_HP,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "hth_gauge",
|
||||||
|
"type" : "gauge",
|
||||||
|
|
||||||
|
"x" : 30,
|
||||||
|
"y" : 4,
|
||||||
|
|
||||||
|
"width" : 100 + PLUS_BUTTON_WIDTH,
|
||||||
|
"color" : "red",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "hth_slot",
|
||||||
|
"type" : "slotbar",
|
||||||
|
|
||||||
|
"x" : 137 + PLUS_BUTTON_WIDTH,
|
||||||
|
"y" : -1,
|
||||||
|
"width" : 24,
|
||||||
|
"height" : 16,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "hth_value",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 1,
|
||||||
|
"all_align" : "center",
|
||||||
|
|
||||||
|
"text" : "99",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "int",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 15,
|
||||||
|
"y" : 157,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_SP,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "int_gauge",
|
||||||
|
"type" : "gauge",
|
||||||
|
|
||||||
|
"x" : 30,
|
||||||
|
"y" : 4,
|
||||||
|
|
||||||
|
"width" : 100 + PLUS_BUTTON_WIDTH,
|
||||||
|
"color" : "pink",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "int_slot",
|
||||||
|
"type" : "slotbar",
|
||||||
|
|
||||||
|
"x" : 137 + PLUS_BUTTON_WIDTH,
|
||||||
|
"y" : -1,
|
||||||
|
"width" : 24,
|
||||||
|
"height" : 16,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "int_value",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 1,
|
||||||
|
"all_align" : "center",
|
||||||
|
|
||||||
|
"text" : "99",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "str",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 15,
|
||||||
|
"y" : 176,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_ATT_GRADE,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "str_gauge",
|
||||||
|
"type" : "gauge",
|
||||||
|
|
||||||
|
"x" : 30,
|
||||||
|
"y" : 4,
|
||||||
|
|
||||||
|
"width" : 100 + PLUS_BUTTON_WIDTH,
|
||||||
|
"color" : "purple",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "str_slot",
|
||||||
|
"type" : "slotbar",
|
||||||
|
|
||||||
|
"x" : 137 + PLUS_BUTTON_WIDTH,
|
||||||
|
"y" : -1,
|
||||||
|
"width" : 24,
|
||||||
|
"height" : 16,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "str_value",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 1,
|
||||||
|
"all_align" : "center",
|
||||||
|
|
||||||
|
"text" : "99",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "dex",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 15,
|
||||||
|
"y" : 195,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_DEX_GRADE,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "dex_gauge",
|
||||||
|
"type" : "gauge",
|
||||||
|
|
||||||
|
"x" : 30,
|
||||||
|
"y" : 4,
|
||||||
|
|
||||||
|
"width" : 100 + PLUS_BUTTON_WIDTH,
|
||||||
|
"color" : "blue",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "dex_slot",
|
||||||
|
"type" : "slotbar",
|
||||||
|
|
||||||
|
"x" : 137 + PLUS_BUTTON_WIDTH,
|
||||||
|
"y" : -1,
|
||||||
|
"width" : 24,
|
||||||
|
"height" : 16,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "dex_value",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 1,
|
||||||
|
"all_align" : "center",
|
||||||
|
|
||||||
|
"text" : "99",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name" : "hth_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 184,
|
||||||
|
"y" : 139,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "int_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 184,
|
||||||
|
"y" : 158,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "str_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 184,
|
||||||
|
"y" : 177,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "dex_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 184,
|
||||||
|
"y" : 196,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name" : "character_name",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 43,
|
||||||
|
"y" : 217 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_NAME,
|
||||||
|
|
||||||
|
"text_horizontal_align" : "center",
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "character_name_slot",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : 40 - 1,
|
||||||
|
"y" : -2,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/public/parameter_slot_04.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "character_name_value",
|
||||||
|
"type" : "editline",
|
||||||
|
|
||||||
|
"x" : 40 - 1 + 3,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"input_limit" : 12,
|
||||||
|
|
||||||
|
"width" : 90,
|
||||||
|
"height" : 20,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name" : "character_name",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 43,
|
||||||
|
"y" : 241 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_SHAPE,
|
||||||
|
|
||||||
|
"text_horizontal_align" : "center",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "shape_button_01",
|
||||||
|
"type" : "radio_button",
|
||||||
|
|
||||||
|
"x" : 79,
|
||||||
|
"y" : 239 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : "1",
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Middle_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Middle_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Middle_Button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "shape_button_02",
|
||||||
|
"type" : "radio_button",
|
||||||
|
|
||||||
|
"x" : 139,
|
||||||
|
"y" : 239 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : "2",
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Middle_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Middle_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Middle_Button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "create_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 11,
|
||||||
|
"y" : 265 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CREATE_CREATE,
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Large_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Large_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Large_Button_03.sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "cancel_button",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 109,
|
||||||
|
"y" : 265 + TEMPORARY_HEIGHT,
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.CANCEL,
|
||||||
|
|
||||||
|
"default_image" : ROOT_PATH + "Large_Button_01.sub",
|
||||||
|
"over_image" : ROOT_PATH + "Large_Button_02.sub",
|
||||||
|
"down_image" : ROOT_PATH + "Large_Button_03.sub",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
刺客是以短剑和弓箭为主的专业[ENTER]
|
||||||
|
杀手。高水准的刺客要经过残酷[ENTER]
|
||||||
|
的训练过程,所以其数量不是很[ENTER]
|
||||||
|
多,但是只要具备某种特定条件[ENTER]
|
||||||
|
,他们超强的战斗能力足可以扭[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
转战争的进程,为了保证敏捷和[ENTER]
|
||||||
|
速度,所以只能使用轻便的防御[ENTER]
|
||||||
|
盔甲,这是他们唯一的弱点。[ENTER]
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
盛唐国[ENTER]
|
||||||
|
[ENTER]
|
||||||
|
繁荣的国度,有着辉煌的经济[ENTER]
|
||||||
|
文化成就。这里人们大都贤明[ENTER]
|
||||||
|
且具有很高的智力,在一个[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
崇高而神圣的目标指引下,他[ENTER]
|
||||||
|
们团结在一起,相互配合,[ENTER]
|
||||||
|
亲密无间。他们都尊崇圣人之道[ENTER]
|
||||||
|
,严以律己,从不崇尚武力,但[ENTER]
|
||||||
|
这并不表示软弱。当他们热爱的[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
家园受到威胁时,也会毫不犹豫的[ENTER]
|
||||||
|
给对手以致命的一击。[ENTER]
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
秦皇国[ENTER]
|
||||||
|
[ENTER]
|
||||||
|
极具野心的帝国,整个国家有着[ENTER]
|
||||||
|
森严的等级制度,由于多年战乱,[ENTER]
|
||||||
|
这里的军队都经常长期的训练,纪[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
律严明,作战灵活,具有非同一[ENTER]
|
||||||
|
般的忍耐力,超强的凝聚力和战[ENTER]
|
||||||
|
斗力。[ENTER]
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
汉武国[ENTER]
|
||||||
|
[ENTER]
|
||||||
|
一个历经百年强盛的国度,有[ENTER]
|
||||||
|
横扫八荒的野心。这里的人们[ENTER]
|
||||||
|
都勇决果敢、爱憎分明,有胆识、[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
有魄力,在激情背后始终保持一颗[ENTER]
|
||||||
|
充满自信的心。他们注重自己的威[ENTER]
|
||||||
|
严,虽然有时会显得刚愎自用,[ENTER]
|
||||||
|
当这并不防碍他们成为万人敬[ENTER]
|
||||||
|
仰的英雄。[ENTER]
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
神女是领悟到自然流逝与阴阳照[ENTER]
|
||||||
|
化的美丽化身。她们利用自然的[ENTER]
|
||||||
|
力量发挥巨大的潜能,营造出绚[ENTER]
|
||||||
|
丽的仙术世界。同时拥有渊源的[ENTER]
|
||||||
|
知识,所以很想与别人沟通,[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
但却很少有人能够见到她们真正[ENTER]
|
||||||
|
的化身。精通仙术的神女将成为[ENTER]
|
||||||
|
战场上至关重要的角色。
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
修罗将恶魔的种子寄生在自己的[ENTER]
|
||||||
|
手臂上,用来吸取魔法力量。他[ENTER]
|
||||||
|
们与别人不同,更加不会相信别[ENTER]
|
||||||
|
人,所以使得周围没有亲近的朋[ENTER]
|
||||||
|
友。他们的目标只有一个,就是[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
追求大陆上最强的力量,此外的[ENTER]
|
||||||
|
事物都将视为阻碍。[ENTER]
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[DELAY value;10]
|
||||||
|
猛将拥有一把锋利的巨剑以及厚[ENTER]
|
||||||
|
实的盔甲,从游戏一开始就成为[ENTER]
|
||||||
|
关注的焦点,没有人敢蔑视他们[ENTER]
|
||||||
|
他们追求钢铁般的肌肉和净水般[ENTER]
|
||||||
|
宁静的精神世界。整个大陆上没[ENTER]
|
||||||
|
[WAIT]
|
||||||
|
有人能抵挡他们愤怒的脚步。[ENTER]
|
||||||
@@ -0,0 +1,504 @@
|
|||||||
|
import uiScriptLocale
|
||||||
|
|
||||||
|
LOCALE_PATH = "d:/ymir work/ui/intro/"+uiScriptLocale.CODEPAGE+"_login/"
|
||||||
|
|
||||||
|
window = {
|
||||||
|
"name" : "LoginWindow",
|
||||||
|
"sytle" : ("movable",),
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"width" : SCREEN_WIDTH,
|
||||||
|
"height" : SCREEN_HEIGHT,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
|
||||||
|
## Board
|
||||||
|
{
|
||||||
|
"name" : "BackGround",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 42,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/background_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 128) / 128.0, float(SCREEN_HEIGHT - 128 - 42*2) / 128.0),
|
||||||
|
},
|
||||||
|
|
||||||
|
## Alpha
|
||||||
|
{
|
||||||
|
"name" : "Alpha",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/login/background_alpha.sub",
|
||||||
|
|
||||||
|
"x_scale" : float(SCREEN_WIDTH) / 128.0,
|
||||||
|
"y_scale" : float(SCREEN_HEIGHT) / 96.0,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Top & Bottom Line
|
||||||
|
{
|
||||||
|
"name" : "Top_Line",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/line_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 50) / 50.0, 0.0),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "Bottom_Line",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : SCREEN_HEIGHT - 42,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/line_pattern.tga",
|
||||||
|
|
||||||
|
"rect" : (0.0, 0.0, float(SCREEN_WIDTH - 50) / 50.0, 0.0),
|
||||||
|
},
|
||||||
|
|
||||||
|
## BackGround
|
||||||
|
{
|
||||||
|
"name" : "BackGround",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"x_scale" : float(SCREEN_WIDTH) / 800.0,
|
||||||
|
"y_scale" : float(SCREEN_HEIGHT) / 600.0,
|
||||||
|
"mode" : "MODULATE",
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/pattern/intro_background.dds",
|
||||||
|
},
|
||||||
|
|
||||||
|
## Metin2 Logo
|
||||||
|
{
|
||||||
|
"name" : "Metin2_Logo",
|
||||||
|
"type" : "expanded_image",
|
||||||
|
|
||||||
|
"x" : float(SCREEN_WIDTH) / 800.0 * 20,
|
||||||
|
"y" : float(SCREEN_HEIGHT) / 600.0 * 10,
|
||||||
|
"x_scale" : float(SCREEN_WIDTH) / 800.0,
|
||||||
|
"y_scale" : float(SCREEN_HEIGHT) / 600.0,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/936_login/logo.sub",
|
||||||
|
},
|
||||||
|
|
||||||
|
## Copyright
|
||||||
|
{
|
||||||
|
"name" : "Copyright",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : SCREEN_WIDTH/2 - 378/2,
|
||||||
|
"y" : SCREEN_HEIGHT - 33,
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/login/copyright.sub",
|
||||||
|
},
|
||||||
|
|
||||||
|
## ConnectBoard
|
||||||
|
{
|
||||||
|
"name" : "ConnectBoard",
|
||||||
|
"type" : "thinboard",
|
||||||
|
|
||||||
|
"x" : SCREEN_WIDTH - 275,
|
||||||
|
"y" : SCREEN_HEIGHT - 195,
|
||||||
|
"width" : 208,
|
||||||
|
"height" : 30,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "ConnectName",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 0,
|
||||||
|
"vertical_align" : "center",
|
||||||
|
"text_vertical_align" : "center",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_DEFAULT_SERVERADDR,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "SelectConnectButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 155,
|
||||||
|
"y" : 0,
|
||||||
|
"vertical_align" : "center",
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/small_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/small_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/small_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_SELECT_BUTTON,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
## Alert
|
||||||
|
{
|
||||||
|
"name" : "AlertBoard",
|
||||||
|
"type" : "thinboard",
|
||||||
|
|
||||||
|
"x" : 67,
|
||||||
|
"y" : SCREEN_HEIGHT - 169,
|
||||||
|
"width" : 228,
|
||||||
|
"height" : 111,
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "936_AlertImage",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 0,
|
||||||
|
"horizontal_align" : "center",
|
||||||
|
"vertical_align" : "center",
|
||||||
|
|
||||||
|
"image" : "d:/ymir work/ui/intro/936_login/alert.sub",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
## LoginBoard
|
||||||
|
{
|
||||||
|
"name" : "LoginBoard",
|
||||||
|
"type" : "image",
|
||||||
|
|
||||||
|
"x" : SCREEN_WIDTH - 275,
|
||||||
|
"y" : SCREEN_HEIGHT - 155,
|
||||||
|
|
||||||
|
"image" : LOCALE_PATH+"loginwindow.sub",
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"name" : "ID_EditLine",
|
||||||
|
"type" : "editline",
|
||||||
|
|
||||||
|
"x" : 77,
|
||||||
|
"y" : 16,
|
||||||
|
|
||||||
|
"width" : 120,
|
||||||
|
"height" : 18,
|
||||||
|
|
||||||
|
"input_limit" : 16,
|
||||||
|
"enable_codepage" : 0,
|
||||||
|
|
||||||
|
"r" : 1.0,
|
||||||
|
"g" : 1.0,
|
||||||
|
"b" : 1.0,
|
||||||
|
"a" : 1.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "Password_EditLine",
|
||||||
|
"type" : "editline",
|
||||||
|
|
||||||
|
"x" : 77,
|
||||||
|
"y" : 43,
|
||||||
|
|
||||||
|
"width" : 120,
|
||||||
|
"height" : 18,
|
||||||
|
|
||||||
|
"input_limit" : 16,
|
||||||
|
"secret_flag" : 1,
|
||||||
|
"enable_codepage" : 0,
|
||||||
|
|
||||||
|
"r" : 1.0,
|
||||||
|
"g" : 1.0,
|
||||||
|
"b" : 1.0,
|
||||||
|
"a" : 1.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "LoginButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 15,
|
||||||
|
"y" : 65,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_CONNECT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "LoginExitButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 105,
|
||||||
|
"y" : 65,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_EXIT,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
## ServerBoard
|
||||||
|
{
|
||||||
|
"name" : "ServerBoard",
|
||||||
|
"type" : "thinboard",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 308,
|
||||||
|
"width" : 375,
|
||||||
|
"height" : 220,
|
||||||
|
"horizontal_align" : "center",
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
|
||||||
|
## Title
|
||||||
|
{
|
||||||
|
"name" : "Title",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 12,
|
||||||
|
"horizontal_align" : "center",
|
||||||
|
"text_horizontal_align" : "center",
|
||||||
|
"text" : uiScriptLocale.LOGIN_SELECT_TITLE,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Horizontal
|
||||||
|
{
|
||||||
|
"name" : "HorizontalLine1",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 34,
|
||||||
|
"width" : 354,
|
||||||
|
"height" : 0,
|
||||||
|
"color" : 0xff777777,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "HorizontalLine2",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 35,
|
||||||
|
"width" : 355,
|
||||||
|
"height" : 0,
|
||||||
|
"color" : 0xff111111,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Vertical
|
||||||
|
{
|
||||||
|
"name" : "VerticalLine1",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 246,
|
||||||
|
"y" : 38,
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 175,
|
||||||
|
"color" : 0xff777777,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "VerticalLine2",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 247,
|
||||||
|
"y" : 38,
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 175,
|
||||||
|
"color" : 0xff111111,
|
||||||
|
},
|
||||||
|
|
||||||
|
## ListBox
|
||||||
|
{
|
||||||
|
"name" : "ServerList",
|
||||||
|
"type" : "listbox",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 40,
|
||||||
|
"width" : 232,
|
||||||
|
"height" : 171,
|
||||||
|
|
||||||
|
"item_align" : 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "ChannelList",
|
||||||
|
"type" : "listbox",
|
||||||
|
|
||||||
|
"x" : 255,
|
||||||
|
"y" : 40,
|
||||||
|
"width" : 109,
|
||||||
|
"height" : 171,
|
||||||
|
|
||||||
|
"item_align" : 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Buttons
|
||||||
|
{
|
||||||
|
"name" : "ServerSelectButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 267,
|
||||||
|
"y" : 170,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.OK,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "ServerExitButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 267,
|
||||||
|
"y" : 192,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_SELECT_EXIT,
|
||||||
|
},
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
## SettlementBoard
|
||||||
|
{
|
||||||
|
"name" : "RegionBoard",
|
||||||
|
"type" : "thinboard",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 308,
|
||||||
|
"width" : 375,
|
||||||
|
"height" : 220,
|
||||||
|
"horizontal_align" : "center",
|
||||||
|
|
||||||
|
"children" :
|
||||||
|
(
|
||||||
|
|
||||||
|
## Title
|
||||||
|
{
|
||||||
|
"name" : "RegionTitle",
|
||||||
|
"type" : "text",
|
||||||
|
|
||||||
|
"x" : 0,
|
||||||
|
"y" : 12,
|
||||||
|
"horizontal_align" : "center",
|
||||||
|
"text_horizontal_align" : "center",
|
||||||
|
"text" : uiScriptLocale.LOGIN_REGION_TITLE,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Horizontal
|
||||||
|
{
|
||||||
|
"name" : "RegionHorizontalLine1",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 34,
|
||||||
|
"width" : 354,
|
||||||
|
"height" : 0,
|
||||||
|
"color" : 0xff777777,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "RegionHorizontalLine2",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 35,
|
||||||
|
"width" : 355,
|
||||||
|
"height" : 0,
|
||||||
|
"color" : 0xff111111,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Vertical
|
||||||
|
{
|
||||||
|
"name" : "RegionVerticalLine1",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 246,
|
||||||
|
"y" : 38,
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 175,
|
||||||
|
"color" : 0xff777777,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "RegionVerticalLine2",
|
||||||
|
"type" : "line",
|
||||||
|
|
||||||
|
"x" : 247,
|
||||||
|
"y" : 38,
|
||||||
|
"width" : 0,
|
||||||
|
"height" : 175,
|
||||||
|
"color" : 0xff111111,
|
||||||
|
},
|
||||||
|
|
||||||
|
## ListBox
|
||||||
|
{
|
||||||
|
"name" : "RegionGroupList",
|
||||||
|
"type" : "listbox",
|
||||||
|
|
||||||
|
"x" : 10,
|
||||||
|
"y" : 40,
|
||||||
|
"width" : 232,
|
||||||
|
"height" : 171,
|
||||||
|
|
||||||
|
"item_align" : 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "ServerListOnRegionBoard",
|
||||||
|
"type" : "listbox",
|
||||||
|
|
||||||
|
"x" : 255,
|
||||||
|
"y" : 40,
|
||||||
|
"width" : 109,
|
||||||
|
"height" : 171,
|
||||||
|
|
||||||
|
"item_align" : 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
## Buttons
|
||||||
|
{
|
||||||
|
"name" : "RegionSelectButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 267,
|
||||||
|
"y" : 170,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.OK,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "RegionExitButton",
|
||||||
|
"type" : "button",
|
||||||
|
|
||||||
|
"x" : 267,
|
||||||
|
"y" : 192,
|
||||||
|
|
||||||
|
"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
|
||||||
|
"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
|
||||||
|
"down_image" : "d:/ymir work/ui/public/large_button_03.sub",
|
||||||
|
|
||||||
|
"text" : uiScriptLocale.LOGIN_SELECT_EXIT,
|
||||||
|
},
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
),
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user