commit 11df29aa6b62bbe9af1a6de6737e4d685757da05 Author: Andreas Lierschaft Date: Mon Aug 17 21:50:23 2026 +0200 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. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4649050 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/root/20110915_ymir_item_proto b/root/20110915_ymir_item_proto new file mode 100644 index 0000000..0ddbaf5 Binary files /dev/null and b/root/20110915_ymir_item_proto differ diff --git a/root/936mob_proto b/root/936mob_proto new file mode 100644 index 0000000..ef733d6 Binary files /dev/null and b/root/936mob_proto differ diff --git a/root/936skilldesc.txt b/root/936skilldesc.txt new file mode 100644 index 0000000..bf0f4bb --- /dev/null +++ b/root/936skilldesc.txt @@ -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 diff --git a/root/936skilltable.txt b/root/936skilltable.txt new file mode 100644 index 0000000..ba5a6bb --- /dev/null +++ b/root/936skilltable.txt @@ -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 diff --git a/root/assassin_m.msm b/root/assassin_m.msm new file mode 100644 index 0000000..b345e10 --- /dev/null +++ b/root/assassin_m.msm @@ -0,0 +1,1530 @@ +ScriptType RaceDataScript + +BaseModelFileName "d:/ymir work/pc2/assassin/assassin_novice.GR2" + + +Group HairData +{ + PathName "d:/ymir Work/pc2/assassin/" + + HairDataCount 61 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "assassin_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 2001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 2002 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 2003 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 2004 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 2005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 2006 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 2007 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 2008 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 2009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 2010 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 2011 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 2012 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_4.dds" + } + + Group HairData18 + { + HairIndex 2013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 2014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 2015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 2016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + HairIndex 2017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + HairIndex 2018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + Group HairData26 + { + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + Group HairData27 + { + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + Group HairData29 + { + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData30 + { + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + Group HairData31 + { + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + Group HairData32 + { + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData33 + { + HairIndex 5028 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_3.dds" + } + Group HairData34 + { + HairIndex 5029 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_2.dds" + } + Group HairData35 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData36 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData37 + { + HairIndex 5033 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData38 + { + HairIndex 5035 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData39 + { + HairIndex 5037 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData40 + { + HairIndex 5039 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData41 + { + HairIndex 5041 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData42 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData43 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData44 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData45 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData46 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData47 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData48 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData49 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData50 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData51 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData52 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData53 + { + HairIndex 5055 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData54 + { + HairIndex 5057 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData55 + { + HairIndex 5059 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData56 + { + HairIndex 5061 + Model "hair/hair_35_1.gr2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData57 + { + HairIndex 5063 + Model "hair/hair_37_1.gr2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + Group HairData58 + { + HairIndex 5064 + Model "hair/hair_36_1.gr2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + Group HairData59 + { + HairIndex 5065 + Model "hair/hair_38_1.gr2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + + Group HairData60 + { + HairIndex 5022 + Model "hair/hair_12_1.gr2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc2/assassin/" + + ShapeDataCount 146 + + Group ShapeData00 + { + ShapeIndex 0 + + Model "assassin_novice.GR2" + SourceSkin "assassin_novice_red.dds" + TargetSkin "assassin_novice_red.dds" + } + Group ShapeData01 + { + ShapeIndex 1 + + Model "assassin_novice.GR2" + SourceSkin "assassin_novice_red.dds" + TargetSkin "assassin_novice_green.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_tanma.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_geukseom.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_dahong.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_biyeong.DDS" + } + Group ShapeData06 + { + ShapeIndex 7 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_yeongrin.DDS" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_jeoksal.DDS" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_yonga.DDS" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_salpung.DDS" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "assassin_bihyeon.GR2" + SourceSkin "assassin_bihyeon.DDS" + TargetSkin "assassin_bihyeon.DDS" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir work/pc2/assassin/" + + ShapeIndex 201 + Model "assassin_marry_01.GR2" + SourceSkin "assassin_marry_01.dds" + TargetSkin "assassin_marry_01.dds" + } + Group ShapeData16 + { + ShapeIndex 12 + Model "assassin_4-1.gr2" + SourceSkin "assassin_4-1.dds" + TargetSkin "assassin_4-1.dds" + + } + Group ShapeData17 + { + ShapeIndex 24 + Model "assassin_lord.GR2" + SourceSkin "assassin_queen01.dds" + TargetSkin "assassin_queen01.dds" + } + Group ShapeData18 + { + ShapeIndex 14 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-1_tanma_a.DDS" + } + Group ShapeData19 + { + ShapeIndex 15 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-2_geukseom_a.DDS" + } + Group ShapeData20 + { + ShapeIndex 16 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-3_dahong_a.DDS" + } + Group ShapeData21 + { + ShapeIndex 17 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-1_biyeong_a.DDS" + } + Group ShapeData22 + { + ShapeIndex 18 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-2_yeongrin_a.DDS" + } + Group ShapeData23 + { + ShapeIndex 19 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-3_jeoksal_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 20 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_3-1_yonga_a.DDS" + } + Group ShapeData25 + { + ShapeIndex 21 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_salpung_a.dds" + } + Group ShapeData26 + { + ShapeIndex 25 + Model "assassin_lord.GR2" + SourceSkin "assassin_queen01.dds" + TargetSkin "assassin_queen02.dds" + } + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc2/assassin/" + + ShapeIndex 26 + Model "assassin_4-1.GR2" + SourceSkin "assassin_4-1.dds" + TargetSkin "assassin_4-2.dds" + } + Group ShapeData28 + { + + ShapeIndex 27 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_blue.dds" + } + Group ShapeData31 + { + ShapeIndex 30 + Model "assassin_tanma.gr2" + SourceSkin "assassin_tanma.dds" + TargetSkin "assassin_costume1.dds" + } + Group ShapeData32 + { + ShapeIndex 40031 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1.dds" + } + Group ShapeData33 + { + + ShapeIndex 40033 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_London.dds" + } + Group ShapeData34 + { + ShapeIndex 40034 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assasin_fencing1_Germany.dds" + } + Group ShapeData35 + { + ShapeIndex 40035 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Turkey.dds" + } + Group ShapeData36 + { + ShapeIndex 40036 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Brazil.dds" + } + Group ShapeData37 + { + ShapeIndex 40037 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_London.dds" + } + Group ShapeData38 + { + ShapeIndex 40038 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assasin_soccer1_Germany.dds" + } + Group ShapeData39 + { + ShapeIndex 40039 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Turkey.dds" + } + Group ShapeData40 + { + ShapeIndex 40040 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Brazil.dds" + } + Group ShapeData41 + { + ShapeIndex 40041 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_London.dds" + } + Group ShapeData42 + { + ShapeIndex 40042 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Germany.dds" + } + Group ShapeData43 + { + ShapeIndex 40043 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Turkey.dds" + } + Group ShapeData44 + { + ShapeIndex 40044 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Brazil.dds" + } + Group ShapeData45 + { + ShapeIndex 40032 + Model "assassin_assasin1.GR2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assasin1.dds" + } + Group ShapeData46 + { + ShapeIndex 40045 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_France.dds" + } + Group ShapeData47 + { + ShapeIndex 40046 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Italy.dds" + } + Group ShapeData48 + { + ShapeIndex 40047 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Poland.dds" + } + Group ShapeData49 + { + ShapeIndex 40048 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Romania.dds" + } + Group ShapeData50 + { + ShapeIndex 40049 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assasin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Spain.dds" + } + Group ShapeData51 + { + ShapeIndex 40050 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_France.dds" + } + Group ShapeData52 + { + ShapeIndex 40051 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Italy.dds" + } + Group ShapeData53 + { + ShapeIndex 40052 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Poland.dds" + } + Group ShapeData54 + { + ShapeIndex 40053 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Romania.dds" + } + Group ShapeData55 + { + ShapeIndex 40054 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Spain.dds" + } + Group ShapeData56 + { + ShapeIndex 40055 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_France.dds" + } + Group ShapeData57 + { + ShapeIndex 40056 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Italy.dds" + } + Group ShapeData58 + { + ShapeIndex 40057 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Poland.dds" + } + Group ShapeData59 + { + ShapeIndex 40058 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Romania.dds" + } + Group ShapeData60 + { + ShapeIndex 40059 + Model "assassin_boxing1_Germany.GR2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Spain.dds" + } + Group ShapeData61 + { + ShapeIndex 40065 + Model "assassin_halloween1.GR2" + SourceSkin "assassin_halloween1.dds" + TargetSkin "assassin_halloween1.dds" + } + Group ShapeData62 + { + ShapeIndex 13 + Model "assassin_5_1.gr2" + SourceSkin "assassin_5_1.dds" + TargetSkin "assassin_5_1.dds" + } + Group ShapeData63 + { + ShapeIndex 40062 + Model "assassin_salsa1.GR2" + SourceSkin "assassin_salsa1.dds" + TargetSkin "assassin_salsa1.dds" + } + Group ShapeData64 + { + ShapeIndex 40063 + Model "assassin_Springwear1.GR2" + SourceSkin "assassin_Springwear1.dds" + TargetSkin "assassin_Springwear1.dds" + } + Group ShapeData65 + { + ShapeIndex 40061 + Model "assassin_tailcoat1.gr2" + SourceSkin "assassin_tailcoat1.dds" + TargetSkin "assassin_tailcoat1.dds" + } + Group ShapeData66 + { + ShapeIndex 40069 + Model "assassin_deer1.gr2" + SourceSkin "assassin_deer1.dds" + TargetSkin "assassin_deer1.dds" + } + Group ShapeData67 + { + ShapeIndex 40066 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_red.dds" + } + Group ShapeData68 + { + ShapeIndex 40067 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_green.dds" + } + Group ShapeData69 + { + ShapeIndex 40068 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "assassin_samurai1.GR2" + SourceSkin "assassin_samurai1.dds" + TargetSkin "assassin_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "assassin_BlackSnake1.GR2" + SourceSkin "assassin_BlackSnake1.dds" + TargetSkin "assassin_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "assassin_BlackSnake1.GR2" + SourceSkin "assassin_BlackSnake1.dds" + TargetSkin "assassin_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40112 + Model "assassin_assasin1.GR2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assasin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40114 + Model "assassin_pwahuang1.GR2" + SourceSkin "assassin_pwahuang1.dds" + TargetSkin "assassin_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40116 + Model "assassin_halloween2.GR2" + SourceSkin "assassin_halloween2.dds" + TargetSkin "assassin_halloween2.dds" + } + Group ShapeData112 + { + + ShapeIndex 40118 + Model "assassin_assasin1.GR2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assassin3 .dds" + } + + Group ShapeData113 + { + + ShapeIndex 40060 + Model "assasin_capoeira1.GR2" + SourceSkin "assasin_capoeira1.dds" + TargetSkin "assasin_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40120 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40122 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40124 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40126 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40128 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40130 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40132 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40134 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40136 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40138 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40140 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40142 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40144 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40146 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40148 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40150 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40152 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40154 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40156 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40158 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40160 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40162 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40164 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40166 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40168 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40170 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40172 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40174 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40176 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40178 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40180 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40182 + Model "assasin_soccer1_Germany.GR2" + SourceSkin "assasin_soccer1_Germany.dds" + TargetSkin "assassin_WC32.dds" + } + +} + +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 90.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 90.000000 + } + } +} diff --git a/root/assassin_w.msm b/root/assassin_w.msm new file mode 100644 index 0000000..e3d1a34 --- /dev/null +++ b/root/assassin_w.msm @@ -0,0 +1,1627 @@ +ScriptType RaceDataScript + +BaseModelFileName "D:/YMIR WORK/pc/assassin/assassin_novice.GR2" + + +Group HairData +{ + PathName "d:/ymir Work/pc/assassin/" + + HairDataCount 75 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "assassin_hair_01.dds" + TargetSkin "assassin_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 2001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 2002 + Model "hair/hair_2_2.gr2" + SourceSkin "hair/hair_2_2.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 2003 + Model "hair/hair_2_3.gr2" + SourceSkin "hair/hair_2_3.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 2004 + Model "hair/hair_2_4.gr2" + SourceSkin "hair/hair_2_4.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 2005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 2006 + Model "hair/hair_3_2.gr2" + SourceSkin "hair/hair_3_2.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 2007 + Model "hair/hair_3_3.gr2" + SourceSkin "hair/hair_3_3.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 2008 + Model "hair/hair_3_4.gr2" + SourceSkin "hair/hair_3_4.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 2009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 2010 + Model "hair/hair_4_2.gr2" + SourceSkin "hair/hair_4_2.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 2011 + Model "hair/hair_4_3.gr2" + SourceSkin "hair/hair_4_3.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 2012 + Model "hair/hair_4_4.gr2" + SourceSkin "hair/hair_4_4.dds" + TargetSkin "hair/hair_4_4.dds" + } + + Group HairData18 + { + HairIndex 2013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 2014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 2015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 2016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + HairIndex 2017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + HairIndex 2018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + Group HairData26 + { + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + Group HairData27 + { + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + Group HairData29 + { + HairIndex 5006 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_2.dds" + } + Group HairData30 + { + HairIndex 5007 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_3.dds" + } + Group HairData31 + { + HairIndex 5008 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_4.dds" + } + Group HairData32 + { + HairIndex 5009 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_5.dds" + } + Group HairData33 + { + HairIndex 5010 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_6.dds" + } + Group HairData34 + { + HairIndex 5011 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_7.dds" + } + Group HairData35 + { + HairIndex 5012 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_8.dds" + } + Group HairData36 + { + HairIndex 5013 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_9.dds" + } + Group HairData37 + { + HairIndex 5014 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_2.dds" + } + Group HairData38 + { + HairIndex 5015 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_3.dds" + } + Group HairData39 + { + HairIndex 5016 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_4.dds" + } + Group HairData40 + { + HairIndex 5017 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_5.dds" + } + Group HairData41 + { + HairIndex 5018 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_6.dds" + } + Group HairData42 + { + HairIndex 5019 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_7.dds" + } + Group HairData43 + { + HairIndex 5020 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_8.dds" + } + Group HairData44 + { + HairIndex 5021 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_9.dds" + } + Group HairData45 + { + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData46 + { + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + Group HairData47 + { + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + Group HairData48 + { + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData49 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData50 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData51 + { + HairIndex 5034 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData52 + { + HairIndex 5036 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData53 + { + HairIndex 5038 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData54 + { + HairIndex 5040 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData55 + { + HairIndex 5042 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData56 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData57 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData58 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData59 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData60 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData61 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData62 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData63 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData64 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData65 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData66 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData67 + { + HairIndex 5056 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData68 + { + HairIndex 5058 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData69 + { + HairIndex 5060 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData70 + { + HairIndex 5062 + Model "hair/hair_35_1.gr2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData71 + { + HairIndex 5063 + Model "hair/hair_37_1.gr2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + Group HairData72 + { + HairIndex 5064 + Model "hair/hair_36_1.gr2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + Group HairData73 + { + HairIndex 5065 + Model "hair/hair_38_1.gr2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + Group HairData74 + { + HairIndex 5022 + Model "hair/hair_12_1.gr2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } + +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc/assassin/" + + ShapeDataCount 146 + + Group ShapeData00 + { + ShapeIndex 0 + + Model "assassin_novice.GR2" + SourceSkin "assassin_novice_red.dds" + TargetSkin "assassin_novice_red.dds" + } + Group ShapeData01 + { + ShapeIndex 1 + + Model "assassin_novice.GR2" + SourceSkin "assassin_novice_red.dds" + TargetSkin "assassin_novice_green.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_tanma.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_geukseom.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_dahong.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_biyeong.DDS" + } + Group ShapeData06 + { + ShapeIndex 7 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_yeongrin.DDS" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_jeoksal.DDS" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_yonga.DDS" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_salpung.DDS" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "assassin_bihyeon.GR2" + SourceSkin "assassin_bihyeon.DDS" + TargetSkin "assassin_bihyeon.DDS" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir work/pc/assassin/" + + ShapeIndex 201 + Model "assassin_marry_01.GR2" + SourceSkin "assassin_marry_01.dds" + TargetSkin "assassin_marry_01.dds" + } + Group ShapeData16 + { + ShapeIndex 12 + Model "assassin_4-1.GR2" + SourceSkin "assassin_4-1.DDS" + TargetSkin "assassin_4-1.DDS" + } + Group ShapeData17 + { + ShapeIndex 24 + Model "assassin_lord.GR2" + SourceSkin "assassin_queen01.dds" + TargetSkin "assassin_queen01.dds" + } + Group ShapeData18 + { + ShapeIndex 14 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-1_tanma_a.DDS" + } + Group ShapeData19 + { + ShapeIndex 15 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-2_geukseom_a.DDS" + } + Group ShapeData20 + { + ShapeIndex 16 + Model "assassin_tanma.GR2" + SourceSkin "assassin_tanma.DDS" + TargetSkin "assassin_1-3_dahong_a.DDS" + } + Group ShapeData21 + { + ShapeIndex 17 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-1_biyeong_a.DDS" + } + Group ShapeData22 + { + ShapeIndex 18 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-2_yeongrin_a.DDS" + } + Group ShapeData23 + { + ShapeIndex 19 + Model "assassin_biyeong.GR2" + SourceSkin "assassin_biyeong.DDS" + TargetSkin "assassin_2-3_jeoksal_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 20 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_3-1_yonga_a.DDS" + } + Group ShapeData25 + { + ShapeIndex 21 + Model "assassin_yonga.GR2" + SourceSkin "assassin_yonga.DDS" + TargetSkin "assassin_salpung_a.dds" + } + Group ShapeData26 + { + ShapeIndex 25 + Model "assassin_lord.GR2" + SourceSkin "assassin_queen01.dds" + TargetSkin "assassin_queen02.dds" + } + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc/assassin/" + + ShapeIndex 26 + Model "assassin_4-1.GR2" + SourceSkin "assassin_4-1.dds" + TargetSkin "assassin_4-2.dds" + } + Group ShapeData28 + { + + ShapeIndex 27 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "assassin_event1.GR2" + SourceSkin "assassin_event1_yellow.dds" + TargetSkin "assassin_event1_blue.dds" + + } + + Group ShapeData31 + { + ShapeIndex 30 + Model "assassin_tanma.gr2" + SourceSkin "assassin_tanma.dds" + TargetSkin "assassin_costume1.dds" + } + Group ShapeData32 + { + ShapeIndex 40031 + Model "assassin_rabbit1.gr2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1.dds" + } + Group ShapeData33 + { + + ShapeIndex 40033 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_London.dds" + } + Group ShapeData34 + { + ShapeIndex 40034 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Germany.dds" + } + Group ShapeData35 + { + ShapeIndex 40035 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Turkey.dds" + } + Group ShapeData36 + { + ShapeIndex 40036 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Brazil.dds" + } + Group ShapeData37 + { + ShapeIndex 40037 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_London.dds" + } + Group ShapeData38 + { + ShapeIndex 40038 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Germany.dds" + } + Group ShapeData39 + { + ShapeIndex 40039 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Turkey.dds" + } + Group ShapeData40 + { + ShapeIndex 40040 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Brazil.dds" + } + Group ShapeData41 + { + ShapeIndex 40041 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_London.dds" + } + Group ShapeData42 + { + ShapeIndex 40042 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Germany.dds" + } + Group ShapeData43 + { + ShapeIndex 40043 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Turkey.dds" + } + Group ShapeData44 + { + ShapeIndex 40044 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Brazil.dds" + } + Group ShapeData45 + { + ShapeIndex 40032 + Model "assassin_assasin1.gr2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assasin1.dds" + } + Group ShapeData46 + { + ShapeIndex 40045 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_France.dds" + } + Group ShapeData47 + { + ShapeIndex 40046 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Italy.dds" + } + Group ShapeData48 + { + ShapeIndex 40047 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Poland.dds" + } + Group ShapeData49 + { + ShapeIndex 40048 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Romania.dds" + } + Group ShapeData50 + { + ShapeIndex 40049 + Model "assassin_fencing1_Germany.GR2" + SourceSkin "assassin_fencing1_Germany.dds" + TargetSkin "assassin_fencing1_Spain.dds" + } + + Group ShapeData51 + { + ShapeIndex 40050 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_France.dds" + } + Group ShapeData52 + { + ShapeIndex 40051 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Italy.dds" + } + Group ShapeData53 + { + ShapeIndex 40052 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Poland.dds" + } + Group ShapeData54 + { + ShapeIndex 40053 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Romania.dds" + } + Group ShapeData55 + { + ShapeIndex 40054 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_soccer1_Spain.dds" + } + Group ShapeData56 + { + ShapeIndex 40055 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_France.dds" + } + Group ShapeData57 + { + ShapeIndex 40056 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Italy.dds" + } + Group ShapeData58 + { + ShapeIndex 40057 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Poland.dds" + } + Group ShapeData59 + { + ShapeIndex 40058 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Romania.dds" + } + Group ShapeData60 + { + ShapeIndex 40059 + Model "assassin_boxing1_Germany.gr2" + SourceSkin "assassin_boxing1_Germany.dds" + TargetSkin "assassin_boxing1_Spain.dds" + } + Group ShapeData61 + { + ShapeIndex 40065 + Model "assassin_halloween1.gr2" + SourceSkin "assassin_halloween1.dds" + TargetSkin "assassin_halloween1.dds" + } + Group ShapeData62 + { + ShapeIndex 13 + Model "assassin_5_1.GR2" + SourceSkin "assassin_5_1.DDS" + TargetSkin "assassin_5_1.DDS" + } + Group ShapeData63 + { + ShapeIndex 40062 + Model "assassin_salsa1.GR2" + SourceSkin "assassin_salsa1.dds" + TargetSkin "assassin_salsa1.dds" + } + Group ShapeData64 + { + ShapeIndex 40063 + Model "assassin_Springwear1.GR2" + SourceSkin "assassin_Springwear1.dds" + TargetSkin "assassin_Springwear1.dds" + } + Group ShapeData65 + { + ShapeIndex 40061 + Model "assassin_tailcoat1.gr2" + SourceSkin "assassin_tailcoat1.dds" + TargetSkin "assassin_tailcoat1.ddsS" + } + Group ShapeData66 + { + ShapeIndex 40069 + Model "assassin_deer1.gr2" + SourceSkin "assassin_deer1.dds" + TargetSkin "assassin_deer1.dds" + } + Group ShapeData67 + { + ShapeIndex 40066 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_red.dds" + } + Group ShapeData68 + { + ShapeIndex 40067 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_green.dds" + } + Group ShapeData69 + { + ShapeIndex 40068 + Model "assassin_santa1_black.gr2" + SourceSkin "assassin_santa1_black.dds" + TargetSkin "assassin_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "assassin_samurai1.GR2" + SourceSkin "assassin_samurai1.dds" + TargetSkin "assassin_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "assassin_rabbit1.GR2" + SourceSkin "assassin_rabbit1.dds" + TargetSkin "assassin_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "assassin_BlackSnake1.GR2" + SourceSkin "assassin_BlackSnake1.dds" + TargetSkin "assassin_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "assassin_BlackSnake1.GR2" + SourceSkin "assassin_BlackSnake1.dds" + TargetSkin "assassin_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40113 + Model "assassin_assasin1.GR2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assasin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40115 + Model "assassin_pwahuang1.GR2" + SourceSkin "assassin_pwahuang1.dds" + TargetSkin "assassin_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40117 + Model "assassin_halloween2.GR2" + SourceSkin "assassin_halloween2.dds" + TargetSkin "assassin_halloween2.dds" + } + Group ShapeData112 + { + ShapeIndex 40119 + Model "assassin_assasin1.gr2" + SourceSkin "assassin_assasin1.dds" + TargetSkin "assassin_assassin3.dds" + } + Group ShapeData113 + { + ShapeIndex 40060 + Model "assasin_capoeira1.GR2" + SourceSkin "assasin_capoeira1.dds" + TargetSkin "assasin_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40121 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40123 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40125 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40127 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40129 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40131 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40133 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40135 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40137 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40139 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40141 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40143 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40145 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40147 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40149 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40151 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40153 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40155 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40157 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40159 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40161 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40163 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40165 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40167 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40169 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40171 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40173 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40175 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40177 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40179 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40181 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40183 + Model "assassin_soccer1_Germany.GR2" + SourceSkin "assassin_soccer1_Germany.dds" + TargetSkin "assassin_WC32.dds" + } + +} + +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 90.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 90.000000 + } + } +} diff --git a/root/atlasinfo.txt b/root/atlasinfo.txt new file mode 100644 index 0000000..d33f65d --- /dev/null +++ b/root/atlasinfo.txt @@ -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 \ No newline at end of file diff --git a/root/colorinfo.py b/root/colorinfo.py new file mode 100644 index 0000000..76de6f1 --- /dev/null +++ b/root/colorinfo.py @@ -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) diff --git a/root/consolemodule.py b/root/consolemodule.py new file mode 100644 index 0000000..8e8968f --- /dev/null +++ b/root/consolemodule.py @@ -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() diff --git a/root/constinfo.py b/root/constinfo.py new file mode 100644 index 0000000..3346b3f --- /dev/null +++ b/root/constinfo.py @@ -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) + diff --git a/root/debuginfo.py b/root/debuginfo.py new file mode 100644 index 0000000..d2bfd71 --- /dev/null +++ b/root/debuginfo.py @@ -0,0 +1,10 @@ +g_isDebugMode=0 + +def SetDebugMode(isDebugMode): + global g_isDebugMode + g_isDebugMode=isDebugMode + +def IsDebugMode(): + global g_isDebugMode + return g_isDebugMode + diff --git a/root/dragon_soul_refine_settings.py b/root/dragon_soul_refine_settings.py new file mode 100644 index 0000000..9ee76a7 --- /dev/null +++ b/root/dragon_soul_refine_settings.py @@ -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, +} + diff --git a/root/emotion.py b/root/emotion.py new file mode 100644 index 0000000..4f10e6a --- /dev/null +++ b/root/emotion.py @@ -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) + diff --git a/root/exception.py b/root/exception.py new file mode 100644 index 0000000..29933fb --- /dev/null +++ b/root/exception.py @@ -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 diff --git a/root/game.py b/root/game.py new file mode 100644 index 0000000..a098406 --- /dev/null +++ b/root/game.py @@ -0,0 +1,2183 @@ +import os +import app +import dbg +import grp +import item +import background +import chr +import chrmgr +import player +import snd +import chat +import textTail +import snd +import net +import effect +import wndMgr +import fly +import systemSetting +import quest +import guild +import skill +import messenger +import localeInfo +import constInfo +import exchange +import ime + +import ui +import uiCommon +import uiPhaseCurtain +import uiMapNameShower +import uiAffectShower +import uiPlayerGauge +import uiCharacter +import uiTarget + +# PRIVATE_SHOP_PRICE_LIST +import uiPrivateShopBuilder +# END_OF_PRIVATE_SHOP_PRICE_LIST + +import mouseModule +import consoleModule +import localeInfo + +import playerSettingModule +import interfaceModule + +import musicInfo +import debugInfo +import stringCommander + +from _weakref import proxy + +# TEXTTAIL_LIVINGTIME_CONTROL +#if localeInfo.IsJAPAN(): +# app.SetTextTailLivingTime(8.0) +# END_OF_TEXTTAIL_LIVINGTIME_CONTROL + +# SCREENSHOT_CWDSAVE +SCREENSHOT_CWDSAVE = False +SCREENSHOT_DIR = None + +if localeInfo.IsEUROPE(): + SCREENSHOT_CWDSAVE = True + +if localeInfo.IsCIBN10(): + SCREENSHOT_CWDSAVE = False + SCREENSHOT_DIR = "YT2W" + +cameraDistance = 1550.0 +cameraPitch = 27.0 +cameraRotation = 0.0 +cameraHeight = 100.0 + +testAlignment = 0 + +class GameWindow(ui.ScriptWindow): + def __init__(self, stream): + ui.ScriptWindow.__init__(self, "GAME") + self.SetWindowName("game") + net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self) + player.SetGameWindow(self) + + self.quickSlotPageIndex = 0 + self.lastPKModeSendedTime = 0 + self.pressNumber = None + + self.guildWarQuestionDialog = None + self.interface = None + self.targetBoard = None + self.console = None + self.mapNameShower = None + self.affectShower = None + self.playerGauge = None + + self.stream=stream + self.interface = interfaceModule.Interface() + self.interface.MakeInterface() + self.interface.ShowDefaultWindows() + + self.curtain = uiPhaseCurtain.PhaseCurtain() + self.curtain.speed = 0.03 + self.curtain.Hide() + + self.targetBoard = uiTarget.TargetBoard() + self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog)) + self.targetBoard.Hide() + + self.console = consoleModule.ConsoleWindow() + self.console.BindGameClass(self) + self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200) + self.console.Hide() + + self.mapNameShower = uiMapNameShower.MapNameShower() + self.affectShower = uiAffectShower.AffectShower() + + self.playerGauge = uiPlayerGauge.PlayerGauge(self) + self.playerGauge.Hide() + + #wj 2014.1.2. ESC虐甫 穿甫 矫 快急利栏肺 DropQuestionDialog甫 掺档废 父甸菌促. 窍瘤父 贸澜俊 itemDropQuestionDialog啊 急攫登绢 乐瘤 臼酒 ERROR啊 惯积窍咯 init俊辑 急攫苞 悼矫俊 檬扁拳 矫糯. + self.itemDropQuestionDialog = None + + self.__SetQuickSlotMode() + + self.__ServerCommand_Build() + self.__ProcessPreservedServerCommand() + + def __del__(self): + player.SetGameWindow(0) + net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self) + ui.ScriptWindow.__del__(self) + + def Open(self): + app.SetFrameSkip(1) + + self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) + + self.quickSlotPageIndex = 0 + self.PickingCharacterIndex = -1 + self.PickingItemIndex = -1 + self.consoleEnable = False + self.isShowDebugInfo = False + self.ShowNameFlag = False + + self.enableXMasBoom = False + self.startTimeXMasBoom = 0.0 + self.indexXMasBoom = 0 + + global cameraDistance, cameraPitch, cameraRotation, cameraHeight + + app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight) + + constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE() + constInfo.SET_DEFAULT_CHRNAME_COLOR() + constInfo.SET_DEFAULT_FOG_LEVEL() + constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE() + constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS() + constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE() + + # TWO_HANDED_WEAPON_ATTACK_SPEED_UP + constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE() + # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP + + import event + event.SetLeftTimeString(localeInfo.UI_LEFT_TIME) + + textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE) + + if constInfo.PVPMODE_TEST_ENABLE: + self.testPKMode = ui.TextLine() + self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT) + self.testPKMode.SetPosition(0, 15) + self.testPKMode.SetWindowHorizontalAlignCenter() + self.testPKMode.SetHorizontalAlignCenter() + self.testPKMode.SetFeather() + self.testPKMode.SetOutline() + self.testPKMode.Show() + + self.testAlignment = ui.TextLine() + self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT) + self.testAlignment.SetPosition(0, 35) + self.testAlignment.SetWindowHorizontalAlignCenter() + self.testAlignment.SetHorizontalAlignCenter() + self.testAlignment.SetFeather() + self.testAlignment.SetOutline() + self.testAlignment.Show() + + self.__BuildKeyDict() + self.__BuildDebugInfo() + + # PRIVATE_SHOP_PRICE_LIST + uiPrivateShopBuilder.Clear() + # END_OF_PRIVATE_SHOP_PRICE_LIST + + # UNKNOWN_UPDATE + exchange.InitTrading() + # END_OF_UNKNOWN_UPDATE + + if debugInfo.IsDebugMode(): + self.ToggleDebugInfo() + + ## Sound + snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume()) + snd.SetSoundVolume(systemSetting.GetSoundVolume()) + + netFieldMusicFileName = net.GetFieldMusicFileName() + if netFieldMusicFileName: + snd.FadeInMusic("BGM/" + netFieldMusicFileName) + elif musicInfo.fieldMusic != "": + snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) + + self.__SetQuickSlotMode() + self.__SelectQuickPage(self.quickSlotPageIndex) + + self.SetFocus() + self.Show() + app.ShowCursor() + + net.SendEnterGamePacket() + + # START_GAME_ERROR_EXIT + try: + self.StartGame() + except: + import exception + exception.Abort("GameWindow.Open") + # END_OF_START_GAME_ERROR_EXIT + + # NPC啊 钮宏矫胶袍栏肺 父甸 荐 乐绰 酒捞袍甸狼 格废阑 某教 + # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ] + self.cubeInformation = {} + self.currentCubeNPC = 0 + + def Close(self): + self.Hide() + + global cameraDistance, cameraPitch, cameraRotation, cameraHeight + (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera() + + if musicInfo.fieldMusic != "": + snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic) + + self.onPressKeyDict = None + self.onClickKeyDict = None + + chat.Close() + snd.StopAllSound() + grp.InitScreenEffect() + chr.Destroy() + textTail.Clear() + quest.Clear() + background.Destroy() + guild.Destroy() + messenger.Destroy() + skill.ClearSkillData() + wndMgr.Unlock() + mouseModule.mouseController.DeattachObject() + + if self.guildWarQuestionDialog: + self.guildWarQuestionDialog.Close() + + self.guildNameBoard = None + self.partyRequestQuestionDialog = None + self.partyInviteQuestionDialog = None + self.guildInviteQuestionDialog = None + self.guildWarQuestionDialog = None + self.messengerAddFriendQuestion = None + + # UNKNOWN_UPDATE + self.itemDropQuestionDialog = None + # END_OF_UNKNOWN_UPDATE + + # QUEST_CONFIRM + self.confirmDialog = None + # END_OF_QUEST_CONFIRM + + self.PrintCoord = None + self.FrameRate = None + self.Pitch = None + self.Splat = None + self.TextureNum = None + self.ObjectNum = None + self.ViewDistance = None + self.PrintMousePos = None + + self.ClearDictionary() + + self.playerGauge = None + self.mapNameShower = None + self.affectShower = None + + if self.console: + self.console.BindGameClass(0) + self.console.Close() + self.console=None + + if self.targetBoard: + self.targetBoard.Destroy() + self.targetBoard = None + + if self.interface: + self.interface.HideAllWindows() + self.interface.Close() + self.interface=None + + player.ClearSkillDict() + player.ResetCameraRotation() + + self.KillFocus() + app.HideCursor() + + print "---------------------------------------------------------------------------- CLOSE GAME WINDOW" + + def __BuildKeyDict(self): + onPressKeyDict = {} + + ##PressKey 绰 穿福绊 乐绰 悼救 拌加 利侩登绰 虐捞促. + + ## 箭磊 窜绵虐 狞浇吩俊 捞侩等促.(捞饶 箭磊甸档 狞 浇吩侩 抗距) + ## F12 绰 努扼 叼滚弊侩 虐捞骨肺 静瘤 臼绰 霸 亮促. + onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1) + onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2) + onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3) + onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4) + onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5) + onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6) + onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7) + onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8) + onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9) + onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4) + onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5) + onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6) + onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7) + + onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName() + onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage() + onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen() + onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack() + + #某腐磐 捞悼虐 + onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp() + onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown() + onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft() + onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight() + onPressKeyDict[app.DIK_W] = lambda : self.MoveUp() + onPressKeyDict[app.DIK_S] = lambda : self.MoveDown() + onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft() + onPressKeyDict[app.DIK_D] = lambda : self.MoveRight() + + onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE) + onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE) + #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE) + onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE) + onPressKeyDict[app.DIK_G] = self.__PressGKey + onPressKeyDict[app.DIK_Q] = self.__PressQKey + + onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera() + onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE) + onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE) + onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE) + onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE) + onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE) + onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE) + onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem() + onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem() + onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state) + onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state) + #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state) + onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state) + onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow() + onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo() + onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey() + #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow() + onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp() + onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown() + onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow() + onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key + onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode() + + onPressKeyDict[app.DIK_J] = lambda : self.__PressJKey() + onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey() + onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey() + onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey() + + # CUBE_TEST + #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow() + # CUBE_TEST_END + + self.onPressKeyDict = onPressKeyDict + + onClickKeyDict = {} + onClickKeyDict[app.DIK_UP] = lambda : self.StopUp() + onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown() + onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft() + onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight() + onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack() + + onClickKeyDict[app.DIK_W] = lambda : self.StopUp() + onClickKeyDict[app.DIK_S] = lambda : self.StopDown() + onClickKeyDict[app.DIK_A] = lambda : self.StopLeft() + onClickKeyDict[app.DIK_D] = lambda : self.StopRight() + onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey() + onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP) + onClickKeyDict[app.DIK_LALT] = lambda: self.HideName() + onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage() + onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode() + + #if constInfo.PVPMODE_ACCELKEY_ENABLE: + # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode() + + self.onClickKeyDict=onClickKeyDict + + def __PressNumKey(self,num): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + + if num >= 1 and num <= 9: + if(chrmgr.IsPossibleEmoticon(-1)): + chrmgr.SetEmoticon(-1,int(num)-1) + net.SendEmoticon(int(num)-1) + else: + if num >= 1 and num <= 4: + self.pressNumber(num-1) + + def __ClickBKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + return + else: + if constInfo.PVPMODE_ACCELKEY_ENABLE: + self.ChangePKMode() + + + def __PressJKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + if player.IsMountingHorse(): + net.SendChatPacket("/unmount") + else: + #net.SendChatPacket("/user_horse_ride") + if not uiPrivateShopBuilder.IsBuildingPrivateShop(): + for i in xrange(player.INVENTORY_PAGE_SIZE): + if player.GetItemIndex(i) in (71114, 71116, 71118, 71120): + net.SendItemUsePacket(i) + break + def __PressHKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + net.SendChatPacket("/user_horse_ride") + else: + self.interface.OpenHelpWindow() + + def __PressBKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + net.SendChatPacket("/user_horse_back") + else: + state = "EMOTICON" + self.interface.ToggleCharacterWindow(state) + + def __PressFKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + net.SendChatPacket("/user_horse_feed") + else: + app.ZoomCamera(app.CAMERA_TO_POSITIVE) + + def __PressGKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + net.SendChatPacket("/ride") + else: + if self.ShowNameFlag: + self.interface.ToggleGuildWindow() + else: + app.PitchCamera(app.CAMERA_TO_POSITIVE) + + def __ReleaseGKey(self): + app.PitchCamera(app.CAMERA_STOP) + + def __PressQKey(self): + if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): + if 0==interfaceModule.IsQBHide: + interfaceModule.IsQBHide = 1 + self.interface.HideAllQuestButton() + else: + interfaceModule.IsQBHide = 0 + self.interface.ShowAllQuestButton() + else: + app.RotateCamera(app.CAMERA_TO_NEGATIVE) + + def __SetQuickSlotMode(self): + self.pressNumber=ui.__mem_func__(self.__PressQuickSlot) + + def __SetQuickPageMode(self): + self.pressNumber=ui.__mem_func__(self.__SelectQuickPage) + + def __PressQuickSlot(self, localSlotIndex): + if localeInfo.IsARABIC(): + if 0 <= localSlotIndex and localSlotIndex < 4: + player.RequestUseLocalQuickSlot(3-localSlotIndex) + else: + player.RequestUseLocalQuickSlot(11-localSlotIndex) + else: + player.RequestUseLocalQuickSlot(localSlotIndex) + + def __SelectQuickPage(self, pageIndex): + self.quickSlotPageIndex = pageIndex + player.SetQuickPage(pageIndex) + + def ToggleDebugInfo(self): + self.isShowDebugInfo = not self.isShowDebugInfo + + if self.isShowDebugInfo: + self.PrintCoord.Show() + self.FrameRate.Show() + self.Pitch.Show() + self.Splat.Show() + self.TextureNum.Show() + self.ObjectNum.Show() + self.ViewDistance.Show() + self.PrintMousePos.Show() + else: + self.PrintCoord.Hide() + self.FrameRate.Hide() + self.Pitch.Hide() + self.Splat.Hide() + self.TextureNum.Hide() + self.ObjectNum.Hide() + self.ViewDistance.Hide() + self.PrintMousePos.Hide() + + def __BuildDebugInfo(self): + ## Character Position Coordinate + self.PrintCoord = ui.TextLine() + self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT) + self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0) + + ## Frame Rate + self.FrameRate = ui.TextLine() + self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT) + self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20) + + ## Camera Pitch + self.Pitch = ui.TextLine() + self.Pitch.SetFontName(localeInfo.UI_DEF_FONT) + self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40) + + ## Splat + self.Splat = ui.TextLine() + self.Splat.SetFontName(localeInfo.UI_DEF_FONT) + self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60) + + ## + self.PrintMousePos = ui.TextLine() + self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT) + self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80) + + # TextureNum + self.TextureNum = ui.TextLine() + self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT) + self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100) + + # 坷宏璃飘 弊府绰 俺荐 + self.ObjectNum = ui.TextLine() + self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT) + self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120) + + # 矫具芭府 + self.ViewDistance = ui.TextLine() + self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT) + self.ViewDistance.SetPosition(0, 0) + + def __NotifyError(self, msg): + chat.AppendChat(chat.CHAT_TYPE_INFO, msg) + + def ChangePKMode(self): + + if not app.IsPressed(app.DIK_LCONTROL): + return + + if player.GetStatus(player.LEVEL) 5000: + answer = False + + net.SendPartyInviteAnswerPacket(partyLeaderVID, answer) + + self.partyInviteQuestionDialog.Close() + self.partyInviteQuestionDialog = None + + def AddPartyMember(self, pid, name): + self.interface.AddPartyMember(pid, name) + + def UpdatePartyMemberInfo(self, pid): + self.interface.UpdatePartyMemberInfo(pid) + + def RemovePartyMember(self, pid): + self.interface.RemovePartyMember(pid) + self.__RefreshTargetBoard() + + def LinkPartyMember(self, pid, vid): + self.interface.LinkPartyMember(pid, vid) + + def UnlinkPartyMember(self, pid): + self.interface.UnlinkPartyMember(pid) + + def UnlinkAllPartyMember(self): + self.interface.UnlinkAllPartyMember() + + def ExitParty(self): + self.interface.ExitParty() + self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID()) + + def ChangePartyParameter(self, distributionMode): + self.interface.ChangePartyParameter(distributionMode) + + ## Messenger + def OnMessengerAddFriendQuestion(self, name): + messengerAddFriendQuestion = uiCommon.QuestionDialog2() + messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name)) + messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2) + messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend)) + messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend)) + messengerAddFriendQuestion.Open() + messengerAddFriendQuestion.name = name + self.messengerAddFriendQuestion = messengerAddFriendQuestion + + def OnAcceptAddFriend(self): + name = self.messengerAddFriendQuestion.name + net.SendChatPacket("/messenger_auth y " + name) + self.OnCloseAddFriendQuestionDialog() + return True + + def OnDenyAddFriend(self): + name = self.messengerAddFriendQuestion.name + net.SendChatPacket("/messenger_auth n " + name) + self.OnCloseAddFriendQuestionDialog() + return True + + def OnCloseAddFriendQuestionDialog(self): + self.messengerAddFriendQuestion.Close() + self.messengerAddFriendQuestion = None + return True + + ## SafeBox + def OpenSafeboxWindow(self, size): + self.interface.OpenSafeboxWindow(size) + + def RefreshSafebox(self): + self.interface.RefreshSafebox() + + def RefreshSafeboxMoney(self): + self.interface.RefreshSafeboxMoney() + + # ITEM_MALL + def OpenMallWindow(self, size): + self.interface.OpenMallWindow(size) + + def RefreshMall(self): + self.interface.RefreshMall() + # END_OF_ITEM_MALL + + ## Guild + def RecvGuildInviteQuestion(self, guildID, guildName): + guildInviteQuestionDialog = uiCommon.QuestionDialog() + guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN) + guildInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerGuildInvite(arg)) + guildInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerGuildInvite(arg)) + guildInviteQuestionDialog.Open() + guildInviteQuestionDialog.guildID = guildID + self.guildInviteQuestionDialog = guildInviteQuestionDialog + + def AnswerGuildInvite(self, answer): + + if not self.guildInviteQuestionDialog: + return + + guildLeaderVID = self.guildInviteQuestionDialog.guildID + net.SendGuildInviteAnswerPacket(guildLeaderVID, answer) + + self.guildInviteQuestionDialog.Close() + self.guildInviteQuestionDialog = None + + + def DeleteGuild(self): + self.interface.DeleteGuild() + + ## Clock + def ShowClock(self, second): + self.interface.ShowClock(second) + + def HideClock(self): + self.interface.HideClock() + + ## Emotion + def BINARY_ActEmotion(self, emotionIndex): + if self.interface.wndCharacter: + self.interface.wndCharacter.ActEmotion(emotionIndex) + + ############################################################################################### + ############################################################################################### + ## Keyboard Functions + + def CheckFocus(self): + if False == self.IsFocus(): + if True == self.interface.IsOpenChat(): + self.interface.ToggleChat() + + self.SetFocus() + + def SaveScreen(self): + print "save screen" + + # SCREENSHOT_CWDSAVE + if SCREENSHOT_CWDSAVE: + if not os.path.exists(os.getcwd()+os.sep+"screenshot"): + os.mkdir(os.getcwd()+os.sep+"screenshot") + + (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep) + elif SCREENSHOT_DIR: + (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR) + else: + (succeeded, name) = grp.SaveScreenShot() + # END_OF_SCREENSHOT_CWDSAVE + + if succeeded: + pass + """ + chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1) + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2) + """ + else: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE) + + def ShowConsole(self): + if debugInfo.IsDebugMode() or True == self.consoleEnable: + player.EndKeyWalkingImmediately() + self.console.OpenWindow() + + def ShowName(self): + self.ShowNameFlag = True + self.playerGauge.EnableShowAlways() + player.SetQuickPage(self.quickSlotPageIndex+1) + + # ADD_ALWAYS_SHOW_NAME + def __IsShowName(self): + + if systemSetting.IsAlwaysShowName(): + return True + + if self.ShowNameFlag: + return True + + return False + # END_OF_ADD_ALWAYS_SHOW_NAME + + def HideName(self): + self.ShowNameFlag = False + self.playerGauge.DisableShowAlways() + player.SetQuickPage(self.quickSlotPageIndex) + + def ShowMouseImage(self): + self.interface.ShowMouseImage() + + def HideMouseImage(self): + self.interface.HideMouseImage() + + def StartAttack(self): + player.SetAttackKeyState(True) + + def EndAttack(self): + player.SetAttackKeyState(False) + + def MoveUp(self): + player.SetSingleDIKKeyState(app.DIK_UP, True) + + def MoveDown(self): + player.SetSingleDIKKeyState(app.DIK_DOWN, True) + + def MoveLeft(self): + player.SetSingleDIKKeyState(app.DIK_LEFT, True) + + def MoveRight(self): + player.SetSingleDIKKeyState(app.DIK_RIGHT, True) + + def StopUp(self): + player.SetSingleDIKKeyState(app.DIK_UP, False) + + def StopDown(self): + player.SetSingleDIKKeyState(app.DIK_DOWN, False) + + def StopLeft(self): + player.SetSingleDIKKeyState(app.DIK_LEFT, False) + + def StopRight(self): + player.SetSingleDIKKeyState(app.DIK_RIGHT, False) + + def PickUpItem(self): + player.PickCloseItem() + + ############################################################################################### + ############################################################################################### + ## Event Handler + + def OnKeyDown(self, key): + if self.interface.wndWeb and self.interface.wndWeb.IsShow(): + return + + if key == app.DIK_ESC: + self.RequestDropItem(False) + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) + + try: + self.onPressKeyDict[key]() + except KeyError: + pass + except: + raise + + return True + + def OnKeyUp(self, key): + try: + self.onClickKeyDict[key]() + except KeyError: + pass + except: + raise + + return True + + def OnMouseLeftButtonDown(self): + if self.interface.BUILD_OnMouseLeftButtonDown(): + return + + if mouseModule.mouseController.isAttached(): + self.CheckFocus() + else: + hyperlink = ui.GetHyperlink() + if hyperlink: + return + else: + self.CheckFocus() + player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS); + + return True + + def OnMouseLeftButtonUp(self): + + if self.interface.BUILD_OnMouseLeftButtonUp(): + return + + if mouseModule.mouseController.isAttached(): + + attachedType = mouseModule.mouseController.GetAttachedType() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + + ## QuickSlot + if player.SLOT_TYPE_QUICK_SLOT == attachedType: + player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos) + + ## Inventory + elif player.SLOT_TYPE_INVENTORY == attachedType: + + if player.ITEM_MONEY == attachedItemIndex: + self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex) + else: + self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex) + + ## DragonSoul + elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType: + self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex) + + mouseModule.mouseController.DeattachObject() + + else: + hyperlink = ui.GetHyperlink() + if hyperlink: + if app.IsPressed(app.DIK_LALT): + link = chat.GetLinkFromHyperlink(hyperlink) + ime.PasteString(link) + else: + self.interface.MakeHyperlinkTooltip(hyperlink) + return + else: + player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK) + + #player.EndMouseWalking() + return True + + def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID): + if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType: + attachedInvenType = player.SlotTypeToInvenType(attachedType) + if True == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID: + if player.IsEquipmentSlot(attachedItemSlotPos) and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType: + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK) + else: + if chr.IsNPC(dstChrID): + net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount) + else: + net.SendExchangeStartPacket(dstChrID) + net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0) + else: + self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount) + + def __PutMoney(self, attachedType, attachedMoney, dstChrID): + if True == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID: + net.SendExchangeStartPacket(dstChrID) + net.SendExchangeElkAddPacket(attachedMoney) + else: + self.__DropMoney(attachedType, attachedMoney) + + def __DropMoney(self, attachedType, attachedMoney): + # PRIVATESHOP_DISABLE_ITEM_DROP - 俺牢惑痢 凯绊 乐绰 悼救 酒捞袍 滚覆 规瘤 + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) + return + # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP + + if attachedMoney>=1000: + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK) + return + + itemDropQuestionDialog = uiCommon.QuestionDialog() + itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney)) + itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) + itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) + itemDropQuestionDialog.Open() + itemDropQuestionDialog.dropType = attachedType + itemDropQuestionDialog.dropCount = attachedMoney + itemDropQuestionDialog.dropNumber = player.ITEM_MONEY + self.itemDropQuestionDialog = itemDropQuestionDialog + + def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount): + # PRIVATESHOP_DISABLE_ITEM_DROP - 俺牢惑痢 凯绊 乐绰 悼救 酒捞袍 滚覆 规瘤 + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) + return + # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP + + if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos): + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK) + + else: + if player.SLOT_TYPE_INVENTORY == attachedType: + dropItemIndex = player.GetItemIndex(attachedItemSlotPos) + + item.SelectItem(dropItemIndex) + dropItemName = item.GetItemName() + + ## Question Text + questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) + + ## Dialog + itemDropQuestionDialog = uiCommon.QuestionDialog() + itemDropQuestionDialog.SetText(questionText) + itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) + itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) + itemDropQuestionDialog.Open() + itemDropQuestionDialog.dropType = attachedType + itemDropQuestionDialog.dropNumber = attachedItemSlotPos + itemDropQuestionDialog.dropCount = attachedItemCount + self.itemDropQuestionDialog = itemDropQuestionDialog + + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) + elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType: + dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos) + + item.SelectItem(dropItemIndex) + dropItemName = item.GetItemName() + + ## Question Text + questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) + + ## Dialog + itemDropQuestionDialog = uiCommon.QuestionDialog() + itemDropQuestionDialog.SetText(questionText) + itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) + itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) + itemDropQuestionDialog.Open() + itemDropQuestionDialog.dropType = attachedType + itemDropQuestionDialog.dropNumber = attachedItemSlotPos + itemDropQuestionDialog.dropCount = attachedItemCount + self.itemDropQuestionDialog = itemDropQuestionDialog + + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) + + def RequestDropItem(self, answer): + if not self.itemDropQuestionDialog: + return + + if answer: + dropType = self.itemDropQuestionDialog.dropType + dropCount = self.itemDropQuestionDialog.dropCount + dropNumber = self.itemDropQuestionDialog.dropNumber + + if player.SLOT_TYPE_INVENTORY == dropType: + if dropNumber == player.ITEM_MONEY: + net.SendGoldDropPacketNew(dropCount) + snd.PlaySound("sound/ui/money.wav") + else: + # PRIVATESHOP_DISABLE_ITEM_DROP + self.__SendDropItemPacket(dropNumber, dropCount) + # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP + elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType: + # PRIVATESHOP_DISABLE_ITEM_DROP + self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY) + # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP + + self.itemDropQuestionDialog.Close() + self.itemDropQuestionDialog = None + + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) + + # PRIVATESHOP_DISABLE_ITEM_DROP + def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY): + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) + return + + net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount) + # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP + + def OnMouseRightButtonDown(self): + + self.CheckFocus() + + if True == mouseModule.mouseController.isAttached(): + mouseModule.mouseController.DeattachObject() + + else: + player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS) + + return True + + def OnMouseRightButtonUp(self): + if True == mouseModule.mouseController.isAttached(): + return True + + player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK) + return True + + def OnMouseMiddleButtonDown(self): + player.SetMouseMiddleButtonState(player.MBS_PRESS) + + def OnMouseMiddleButtonUp(self): + player.SetMouseMiddleButtonState(player.MBS_CLICK) + + def OnUpdate(self): + app.UpdateGame() + + if self.mapNameShower.IsShow(): + self.mapNameShower.Update() + + if self.isShowDebugInfo: + self.UpdateDebugInfo() + + if self.enableXMasBoom: + self.__XMasBoom_Update() + + self.interface.BUILD_OnUpdate() + + + def UpdateDebugInfo(self): + # + # 某腐磐 谅钎 棺 FPS 免仿 + (x, y, z) = player.GetMainCharacterPosition() + nUpdateTime = app.GetUpdateTime() + nUpdateFPS = app.GetUpdateFPS() + nRenderFPS = app.GetRenderFPS() + nFaceCount = app.GetFaceCount() + fFaceSpeed = app.GetFaceSpeed() + nST=background.GetRenderShadowTime() + (fAveRT, nCurRT) = app.GetRenderTime() + (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo() + (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum() + if iPatch == 0: + iPatch = 1 + + #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum() + + self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024))) + xMouse, yMouse = wndMgr.GetMousePosition() + self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse)) + + self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed)) + + if fAveRT>1.0: + self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT)) + + self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio)) + #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch()) + #self.TextureNum.SetText("TN : %s" % (sTextureNum)) + #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC)) + self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp)) + + def OnRender(self): + app.RenderGame() + + if self.console.Console.collision: + background.RenderCollision() + chr.RenderCollision() + + (x, y) = app.GetCursorPosition() + + ######################## + # Picking + ######################## + textTail.UpdateAllTextTail() + + if True == wndMgr.IsPickedWindow(self.hWnd): + + self.PickingCharacterIndex = chr.Pick() + + if -1 != self.PickingCharacterIndex: + textTail.ShowCharacterTextTail(self.PickingCharacterIndex) + if 0 != self.targetBoard.GetTargetVID(): + textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID()) + + # ADD_ALWAYS_SHOW_NAME + if not self.__IsShowName(): + self.PickingItemIndex = item.Pick() + if -1 != self.PickingItemIndex: + textTail.ShowItemTextTail(self.PickingItemIndex) + # END_OF_ADD_ALWAYS_SHOW_NAME + + ## Show all name in the range + + # ADD_ALWAYS_SHOW_NAME + if self.__IsShowName(): + textTail.ShowAllTextTail() + self.PickingItemIndex = textTail.Pick(x, y) + # END_OF_ADD_ALWAYS_SHOW_NAME + + textTail.UpdateShowingTextTail() + textTail.ArrangeTextTail() + if -1 != self.PickingItemIndex: + textTail.SelectItemName(self.PickingItemIndex) + + grp.PopState() + grp.SetInterfaceRenderState() + + textTail.Render() + textTail.HideAllTextTail() + + def OnPressEscapeKey(self): + if app.TARGET == app.GetCursor(): + app.SetCursor(app.NORMAL) + + elif True == mouseModule.mouseController.isAttached(): + mouseModule.mouseController.DeattachObject() + + else: + self.interface.OpenSystemDialog() + + return True + + def OnIMEReturn(self): + if app.IsPressed(app.DIK_LSHIFT): + self.interface.OpenWhisperDialogWithoutTarget() + else: + self.interface.ToggleChat() + return True + + def OnPressExitKey(self): + self.interface.ToggleSystemDialog() + return True + + ## BINARY CALLBACK + ###################################################################################### + + # WEDDING + def BINARY_LoverInfo(self, name, lovePoint): + if self.interface.wndMessenger: + self.interface.wndMessenger.OnAddLover(name, lovePoint) + if self.affectShower: + self.affectShower.SetLoverInfo(name, lovePoint) + + def BINARY_UpdateLovePoint(self, lovePoint): + if self.interface.wndMessenger: + self.interface.wndMessenger.OnUpdateLovePoint(lovePoint) + if self.affectShower: + self.affectShower.OnUpdateLovePoint(lovePoint) + # END_OF_WEDDING + + # QUEST_CONFIRM + def BINARY_OnQuestConfirm(self, msg, timeout, pid): + confirmDialog = uiCommon.QuestionDialogWithTimeLimit() + confirmDialog.Open(msg, timeout) + confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide()) + confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide()) + self.confirmDialog = confirmDialog + # END_OF_QUEST_CONFIRM + + # GIFT command + def Gift_Show(self): + self.interface.ShowGift() + + # CUBE + def BINARY_Cube_Open(self, npcVNUM): + self.currentCubeNPC = npcVNUM + + self.interface.OpenCubeWindow() + + + if npcVNUM not in self.cubeInformation: + net.SendChatPacket("/cube r_info") + else: + cubeInfoList = self.cubeInformation[npcVNUM] + + i = 0 + for cubeInfo in cubeInfoList: + self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"]) + + j = 0 + for materialList in cubeInfo["materialList"]: + for materialInfo in materialList: + itemVnum, itemCount = materialInfo + self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount) + j = j + 1 + + i = i + 1 + + self.interface.wndCube.Refresh() + + def BINARY_Cube_Close(self): + self.interface.CloseCubeWindow() + + # 力累俊 鞘夸茄 榜靛, 抗惑登绰 肯己前狼 VNUM苞 俺荐 沥焊 update + def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count): + self.interface.UpdateCubeInfo(gold, itemVnum, count) + + def BINARY_Cube_Succeed(self, itemVnum, count): + print "钮宏 力累 己傍" + self.interface.SucceedCubeWork(itemVnum, count) + pass + + def BINARY_Cube_Failed(self): + print "钮宏 力累 角菩" + self.interface.FailedCubeWork() + pass + + def BINARY_Cube_ResultList(self, npcVNUM, listText): + # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 捞繁侥栏肺 "/" 巩磊肺 备盒等 府胶飘甫 淋 + #print listText + + if npcVNUM == 0: + npcVNUM = self.currentCubeNPC + + self.cubeInformation[npcVNUM] = [] + + try: + for eachInfoText in listText.split("/"): + eachInfo = eachInfoText.split(",") + itemVnum = int(eachInfo[0]) + itemCount = int(eachInfo[1]) + + self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount}) + self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount) + + resultCount = len(self.cubeInformation[npcVNUM]) + requestCount = 7 + modCount = resultCount % requestCount + splitCount = resultCount / requestCount + for i in xrange(splitCount): + #print("/cube r_info %d %d" % (i * requestCount, requestCount)) + net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount)) + + if 0 < modCount: + #print("/cube r_info %d %d" % (splitCount * requestCount, modCount)) + net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount)) + + except RuntimeError, msg: + dbg.TraceError(msg) + return 0 + + pass + + def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText): + # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000 + try: + #print listText + + if 3 > len(listText): + dbg.TraceError("Wrong Cube Material Infomation") + return 0 + + + + eachResultList = listText.split("@") + + cubeInfo = self.cubeInformation[self.currentCubeNPC] + + itemIndex = 0 + for eachResultText in eachResultList: + cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []] + materialList = cubeInfo[startIndex + itemIndex]["materialList"] + + gold = 0 + splitResult = eachResultText.split("/") + if 1 < len(splitResult): + gold = int(splitResult[1]) + + #print "splitResult : ", splitResult + eachMaterialList = splitResult[0].split("&") + + i = 0 + for eachMaterialText in eachMaterialList: + complicatedList = eachMaterialText.split("|") + + if 0 < len(complicatedList): + for complicatedText in complicatedList: + (itemVnum, itemCount) = complicatedText.split(",") + itemVnum = int(itemVnum) + itemCount = int(itemCount) + self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount) + + materialList[i].append((itemVnum, itemCount)) + + else: + itemVnum, itemCount = eachMaterialText.split(",") + itemVnum = int(itemVnum) + itemCount = int(itemCount) + self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount) + + materialList[i].append((itemVnum, itemCount)) + + i = i + 1 + + + + itemIndex = itemIndex + 1 + + self.interface.wndCube.Refresh() + + + except RuntimeError, msg: + dbg.TraceError(msg) + return 0 + + pass + + # END_OF_CUBE + + # 侩去籍 + def BINARY_Highlight_Item(self, inven_type, inven_pos): + self.interface.Highligt_Item(inven_type, inven_pos) + + def BINARY_DragonSoulGiveQuilification(self): + self.interface.DragonSoulGiveQuilification() + + def BINARY_DragonSoulRefineWindow_Open(self): + self.interface.OpenDragonSoulRefineWindow() + + def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos): + self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos) + + def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos): + self.interface.SucceedDragonSoulRefine(inven_type, inven_pos) + + # END of DRAGON SOUL REFINE WINDOW + + def BINARY_SetBigMessage(self, message): + self.interface.bigBoard.SetTip(message) + + def BINARY_SetTipMessage(self, message): + self.interface.tipBoard.SetTip(message) + + def BINARY_AppendNotifyMessage(self, type): + if not type in localeInfo.NOTIFY_MESSAGE: + return + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type]) + + def BINARY_Guild_EnterGuildArea(self, areaID): + self.interface.BULID_EnterGuildArea(areaID) + + def BINARY_Guild_ExitGuildArea(self, areaID): + self.interface.BULID_ExitGuildArea(areaID) + + def BINARY_GuildWar_OnSendDeclare(self, guildID): + pass + + def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType): + mainCharacterName = player.GetMainCharacterName() + masterName = guild.GetGuildMasterName() + if mainCharacterName == masterName: + self.__GuildWar_OpenAskDialog(guildID, warType) + + def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point): + self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point) + + def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp): + self.interface.OnStartGuildWar(guildSelf, guildOpp) + + def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp): + self.interface.OnEndGuildWar(guildSelf, guildOpp) + + def BINARY_BettingGuildWar_SetObserverMode(self, isEnable): + self.interface.BINARY_SetObserverMode(isEnable) + + def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount): + self.interface.wndMiniMap.UpdateObserverCount(observerCount) + + def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount): + guildID1 = int(guildID1) + guildID2 = int(guildID2) + memberCount1 = int(memberCount1) + memberCount2 = int(memberCount2) + observerCount = int(observerCount) + + self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2) + self.interface.wndMiniMap.UpdateObserverCount(observerCount) + + def __GuildWar_OpenAskDialog(self, guildID, warType): + + guildName = guild.GetGuildName(guildID) + + # REMOVED_GUILD_BUG_FIX + if "Noname" == guildName: + return + # END_OF_REMOVED_GUILD_BUG_FIX + + import uiGuild + questionDialog = uiGuild.AcceptGuildWarDialog() + questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept) + questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline) + questionDialog.Open(guildName, warType) + + self.guildWarQuestionDialog = questionDialog + + def __GuildWar_CloseAskDialog(self): + self.guildWarQuestionDialog.Close() + self.guildWarQuestionDialog = None + + def __GuildWar_OnAccept(self): + + guildName = self.guildWarQuestionDialog.GetGuildName() + + net.SendChatPacket("/war " + guildName) + self.__GuildWar_CloseAskDialog() + + return 1 + + def __GuildWar_OnDecline(self): + + guildName = self.guildWarQuestionDialog.GetGuildName() + + net.SendChatPacket("/nowar " + guildName) + self.__GuildWar_CloseAskDialog() + + return 1 + ## BINARY CALLBACK + ###################################################################################### + + def __ServerCommand_Build(self): + serverCommandList={ + "ConsoleEnable" : self.__Console_Enable, + "DayMode" : self.__DayMode_Update, + "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update, + "CloseRestartWindow" : self.__RestartDialog_Close, + "OpenPrivateShop" : self.__PrivateShop_Open, + "PartyHealReady" : self.PartyHealReady, + "ShowMeSafeboxPassword" : self.AskSafeboxPassword, + "CloseSafebox" : self.CommandCloseSafebox, + + # ITEM_MALL + "CloseMall" : self.CommandCloseMall, + "ShowMeMallPassword" : self.AskMallPassword, + "item_mall" : self.__ItemMall_Open, + # END_OF_ITEM_MALL + + "RefineSuceeded" : self.RefineSuceededMessage, + "RefineFailed" : self.RefineFailedMessage, + "xmas_snow" : self.__XMasSnow_Enable, + "xmas_boom" : self.__XMasBoom_Enable, + "xmas_song" : self.__XMasSong_Enable, + "xmas_tree" : self.__XMasTree_Enable, + "newyear_boom" : self.__XMasBoom_Enable, + "PartyRequest" : self.__PartyRequestQuestion, + "PartyRequestDenied" : self.__PartyRequestDenied, + "horse_state" : self.__Horse_UpdateState, + "hide_horse_state" : self.__Horse_HideState, + "WarUC" : self.__GuildWar_UpdateMemberCount, + "test_server" : self.__EnableTestServerFlag, + "mall" : self.__InGameShop_Show, + + # WEDDING + "lover_login" : self.__LoginLover, + "lover_logout" : self.__LogoutLover, + "lover_near" : self.__LoverNear, + "lover_far" : self.__LoverFar, + "lover_divorce" : self.__LoverDivorce, + "PlayMusic" : self.__PlayMusic, + # END_OF_WEDDING + + # PRIVATE_SHOP_PRICE_LIST + "MyShopPriceList" : self.__PrivateShop_PriceList, + # END_OF_PRIVATE_SHOP_PRICE_LIST + } + + self.serverCommander=stringCommander.Analyzer() + for serverCommandItem in serverCommandList.items(): + self.serverCommander.SAFE_RegisterCallBack( + serverCommandItem[0], serverCommandItem[1] + ) + + def BINARY_ServerCommand_Run(self, line): + #dbg.TraceError(line) + try: + #print " BINARY_ServerCommand_Run", line + return self.serverCommander.Run(line) + except RuntimeError, msg: + dbg.TraceError(msg) + return 0 + + def __ProcessPreservedServerCommand(self): + try: + command = net.GetPreservedServerCommand() + while command: + print " __ProcessPreservedServerCommand", command + self.serverCommander.Run(command) + command = net.GetPreservedServerCommand() + except RuntimeError, msg: + dbg.TraceError(msg) + return 0 + + def PartyHealReady(self): + self.interface.PartyHealReady() + + def AskSafeboxPassword(self): + self.interface.AskSafeboxPassword() + + # ITEM_MALL + def AskMallPassword(self): + self.interface.AskMallPassword() + + def __ItemMall_Open(self): + self.interface.OpenItemMall(); + + def CommandCloseMall(self): + self.interface.CommandCloseMall() + # END_OF_ITEM_MALL + + def RefineSuceededMessage(self): + snd.PlaySound("sound/ui/make_soket.wav") + self.PopupMessage(localeInfo.REFINE_SUCCESS) + + def RefineFailedMessage(self): + snd.PlaySound("sound/ui/jaeryun_fail.wav") + self.PopupMessage(localeInfo.REFINE_FAILURE) + + def CommandCloseSafebox(self): + self.interface.CommandCloseSafebox() + + # PRIVATE_SHOP_PRICE_LIST + def __PrivateShop_PriceList(self, itemVNum, itemPrice): + uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice) + # END_OF_PRIVATE_SHOP_PRICE_LIST + + def __Horse_HideState(self): + self.affectShower.SetHorseState(0, 0, 0) + + def __Horse_UpdateState(self, level, health, battery): + self.affectShower.SetHorseState(int(level), int(health), int(battery)) + + def __IsXMasMap(self): + mapDict = ( "metin2_map_n_flame_01", + "metin2_map_n_desert_01", + "metin2_map_spiderdungeon", + "metin2_map_deviltower1", ) + + if background.GetCurrentMapName() in mapDict: + return False + + return True + + def __XMasSnow_Enable(self, mode): + + self.__XMasSong_Enable(mode) + + if "1"==mode: + + if not self.__IsXMasMap(): + return + + print "XMAS_SNOW ON" + background.EnableSnow(1) + + else: + print "XMAS_SNOW OFF" + background.EnableSnow(0) + + def __XMasBoom_Enable(self, mode): + if "1"==mode: + + if not self.__IsXMasMap(): + return + + print "XMAS_BOOM ON" + self.__DayMode_Update("dark") + self.enableXMasBoom = True + self.startTimeXMasBoom = app.GetTime() + else: + print "XMAS_BOOM OFF" + self.__DayMode_Update("light") + self.enableXMasBoom = False + + def __XMasTree_Enable(self, grade): + + print "XMAS_TREE ", grade + background.SetXMasTree(int(grade)) + + def __XMasSong_Enable(self, mode): + if "1"==mode: + print "XMAS_SONG ON" + + XMAS_BGM = "xmas.mp3" + + if app.IsExistFile("BGM/" + XMAS_BGM)==1: + if musicInfo.fieldMusic != "": + snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) + + musicInfo.fieldMusic=XMAS_BGM + snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) + + else: + print "XMAS_SONG OFF" + + if musicInfo.fieldMusic != "": + snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) + + musicInfo.fieldMusic=musicInfo.METIN2THEMA + snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) + + def __RestartDialog_Close(self): + self.interface.CloseRestartDialog() + + def __Console_Enable(self): + constInfo.CONSOLE_ENABLE = True + self.consoleEnable = True + app.EnableSpecialCameraMode() + ui.EnablePaste(True) + + ## PrivateShop + def __PrivateShop_Open(self): + self.interface.OpenPrivateShopInputNameDialog() + + def BINARY_PrivateShop_Appear(self, vid, text): + self.interface.AppearPrivateShop(vid, text) + + def BINARY_PrivateShop_Disappear(self, vid): + self.interface.DisappearPrivateShop(vid) + + ## DayMode + def __PRESERVE_DayMode_Update(self, mode): + if "light"==mode: + background.SetEnvironmentData(0) + elif "dark"==mode: + + if not self.__IsXMasMap(): + return + + background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) + background.SetEnvironmentData(1) + + def __DayMode_Update(self, mode): + if "light"==mode: + self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight) + elif "dark"==mode: + + if not self.__IsXMasMap(): + return + + self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark) + + def __DayMode_OnCompleteChangeToLight(self): + background.SetEnvironmentData(0) + self.curtain.FadeIn() + + def __DayMode_OnCompleteChangeToDark(self): + background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) + background.SetEnvironmentData(1) + self.curtain.FadeIn() + + ## XMasBoom + def __XMasBoom_Update(self): + + self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) ) + if self.indexXMasBoom >= len(self.BOOM_DATA_LIST): + return + + boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0] + boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1] + + if app.GetTime() - self.startTimeXMasBoom > boomTime: + + self.indexXMasBoom += 1 + + for i in xrange(boomCount): + self.__XMasBoom_Boom() + + def __XMasBoom_Boom(self): + x, y, z = player.GetMainCharacterPosition() + randX = app.GetRandom(-150, 150) + randY = app.GetRandom(-150, 150) + + snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3") + + def __PartyRequestQuestion(self, vid): + vid = int(vid) + partyRequestQuestionDialog = uiCommon.QuestionDialog() + partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT) + partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT) + partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY) + partyRequestQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerPartyRequest(arg)) + partyRequestQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerPartyRequest(arg)) + partyRequestQuestionDialog.Open() + partyRequestQuestionDialog.vid = vid + self.partyRequestQuestionDialog = partyRequestQuestionDialog + + def __AnswerPartyRequest(self, answer): + if not self.partyRequestQuestionDialog: + return + + vid = self.partyRequestQuestionDialog.vid + + if answer: + net.SendChatPacket("/party_request_accept " + str(vid)) + else: + net.SendChatPacket("/party_request_deny " + str(vid)) + + self.partyRequestQuestionDialog.Close() + self.partyRequestQuestionDialog = None + + def __PartyRequestDenied(self): + self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED) + + def __EnableTestServerFlag(self): + app.EnableTestServerFlag() + + def __InGameShop_Show(self, url): + if constInfo.IN_GAME_SHOP_ENABLE: + self.interface.OpenWebWindow(url) + + # WEDDING + def __LoginLover(self): + if self.interface.wndMessenger: + self.interface.wndMessenger.OnLoginLover() + + def __LogoutLover(self): + if self.interface.wndMessenger: + self.interface.wndMessenger.OnLogoutLover() + if self.affectShower: + self.affectShower.HideLoverState() + + def __LoverNear(self): + if self.affectShower: + self.affectShower.ShowLoverState() + + def __LoverFar(self): + if self.affectShower: + self.affectShower.HideLoverState() + + def __LoverDivorce(self): + if self.interface.wndMessenger: + self.interface.wndMessenger.ClearLoverInfo() + if self.affectShower: + self.affectShower.ClearLoverState() + + def __PlayMusic(self, flag, filename): + flag = int(flag) + if flag: + snd.FadeOutAllMusic() + musicInfo.SaveLastPlayFieldMusic() + snd.FadeInMusic("BGM/" + filename) + else: + snd.FadeOutAllMusic() + musicInfo.LoadLastPlayFieldMusic() + snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) + + # END_OF_WEDDING + + diff --git a/root/grpblk.txt b/root/grpblk.txt new file mode 100644 index 0000000..e62967a --- /dev/null +++ b/root/grpblk.txt @@ -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 diff --git a/root/interfacemodule.py b/root/interfacemodule.py new file mode 100644 index 0000000..64b13d0 --- /dev/null +++ b/root/interfacemodule.py @@ -0,0 +1,1721 @@ +## +## Interface +## +import constInfo +import systemSetting +import wndMgr +import chat +import app +import player +import uiTaskBar +import uiCharacter +import uiInventory +import uiDragonSoul +import uiChat +import uiMessenger +import guild + +import ui +import uiHelp +import uiWhisper +import uiPointReset +import uiShop +import uiExchange +import uiSystem +import uiRestart +import uiToolTip +import uiMiniMap +import uiParty +import uiSafebox +import uiGuild +import uiQuest +import uiPrivateShopBuilder +import uiCommon +import uiRefine +import uiEquipmentDialog +import uiGameButton +import uiTip +import uiCube +import miniMap +# ACCESSORY_REFINE_ADD_METIN_STONE +import uiselectitem +# END_OF_ACCESSORY_REFINE_ADD_METIN_STONE +import uiScriptLocale + +import event +import localeInfo + +IsQBHide = 0 +class Interface(object): + CHARACTER_STATUS_TAB = 1 + CHARACTER_SKILL_TAB = 2 + + def __init__(self): + systemSetting.SetInterfaceHandler(self) + self.windowOpenPosition = 0 + self.dlgWhisperWithoutTarget = None + self.inputDialog = None + self.tipBoard = None + self.bigBoard = None + + # ITEM_MALL + self.mallPageDlg = None + # END_OF_ITEM_MALL + + self.wndWeb = None + self.wndTaskBar = None + self.wndCharacter = None + self.wndInventory = None + self.wndExpandedTaskBar = None + self.wndDragonSoul = None + self.wndDragonSoulRefine = None + self.wndChat = None + self.wndMessenger = None + self.wndMiniMap = None + self.wndGuild = None + self.wndGuildBuilding = None + + self.listGMName = {} + self.wndQuestWindow = {} + self.wndQuestWindowNewKey = 0 + self.privateShopAdvertisementBoardDict = {} + self.guildScoreBoardDict = {} + self.equipmentDialogDict = {} + event.SetInterfaceWindow(self) + + def __del__(self): + systemSetting.DestroyInterfaceHandler() + event.SetInterfaceWindow(None) + + ################################ + ## Make Windows & Dialogs + def __MakeUICurtain(self): + wndUICurtain = ui.Bar("TOP_MOST") + wndUICurtain.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) + wndUICurtain.SetColor(0x77000000) + wndUICurtain.Hide() + self.wndUICurtain = wndUICurtain + + def __MakeMessengerWindow(self): + self.wndMessenger = uiMessenger.MessengerWindow() + + from _weakref import proxy + self.wndMessenger.SetWhisperButtonEvent(lambda n,i=proxy(self):i.OpenWhisperDialog(n)) + self.wndMessenger.SetGuildButtonEvent(ui.__mem_func__(self.ToggleGuildWindow)) + + def __MakeGuildWindow(self): + self.wndGuild = uiGuild.GuildWindow() + + def __MakeChatWindow(self): + + wndChat = uiChat.ChatWindow() + + wndChat.SetSize(wndChat.CHAT_WINDOW_WIDTH, 0) + wndChat.SetPosition(wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 37) + wndChat.SetHeight(200) + wndChat.Refresh() + wndChat.Show() + + self.wndChat = wndChat + self.wndChat.BindInterface(self) + self.wndChat.SetSendWhisperEvent(ui.__mem_func__(self.OpenWhisperDialogWithoutTarget)) + self.wndChat.SetOpenChatLogEvent(ui.__mem_func__(self.ToggleChatLogWindow)) + + def __MakeTaskBar(self): + wndTaskBar = uiTaskBar.TaskBar() + wndTaskBar.LoadWindow() + self.wndTaskBar = wndTaskBar + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHARACTER, ui.__mem_func__(self.ToggleCharacterWindowStatusPage)) + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_INVENTORY, ui.__mem_func__(self.ToggleInventoryWindow)) + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_MESSENGER, ui.__mem_func__(self.ToggleMessenger)) + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_SYSTEM, ui.__mem_func__(self.ToggleSystemDialog)) + if uiTaskBar.TaskBar.IS_EXPANDED: + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND, ui.__mem_func__(self.ToggleExpandedButton)) + self.wndExpandedTaskBar = uiTaskBar.ExpandedTaskBar() + self.wndExpandedTaskBar.LoadWindow() + self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, ui.__mem_func__(self.ToggleDragonSoulWindow)) + + else: + self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat)) + + self.wndEnergyBar = None + import app + if app.ENABLE_ENERGY_SYSTEM: + wndEnergyBar = uiTaskBar.EnergyBar() + wndEnergyBar.LoadWindow() + self.wndEnergyBar = wndEnergyBar + + def __MakeParty(self): + wndParty = uiParty.PartyWindow() + wndParty.Hide() + self.wndParty = wndParty + + def __MakeGameButtonWindow(self): + wndGameButton = uiGameButton.GameButtonWindow() + wndGameButton.SetTop() + wndGameButton.Show() + wndGameButton.SetButtonEvent("STATUS", ui.__mem_func__(self.__OnClickStatusPlusButton)) + wndGameButton.SetButtonEvent("SKILL", ui.__mem_func__(self.__OnClickSkillPlusButton)) + wndGameButton.SetButtonEvent("QUEST", ui.__mem_func__(self.__OnClickQuestButton)) + wndGameButton.SetButtonEvent("HELP", ui.__mem_func__(self.__OnClickHelpButton)) + wndGameButton.SetButtonEvent("BUILD", ui.__mem_func__(self.__OnClickBuildButton)) + + self.wndGameButton = wndGameButton + + def __IsChatOpen(self): + return True + + def __MakeWindows(self): + wndCharacter = uiCharacter.CharacterWindow() + wndInventory = uiInventory.InventoryWindow() + wndInventory.BindInterfaceClass(self) + if app.ENABLE_DRAGON_SOUL_SYSTEM: + wndDragonSoul = uiDragonSoul.DragonSoulWindow() + wndDragonSoulRefine = uiDragonSoul.DragonSoulRefineWindow() + else: + wndDragonSoul = None + wndDragonSoulRefine = None + + wndMiniMap = uiMiniMap.MiniMap() + wndSafebox = uiSafebox.SafeboxWindow() + + # ITEM_MALL + wndMall = uiSafebox.MallWindow() + self.wndMall = wndMall + # END_OF_ITEM_MALL + + wndChatLog = uiChat.ChatLogWindow() + wndChatLog.BindInterface(self) + + self.wndCharacter = wndCharacter + self.wndInventory = wndInventory + self.wndDragonSoul = wndDragonSoul + self.wndDragonSoulRefine = wndDragonSoulRefine + self.wndMiniMap = wndMiniMap + self.wndSafebox = wndSafebox + self.wndChatLog = wndChatLog + + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.SetDragonSoulRefineWindow(self.wndDragonSoulRefine) + self.wndDragonSoulRefine.SetInventoryWindows(self.wndInventory, self.wndDragonSoul) + self.wndInventory.SetDragonSoulRefineWindow(self.wndDragonSoulRefine) + + def __MakeDialogs(self): + self.dlgExchange = uiExchange.ExchangeDialog() + self.dlgExchange.LoadDialog() + self.dlgExchange.SetCenterPosition() + self.dlgExchange.Hide() + + self.dlgPointReset = uiPointReset.PointResetDialog() + self.dlgPointReset.LoadDialog() + self.dlgPointReset.Hide() + + self.dlgShop = uiShop.ShopDialog() + self.dlgShop.LoadDialog() + self.dlgShop.Hide() + + self.dlgRestart = uiRestart.RestartDialog() + self.dlgRestart.LoadDialog() + self.dlgRestart.Hide() + + self.dlgSystem = uiSystem.SystemDialog() + self.dlgSystem.LoadDialog() + self.dlgSystem.SetOpenHelpWindowEvent(ui.__mem_func__(self.OpenHelpWindow)) + + self.dlgSystem.Hide() + + self.dlgPassword = uiSafebox.PasswordDialog() + self.dlgPassword.Hide() + + self.hyperlinkItemTooltip = uiToolTip.HyperlinkItemToolTip() + self.hyperlinkItemTooltip.Hide() + + self.tooltipItem = uiToolTip.ItemToolTip() + self.tooltipItem.Hide() + + self.tooltipSkill = uiToolTip.SkillToolTip() + self.tooltipSkill.Hide() + + self.privateShopBuilder = uiPrivateShopBuilder.PrivateShopBuilder() + self.privateShopBuilder.Hide() + + self.dlgRefineNew = uiRefine.RefineDialogNew() + self.dlgRefineNew.Hide() + + def __MakeHelpWindow(self): + self.wndHelp = uiHelp.HelpWindow() + self.wndHelp.LoadDialog() + self.wndHelp.SetCloseEvent(ui.__mem_func__(self.CloseHelpWindow)) + self.wndHelp.Hide() + + def __MakeTipBoard(self): + self.tipBoard = uiTip.TipBoard() + self.tipBoard.Hide() + + self.bigBoard = uiTip.BigBoard() + self.bigBoard.Hide() + + def __MakeWebWindow(self): + if constInfo.IN_GAME_SHOP_ENABLE: + import uiWeb + self.wndWeb = uiWeb.WebWindow() + self.wndWeb.LoadWindow() + self.wndWeb.Hide() + + def __MakeCubeWindow(self): + self.wndCube = uiCube.CubeWindow() + self.wndCube.LoadWindow() + self.wndCube.Hide() + + def __MakeCubeResultWindow(self): + self.wndCubeResult = uiCube.CubeResultWindow() + self.wndCubeResult.LoadWindow() + self.wndCubeResult.Hide() + + # ACCESSORY_REFINE_ADD_METIN_STONE + def __MakeItemSelectWindow(self): + self.wndItemSelect = uiselectitem.SelectItemWindow() + self.wndItemSelect.Hide() + # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE + + def MakeInterface(self): + self.__MakeMessengerWindow() + self.__MakeGuildWindow() + self.__MakeChatWindow() + self.__MakeParty() + self.__MakeWindows() + self.__MakeDialogs() + + self.__MakeUICurtain() + self.__MakeTaskBar() + self.__MakeGameButtonWindow() + self.__MakeHelpWindow() + self.__MakeTipBoard() + self.__MakeWebWindow() + self.__MakeCubeWindow() + self.__MakeCubeResultWindow() + + + # ACCESSORY_REFINE_ADD_METIN_STONE + self.__MakeItemSelectWindow() + # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE + + self.questButtonList = [] + self.whisperButtonList = [] + self.whisperDialogDict = {} + self.privateShopAdvertisementBoardDict = {} + + self.wndInventory.SetItemToolTip(self.tooltipItem) + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.SetItemToolTip(self.tooltipItem) + self.wndDragonSoulRefine.SetItemToolTip(self.tooltipItem) + self.wndSafebox.SetItemToolTip(self.tooltipItem) + self.wndCube.SetItemToolTip(self.tooltipItem) + self.wndCubeResult.SetItemToolTip(self.tooltipItem) + + # ITEM_MALL + self.wndMall.SetItemToolTip(self.tooltipItem) + # END_OF_ITEM_MALL + + self.wndCharacter.SetSkillToolTip(self.tooltipSkill) + self.wndTaskBar.SetItemToolTip(self.tooltipItem) + self.wndTaskBar.SetSkillToolTip(self.tooltipSkill) + self.wndGuild.SetSkillToolTip(self.tooltipSkill) + + # ACCESSORY_REFINE_ADD_METIN_STONE + self.wndItemSelect.SetItemToolTip(self.tooltipItem) + # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE + + self.dlgShop.SetItemToolTip(self.tooltipItem) + self.dlgExchange.SetItemToolTip(self.tooltipItem) + self.privateShopBuilder.SetItemToolTip(self.tooltipItem) + + self.__InitWhisper() + self.DRAGON_SOUL_IS_QUALIFIED = False + + def MakeHyperlinkTooltip(self, hyperlink): + tokens = hyperlink.split(":") + if tokens and len(tokens): + type = tokens[0] + if "item" == type: + self.hyperlinkItemTooltip.SetHyperlinkItem(tokens) + + ## Make Windows & Dialogs + ################################ + + def Close(self): + if self.dlgWhisperWithoutTarget: + self.dlgWhisperWithoutTarget.Destroy() + del self.dlgWhisperWithoutTarget + + if uiQuest.QuestDialog.__dict__.has_key("QuestCurtain"): + uiQuest.QuestDialog.QuestCurtain.Close() + + if self.wndQuestWindow: + for key, eachQuestWindow in self.wndQuestWindow.items(): + eachQuestWindow.nextCurtainMode = -1 + eachQuestWindow.CloseSelf() + eachQuestWindow = None + self.wndQuestWindow = {} + + if self.wndChat: + self.wndChat.Destroy() + + if self.wndTaskBar: + self.wndTaskBar.Destroy() + + if self.wndExpandedTaskBar: + self.wndExpandedTaskBar.Destroy() + + if self.wndEnergyBar: + self.wndEnergyBar.Destroy() + + if self.wndCharacter: + self.wndCharacter.Destroy() + + if self.wndInventory: + self.wndInventory.Destroy() + + if self.wndDragonSoul: + self.wndDragonSoul.Destroy() + + if self.wndDragonSoulRefine: + self.wndDragonSoulRefine.Destroy() + + if self.dlgExchange: + self.dlgExchange.Destroy() + + if self.dlgPointReset: + self.dlgPointReset.Destroy() + + if self.dlgShop: + self.dlgShop.Destroy() + + if self.dlgRestart: + self.dlgRestart.Destroy() + + if self.dlgSystem: + self.dlgSystem.Destroy() + + if self.dlgPassword: + self.dlgPassword.Destroy() + + if self.wndMiniMap: + self.wndMiniMap.Destroy() + + if self.wndSafebox: + self.wndSafebox.Destroy() + + if self.wndWeb: + self.wndWeb.Destroy() + self.wndWeb = None + + if self.wndMall: + self.wndMall.Destroy() + + if self.wndParty: + self.wndParty.Destroy() + + if self.wndHelp: + self.wndHelp.Destroy() + + if self.wndCube: + self.wndCube.Destroy() + + if self.wndCubeResult: + self.wndCubeResult.Destroy() + + if self.wndMessenger: + self.wndMessenger.Destroy() + + if self.wndGuild: + self.wndGuild.Destroy() + + if self.privateShopBuilder: + self.privateShopBuilder.Destroy() + + if self.dlgRefineNew: + self.dlgRefineNew.Destroy() + + if self.wndGuildBuilding: + self.wndGuildBuilding.Destroy() + + if self.wndGameButton: + self.wndGameButton.Destroy() + + # ITEM_MALL + if self.mallPageDlg: + self.mallPageDlg.Destroy() + # END_OF_ITEM_MALL + + # ACCESSORY_REFINE_ADD_METIN_STONE + if self.wndItemSelect: + self.wndItemSelect.Destroy() + # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE + + self.wndChatLog.Destroy() + for btn in self.questButtonList: + btn.SetEvent(0) + for btn in self.whisperButtonList: + btn.SetEvent(0) + for dlg in self.whisperDialogDict.itervalues(): + dlg.Destroy() + for brd in self.guildScoreBoardDict.itervalues(): + brd.Destroy() + for dlg in self.equipmentDialogDict.itervalues(): + dlg.Destroy() + + # ITEM_MALL + del self.mallPageDlg + # END_OF_ITEM_MALL + + del self.wndGuild + del self.wndMessenger + del self.wndUICurtain + del self.wndChat + del self.wndTaskBar + if self.wndExpandedTaskBar: + del self.wndExpandedTaskBar + del self.wndEnergyBar + del self.wndCharacter + del self.wndInventory + if self.wndDragonSoul: + del self.wndDragonSoul + if self.wndDragonSoulRefine: + del self.wndDragonSoulRefine + del self.dlgExchange + del self.dlgPointReset + del self.dlgShop + del self.dlgRestart + del self.dlgSystem + del self.dlgPassword + del self.hyperlinkItemTooltip + del self.tooltipItem + del self.tooltipSkill + del self.wndMiniMap + del self.wndSafebox + del self.wndMall + del self.wndParty + del self.wndHelp + del self.wndCube + del self.wndCubeResult + del self.privateShopBuilder + del self.inputDialog + del self.wndChatLog + del self.dlgRefineNew + del self.wndGuildBuilding + del self.wndGameButton + del self.tipBoard + del self.bigBoard + del self.wndItemSelect + + self.questButtonList = [] + self.whisperButtonList = [] + self.whisperDialogDict = {} + self.privateShopAdvertisementBoardDict = {} + self.guildScoreBoardDict = {} + self.equipmentDialogDict = {} + + uiChat.DestroyChatInputSetWindow() + + ## Skill + def OnUseSkill(self, slotIndex, coolTime): + self.wndCharacter.OnUseSkill(slotIndex, coolTime) + self.wndTaskBar.OnUseSkill(slotIndex, coolTime) + self.wndGuild.OnUseSkill(slotIndex, coolTime) + + def OnActivateSkill(self, slotIndex): + self.wndCharacter.OnActivateSkill(slotIndex) + self.wndTaskBar.OnActivateSkill(slotIndex) + + def OnDeactivateSkill(self, slotIndex): + self.wndCharacter.OnDeactivateSkill(slotIndex) + self.wndTaskBar.OnDeactivateSkill(slotIndex) + + def OnChangeCurrentSkill(self, skillSlotNumber): + self.wndTaskBar.OnChangeCurrentSkill(skillSlotNumber) + + def SelectMouseButtonEvent(self, dir, event): + self.wndTaskBar.SelectMouseButtonEvent(dir, event) + + ## Refresh + def RefreshAlignment(self): + self.wndCharacter.RefreshAlignment() + + def RefreshStatus(self): + self.wndTaskBar.RefreshStatus() + self.wndCharacter.RefreshStatus() + self.wndInventory.RefreshStatus() + if self.wndEnergyBar: + self.wndEnergyBar.RefreshStatus() + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.RefreshStatus() + + def RefreshStamina(self): + self.wndTaskBar.RefreshStamina() + + def RefreshSkill(self): + self.wndCharacter.RefreshSkill() + self.wndTaskBar.RefreshSkill() + + def RefreshInventory(self): + self.wndTaskBar.RefreshQuickSlot() + self.wndInventory.RefreshItemSlot() + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.RefreshItemSlot() + + def RefreshCharacter(self): ## Character 其捞瘤狼 倔奔, Inventory 其捞瘤狼 傈脚 弊覆 殿狼 Refresh + self.wndCharacter.RefreshCharacter() + self.wndTaskBar.RefreshQuickSlot() + + def RefreshQuest(self): + self.wndCharacter.RefreshQuest() + + def RefreshSafebox(self): + self.wndSafebox.RefreshSafebox() + + # ITEM_MALL + def RefreshMall(self): + self.wndMall.RefreshMall() + + def OpenItemMall(self): + if not self.mallPageDlg: + self.mallPageDlg = uiShop.MallPageDialog() + + self.mallPageDlg.Open() + # END_OF_ITEM_MALL + + def RefreshMessenger(self): + self.wndMessenger.RefreshMessenger() + + def RefreshGuildInfoPage(self): + self.wndGuild.RefreshGuildInfoPage() + + def RefreshGuildBoardPage(self): + self.wndGuild.RefreshGuildBoardPage() + + def RefreshGuildMemberPage(self): + self.wndGuild.RefreshGuildMemberPage() + + def RefreshGuildMemberPageGradeComboBox(self): + self.wndGuild.RefreshGuildMemberPageGradeComboBox() + + def RefreshGuildSkillPage(self): + self.wndGuild.RefreshGuildSkillPage() + + def RefreshGuildGradePage(self): + self.wndGuild.RefreshGuildGradePage() + + def DeleteGuild(self): + self.wndMessenger.ClearGuildMember() + self.wndGuild.DeleteGuild() + + def RefreshMobile(self): + self.dlgSystem.RefreshMobile() + + def OnMobileAuthority(self): + self.dlgSystem.OnMobileAuthority() + + def OnBlockMode(self, mode): + self.dlgSystem.OnBlockMode(mode) + + ## Calling Functions + # PointReset + def OpenPointResetDialog(self): + self.dlgPointReset.Show() + self.dlgPointReset.SetTop() + + def ClosePointResetDialog(self): + self.dlgPointReset.Close() + + # Shop + def OpenShopDialog(self, vid): + self.wndInventory.Show() + self.wndInventory.SetTop() + self.dlgShop.Open(vid) + self.dlgShop.SetTop() + + def CloseShopDialog(self): + self.dlgShop.Close() + + def RefreshShopDialog(self): + self.dlgShop.Refresh() + + ## Quest + def OpenCharacterWindowQuestPage(self): + self.wndCharacter.Show() + self.wndCharacter.SetState("QUEST") + + def OpenQuestWindow(self, skin, idx): + + wnds = () + + q = uiQuest.QuestDialog(skin, idx) + q.SetWindowName("QuestWindow" + str(idx)) + q.Show() + if skin: + q.Lock() + wnds = self.__HideWindows() + + # UNKNOWN_UPDATE + q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args)) + # END_OF_UNKNOWN_UPDATE + + if skin: + q.AddOnCloseEvent(q.Unlock) + q.AddOnCloseEvent(lambda key = self.wndQuestWindowNewKey:ui.__mem_func__(self.RemoveQuestDialog)(key)) + self.wndQuestWindow[self.wndQuestWindowNewKey] = q + + self.wndQuestWindowNewKey = self.wndQuestWindowNewKey + 1 + + # END_OF_UNKNOWN_UPDATE + + def RemoveQuestDialog(self, key): + del self.wndQuestWindow[key] + + ## Exchange + def StartExchange(self): + self.dlgExchange.OpenDialog() + self.dlgExchange.Refresh() + + def EndExchange(self): + self.dlgExchange.CloseDialog() + + def RefreshExchange(self): + self.dlgExchange.Refresh() + + ## Party + def AddPartyMember(self, pid, name): + self.wndParty.AddPartyMember(pid, name) + + self.__ArrangeQuestButton() + + def UpdatePartyMemberInfo(self, pid): + self.wndParty.UpdatePartyMemberInfo(pid) + + def RemovePartyMember(self, pid): + self.wndParty.RemovePartyMember(pid) + + ##!! 20061026.levites.涅胶飘_困摹_焊沥 + self.__ArrangeQuestButton() + + def LinkPartyMember(self, pid, vid): + self.wndParty.LinkPartyMember(pid, vid) + + def UnlinkPartyMember(self, pid): + self.wndParty.UnlinkPartyMember(pid) + + def UnlinkAllPartyMember(self): + self.wndParty.UnlinkAllPartyMember() + + def ExitParty(self): + self.wndParty.ExitParty() + + ##!! 20061026.levites.涅胶飘_困摹_焊沥 + self.__ArrangeQuestButton() + + def PartyHealReady(self): + self.wndParty.PartyHealReady() + + def ChangePartyParameter(self, distributionMode): + self.wndParty.ChangePartyParameter(distributionMode) + + ## Safebox + def AskSafeboxPassword(self): + if self.wndSafebox.IsShow(): + return + + # SAFEBOX_PASSWORD + self.dlgPassword.SetTitle(localeInfo.PASSWORD_TITLE) + self.dlgPassword.SetSendMessage("/safebox_password ") + # END_OF_SAFEBOX_PASSWORD + + self.dlgPassword.ShowDialog() + + def OpenSafeboxWindow(self, size): + self.dlgPassword.CloseDialog() + self.wndSafebox.ShowWindow(size) + + def RefreshSafeboxMoney(self): + self.wndSafebox.RefreshSafeboxMoney() + + def CommandCloseSafebox(self): + self.wndSafebox.CommandCloseSafebox() + + # ITEM_MALL + def AskMallPassword(self): + if self.wndMall.IsShow(): + return + self.dlgPassword.SetTitle(localeInfo.MALL_PASSWORD_TITLE) + self.dlgPassword.SetSendMessage("/mall_password ") + self.dlgPassword.ShowDialog() + + def OpenMallWindow(self, size): + self.dlgPassword.CloseDialog() + self.wndMall.ShowWindow(size) + + def CommandCloseMall(self): + self.wndMall.CommandCloseMall() + # END_OF_ITEM_MALL + + ## Guild + def OnStartGuildWar(self, guildSelf, guildOpp): + self.wndGuild.OnStartGuildWar(guildSelf, guildOpp) + + guildWarScoreBoard = uiGuild.GuildWarScoreBoard() + guildWarScoreBoard.Open(guildSelf, guildOpp) + guildWarScoreBoard.Show() + self.guildScoreBoardDict[uiGuild.GetGVGKey(guildSelf, guildOpp)] = guildWarScoreBoard + + def OnEndGuildWar(self, guildSelf, guildOpp): + self.wndGuild.OnEndGuildWar(guildSelf, guildOpp) + + key = uiGuild.GetGVGKey(guildSelf, guildOpp) + + if not self.guildScoreBoardDict.has_key(key): + return + + self.guildScoreBoardDict[key].Destroy() + del self.guildScoreBoardDict[key] + + # GUILDWAR_MEMBER_COUNT + def UpdateMemberCount(self, gulidID1, memberCount1, guildID2, memberCount2): + key = uiGuild.GetGVGKey(gulidID1, guildID2) + + if not self.guildScoreBoardDict.has_key(key): + return + + self.guildScoreBoardDict[key].UpdateMemberCount(gulidID1, memberCount1, guildID2, memberCount2) + # END_OF_GUILDWAR_MEMBER_COUNT + + def OnRecvGuildWarPoint(self, gainGuildID, opponentGuildID, point): + key = uiGuild.GetGVGKey(gainGuildID, opponentGuildID) + if not self.guildScoreBoardDict.has_key(key): + return + + guildBoard = self.guildScoreBoardDict[key] + guildBoard.SetScore(gainGuildID, opponentGuildID, point) + + ## PK Mode + def OnChangePKMode(self): + self.wndCharacter.RefreshAlignment() + self.dlgSystem.OnChangePKMode() + + ## Refine + def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type): + self.dlgRefineNew.Open(targetItemPos, nextGradeItemVnum, cost, prob, type) + + def AppendMaterialToRefineDialog(self, vnum, count): + self.dlgRefineNew.AppendMaterial(vnum, count) + + ## Show & Hide + def ShowDefaultWindows(self): + self.wndTaskBar.Show() + self.wndMiniMap.Show() + self.wndMiniMap.ShowMiniMap() + if self.wndEnergyBar: + self.wndEnergyBar.Show() + + def ShowAllWindows(self): + self.wndTaskBar.Show() + self.wndCharacter.Show() + self.wndInventory.Show() + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.Show() + self.wndDragonSoulRefine.Show() + self.wndChat.Show() + self.wndMiniMap.Show() + if self.wndEnergyBar: + self.wndEnergyBar.Show() + if self.wndExpandedTaskBar: + self.wndExpandedTaskBar.Show() + self.wndExpandedTaskBar.SetTop() + + def HideAllWindows(self): + if self.wndTaskBar: + self.wndTaskBar.Hide() + + if self.wndEnergyBar: + self.wndEnergyBar.Hide() + + if self.wndCharacter: + self.wndCharacter.Hide() + + if self.wndInventory: + self.wndInventory.Hide() + + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.Hide() + self.wndDragonSoulRefine.Hide() + + if self.wndChat: + self.wndChat.Hide() + + if self.wndMiniMap: + self.wndMiniMap.Hide() + + if self.wndMessenger: + self.wndMessenger.Hide() + + if self.wndGuild: + self.wndGuild.Hide() + + if self.wndExpandedTaskBar: + self.wndExpandedTaskBar.Hide() + + + def ShowMouseImage(self): + self.wndTaskBar.ShowMouseImage() + + def HideMouseImage(self): + self.wndTaskBar.HideMouseImage() + + def ToggleChat(self): + if True == self.wndChat.IsEditMode(): + self.wndChat.CloseChat() + else: + # 昆其捞瘤啊 凯啡阑锭绰 盲泼 涝仿捞 救凳 + if self.wndWeb and self.wndWeb.IsShow(): + pass + else: + self.wndChat.OpenChat() + + def IsOpenChat(self): + return self.wndChat.IsEditMode() + + def SetChatFocus(self): + self.wndChat.SetChatFocus() + + def OpenRestartDialog(self): + self.dlgRestart.OpenDialog() + self.dlgRestart.SetTop() + + def CloseRestartDialog(self): + self.dlgRestart.Close() + + def ToggleSystemDialog(self): + if False == self.dlgSystem.IsShow(): + self.dlgSystem.OpenDialog() + self.dlgSystem.SetTop() + else: + self.dlgSystem.Close() + + def OpenSystemDialog(self): + self.dlgSystem.OpenDialog() + self.dlgSystem.SetTop() + + def ToggleMessenger(self): + if self.wndMessenger.IsShow(): + self.wndMessenger.Hide() + else: + self.wndMessenger.SetTop() + self.wndMessenger.Show() + + def ToggleMiniMap(self): + if app.IsPressed(app.DIK_LSHIFT) or app.IsPressed(app.DIK_RSHIFT): + if False == self.wndMiniMap.isShowMiniMap(): + self.wndMiniMap.ShowMiniMap() + self.wndMiniMap.SetTop() + else: + self.wndMiniMap.HideMiniMap() + + else: + self.wndMiniMap.ToggleAtlasWindow() + + def PressMKey(self): + if app.IsPressed(app.DIK_LALT) or app.IsPressed(app.DIK_RALT): + self.ToggleMessenger() + + else: + self.ToggleMiniMap() + + def SetMapName(self, mapName): + self.wndMiniMap.SetMapName(mapName) + + def MiniMapScaleUp(self): + self.wndMiniMap.ScaleUp() + + def MiniMapScaleDown(self): + self.wndMiniMap.ScaleDown() + + def ToggleCharacterWindow(self, state): + if False == player.IsObserverMode(): + if False == self.wndCharacter.IsShow(): + self.OpenCharacterWindowWithState(state) + else: + if state == self.wndCharacter.GetState(): + self.wndCharacter.OverOutItem() + self.wndCharacter.Hide() + else: + self.wndCharacter.SetState(state) + + def OpenCharacterWindowWithState(self, state): + if False == player.IsObserverMode(): + self.wndCharacter.SetState(state) + self.wndCharacter.Show() + self.wndCharacter.SetTop() + + def ToggleCharacterWindowStatusPage(self): + self.ToggleCharacterWindow("STATUS") + + def ToggleInventoryWindow(self): + if False == player.IsObserverMode(): + if False == self.wndInventory.IsShow(): + self.wndInventory.Show() + self.wndInventory.SetTop() + else: + self.wndInventory.OverOutItem() + self.wndInventory.Close() + + def ToggleExpandedButton(self): + if False == player.IsObserverMode(): + if False == self.wndExpandedTaskBar.IsShow(): + self.wndExpandedTaskBar.Show() + self.wndExpandedTaskBar.SetTop() + else: + self.wndExpandedTaskBar.Close() + + # 侩去籍 + def DragonSoulActivate(self, deck): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.ActivateDragonSoulByExtern(deck) + + def DragonSoulDeactivate(self): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.DeactivateDragonSoul() + + def Highligt_Item(self, inven_type, inven_pos): + if player.DRAGON_SOUL_INVENTORY == inven_type: + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoul.HighlightSlot(inven_pos) + + def DragonSoulGiveQuilification(self): + self.DRAGON_SOUL_IS_QUALIFIED = True + self.wndExpandedTaskBar.SetToolTipText(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, uiScriptLocale.TASKBAR_DRAGON_SOUL) + + def ToggleDragonSoulWindow(self): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if False == self.wndDragonSoul.IsShow(): + if self.DRAGON_SOUL_IS_QUALIFIED: + self.wndDragonSoul.Show() + else: + try: + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED) + self.wndPopupDialog.Open() + except: + self.wndPopupDialog = uiCommon.PopupDialog() + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED) + self.wndPopupDialog.Open() + else: + self.wndDragonSoul.Close() + + def ToggleDragonSoulWindowWithNoInfo(self): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if False == self.wndDragonSoul.IsShow(): + if self.DRAGON_SOUL_IS_QUALIFIED: + self.wndDragonSoul.Show() + else: + self.wndDragonSoul.Close() + + def FailDragonSoulRefine(self, reason, inven_type, inven_pos): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if True == self.wndDragonSoulRefine.IsShow(): + self.wndDragonSoulRefine.RefineFail(reason, inven_type, inven_pos) + + def SucceedDragonSoulRefine(self, inven_type, inven_pos): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if True == self.wndDragonSoulRefine.IsShow(): + self.wndDragonSoulRefine.RefineSucceed(inven_type, inven_pos) + + def OpenDragonSoulRefineWindow(self): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if False == self.wndDragonSoulRefine.IsShow(): + self.wndDragonSoulRefine.Show() + if None != self.wndDragonSoul: + if False == self.wndDragonSoul.IsShow(): + self.wndDragonSoul.Show() + + def CloseDragonSoulRefineWindow(self): + if False == player.IsObserverMode(): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if True == self.wndDragonSoulRefine.IsShow(): + self.wndDragonSoulRefine.Close() + + # 侩去籍 场 + + def ToggleGuildWindow(self): + if not self.wndGuild.IsShow(): + if self.wndGuild.CanOpen(): + self.wndGuild.Open() + else: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GUILD_YOU_DO_NOT_JOIN) + else: + self.wndGuild.OverOutItem() + self.wndGuild.Hide() + + def ToggleChatLogWindow(self): + if self.wndChatLog.IsShow(): + self.wndChatLog.Hide() + else: + self.wndChatLog.Show() + + def CheckGameButton(self): + if self.wndGameButton: + self.wndGameButton.CheckGameButton() + + def __OnClickStatusPlusButton(self): + self.ToggleCharacterWindow("STATUS") + + def __OnClickSkillPlusButton(self): + self.ToggleCharacterWindow("SKILL") + + def __OnClickQuestButton(self): + self.ToggleCharacterWindow("QUEST") + + def __OnClickHelpButton(self): + player.SetPlayTime(1) + self.CheckGameButton() + self.OpenHelpWindow() + + def __OnClickBuildButton(self): + self.BUILD_OpenWindow() + + def OpenHelpWindow(self): + self.wndUICurtain.Show() + self.wndHelp.Open() + + def CloseHelpWindow(self): + self.wndUICurtain.Hide() + self.wndHelp.Close() + + def OpenWebWindow(self, url): + self.wndWeb.Open(url) + + # 昆其捞瘤甫 凯搁 盲泼阑 摧绰促 + self.wndChat.CloseChat() + + # show GIFT + def ShowGift(self): + self.wndTaskBar.ShowGift() + + def CloseWbWindow(self): + self.wndWeb.Close() + + def OpenCubeWindow(self): + self.wndCube.Open() + + if FALSE == self.wndInventory.IsShow(): + self.wndInventory.Show() + + def UpdateCubeInfo(self, gold, itemVnum, count): + self.wndCube.UpdateInfo(gold, itemVnum, count) + + def CloseCubeWindow(self): + self.wndCube.Close() + + def FailedCubeWork(self): + self.wndCube.Refresh() + + def SucceedCubeWork(self, itemVnum, count): + self.wndCube.Clear() + + print "钮宏 力累 己傍! [%d:%d]" % (itemVnum, count) + + if 0: # 搬苞 皋矫瘤 免仿篮 积帆 茄促 + self.wndCubeResult.SetPosition(*self.wndCube.GetGlobalPosition()) + self.wndCubeResult.SetCubeResultItem(itemVnum, count) + self.wndCubeResult.Open() + self.wndCubeResult.SetTop() + + def __HideWindows(self): + hideWindows = self.wndTaskBar,\ + self.wndCharacter,\ + self.wndInventory,\ + self.wndMiniMap,\ + self.wndGuild,\ + self.wndMessenger,\ + self.wndChat,\ + self.wndParty,\ + self.wndGameButton, + + if self.wndEnergyBar: + hideWindows += self.wndEnergyBar, + + if self.wndExpandedTaskBar: + hideWindows += self.wndExpandedTaskBar, + + if app.ENABLE_DRAGON_SOUL_SYSTEM: + hideWindows += self.wndDragonSoul,\ + self.wndDragonSoulRefine, + + hideWindows = filter(lambda x:x.IsShow(), hideWindows) + map(lambda x:x.Hide(), hideWindows) + import sys + + self.HideAllQuestButton() + self.HideAllWhisperButton() + + if self.wndChat.IsEditMode(): + self.wndChat.CloseChat() + + return hideWindows + + def __ShowWindows(self, wnds): + import sys + map(lambda x:x.Show(), wnds) + global IsQBHide + if not IsQBHide: + self.ShowAllQuestButton() + else: + self.HideAllQuestButton() + + self.ShowAllWhisperButton() + + def BINARY_OpenAtlasWindow(self): + if self.wndMiniMap: + self.wndMiniMap.ShowAtlas() + + def BINARY_SetObserverMode(self, flag): + self.wndGameButton.SetObserverMode(flag) + + # ACCESSORY_REFINE_ADD_METIN_STONE + def BINARY_OpenSelectItemWindow(self): + self.wndItemSelect.Open() + # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE + + ##################################################################################### + ### Private Shop ### + + def OpenPrivateShopInputNameDialog(self): + #if player.IsInSafeArea(): + # chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA) + # return + + inputDialog = uiCommon.InputDialog() + inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE) + inputDialog.SetMaxLength(32) + inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder)) + inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog)) + inputDialog.Open() + self.inputDialog = inputDialog + + def ClosePrivateShopInputNameDialog(self): + self.inputDialog = None + return True + + def OpenPrivateShopBuilder(self): + + if not self.inputDialog: + return True + + if not len(self.inputDialog.GetText()): + return True + + self.privateShopBuilder.Open(self.inputDialog.GetText()) + self.ClosePrivateShopInputNameDialog() + return True + + def AppearPrivateShop(self, vid, text): + + board = uiPrivateShopBuilder.PrivateShopAdvertisementBoard() + board.Open(vid, text) + + self.privateShopAdvertisementBoardDict[vid] = board + + def DisappearPrivateShop(self, vid): + + if not self.privateShopAdvertisementBoardDict.has_key(vid): + return + + del self.privateShopAdvertisementBoardDict[vid] + uiPrivateShopBuilder.DeleteADBoard(vid) + + ##################################################################################### + ### Equipment ### + + def OpenEquipmentDialog(self, vid): + dlg = uiEquipmentDialog.EquipmentDialog() + dlg.SetItemToolTip(self.tooltipItem) + dlg.SetCloseEvent(ui.__mem_func__(self.CloseEquipmentDialog)) + dlg.Open(vid) + + self.equipmentDialogDict[vid] = dlg + + def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count): + if not vid in self.equipmentDialogDict: + return + self.equipmentDialogDict[vid].SetEquipmentDialogItem(slotIndex, vnum, count) + + def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value): + if not vid in self.equipmentDialogDict: + return + self.equipmentDialogDict[vid].SetEquipmentDialogSocket(slotIndex, socketIndex, value) + + def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value): + if not vid in self.equipmentDialogDict: + return + self.equipmentDialogDict[vid].SetEquipmentDialogAttr(slotIndex, attrIndex, type, value) + + def CloseEquipmentDialog(self, vid): + if not vid in self.equipmentDialogDict: + return + del self.equipmentDialogDict[vid] + + ##################################################################################### + + ##################################################################################### + ### Quest ### + def BINARY_ClearQuest(self, index): + btn = self.__FindQuestButton(index) + if 0 != btn: + self.__DestroyQuestButton(btn) + + def RecvQuest(self, index, name): + # QUEST_LETTER_IMAGE + self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName()) + # END_OF_QUEST_LETTER_IMAGE + + def BINARY_RecvQuest(self, index, name, iconType, iconName): + + btn = self.__FindQuestButton(index) + if 0 != btn: + self.__DestroyQuestButton(btn) + + btn = uiWhisper.WhisperButton() + + # QUEST_LETTER_IMAGE + ##!! 20061026.levites.涅胶飘_捞固瘤_背眉 + import item + if "item"==iconType: + item.SelectItem(int(iconName)) + buttonImageFileName=item.GetIconImageFileName() + else: + buttonImageFileName=iconName + + if localeInfo.IsEUROPE(): + if "highlight" == iconType: + btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga") + btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga") + btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga") + else: + btn.SetUpVisual(localeInfo.GetLetterCloseImageName()) + btn.SetOverVisual(localeInfo.GetLetterOpenImageName()) + btn.SetDownVisual(localeInfo.GetLetterOpenImageName()) + else: + btn.SetUpVisual(buttonImageFileName) + btn.SetOverVisual(buttonImageFileName) + btn.SetDownVisual(buttonImageFileName) + btn.Flash() + # END_OF_QUEST_LETTER_IMAGE + + if localeInfo.IsARABIC(): + btn.SetToolTipText(name, 0, 35) + btn.ToolTipText.SetHorizontalAlignCenter() + else: + btn.SetToolTipText(name, -20, 35) + btn.ToolTipText.SetHorizontalAlignLeft() + + btn.SetEvent(ui.__mem_func__(self.__StartQuest), btn) + btn.Show() + + btn.index = index + btn.name = name + + self.questButtonList.insert(0, btn) + self.__ArrangeQuestButton() + + #chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.QUEST_APPEND) + + def __ArrangeQuestButton(self): + + screenWidth = wndMgr.GetScreenWidth() + screenHeight = wndMgr.GetScreenHeight() + + ##!! 20061026.levites.涅胶飘_困摹_焊沥 + if self.wndParty.IsShow(): + xPos = 100 + 30 + else: + xPos = 20 + + if localeInfo.IsARABIC(): + xPos = xPos + 15 + + yPos = 170 * screenHeight / 600 + yCount = (screenHeight - 330) / 63 + + count = 0 + for btn in self.questButtonList: + + btn.SetPosition(xPos + (int(count/yCount) * 100), yPos + (count%yCount * 63)) + count += 1 + global IsQBHide + if IsQBHide: + btn.Hide() + else: + btn.Show() + + def __StartQuest(self, btn): + event.QuestButtonClick(btn.index) + self.__DestroyQuestButton(btn) + + def __FindQuestButton(self, index): + for btn in self.questButtonList: + if btn.index == index: + return btn + + return 0 + + def __DestroyQuestButton(self, btn): + btn.SetEvent(0) + self.questButtonList.remove(btn) + self.__ArrangeQuestButton() + + def HideAllQuestButton(self): + for btn in self.questButtonList: + btn.Hide() + + def ShowAllQuestButton(self): + for btn in self.questButtonList: + btn.Show() + ##################################################################################### + + ##################################################################################### + ### Whisper ### + + def __InitWhisper(self): + chat.InitWhisper(self) + + ## 盲泼芒狼 "皋矫瘤 焊郴扁"甫 喘范阑锭 捞抚 绝绰 措拳芒阑 咯绰 窃荐 + ## 捞抚捞 绝扁 锭巩俊 扁粮狼 WhisperDialogDict 客 喊档肺 包府等促. + def OpenWhisperDialogWithoutTarget(self): + if not self.dlgWhisperWithoutTarget: + dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog) + dlgWhisper.BindInterface(self) + dlgWhisper.LoadDialog() + dlgWhisper.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog) + dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30) + dlgWhisper.Show() + self.dlgWhisperWithoutTarget = dlgWhisper + + self.windowOpenPosition = (self.windowOpenPosition+1) % 5 + + else: + self.dlgWhisperWithoutTarget.SetTop() + self.dlgWhisperWithoutTarget.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog) + + ## 捞抚 绝绰 措拳芒俊辑 捞抚阑 搬沥沁阑锭 WhisperDialogDict俊 芒阑 持绢林绰 窃荐 + def RegisterTemporaryWhisperDialog(self, name): + if not self.dlgWhisperWithoutTarget: + return + + btn = self.__FindWhisperButton(name) + if 0 != btn: + self.__DestroyWhisperButton(btn) + + elif self.whisperDialogDict.has_key(name): + oldDialog = self.whisperDialogDict[name] + oldDialog.Destroy() + del self.whisperDialogDict[name] + + self.whisperDialogDict[name] = self.dlgWhisperWithoutTarget + self.dlgWhisperWithoutTarget.OpenWithTarget(name) + self.dlgWhisperWithoutTarget = None + self.__CheckGameMaster(name) + + ## 某腐磐 皋春狼 1:1 措拳 窍扁甫 喘范阑锭 捞抚阑 啊瘤绊 官肺 芒阑 咯绰 窃荐 + def OpenWhisperDialog(self, name): + if not self.whisperDialogDict.has_key(name): + dlg = self.__MakeWhisperDialog(name) + dlg.OpenWithTarget(name) + dlg.chatLine.SetFocus() + dlg.Show() + + self.__CheckGameMaster(name) + btn = self.__FindWhisperButton(name) + if 0 != btn: + self.__DestroyWhisperButton(btn) + + ## 促弗 某腐磐肺何磐 皋技瘤甫 罐疽阑锭 老窜 滚瓢父 剁况 滴绰 窃荐 + def RecvWhisper(self, name): + if not self.whisperDialogDict.has_key(name): + btn = self.__FindWhisperButton(name) + if 0 == btn: + btn = self.__MakeWhisperButton(name) + btn.Flash() + + chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name)) + + else: + btn.Flash() + elif self.IsGameMasterName(name): + dlg = self.whisperDialogDict[name] + dlg.SetGameMasterLook() + + def MakeWhisperButton(self, name): + self.__MakeWhisperButton(name) + + ## 滚瓢阑 喘范阑锭 芒阑 咯绰 窃荐 + def ShowWhisperDialog(self, btn): + try: + self.__MakeWhisperDialog(btn.name) + dlgWhisper = self.whisperDialogDict[btn.name] + dlgWhisper.OpenWithTarget(btn.name) + dlgWhisper.Show() + self.__CheckGameMaster(btn.name) + except: + import dbg + dbg.TraceError("interface.ShowWhisperDialog - Failed to find key") + + ## 滚瓢 檬扁拳 + self.__DestroyWhisperButton(btn) + + ## WhisperDialog 芒俊辑 弥家拳 疙飞阑 荐青沁阑锭 龋免登绰 窃荐 + ## 芒阑 弥家拳 钦聪促. + def MinimizeWhisperDialog(self, name): + + if 0 != name: + self.__MakeWhisperButton(name) + + self.CloseWhisperDialog(name) + + ## WhisperDialog 芒俊辑 摧扁 疙飞阑 荐青沁阑锭 龋免登绰 窃荐 + ## 芒阑 瘤矿聪促. + def CloseWhisperDialog(self, name): + + if 0 == name: + + if self.dlgWhisperWithoutTarget: + self.dlgWhisperWithoutTarget.Destroy() + self.dlgWhisperWithoutTarget = None + + return + + try: + dlgWhisper = self.whisperDialogDict[name] + dlgWhisper.Destroy() + del self.whisperDialogDict[name] + except: + import dbg + dbg.TraceError("interface.CloseWhisperDialog - Failed to find key") + + ## 滚瓢狼 俺荐啊 官差菌阑锭 滚瓢阑 犁沥纺 窍绰 窃荐 + def __ArrangeWhisperButton(self): + + screenWidth = wndMgr.GetScreenWidth() + screenHeight = wndMgr.GetScreenHeight() + + xPos = screenWidth - 70 + yPos = 170 * screenHeight / 600 + yCount = (screenHeight - 330) / 63 + #yCount = (screenHeight - 285) / 63 + + count = 0 + for button in self.whisperButtonList: + + button.SetPosition(xPos + (int(count/yCount) * -50), yPos + (count%yCount * 63)) + count += 1 + + ## 捞抚栏肺 Whisper 滚瓢阑 茫酒 府畔秦 林绰 窃荐 + ## 滚瓢篮 雕寂呈府肺 窍瘤 臼绰 巴篮 沥纺 登绢 滚妨 鉴辑啊 蜡瘤 登瘤 臼栏哥 + ## 捞肺 牢秦 ToolTip甸捞 促弗 滚瓢甸俊 狼秦 啊妨瘤扁 锭巩捞促. + def __FindWhisperButton(self, name): + for button in self.whisperButtonList: + if button.name == name: + return button + + return 0 + + ## 芒阑 父奠聪促. + def __MakeWhisperDialog(self, name): + dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog) + dlgWhisper.BindInterface(self) + dlgWhisper.LoadDialog() + dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30) + self.whisperDialogDict[name] = dlgWhisper + + self.windowOpenPosition = (self.windowOpenPosition+1) % 5 + + return dlgWhisper + + ## 滚瓢阑 父奠聪促. + def __MakeWhisperButton(self, name): + whisperButton = uiWhisper.WhisperButton() + whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") + whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") + whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") + if self.IsGameMasterName(name): + whisperButton.SetToolTipTextWithColor(name, 0xffffa200) + else: + whisperButton.SetToolTipText(name) + whisperButton.ToolTipText.SetHorizontalAlignCenter() + whisperButton.SetEvent(ui.__mem_func__(self.ShowWhisperDialog), whisperButton) + whisperButton.Show() + whisperButton.name = name + + self.whisperButtonList.insert(0, whisperButton) + self.__ArrangeWhisperButton() + + return whisperButton + + def __DestroyWhisperButton(self, button): + button.SetEvent(0) + self.whisperButtonList.remove(button) + self.__ArrangeWhisperButton() + + def HideAllWhisperButton(self): + for btn in self.whisperButtonList: + btn.Hide() + + def ShowAllWhisperButton(self): + for btn in self.whisperButtonList: + btn.Show() + + def __CheckGameMaster(self, name): + if not self.listGMName.has_key(name): + return + if self.whisperDialogDict.has_key(name): + dlg = self.whisperDialogDict[name] + dlg.SetGameMasterLook() + + def RegisterGameMasterName(self, name): + if self.listGMName.has_key(name): + return + self.listGMName[name] = "GM" + + def IsGameMasterName(self, name): + if self.listGMName.has_key(name): + return True + else: + return False + + ##################################################################################### + + ##################################################################################### + ### Guild Building ### + + def BUILD_OpenWindow(self): + self.wndGuildBuilding = uiGuild.BuildGuildBuildingWindow() + self.wndGuildBuilding.Open() + self.wndGuildBuilding.wnds = self.__HideWindows() + self.wndGuildBuilding.SetCloseEvent(ui.__mem_func__(self.BUILD_CloseWindow)) + + def BUILD_CloseWindow(self): + self.__ShowWindows(self.wndGuildBuilding.wnds) + self.wndGuildBuilding = None + + def BUILD_OnUpdate(self): + if not self.wndGuildBuilding: + return + + if self.wndGuildBuilding.IsPositioningMode(): + import background + x, y, z = background.GetPickingPoint() + self.wndGuildBuilding.SetBuildingPosition(x, y, z) + + def BUILD_OnMouseLeftButtonDown(self): + if not self.wndGuildBuilding: + return + + # GUILD_BUILDING + if self.wndGuildBuilding.IsPositioningMode(): + self.wndGuildBuilding.SettleCurrentPosition() + return True + elif self.wndGuildBuilding.IsPreviewMode(): + pass + else: + return True + # END_OF_GUILD_BUILDING + return False + + def BUILD_OnMouseLeftButtonUp(self): + if not self.wndGuildBuilding: + return + + if not self.wndGuildBuilding.IsPreviewMode(): + return True + + return False + + def BULID_EnterGuildArea(self, areaID): + # GUILD_BUILDING + mainCharacterName = player.GetMainCharacterName() + masterName = guild.GetGuildMasterName() + + if mainCharacterName != masterName: + return + + if areaID != player.GetGuildID(): + return + # END_OF_GUILD_BUILDING + + self.wndGameButton.ShowBuildButton() + + def BULID_ExitGuildArea(self, areaID): + self.wndGameButton.HideBuildButton() + + ##################################################################################### + + def IsEditLineFocus(self): + if self.ChatWindow.chatLine.IsFocus(): + return 1 + + if self.ChatWindow.chatToLine.IsFocus(): + return 1 + + return 0 + + def EmptyFunction(self): + pass + +if __name__ == "__main__": + + import app + import wndMgr + import systemSetting + import mouseModule + import grp + import ui + 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() + player.SetItemData(0, 27001, 10) + player.SetItemData(1, 27004, 10) + + self.interface = Interface() + self.interface.MakeInterface() + self.interface.ShowDefaultWindows() + self.interface.RefreshInventory() + #self.interface.OpenCubeWindow() + + 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() diff --git a/root/introcreate.py b/root/introcreate.py new file mode 100644 index 0000000..b5f630c --- /dev/null +++ b/root/introcreate.py @@ -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() diff --git a/root/introempire.py b/root/introempire.py new file mode 100644 index 0000000..f2216fd --- /dev/null +++ b/root/introempire.py @@ -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() diff --git a/root/introloading.py b/root/introloading.py new file mode 100644 index 0000000..6a1f65a --- /dev/null +++ b/root/introloading.py @@ -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() diff --git a/root/intrologin.py b/root/intrologin.py new file mode 100644 index 0000000..fe14548 --- /dev/null +++ b/root/intrologin.py @@ -0,0 +1,1379 @@ +import dbg +import app +import net +import ui +import ime +import snd +import wndMgr +import musicInfo +import serverInfo +import systemSetting +import ServerStateChecker +import localeInfo +import constInfo +import uiCommon +import time +import serverCommandParser +import ime +import uiScriptLocale + +RUNUP_MATRIX_AUTH = False +NEWCIBN_PASSPOD_AUTH = False + +LOGIN_DELAY_SEC = 0.0 +SKIP_LOGIN_PHASE = False +SKIP_LOGIN_PHASE_SUPPORT_CHANNEL = False +FULL_BACK_IMAGE = False + +PASSPOD_MSG_DICT = {} + +VIRTUAL_KEYBOARD_NUM_KEYS = 46 +VIRTUAL_KEYBOARD_RAND_KEY = True + +def Suffle(src): + if VIRTUAL_KEYBOARD_RAND_KEY: + items = [item for item in src] + + itemCount = len(items) + for oldPos in xrange(itemCount): + newPos = app.GetRandom(0, itemCount-1) + items[newPos], items[oldPos] = items[oldPos], items[newPos] + + return "".join(items) + else: + return src + +if localeInfo.IsNEWCIBN() or localeInfo.IsCIBN10(): + LOGIN_DELAY_SEC = 60.0 + FULL_BACK_IMAGE = True + NEWCIBN_PASSPOD_AUTH = True + PASSPOD_MSG_DICT = { + "PASERR1" : localeInfo.LOGIN_FAILURE_PASERR1, + "PASERR2" : localeInfo.LOGIN_FAILURE_PASERR2, + "PASERR3" : localeInfo.LOGIN_FAILURE_PASERR3, + "PASERR4" : localeInfo.LOGIN_FAILURE_PASERR4, + "PASERR5" : localeInfo.LOGIN_FAILURE_PASERR5, + } + +elif localeInfo.IsYMIR() or localeInfo.IsCHEONMA(): + FULL_BACK_IMAGE = True + +elif localeInfo.IsHONGKONG(): + FULL_BACK_IMAGE = True + RUNUP_MATRIX_AUTH = True + PASSPOD_MSG_DICT = { + "NOTELE" : localeInfo.LOGIN_FAILURE_NOTELEBLOCK, + } + +elif localeInfo.IsJAPAN(): + FULL_BACK_IMAGE = True + +elif localeInfo.IsBRAZIL(): + LOGIN_DELAY_SEC = 60.0 + +def IsFullBackImage(): + global FULL_BACK_IMAGE + return FULL_BACK_IMAGE + +def IsLoginDelay(): + global LOGIN_DELAY_SEC + if LOGIN_DELAY_SEC > 0.0: + return True + else: + return False + +def IsRunupMatrixAuth(): + global RUNUP_MATRIX_AUTH + return RUNUP_MATRIX_AUTH + +def IsNEWCIBNPassPodAuth(): + global NEWCIBN_PASSPOD_AUTH + return NEWCIBN_PASSPOD_AUTH + +def GetLoginDelay(): + global LOGIN_DELAY_SEC + return LOGIN_DELAY_SEC + +app.SetGuildMarkPath("test") + +class ConnectingDialog(ui.ScriptWindow): + + def __init__(self): + ui.ScriptWindow.__init__(self) + self.__LoadDialog() + self.eventTimeOver = lambda *arg: None + self.eventExit = lambda *arg: None + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def __LoadDialog(self): + try: + PythonScriptLoader = ui.PythonScriptLoader() + PythonScriptLoader.LoadScriptFile(self, "UIScript/ConnectingDialog.py") + + self.board = self.GetChild("board") + self.message = self.GetChild("message") + self.countdownMessage = self.GetChild("countdown_message") + + except: + import exception + exception.Abort("ConnectingDialog.LoadDialog.BindObject") + + def Open(self, waitTime): + curTime = time.clock() + self.endTime = curTime + waitTime + + self.Lock() + self.SetCenterPosition() + self.SetTop() + self.Show() + + def Close(self): + self.Unlock() + self.Hide() + + def Destroy(self): + self.Hide() + self.ClearDictionary() + + def SetText(self, text): + self.message.SetText(text) + + def SetCountDownMessage(self, waitTime): + self.countdownMessage.SetText("%.0f%s" % (waitTime, localeInfo.SECOND)) + + def SAFE_SetTimeOverEvent(self, event): + self.eventTimeOver = ui.__mem_func__(event) + + def SAFE_SetExitEvent(self, event): + self.eventExit = ui.__mem_func__(event) + + def OnUpdate(self): + lastTime = max(0, self.endTime - time.clock()) + if 0 == lastTime: + self.Close() + self.eventTimeOver() + else: + self.SetCountDownMessage(self.endTime - time.clock()) + + def OnPressExitKey(self): + #self.eventExit() + return True + +class LoginWindow(ui.ScriptWindow): + + IS_TEST = net.IsTest() + + def __init__(self, stream): + print "NEW LOGIN WINDOW ----------------------------------------------------------------------------" + ui.ScriptWindow.__init__(self) + net.SetPhaseWindow(net.PHASE_WINDOW_LOGIN, self) + net.SetAccountConnectorHandler(self) + + self.matrixInputChanceCount = 0 + self.lastLoginTime = 0 + self.inputDialog = None + self.connectingDialog = None + self.stream=stream + self.isNowCountDown=False + self.isStartError=False + + self.xServerBoard = 0 + self.yServerBoard = 0 + + self.loadingImage = None + + self.virtualKeyboard = None + self.virtualKeyboardMode = "ALPHABET" + self.virtualKeyboardIsUpper = False + self.timeOutMsg = False #Fix + + def __del__(self): + net.ClearPhaseWindow(net.PHASE_WINDOW_LOGIN, self) + net.SetAccountConnectorHandler(0) + ui.ScriptWindow.__del__(self) + print "---------------------------------------------------------------------------- DELETE LOGIN WINDOW" + + def Open(self): + ServerStateChecker.Create(self) + + print "LOGIN WINDOW OPEN ----------------------------------------------------------------------------" + + self.loginFailureMsgDict={ + #"DEFAULT" : localeInfo.LOGIN_FAILURE_UNKNOWN, + + "ALREADY" : localeInfo.LOGIN_FAILURE_ALREAY, + "NOID" : localeInfo.LOGIN_FAILURE_NOT_EXIST_ID, + "WRONGPWD" : localeInfo.LOGIN_FAILURE_WRONG_PASSWORD, + "FULL" : localeInfo.LOGIN_FAILURE_TOO_MANY_USER, + "SHUTDOWN" : localeInfo.LOGIN_FAILURE_SHUTDOWN, + "REPAIR" : localeInfo.LOGIN_FAILURE_REPAIR_ID, + "BLOCK" : localeInfo.LOGIN_FAILURE_BLOCK_ID, + "WRONGMAT" : localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER, + "QUIT" : localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER_TRIPLE, + "BESAMEKEY" : localeInfo.LOGIN_FAILURE_BE_SAME_KEY, + "NOTAVAIL" : localeInfo.LOGIN_FAILURE_NOT_AVAIL, + "NOBILL" : localeInfo.LOGIN_FAILURE_NOBILL, + "BLKLOGIN" : localeInfo.LOGIN_FAILURE_BLOCK_LOGIN, + "WEBBLK" : localeInfo.LOGIN_FAILURE_WEB_BLOCK, + "BADSCLID" : localeInfo.LOGIN_FAILURE_WRONG_SOCIALID, + "AGELIMIT" : localeInfo.LOGIN_FAILURE_SHUTDOWN_TIME, + } + + self.loginFailureFuncDict = { + "WRONGPWD" : self.__DisconnectAndInputPassword, + "WRONGMAT" : self.__DisconnectAndInputMatrix, + "QUIT" : app.Exit, + } + + self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) + self.SetWindowName("LoginWindow") + + if not self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoginWindow.py"): + dbg.TraceError("LoginWindow.Open - __LoadScript Error") + return + + self.__LoadLoginInfo("loginInfo.xml") + + if app.loggined: + self.loginFailureFuncDict = { + "WRONGPWD" : app.Exit, + "WRONGMAT" : app.Exit, + "QUIT" : app.Exit, + } + + if musicInfo.loginMusic != "": + snd.SetMusicVolume(systemSetting.GetMusicVolume()) + snd.FadeInMusic("BGM/"+musicInfo.loginMusic) + + snd.SetSoundVolume(systemSetting.GetSoundVolume()) + + # pevent key "[" "]" + ime.AddExceptKey(91) + ime.AddExceptKey(93) + + self.Show() + + global SKIP_LOGIN_PHASE + if SKIP_LOGIN_PHASE: + if self.isStartError: + self.connectBoard.Hide() + self.loginBoard.Hide() + self.serverBoard.Hide() + self.PopupNotifyMessage(localeInfo.LOGIN_CONNECT_FAILURE, self.__ExitGame) + return + + if self.loginInfo: + self.serverBoard.Hide() + else: + self.__RefreshServerList() + self.__OpenServerBoard() + else: + connectingIP = self.stream.GetConnectAddr() + if connectingIP: + if app.USE_OPENID and not app.OPENID_TEST : + self.__RefreshServerList() + self.__OpenServerBoard() + else: + self.__OpenLoginBoard() + if IsFullBackImage(): + self.GetChild("bg1").Hide() + self.GetChild("bg2").Show() + + else: + self.__RefreshServerList() + self.__OpenServerBoard() + + app.ShowCursor() + + def Close(self): + + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + ServerStateChecker.Initialize(self) + + print "---------------------------------------------------------------------------- CLOSE LOGIN WINDOW " + # + # selectMusic捞 绝栏搁 BGM捞 谗扁骨肺 滴俺 促 眉农茄促. + # + if musicInfo.loginMusic != "" and musicInfo.selectMusic != "": + snd.FadeOutMusic("BGM/"+musicInfo.loginMusic) + + ## NOTE : idEditLine客 pwdEditLine篮 捞亥飘啊 辑肺 楷搬 登绢乐绢辑 + ## Event甫 碍力肺 檬扁拳 秦林绢具父 钦聪促 - [levites] + self.idEditLine.SetTabEvent(0) + self.idEditLine.SetReturnEvent(0) + self.pwdEditLine.SetReturnEvent(0) + self.pwdEditLine.SetTabEvent(0) + + self.connectBoard = None + self.loginBoard = None + self.idEditLine = None + self.pwdEditLine = None + self.inputDialog = None + self.connectingDialog = None + self.loadingImage = None + + self.serverBoard = None + self.serverList = None + self.channelList = None + + # RUNUP_MATRIX_AUTH + self.matrixQuizBoard = None + self.matrixAnswerInput = None + self.matrixAnswerOK = None + self.matrixAnswerCancel = None + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + self.passpodBoard = None + self.passpodAnswerInput = None + self.passpodAnswerOK = None + self.passpodAnswerCancel = None + # NEWCIBN_PASSPOD_AUTH_END + + self.VIRTUAL_KEY_ALPHABET_LOWERS = None + self.VIRTUAL_KEY_ALPHABET_UPPERS = None + self.VIRTUAL_KEY_SYMBOLS = None + self.VIRTUAL_KEY_NUMBERS = None + + # VIRTUAL_KEYBOARD_BUG_FIX + if self.virtualKeyboard: + for keyIndex in xrange(0, VIRTUAL_KEYBOARD_NUM_KEYS+1): + key = self.GetChild2("key_%d" % keyIndex) + if key: + key.SetEvent(None) + + self.GetChild("key_space").SetEvent(None) + self.GetChild("key_backspace").SetEvent(None) + self.GetChild("key_enter").SetEvent(None) + self.GetChild("key_shift").SetToggleDownEvent(None) + self.GetChild("key_shift").SetToggleUpEvent(None) + self.GetChild("key_at").SetToggleDownEvent(None) + self.GetChild("key_at").SetToggleUpEvent(None) + + self.virtualKeyboard = None + + self.KillFocus() + self.Hide() + + self.stream.popupWindow.Close() + self.loginFailureFuncDict=None + + ime.ClearExceptKey() + + app.HideCursor() + + def __SaveChannelInfo(self): + try: + file=open("channel.inf", "w") + file.write("%d %d %d" % (self.__GetServerID(), self.__GetChannelID(), self.__GetRegionID())) + except: + print "LoginWindow.__SaveChannelInfo - SaveError" + + def __LoadChannelInfo(self): + try: + file=open("channel.inf") + lines=file.readlines() + + if len(lines)>0: + tokens=lines[0].split() + + selServerID=int(tokens[0]) + selChannelID=int(tokens[1]) + + if len(tokens) == 3: + regionID = int(tokens[2]) + + return regionID, selServerID, selChannelID + + except: + print "LoginWindow.__LoadChannelInfo - OpenError" + return -1, -1, -1 + + def __ExitGame(self): + app.Exit() + + def SetIDEditLineFocus(self): + if self.idEditLine != None: + self.idEditLine.SetFocus() + + def SetPasswordEditLineFocus(self): + if localeInfo.IsEUROPE(): + if self.idEditLine != None: #0000862: [M2EU] 肺弊牢芒 扑诀 俊矾: 辆丰矫 刚历 None 汲沥凳 + self.idEditLine.SetText("") + self.idEditLine.SetFocus() #0000685: [M2EU] 酒捞叼/厚剐锅龋 蜡眠 啊瓷 滚弊 荐沥: 公炼扒 酒捞叼肺 器目胶啊 啊霸 父电促 + + if self.pwdEditLine != None: #0000862: [M2EU] 肺弊牢芒 扑诀 俊矾: 辆丰矫 刚历 None 汲沥凳 + self.pwdEditLine.SetText("") + else: + if self.pwdEditLine != None: + self.pwdEditLine.SetFocus() + + def OnEndCountDown(self): + self.isNowCountDown = False + if localeInfo.IsBRAZIL(): + self.timeOutMsg = True + else: + self.timeOutMsg = False + self.OnConnectFailure() + + def OnConnectFailure(self): + + if self.isNowCountDown: + return + + snd.PlaySound("sound/ui/loginfail.wav") + + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + if app.loggined: + self.PopupNotifyMessage(localeInfo.LOGIN_CONNECT_FAILURE, self.__ExitGame) + elif self.timeOutMsg: + self.PopupNotifyMessage(localeInfo.LOGIN_FAILURE_TIMEOUT, self.SetPasswordEditLineFocus) + else: + self.PopupNotifyMessage(localeInfo.LOGIN_CONNECT_FAILURE, self.SetPasswordEditLineFocus) + + def OnHandShake(self): + if not IsLoginDelay(): + snd.PlaySound("sound/ui/loginok.wav") + self.PopupDisplayMessage(localeInfo.LOGIN_CONNECT_SUCCESS) + + def OnLoginStart(self): + if not IsLoginDelay(): + self.PopupDisplayMessage(localeInfo.LOGIN_PROCESSING) + + def OnLoginFailure(self, error): + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + try: + loginFailureMsg = self.loginFailureMsgDict[error] + except KeyError: + if PASSPOD_MSG_DICT: + try: + loginFailureMsg = PASSPOD_MSG_DICT[error] + except KeyError: + loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN + error + else: + loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN + error + + + #0000685: [M2EU] 酒捞叼/厚剐锅龋 蜡眠 啊瓷 滚弊 荐沥: 公炼扒 菩胶况靛肺 器目胶啊 啊霸 父电促 + loginFailureFunc=self.loginFailureFuncDict.get(error, self.SetPasswordEditLineFocus) + + if app.loggined: + self.PopupNotifyMessage(loginFailureMsg, self.__ExitGame) + else: + self.PopupNotifyMessage(loginFailureMsg, loginFailureFunc) + + snd.PlaySound("sound/ui/loginfail.wav") + + def __DisconnectAndInputID(self): + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + self.SetIDEditLineFocus() + net.Disconnect() + + def __DisconnectAndInputPassword(self): + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + self.SetPasswordEditLineFocus() + net.Disconnect() + + def __DisconnectAndInputMatrix(self): + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + self.stream.popupWindow.Close() + self.matrixInputChanceCount -= 1 + + if self.matrixInputChanceCount <= 0: + self.__OnCloseInputDialog() + + elif self.inputDialog: + self.inputDialog.Show() + + def __LoadScript(self, fileName): + import dbg + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, fileName) + except: + import exception + exception.Abort("LoginWindow.__LoadScript.LoadObject") + try: + GetObject=self.GetChild + self.serverBoard = GetObject("ServerBoard") + self.serverList = GetObject("ServerList") + self.channelList = GetObject("ChannelList") + self.serverSelectButton = GetObject("ServerSelectButton") + self.serverExitButton = GetObject("ServerExitButton") + self.connectBoard = GetObject("ConnectBoard") + self.loginBoard = GetObject("LoginBoard") + self.idEditLine = GetObject("ID_EditLine") + self.pwdEditLine = GetObject("Password_EditLine") + self.serverInfo = GetObject("ConnectName") + self.selectConnectButton = GetObject("SelectConnectButton") + self.loginButton = GetObject("LoginButton") + self.loginExitButton = GetObject("LoginExitButton") + + if localeInfo.IsVIETNAM(): + self.checkButton = GetObject("CheckButton") + self.checkButton.Down() + + # RUNUP_MATRIX_AUTH + if IsRunupMatrixAuth(): + self.matrixQuizBoard = GetObject("RunupMatrixQuizBoard") + self.matrixAnswerInput = GetObject("RunupMatrixAnswerInput") + self.matrixAnswerOK = GetObject("RunupMatrixAnswerOK") + self.matrixAnswerCancel = GetObject("RunupMatrixAnswerCancel") + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + if IsNEWCIBNPassPodAuth(): + self.passpodBoard = GetObject("NEWCIBN_PASSPOD_BOARD") + self.passpodAnswerInput = GetObject("NEWCIBN_PASSPOD_INPUT") + self.passpodAnswerOK = GetObject("NEWCIBN_PASSPOD_OK") + self.passpodAnswerCancel= GetObject("NEWCIBN_PASSPOD_CANCEL") + # NEWCIBN_PASSPOD_AUTH_END + + self.virtualKeyboard = self.GetChild2("VirtualKeyboard") + + if self.virtualKeyboard: + self.VIRTUAL_KEY_ALPHABET_UPPERS = Suffle(localeInfo.VIRTUAL_KEY_ALPHABET_UPPERS) + self.VIRTUAL_KEY_ALPHABET_LOWERS = "".join([localeInfo.VIRTUAL_KEY_ALPHABET_LOWERS[localeInfo.VIRTUAL_KEY_ALPHABET_UPPERS.index(e)] for e in self.VIRTUAL_KEY_ALPHABET_UPPERS]) + if localeInfo.IsBRAZIL(): + self.VIRTUAL_KEY_SYMBOLS_BR = Suffle(localeInfo.VIRTUAL_KEY_SYMBOLS_BR) + else: + self.VIRTUAL_KEY_SYMBOLS = Suffle(localeInfo.VIRTUAL_KEY_SYMBOLS) + self.VIRTUAL_KEY_NUMBERS = Suffle(localeInfo.VIRTUAL_KEY_NUMBERS) + self.__VirtualKeyboard_SetAlphabetMode() + + self.GetChild("key_space").SetEvent(lambda : self.__VirtualKeyboard_PressKey(' ')) + self.GetChild("key_backspace").SetEvent(lambda : self.__VirtualKeyboard_PressBackspace()) + self.GetChild("key_enter").SetEvent(lambda : self.__VirtualKeyboard_PressReturn()) + self.GetChild("key_shift").SetToggleDownEvent(lambda : self.__VirtualKeyboard_SetUpperMode()) + self.GetChild("key_shift").SetToggleUpEvent(lambda : self.__VirtualKeyboard_SetLowerMode()) + self.GetChild("key_at").SetToggleDownEvent(lambda : self.__VirtualKeyboard_SetSymbolMode()) + self.GetChild("key_at").SetToggleUpEvent(lambda : self.__VirtualKeyboard_SetAlphabetMode()) + + except: + import exception + exception.Abort("LoginWindow.__LoadScript.BindObject") + + if self.IS_TEST: + self.selectConnectButton.Hide() + else: + self.selectConnectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectConnectButton)) + + self.serverBoard.OnKeyUp = ui.__mem_func__(self.__ServerBoard_OnKeyUp) + self.xServerBoard, self.yServerBoard = self.serverBoard.GetLocalPosition() + + self.serverSelectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectServerButton)) + self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) + + self.loginButton.SetEvent(ui.__mem_func__(self.__OnClickLoginButton)) + self.loginExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) + + self.serverList.SetEvent(ui.__mem_func__(self.__OnSelectServer)) + + self.idEditLine.SetReturnEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) + self.idEditLine.SetTabEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) + + self.pwdEditLine.SetReturnEvent(ui.__mem_func__(self.__OnClickLoginButton)) + self.pwdEditLine.SetTabEvent(ui.__mem_func__(self.idEditLine.SetFocus)) + + # RUNUP_MATRIX_AUTH + if IsRunupMatrixAuth(): + self.matrixAnswerOK.SAFE_SetEvent(self.__OnClickMatrixAnswerOK) + self.matrixAnswerCancel.SAFE_SetEvent(self.__OnClickMatrixAnswerCancel) + self.matrixAnswerInput.SAFE_SetReturnEvent(self.__OnClickMatrixAnswerOK) + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + if IsNEWCIBNPassPodAuth(): + self.passpodAnswerOK.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerOK) + self.passpodAnswerCancel.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerCancel) + self.passpodAnswerInput.SAFE_SetReturnEvent(self.__OnClickNEWCIBNPasspodAnswerOK) + + # NEWCIBN_PASSPOD_AUTH_END + + + if IsFullBackImage(): + self.GetChild("bg1").Show() + self.GetChild("bg2").Hide() + return 1 + + def __VirtualKeyboard_SetKeys(self, keyCodes): + uiDefFontBackup = localeInfo.UI_DEF_FONT + localeInfo.UI_DEF_FONT = localeInfo.UI_DEF_FONT_LARGE + + keyIndex = 1 + for keyCode in keyCodes: + key = self.GetChild2("key_%d" % keyIndex) + if key: + key.SetEvent(lambda x=keyCode: self.__VirtualKeyboard_PressKey(x)) + key.SetText(keyCode) + key.ButtonText.SetFontColor(0, 0, 0) + keyIndex += 1 + + for keyIndex in xrange(keyIndex, VIRTUAL_KEYBOARD_NUM_KEYS+1): + key = self.GetChild2("key_%d" % keyIndex) + if key: + key.SetEvent(lambda x=' ': self.__VirtualKeyboard_PressKey(x)) + key.SetText(' ') + + localeInfo.UI_DEF_FONT = uiDefFontBackup + + def __VirtualKeyboard_PressKey(self, code): + ime.PasteString(code) + + #if self.virtualKeyboardMode == "ALPHABET" and self.virtualKeyboardIsUpper: + # self.__VirtualKeyboard_SetLowerMode() + + def __VirtualKeyboard_PressBackspace(self): + ime.PasteBackspace() + + def __VirtualKeyboard_PressReturn(self): + ime.PasteReturn() + + def __VirtualKeyboard_SetUpperMode(self): + self.virtualKeyboardIsUpper = True + + if self.virtualKeyboardMode == "ALPHABET": + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_ALPHABET_UPPERS) + elif self.virtualKeyboardMode == "NUMBER": + if localeInfo.IsBRAZIL(): + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS_BR) + else: + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS) + else: + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_NUMBERS) + + def __VirtualKeyboard_SetLowerMode(self): + self.virtualKeyboardIsUpper = False + + if self.virtualKeyboardMode == "ALPHABET": + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_ALPHABET_LOWERS) + elif self.virtualKeyboardMode == "NUMBER": + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_NUMBERS) + else: + if localeInfo.IsBRAZIL(): + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS_BR) + else: + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS) + + def __VirtualKeyboard_SetAlphabetMode(self): + self.virtualKeyboardIsUpper = False + self.virtualKeyboardMode = "ALPHABET" + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_ALPHABET_LOWERS) + + def __VirtualKeyboard_SetNumberMode(self): + self.virtualKeyboardIsUpper = False + self.virtualKeyboardMode = "NUMBER" + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_NUMBERS) + + def __VirtualKeyboard_SetSymbolMode(self): + self.virtualKeyboardIsUpper = False + self.virtualKeyboardMode = "SYMBOL" + if localeInfo.IsBRAZIL(): + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS_BR) + else: + self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS) + + def Connect(self, id, pwd): + + if constInfo.SEQUENCE_PACKET_ENABLE: + net.SetPacketSequenceMode() + + if IsLoginDelay(): + loginDelay = GetLoginDelay() + self.connectingDialog = ConnectingDialog() + self.connectingDialog.Open(loginDelay) + self.connectingDialog.SAFE_SetTimeOverEvent(self.OnEndCountDown) + self.connectingDialog.SAFE_SetExitEvent(self.OnPressExitKey) + self.isNowCountDown = True + + else: + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.LOGIN_CONNETING, self.SetPasswordEditLineFocus, localeInfo.UI_CANCEL) + + self.stream.SetLoginInfo(id, pwd) + self.stream.Connect() + + def __OnClickExitButton(self): + self.stream.SetPhaseWindow(0) + + def __SetServerInfo(self, name): + net.SetServerInfo(name.strip()) + self.serverInfo.SetText(name) + + def __LoadLoginInfo(self, loginInfoFileName): + + try: + loginInfo={} + execfile(loginInfoFileName, loginInfo) + except IOError: + print(\ + "磊悼 肺弊牢阑 窍矫妨搁" + loginInfoFileName + "颇老阑 累己秦林技夸\n"\ + "\n"\ + "郴侩:\n"\ + "================================================================\n"\ + "addr=林家\n"\ + "port=器飘\n"\ + "id=酒捞叼\n"\ + "pwd=厚剐锅龋\n"\ + "slot=某腐磐 急琶 牢郸胶 (绝芭唱 -1捞搁 磊悼 急琶 救窃)\n"\ + "autoLogin=磊悼 立加 咯何\n" + "autoSelect=磊悼 立加 咯何\n" + "locale=(ymir) LC_Ymir 老版快 ymir肺 累悼. 瘤沥窍瘤 臼栏搁 korea肺 累悼\n" + ); + + id=loginInfo.get("id", "") + pwd=loginInfo.get("pwd", "") + + if self.IS_TEST: + try: + addr=loginInfo["addr"] + port=loginInfo["port"] + account_addr=addr + account_port=port + + net.SetMarkServer(addr, port) + self.__SetServerInfo(locale.CHANNEL_TEST_SERVER_ADDR % (addr, port)) + except: + try: + addr=serverInfo.TESTADDR["ip"] + port=serverInfo.TESTADDR["tcp_port"] + + net.SetMarkServer(addr, port) + self.__SetServerInfo(locale.CHANNEL_TEST_SERVER) + except: + import exception + exception.Abort("LoginWindow.__LoadLoginInfo - 抛胶飘辑滚 林家啊 绝嚼聪促") + + else: + addr=loginInfo.get("addr", "") + port=loginInfo.get("port", 0) + account_addr=loginInfo.get("account_addr", addr) + account_port=loginInfo.get("account_port", port) + + locale = loginInfo.get("locale", "") + + if addr and port: + net.SetMarkServer(addr, port) + + if locale == "ymir" : + net.SetServerInfo("玫付 辑滚") + self.serverInfo.SetText("Y:"+addr+":"+str(port)) + else: + net.SetServerInfo(addr+":"+str(port)) + self.serverInfo.SetText("K:"+addr+":"+str(port)) + + slot=loginInfo.get("slot", 0) + isAutoLogin=loginInfo.get("auto", 0) + isAutoLogin=loginInfo.get("autoLogin", 0) + isAutoSelect=loginInfo.get("autoSelect", 0) + + self.stream.SetCharacterSlot(slot) + self.stream.SetConnectInfo(addr, port, account_addr, account_port) + self.stream.isAutoLogin=isAutoLogin + self.stream.isAutoSelect=isAutoSelect + + self.id = None + self.pwd = None + self.loginnedServer = None + self.loginnedChannel = None + app.loggined = FALSE + + self.loginInfo = loginInfo + + if self.id and self.pwd: + app.loggined = TRUE + + if isAutoLogin: + self.Connect(id, pwd) + + print "==================================================================================" + print "磊悼 肺弊牢: %s - %s:%d %s" % (loginInfoFileName, addr, port, id) + print "==================================================================================" + + + def PopupDisplayMessage(self, msg): + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(msg) + + def PopupNotifyMessage(self, msg, func=0): + if not func: + func=self.EmptyFunc + + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(msg, func, localeInfo.UI_OK) + + # RUNUP_MATRIX_AUTH + def BINARY_OnRunupMatrixQuiz(self, quiz): + if not IsRunupMatrixAuth(): + return + + id = self.GetChild("RunupMatrixID") + id.SetText(self.idEditLine.GetText()) + + code = self.GetChild("RunupMatrixCode") + + code.SetText("".join(["[%c,%c]" % (quiz[i], quiz[i+1]) for i in xrange(0, len(quiz), 2)])) + + self.stream.popupWindow.Close() + self.serverBoard.Hide() + self.connectBoard.Hide() + self.loginBoard.Hide() + self.matrixQuizBoard.Show() + self.matrixAnswerInput.SetFocus() + + def __OnClickMatrixAnswerOK(self): + answer = self.matrixAnswerInput.GetText() + + print "matrix_quiz.ok" + net.SendRunupMatrixCardPacket(answer) + self.matrixQuizBoard.Hide() + + self.stream.popupWindow.Close() + self.stream.popupWindow.Open("WAITING FOR MATRIX AUTHENTICATION", + self.__OnClickMatrixAnswerCancel, + localeInfo.UI_CANCEL) + + def __OnClickMatrixAnswerCancel(self): + print "matrix_quiz.cancel" + + if self.matrixQuizBoard: + self.matrixQuizBoard.Hide() + + if self.connectBoard: + self.connectBoard.Show() + + if self.loginBoard: + self.loginBoard.Show() + + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + def BINARY_OnNEWCIBNPasspodRequest(self): + if not IsNEWCIBNPassPodAuth(): + return + + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + self.stream.popupWindow.Close() + self.serverBoard.Hide() + self.connectBoard.Hide() + self.loginBoard.Hide() + self.passpodBoard.Show() + self.passpodAnswerInput.SetFocus() + + def BINARY_OnNEWCIBNPasspodFailure(self): + if not IsNEWCIBNPassPodAuth(): + return + + def __OnClickNEWCIBNPasspodAnswerOK(self): + answer = self.passpodAnswerInput.GetText() + + print "passpod.ok" + net.SendNEWCIBNPasspodAnswerPacket(answer) + self.passpodAnswerInput.SetText("") + self.passpodBoard.Hide() + + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.WAIT_FOR_PASSPOD, + self.__OnClickNEWCIBNPasspodAnswerCancel, + localeInfo.UI_CANCEL) + + def __OnClickNEWCIBNPasspodAnswerCancel(self): + print "passpod.cancel" + + if self.passpodBoard: + self.passpodBoard.Hide() + + if self.connectBoard: + self.connectBoard.Show() + + if self.loginBoard: + self.loginBoard.Show() + + # NEWCIBN_PASSPOD_AUTH_END + + + def OnMatrixCard(self, row1, row2, row3, row4, col1, col2, col3, col4): + + if self.connectingDialog: + self.connectingDialog.Close() + self.connectingDialog = None + + self.matrixInputChanceCount = 3 + + self.stream.popupWindow.Close() + + # CHINA_MATRIX_CARD_BUG_FIX + ## A~Z 鳖瘤 26 捞郴狼 蔼捞 甸绢乐绢具父 茄促. + ## Python Exception Log 俊辑 弊 捞惑狼 蔼捞 甸绢乐绢辑 俊矾 规瘤 + ## 清单 恐 茄惫率 肺弊俊辑 捞霸 劝侩登绰瘤绰 葛福摆澜 + row1 = min(30, row1) + row2 = min(30, row2) + row3 = min(30, row3) + row4 = min(30, row4) + # END_OF_CHINA_MATRIX_CARD_BUG_FIX + + row1 = chr(row1 + ord('A')) + row2 = chr(row2 + ord('A')) + row3 = chr(row3 + ord('A')) + row4 = chr(row4 + ord('A')) + col1 = col1 + 1 + col2 = col2 + 1 + col3 = col3 + 1 + col4 = col4 + 1 + + inputDialog = uiCommon.InputDialogWithDescription2() + inputDialog.SetMaxLength(8) + inputDialog.SetAcceptEvent(ui.__mem_func__(self.__OnAcceptMatrixCardData)) + inputDialog.SetCancelEvent(ui.__mem_func__(self.__OnCancelMatrixCardData)) + inputDialog.SetTitle(localeInfo.INPUT_MATRIX_CARD_TITLE) + inputDialog.SetDescription1(localeInfo.INPUT_MATRIX_CARD_NUMBER) + inputDialog.SetDescription2("%c%d %c%d %c%d %c%d" % (row1, col1, + row2, col2, + row3, col3, + row4, col4)) + + inputDialog.Open() + self.inputDialog = inputDialog + + def __OnAcceptMatrixCardData(self): + text = self.inputDialog.GetText() + net.SendChinaMatrixCardPacket(text) + if self.inputDialog: + self.inputDialog.Hide() + self.PopupNotifyMessage(localeInfo.LOGIN_PROCESSING) + return True + + def __OnCancelMatrixCardData(self): + self.SetPasswordEditLineFocus() + self.__OnCloseInputDialog() + self.__DisconnectAndInputPassword() + return True + + def __OnCloseInputDialog(self): + if self.inputDialog: + self.inputDialog.Close() + self.inputDialog = None + return True + + def OnPressExitKey(self): + self.stream.popupWindow.Close() + self.stream.SetPhaseWindow(0) + return True + + def OnExit(self): + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER_TRIPLE, app.Exit, localeInfo.UI_OK) + + def OnUpdate(self): + ServerStateChecker.Update() + + def EmptyFunc(self): + pass + + ##################################################################################### + + def __ServerBoard_OnKeyUp(self, key): + if self.serverBoard.IsShow(): + if app.DIK_RETURN==key: + self.__OnClickSelectServerButton() + return True + + def __GetRegionID(self): + return 0 + + def __GetServerID(self): + return self.serverList.GetSelectedItem() + + def __GetChannelID(self): + return self.channelList.GetSelectedItem() + + # SEVER_LIST_BUG_FIX + def __ServerIDToServerIndex(self, regionID, targetServerID): + try: + regionDict = serverInfo.REGION_DICT[regionID] + except KeyError: + return -1 + + retServerIndex = 0 + for eachServerID, regionDataDict in regionDict.items(): + if eachServerID == targetServerID: + return retServerIndex + + retServerIndex += 1 + + return -1 + + def __ChannelIDToChannelIndex(self, channelID): + return channelID - 1 + # END_OF_SEVER_LIST_BUG_FIX + + def __OpenServerBoard(self): + + loadRegionID, loadServerID, loadChannelID = self.__LoadChannelInfo() + + serverIndex = self.__ServerIDToServerIndex(loadRegionID, loadServerID) + channelIndex = self.__ChannelIDToChannelIndex(loadChannelID) + + # RUNUP_MATRIX_AUTH + if IsRunupMatrixAuth(): + self.matrixQuizBoard.Hide() + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + if IsNEWCIBNPassPodAuth(): + self.passpodBoard.Hide() + # NEWCIBN_PASSPOD_AUTH_END + + + self.serverList.SelectItem(serverIndex) + + if localeInfo.IsEUROPE(): + self.channelList.SelectItem(app.GetRandom(0, self.channelList.GetItemCount())) + else: + if channelIndex >= 0: + self.channelList.SelectItem(channelIndex) + + ## Show/Hide 内靛俊 巩力啊 乐绢辑 烙矫 - [levites] + self.serverBoard.SetPosition(self.xServerBoard, self.yServerBoard) + self.serverBoard.Show() + self.connectBoard.Hide() + self.loginBoard.Hide() + + if self.virtualKeyboard: + self.virtualKeyboard.Hide() + + if app.loggined and not SKIP_LOGIN_PHASE_SUPPORT_CHANNEL: + self.serverList.SelectItem(self.loginnedServer-1) + self.channelList.SelectItem(self.loginnedChannel-1) + self.__OnClickSelectServerButton() + + def __OpenLoginBoard(self): + + # self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton)) + self.serverExitButton.SetText(localeInfo.UI_CLOSE) + + # RUNUP_MATRIX_AUTH + if IsRunupMatrixAuth(): + self.matrixQuizBoard.Hide() + # RUNUP_MATRIX_AUTH_END + + # NEWCIBN_PASSPOD_AUTH + if IsNEWCIBNPassPodAuth(): + self.passpodBoard.Hide() + # NEWCIBN_PASSPOD_AUTH_END + + self.serverBoard.SetPosition(self.xServerBoard, wndMgr.GetScreenHeight()) + self.serverBoard.Hide() + + if self.virtualKeyboard: + self.virtualKeyboard.Show() + + if app.loggined: + self.Connect(self.id, self.pwd) + self.connectBoard.Hide() + self.loginBoard.Hide() + elif not self.stream.isAutoLogin: + self.connectBoard.Show() + self.loginBoard.Show() + + ## if users have the login infomation, then don't initialize.2005.9 haho + if self.idEditLine == None: + self.idEditLine.SetText("") + if self.pwdEditLine == None: + self.pwdEditLine.SetText("") + + self.idEditLine.SetFocus() + + global SKIP_LOGIN_PHASE + if SKIP_LOGIN_PHASE: + if not self.loginInfo: + self.connectBoard.Hide() + + def __OnSelectRegionGroup(self): + self.__RefreshServerList() + + def __OnSelectSettlementArea(self): + # SEVER_LIST_BUG_FIX + regionID = self.__GetRegionID() + serverID = self.serverListOnRegionBoard.GetSelectedItem() + + serverIndex = self.__ServerIDToServerIndex(regionID, serverID) + self.serverList.SelectItem(serverIndex) + # END_OF_SEVER_LIST_BUG_FIX + + self.__OnSelectServer() + + def __RefreshServerList(self): + regionID = self.__GetRegionID() + + if not serverInfo.REGION_DICT.has_key(regionID): + return + + self.serverList.ClearItem() + + regionDict = serverInfo.REGION_DICT[regionID] + + # SEVER_LIST_BUG_FIX + visible_index = 1 + for id, regionDataDict in regionDict.items(): + name = regionDataDict.get("name", "noname") + if localeInfo.IsBRAZIL() or localeInfo.IsCANADA(): + self.serverList.InsertItem(id, "%s" % (name)) + else: + if localeInfo.IsCIBN10(): + if name[0] == "#": + self.serverList.InsertItem(-1, " %s" % (name[1:])) + else: + self.serverList.InsertItem(id, " %s" % (name)) + visible_index += 1 + else: + try: + server_id = serverInfo.SERVER_ID_DICT[id] + except: + server_id = visible_index + + self.serverList.InsertItem(id, " %02d. %s" % (int(server_id), name)) + + visible_index += 1 + + # END_OF_SEVER_LIST_BUG_FIX + + def __OnSelectServer(self): + self.__OnCloseInputDialog() + self.__RequestServerStateList() + self.__RefreshServerStateList() + + def __RequestServerStateList(self): + regionID = self.__GetRegionID() + serverID = self.__GetServerID() + + try: + channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"] + except: + print " __RequestServerStateList - serverInfo.REGION_DICT(%d, %d)" % (regionID, serverID) + return + + ServerStateChecker.Initialize(); + for id, channelDataDict in channelDict.items(): + key=channelDataDict["key"] + ip=channelDataDict["ip"] + udp_port=channelDataDict["udp_port"] + ServerStateChecker.AddChannel(key, ip, udp_port) + + ServerStateChecker.Request() + + def __RefreshServerStateList(self): + + regionID = self.__GetRegionID() + serverID = self.__GetServerID() + bakChannelID = self.channelList.GetSelectedItem() + + self.channelList.ClearItem() + + try: + channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"] + except: + print " __RequestServerStateList - serverInfo.REGION_DICT(%d, %d)" % (regionID, serverID) + return + + for channelID, channelDataDict in channelDict.items(): + channelName = channelDataDict["name"] + channelState = channelDataDict["state"] + self.channelList.InsertItem(channelID, " %s %s" % (channelName, channelState)) + + self.channelList.SelectItem(bakChannelID-1) + + def __GetChannelName(self, regionID, selServerID, selChannelID): + try: + return serverInfo.REGION_DICT[regionID][selServerID]["channel"][selChannelID]["name"] + except KeyError: + if 9==selChannelID: + return localeInfo.CHANNEL_PVP + else: + return localeInfo.CHANNEL_NORMAL % (selChannelID) + + def NotifyChannelState(self, addrKey, state): + try: + stateName=serverInfo.STATE_DICT[state] + except: + stateName=serverInfo.STATE_NONE + + regionID=self.__GetRegionID() + serverID=self.__GetServerID() + channelID=addrKey%10 + + try: + serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"] = stateName + self.__RefreshServerStateList() + + except: + import exception + exception.Abort(localeInfo.CHANNEL_NOT_FIND_INFO) + + def __OnClickExitServerButton(self): + print "exit server" + self.__OpenLoginBoard() + + if IsFullBackImage(): + self.GetChild("bg1").Hide() + self.GetChild("bg2").Show() + + + def __OnClickSelectRegionButton(self): + regionID = self.__GetRegionID() + serverID = self.__GetServerID() + + if (not serverInfo.REGION_DICT.has_key(regionID)): + self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_REGION) + return + + if (not serverInfo.REGION_DICT[regionID].has_key(serverID)): + self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_SERVER) + return + + self.__SaveChannelInfo() + + self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton)) + self.serverExitButton.SetText(localeInfo.UI_CLOSE) + + self.__RefreshServerList() + self.__OpenServerBoard() + + def __OnClickSelectServerButton(self): + if IsFullBackImage(): + self.GetChild("bg1").Hide() + self.GetChild("bg2").Show() + + regionID = self.__GetRegionID() + serverID = self.__GetServerID() + channelID = self.__GetChannelID() + + if (not serverInfo.REGION_DICT.has_key(regionID)): + self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_REGION) + return + + if (not serverInfo.REGION_DICT[regionID].has_key(serverID)): + self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_SERVER) + return + + try: + channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"] + except KeyError: + return + + try: + state = channelDict[channelID]["state"] + except KeyError: + self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_CHANNEL) + return + + # 惑怕啊 FULL 苞 鞍栏搁 柳涝 陛瘤 + if state == serverInfo.STATE_DICT[3]: + self.PopupNotifyMessage(localeInfo.CHANNEL_NOTIFY_FULL) + return + + self.__SaveChannelInfo() + + try: + serverName = serverInfo.REGION_DICT[regionID][serverID]["name"] + channelName = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["name"] + addrKey = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["key"] + + if "玫付 辑滚" == serverName: + app.ForceSetLocale("ymir", "locale/ymir") + elif "蔫档 辑滚" == serverName: + app.ForceSetLocale("we_korea", "locale/we_korea") + + except: + print " ERROR __OnClickSelectServerButton(%d, %d, %d)" % (regionID, serverID, channelID) + serverName = localeInfo.CHANNEL_EMPTY_SERVER + channelName = localeInfo.CHANNEL_NORMAL % channelID + + self.__SetServerInfo("%s, %s " % (serverName, channelName)) + + try: + ip = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["ip"] + tcp_port = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["tcp_port"] + except: + import exception + exception.Abort("LoginWindow.__OnClickSelectServerButton - 辑滚 急琶 角菩") + + try: + account_ip = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["ip"] + account_port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["port"] + except: + account_ip = 0 + account_port = 0 + + try: + markKey = regionID*1000 + serverID*10 + markAddrValue=serverInfo.MARKADDR_DICT[markKey] + net.SetMarkServer(markAddrValue["ip"], markAddrValue["tcp_port"]) + app.SetGuildMarkPath(markAddrValue["mark"]) + # GUILD_SYMBOL + app.SetGuildSymbolPath(markAddrValue["symbol_path"]) + # END_OF_GUILD_SYMBOL + + except: + import exception + exception.Abort("LoginWindow.__OnClickSelectServerButton - 付农 沥焊 绝澜") + + + if app.USE_OPENID and not app.OPENID_TEST : + ## 2012.07.19 OpenID : 辫侩宽 + # 盲澄 急琶 拳搁俊辑 "犬牢"(SelectServerButton) 阑 喘范阑锭, + # 肺弊牢 拳搁栏肺 逞绢啊瘤 臼绊 官肺 辑滚俊 OpenID 牢刘虐甫 焊郴档废 荐沥 + self.stream.SetConnectInfo(ip, tcp_port, account_ip, account_port) + self.Connect(0, 0) + else : + self.stream.SetConnectInfo(ip, tcp_port, account_ip, account_port) + self.__OpenLoginBoard() + + + def __OnClickSelectConnectButton(self): + if IsFullBackImage(): + self.GetChild("bg1").Show() + self.GetChild("bg2").Hide() + self.__RefreshServerList() + self.__OpenServerBoard() + + def __OnClickLoginButton(self): + id = self.idEditLine.GetText() + pwd = self.pwdEditLine.GetText() + + if len(id)==0: + self.PopupNotifyMessage(localeInfo.LOGIN_INPUT_ID, self.SetIDEditLineFocus) + return + + if len(pwd)==0: + self.PopupNotifyMessage(localeInfo.LOGIN_INPUT_PASSWORD, self.SetPasswordEditLineFocus) + return + + self.Connect(id, pwd) + + def SameLogin_OpenUI(self): + self.stream.popupWindow.Close() + self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_SAMELOGIN, 0, localeInfo.UI_OK) diff --git a/root/intrologo.py b/root/intrologo.py new file mode 100644 index 0000000..01e0186 --- /dev/null +++ b/root/intrologo.py @@ -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() + diff --git a/root/introselect.py b/root/introselect.py new file mode 100644 index 0000000..1cef6dd --- /dev/null +++ b/root/introselect.py @@ -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 + diff --git a/root/localeinfo.py b/root/localeinfo.py new file mode 100644 index 0000000..f660406 --- /dev/null +++ b/root/localeinfo.py @@ -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) diff --git a/root/makepackscript_onlyrootnopython.txt b/root/makepackscript_onlyrootnopython.txt new file mode 100644 index 0000000..66095d8 --- /dev/null +++ b/root/makepackscript_onlyrootnopython.txt @@ -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 + } +} diff --git a/root/mousemodule.py b/root/mousemodule.py new file mode 100644 index 0000000..9292765 --- /dev/null +++ b/root/mousemodule.py @@ -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() diff --git a/root/musicinfo.py b/root/musicinfo.py new file mode 100644 index 0000000..2b980fb --- /dev/null +++ b/root/musicinfo.py @@ -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() + + diff --git a/root/networkmodule.py b/root/networkmodule.py new file mode 100644 index 0000000..ef1eb79 --- /dev/null +++ b/root/networkmodule.py @@ -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 diff --git a/root/npclist.txt b/root/npclist.txt new file mode 100644 index 0000000..b86a1a8 --- /dev/null +++ b/root/npclist.txt @@ -0,0 +1,1473 @@ +0 pony_normal pony +0 pony_member pony +0 pony_master pony +0 horse_normal horse +0 horse_member horse +0 horse_master horse +0 horse2_normal horse2 +0 horse2_member horse2 +0 horse2_master horse2 +0 boar boar +0 dog_god dog_god +0 fire_tiger fire_tiger +0 lion lion +0 boar_0 boar +0 dog_god_0 dog_god +0 fire_tiger_0 fire_tiger +0 lion_0 lion +0 boar_3 boar +0 dog_god_3 dog_god +0 fire_tiger_3 fire_tiger +0 lion_3 lion +0 fire_tiger_blue fire_tiger +0 fire_tiger_darkred fire_tiger +0 fire_tiger_gold fire_tiger +0 fire_tiger_green fire_tiger +0 fire_tiger_pied fire_tiger +0 fire_tiger_white fire_tiger +0 reindeer_male1 reindeer_male +0 reindeer_male2 reindeer_male +0 reindeer_male3 reindeer_male +0 reindeer_female1 reindeer_female +0 reindeer_female2 reindeer_female +0 reindeer_female3 reindeer_female +0 reindeer_young1 reindeer_young +0 goods_02 goods +0 bank_02 bank +0 diamond mineral +0 amber mineral +0 fossil_tree mineral +0 copper mineral +0 silver mineral +0 gold mineral +0 jade mineral +0 ebony mineral +0 white_gold mineral +0 quartz mineral +0 amethyst mineral +0 chunru mineral +0 pearl mineral +0 mineral2_sapphire mineral2 +0 mineral2_ruby mineral2 +0 mineral2_garnet mineral2 +0 mineral2_bery mineral2 +0 red_wild_boar wild_boar +0 wolf_gray wolf +0 wolf_blue wolf +0 bear_gray bear +0 bear_black bear +0 bear_brown bear +0 tiger_big tiger +0 tiger_god tiger +0 metinstone_01 metinstone +0 metinstone_02 metinstone +0 metinstone_03 metinstone +0 metinstone_04 metinstone +0 metinstone_05 metinstone +0 metinstone_06 metinstone +0 metinstone_07 metinstone +0 metinstone_08 metinstone +0 metinstone_09 metinstone +0 metinstone_10 metinstone_02 +0 metinstone_11 metinstone_02 +0 metinstone_12 metinstone_02 +0 metinstone_13 metinstone_02 +0 metinstone_14 metinstone_02 +0 metinstone_15 metinstone_02 +0 metinstone_egg01 metinstone_egg +0 christmas_tree_01 christmas_tree +0 christmas_tree_02 christmas_tree +0 christmas_tree_03 christmas_tree +0 flag_red guild_war_flag +0 flag_blue guild_war_flag +0 flag_yellow guild_war_flag +0 haitai fire_tiger_boss +0 monkey_range monkey +0 sura_skeleton1 sura_skeleton +0 sura_skeleton2 sura_skeleton +0 sura_skeleton3 sura_skeleton +0 sura_skeleton4 sura_skeleton +0 sura_skeleton5 sura_skeleton +0 starveling starveling +0 starveling2 starveling +0 starveling3 starveling +0 starveling4 starveling +0 starveling5 starveling +0 pwahuang1_2 pwahuang1 +0 jinno_patrol_spear_01 jinno_patrol_spear +0 gangyo_patrol_spear_01 gangyo_patrol_spear +0 spy1_01 spy1 +0 reindeer_young1_christmas1 reindeer_young +0 reindeer_male1_christmas1 reindeer_male +0 fire_ghost1 fire_ghost +0 fire_tiger_boss1 fire_tiger_boss +0 fire_man1 fire_man +0 fire_knight1 fire_knight +0 fire_king1 fire_king +0 ice_snow_monster1 ice_snow_monster +0 ice_snow_insect1 ice_snow_insect +0 ice_snow_man1 ice_snow_man +0 ice_snow_giant_man1 ice_snow_giant_man +0 ice_snow_golem1 ice_snow_golem +0 bridge_block_chain flame_bridge_block_chain +0 flame_npc flame_dungeon_npc +0 redthief2_officer_young2 redthief2_officer_young1 +0 unicorn1 unicorn +0 phoenix3 phoenix2 +0 pig_young1_white pig_young1 +0 dog_young1_white dog_young1 +0 tiger_young1_white tiger_young1 +0 lion_young1_white lion_young1 +0 turkey_1 turkey +0 turkey_2 turkey +0 turkey_3 turkey +0 dinosaur_1 dinosaur +0 dinosaur_2 dinosaur +0 dinosaur_3 dinosaur +0 leopard_black leopard +0 leopard_yellow leopard +0 leopard_young1_black leopard_young1 +0 leopard_young1_yellow leopard_young1 +101 stray_dog +102 wolf +103 wolf +104 wolf_blue +105 wolf_blue +106 wolf_gray +107 wolf_gray +108 wild_boar +109 red_wild_boar +110 bear +111 bear_gray +112 bear_black +113 bear_brown +114 tiger +115 tiger_big +131 wolf +132 wolf +133 wolf_blue +134 wolf_blue +135 wolf_gray +136 wolf_gray +137 wild_boar +138 red_wild_boar +139 bear +140 bear_gray +141 bear_black +142 bear_brown +143 tiger +144 tiger_big +151 wolf_blue +152 wolf_gray +153 red_wild_boar +154 bear_brown +155 tiger_big +171 stray_dog +172 wolf +173 wolf +174 wolf_blue +175 wolf_blue +176 wolf_gray +177 wolf_gray +178 wild_boar +179 red_wild_boar +180 bear +181 bear_gray +182 bear_black +183 bear_brown +184 tiger +185 tiger_big +191 mountain_dog_god +192 wild_boar_god +193 bear +194 tiger_god +301 bksoldier +302 bkarcher +303 bkknight +304 bkknight +331 bksoldier +332 bkarcher +333 bkknight +334 bkknight +351 bksoldier +352 bkarcher +353 bkknight +354 bkknight +391 bksecond +392 bkthird +393 bkfourth +394 bkboss +395 bksecond +396 bkthird +397 bkfourth +398 bkboss +401 thief1 +402 thief2 +403 thief3 +404 thiefboss1 +405 thiefboss2 +406 thiefboss3 +431 thief1 +432 thief2 +433 thief3 +434 thiefboss1 +435 thiefboss2 +436 thiefboss3 +451 thief1 +452 thief2 +453 thief3 +454 thiefboss1 +455 thiefboss2 +456 thiefboss3 +491 maenghwan +492 bou +493 gupae +494 chuhen +501 barbarian_infantry +502 barbarian_soldier +503 barbarian_bow +504 barbarian_knight +531 barbarian_infantry +532 barbarian_soldier +533 barbarian_bow +534 barbarian_knight +551 barbarian_infantry +552 barbarian_soldier +553 barbarian_bow +554 barbarian_knight +591 barbarian_boss +595 barbarian_bow +601 orc_soldier +602 orc_scouter +603 orc_knight +604 orc_magician +631 orc_soldier +632 orc_scouter +633 orc_knight +634 orc_magician +635 orc_general +636 orc_black +637 orc_bigblack +651 orc_soldier +652 orc_scouter +653 orc_knight +654 orc_magician +655 orc_general +656 orc_black +657 orc_bigblack +691 orc_lord +692 orc_lord +693 #season1/monster/orc_lord_e/ +701 milgyo_religionist +702 milgyo_nahan1 +703 milgyo_nahan2 +704 milgyo_nahan_general +705 milgyo_executor +706 milgyo_monster1 +707 milgyo_monster2 +731 milgyo_religionist +732 milgyo_nahan1 +733 milgyo_nahan2 +734 milgyo_nahan_general +735 milgyo_executor +736 milgyo_monster1 +737 milgyo_monster2 +751 milgyo_religionist +752 milgyo_nahan1 +753 milgyo_nahan2 +754 milgyo_nahan_general +755 milgyo_executor +756 milgyo_monster1 +757 milgyo_monster2 +771 milgyo_religionist +772 milgyo_nahan1 +773 milgyo_nahan2 +774 milgyo_nahan_general +775 milgyo_executor +776 milgyo_monster1 +777 milgyo_monster2 +791 milgyo_founder +792 milgyo_founder +793 milgyo_founder +794 milgyo_founder +795 #season1/monster/milgyo_founder_e/ +901 misterious_diseased_kid +902 misterious_diseased_dog +903 misterious_diseased_infector +904 misterious_diseased_sword +905 misterious_diseased_spear +906 misterious_diseased_bow +907 misterious_diseased_boss +931 misterious_diseased_kid +932 misterious_diseased_dog +933 misterious_diseased_infector +934 misterious_diseased_sword +935 misterious_diseased_spear +936 misterious_diseased_bow +937 misterious_diseased_boss +991 misterious_diseased_egg +992 misterious_diseased_host +993 misterious_diseased_bosshost +1001 skeleton_soldier_scythe +1002 skeleton_soldier_bow +1003 skeleton_soldier_spear +1004 skeleton_magician +1031 skeleton_soldier_scythe +1032 skeleton_soldier_bow +1033 skeleton_soldier_spear +1034 skeleton_magician +1035 spite_ghost +1036 chaos_ghost +1037 skeleton_general +1038 skeleton_bigboss +1039 skeleton_wizard +1040 immotal_ghost +1041 recycle_monster +1061 skeleton_soldier_scythe +1062 skeleton_soldier_bow +1063 skeleton_soldier_spear +1064 skeleton_magician +1065 spite_ghost +1066 chaos_ghost +1067 skeleton_general +1068 skeleton_bigboss +1069 skeleton_wizard +1070 immotal_ghost +1071 recycle_monster +1091 skeleton_king +1092 skeleton_king +1093 skeleton_god +1094 #season1/monster/skeleton_king_e/ +1095 #season1/monster/skeleton_god_e/ +1096 skeleton_king +1101 ice_snow_monster +1102 ice_snow_whale +1103 ice_snow_insect +1104 ice_snow_dog +1105 ice_snow_man +1106 ice_snow_giant_man +1107 ice_snow_golem +1131 ice_snow_monster +1132 ice_snow_whale +1133 ice_snow_insect +1134 ice_snow_dog +1135 ice_snow_man +1136 ice_snow_giant_man +1137 ice_snow_golem +1151 ice_snow_monster +1152 ice_snow_whale +1153 ice_snow_insect +1154 ice_snow_dog +1155 ice_snow_man +1156 ice_snow_giant_man +1157 ice_snow_golem +1171 ice_snow_monster +1172 ice_snow_whale +1173 ice_snow_insect +1174 ice_snow_dog +1175 ice_snow_man +1176 ice_snow_giant_man +1177 ice_snow_golem +1191 ice_snow_witch +1192 ice_snow_witch +1301 greenfrog_soldier +1302 greenfrog_general +1303 goblin_leafhead +1304 yellow_tigerman +1305 sugu_general +1306 yellow_tigerman +1307 #season1/monster/yellow_tigerman_e/ +1308 yellow_tigerman +1309 yellow_tigerman +1310 yellow_tigerman +1331 greenfrog_soldier +1332 greenfrog_general +1333 goblin_leafhead +1334 yellow_tigerman +1335 sugu_general +1401 mutant_1 +1402 mutant_2 +1403 mutant_3 +1501 golem_1 +1502 golem_2 +1503 golem_3 +1601 nersluck_1 +1602 nersluck_2 +1603 nersluck_3 +1901 fox_ninetail +1902 fox_ninetail +1903 #season1/monster/fox_ninetail_e/ +1904 fox_ninetail +1905 fox_ninetail +1906 fox_ninetail +2001 spider_young +2002 spider_poison +2003 spider_redpoison +2004 spider_nipper +2005 spider_soldier +2031 spider_young +2032 spider_poison +2033 spider_redpoison +2034 spider_nipper +2035 spider_soldier +2036 spider_soldier +2051 spider_young +2052 spider_poison +2053 spider_redpoison +2054 spider_nipper +2055 spider_soldier +2061 spider_young +2062 spider_poison +2063 spider_redpoison +2064 spider_nipper +2065 spider_soldier +2071 spider_young +2072 spider_poison +2073 spider_redpoison +2074 spider_nipper +2075 spider_soldier +2076 spider_soldier +2091 spider_queen +2092 spider_king +2093 #season1/monster/spider_queen_e/ +2094 #season1/monster/spider_queen_e/ +2095 spider_spawn +2101 fennec_fox +2102 evil_eye +2103 giant_scorpion +2104 scorpionman_sword +2105 scorpionman_bow +2106 snakeman_sword +2107 snakeman_bow +2108 outlaw +2131 scorpionman_sword +2132 scorpionman_bow +2133 snakeman_sword +2134 snakeman_bow +2135 outlaw +2151 fennec_fox +2152 evil_eye +2153 giant_scorpion +2154 scorpionman_sword +2155 scorpionman_bow +2156 snakeman_sword +2157 snakeman_bow +2158 outlaw +2191 giant_desert_turtle +2192 #season1/monster/giant_desert_turtle_e/ +2201 fire_tiger +2202 fire_ghost +2203 fire_tiger_boss +2204 fire_man +2205 fire_knight +2206 fire_king +2207 fire_king +2231 fire_tiger +2232 fire_ghost +2233 fire_tiger_boss +2234 fire_man +2235 fire_knight +2291 fire_dragon +2292 red_dragon +2293 red_dragon2 +2301 ent_trent +2302 ent_guru +2303 ent_hu +2304 ent_red +2305 ent_black +2306 ent_huge +2307 ent_elder +2311 ent_trent +2312 ent_guru +2313 ent_hu +2314 ent_red +2315 ent_black +2401 ch_footman +2402 ch_bowman +2403 ch_magician +2404 ch_officer +2411 ch_footman +2412 ch_bowman +2413 ch_magician +2414 ch_officer +2431 ch_footman +2432 ch_bowman +2433 ch_magician +2434 ch_officer +2451 ch_footman +2452 ch_bowman +2453 ch_magician +2454 ch_officer +2481 boar_young +2482 dog_god_young +2483 fire_tiger_young +2484 lion_young +2491 ch_general +2492 ch_general +2493 blue_dragon +2494 ch_general +2495 ch_general +2501 zombie_diseased_kid +2502 zombie_diseased_dog +2503 zombie_diseased_infector +2504 zombie_diseased_sword +2505 zombie_diseased_spear +2506 zombie_diseased_bow +2507 zombie_diseased_boss +2508 zombie_soldier_scythe +2509 zombie_soldier_bow +2510 zombie_soldier_spear +2511 zombie_magician +2512 zombie_bigboss +2513 zombie_ghost +2514 zombie_general +2541 zombie_soldier_scythe +2542 zombie_soldier_bow +2543 zombie_soldier_spear +2544 zombie_magician +2545 zombie_bigboss +2546 zombie_ghost +2547 zombie_general +2591 zombie_king +2592 zombie_king +2593 zombie_king +2594 zombie_king +2595 zombie_king +2596 zombie_king +2597 zombie_god +2598 zombie_bigboss2 +2600 gnoll_helhound +2601 gnoll_warrior +2602 gnoll_mage +2603 gnoll_commander +2620 gnoll_minotaur +2630 troll_warrior +2631 troll_archer +2632 troll_mage +2633 troll_commander +2650 troll_argus +2660 naga_soldier +2661 naga_archer +2662 naga_mage +2663 naga_warrior +2680 naga_commander +3001 gnoll_soldier +3002 gnoll_bow +3003 gnoll_soldier2 +3004 gnoll_magic +3005 gnoll_general +3090 gnoll_boss +3091 gnoll_boss2 +3101 cyclops_soldier +3102 cyclops_soldier2 +3103 cyclops_magic +3104 cyclops_officer +3105 cyclops_general +3190 cyclops_boss +3191 cyclops_boss2 +3201 manticore_soldier +3202 manticore_soldier2 +3203 manticore_magic +3204 manticore_officer +3205 manticore_general +3290 manticore_boss +3291 manticore_boss2 +3301 lemures_soldier +3302 lemures_soldier2 +3303 lemures_magic +3304 lemures_officer +3305 lemures_general +3390 lemures_boss +3391 lemures_boss2 +3401 triton_soldier +3402 triton_soldier2 +3403 triton_magic +3404 triton_officer +3405 triton_general +3490 triton_boss +3491 triton_boss2 +3501 redthief_bow +3502 redthief_soldier2 +3503 redthief_magic +3504 redthief_officer +3505 redthief_general +3551 redthief2_bow +3552 redthief2_soldier2 +3553 redthief2_magic +3554 redthief2_officer +3555 redthief2_general +3590 redthief_boss +3591 redthief_boss2 +3595 redthief2_boss +3596 redthief2_boss2 +3601 crustacean_soldier +3602 crustacean_bow +3603 crustacean_soldier2 +3604 crustacean_officer +3605 crustacean_general +3690 crustacean_boss +3691 crustacean_boss2 +3701 giant_soldier +3702 giant_soldier2 +3703 giant_magic +3704 giant_officer +3705 giant_general +3790 giant_boss +3791 giant_boss2 +3801 ogre_soldier +3802 ogre_bow +3803 ogre_officer +3804 ogre_magic +3805 ogre_general +3890 ogre_boss +3891 ogre_boss2 +3901 ent_boss1 +3902 ent_boss2 +3903 ent_boss3 +3904 giant_general +3905 bkfourth +3906 bkboss +3907 redthief2_magic +3908 redthief2_officer +3909 redthief2_general +3910 redthief_boss +3911 ent_huge +3912 ent_huge +3913 ent_huge +5001 japanese_pirate +5002 haitai +5003 monkey +5004 japanese_pirate +5101 monkey +5102 monkey_range +5103 monkey +5104 monkey +5111 monkey +5112 monkey_range +5113 monkey +5114 monkey +5115 stone_monkey +5116 stone_monkey +5121 monkey +5122 monkey_range +5123 monkey +5124 monkey +5125 stone_monkey +5126 gold_monkey +5127 gold_monkey +5131 monkey +5132 monkey_range +5133 monkey +5134 monkey +5141 monkey +5142 monkey_range +5143 monkey +5144 monkey +5145 stone_monkey +5146 stone_monkey +5151 monkey +5152 monkey_range +5153 monkey +5154 monkey +5155 stone_monkey +5156 gold_monkey +5157 gold_monkey +5161 stone_monkey +5162 gold_monkey +5163 god_monkey +6001 fire_ghost1 +6002 fire_tiger_boss1 +6003 fire_man1 +6004 fire_knight1 +6005 fire_king1 +6006 firegolem_soldier +6007 firegolem_magician +6008 firegolem_general +6009 firegolem_boss +6051 firegolem_boss +6091 yamachun_boss +6101 ice_snow_monster1 +6102 ice_snow_insect1 +6103 ice_snow_man1 +6104 ice_snow_giant_man1 +6105 ice_snow_golem1 +6106 icegolem_soldier +6107 icegolem_magician +6108 icegolem_general +6109 icegolem_boss +6151 icegolem_boss +6191 hanma_boss +6201 cyclops_soldier +6202 cyclops_soldier2 +6203 cyclops_magic +6204 cyclops_officer +6205 cyclops_general +6206 giant_soldier +6207 giant_soldier2 +6208 giant_magic +6209 giant_officer +6210 giant_general +6291 cyclops_boss +6293 cyclops_boss2 +6292 giant_boss +6294 giant_boss2 +6301 lemures_soldier +6302 lemures_soldier2 +6303 lemures_magic +6304 lemures_officer +6305 lemures_general +6306 ogre_soldier +6307 ogre_bow +6308 ogre_officer +6309 ogre_magic +6310 ogre_general +6391 lemures_boss +6392 lemures_boss2 +6393 ogre_boss +6394 ogre_boss2 +6395 japanese_pirate +7001 monkey +7002 monkey_range +7003 monkey +7004 monkey +7005 stone_monkey +7006 gold_monkey +7007 gold_monkey +7008 nersluck_1 +7009 nersluck_2 +7010 nersluck_3 +7012 evil_eye +7013 giant_scorpion +7014 scorpionman_sword +7015 scorpionman_bow +7016 snakeman_sword +7017 snakeman_bow +7018 outlaw +7019 fire_tiger +7020 fire_ghost +7021 fire_tiger_boss +7022 fire_man +7023 fire_knight +7024 ent_trent +7025 ent_guru +7026 ent_hu +7027 ent_red +7028 ent_black +7029 ice_snow_monster +7030 ice_snow_whale +7031 ice_snow_insect +7032 ice_snow_dog +7033 ice_snow_man +7034 ice_snow_giant_man +7035 ice_snow_golem +7036 ice_snow_monster +7037 ice_snow_whale +7038 ice_snow_insect +7039 ice_snow_dog +7040 ice_snow_man +7041 ice_snow_giant_man +7042 ice_snow_golem +7043 ice_snow_monster +7044 ice_snow_whale +7045 ice_snow_insect +7046 ice_snow_dog +7047 ice_snow_man +7048 ice_snow_giant_man +7049 ice_snow_golem +7050 evil_eye +7051 giant_scorpion +7052 scorpionman_sword +7053 scorpionman_bow +7054 snakeman_sword +7055 snakeman_bow +7056 outlaw +7057 evil_eye +7058 giant_scorpion +7059 scorpionman_sword +7060 scorpionman_bow +7061 snakeman_sword +7062 snakeman_bow +7063 outlaw +7064 evil_eye +7065 giant_scorpion +7066 scorpionman_sword +7067 scorpionman_bow +7068 snakeman_sword +7069 snakeman_bow +7070 outlaw +7071 fire_tiger +7072 fire_ghost +7073 fire_tiger_boss +7074 fire_man +7075 fire_knight +7076 fire_tiger +7077 fire_ghost +7078 fire_tiger_boss +7079 fire_man +7080 fire_knight +7081 fire_tiger +7082 fire_ghost +7083 fire_tiger_boss +7084 fire_man +7085 fire_knight +7086 ent_guru +7087 ent_hu +7088 ent_red +7089 ent_black +7090 ent_guru +7091 ent_hu +7092 ent_red +7093 ent_black +7094 ent_guru +7095 ent_hu +7096 ent_red +7097 ent_black +7101 #season1/npc/goldenfrog/ +7102 #season1/npc/goldenfrog/ +7103 #season1/npc/goldenfrog/ +7104 #season1/npc/goldenfrog/ +7105 #season1/npc/goldenfrog/ +7106 #season2/npc/signal_fire/ +7107 #season2/npc/signal_fire/ +7108 monkey +7109 monkey_range +7110 monkey +7111 monkey +7112 stone_monkey +7113 gold_monkey +7114 gold_monkey +7115 nersluck_1 +7116 nersluck_2 +7117 nersluck_3 +7118 fox_ninetail +7119 yellow_tigerman +8001 metinstone_01 +8002 metinstone_02 +8003 metinstone_03 +8004 metinstone_04 +8005 metinstone_05 +8006 metinstone_06 +8007 metinstone_07 +8008 metinstone_08 +8009 metinstone_09 +8010 metinstone_04 +8011 metinstone_05 +8012 metinstone_06 +8013 metinstone_07 +8014 metinstone_08 +8015 metinstone_04 +8016 metinstone_05 +8017 metinstone_06 +8018 metinstone_07 +8019 metinstone_08 +8020 metinstone_06 +8021 metinstone_07 +8022 metinstone_08 +8023 metinstone_09 +8024 metinstone_03 +8025 metinstone_04 +8026 metinstone_05 +8027 metinstone_06 +8028 metinstone_06 +8029 metinstone_06 +8030 metinstone_06 +8031 metinstone_09 +8032 metinstone_01 +8033 metinstone_06 +8034 metinstone_02 +8035 metinstone_10 +8036 metinstone_11 +8037 metinstone_12 +8038 metinstone_13 +8039 metinstone_14 +8040 metinstone_15 +8041 metinstone_egg01 +8042 metinstone_egg01 +8043 metinstone_egg01 +8044 metinstone_egg01 +8045 metinstone_egg01 +8046 metinstone_egg01 +8047 metinstone_egg01 +8048 metinstone_egg01 +8049 metinstone_egg01 +8050 metinstone_egg01 +8051 metinstone_10 +8052 metinstone_11 +8053 metinstone_12 +8054 metinstone_13 +8055 metinstone_14 +8056 metinstone_15 +8057 metinstone_12 +8058 metinstone_13 +8059 metinstone_14 +8060 metinstone_15 +8101 metinstone_01 +8102 metinstone_02 +8103 metinstone_03 +8104 metinstone_04 +8105 metinstone_05 +8106 metinstone_06 +8107 metinstone_07 +8108 metinstone_08 +8109 metinstone_09 +8110 metinstone_09 +8111 metinstone_09 +8112 metinstone_09 +8501 stray_dog +8502 wild_boar +8503 bear +8504 tiger_big +8505 orc_bigblack +8506 greenfrog_general +8507 outlaw +8508 milgyo_monster1 +8509 milgyo_monster2 +8510 fire_knight +8511 ice_snow_golem +8600 #season1/monster/orc_lord_e/ +8601 #season1/monster/orc_lord_e/ +8602 #season1/monster/milgyo_founder_e/ +8603 #season1/monster/milgyo_founder_e/ +8604 #season1/monster/skeleton_king_e/ +8605 #season1/monster/skeleton_king_e/ +8606 #season1/monster/skeleton_god_e/ +8607 #season1/monster/skeleton_god_e/ +8608 #season1/monster/fox_ninetail_e/ +8609 #season1/monster/fox_ninetail_e/ +8610 #season1/monster/yellow_tigerman_e/ +8611 #season1/monster/yellow_tigerman_e/ +8612 #season1/monster/spider_queen_e/ +8613 #season1/monster/spider_queen_e/ +8614 #season1/monster/giant_desert_turtle_e/ +8615 #season1/monster/giant_desert_turtle_e/ +8616 #season2/npc/ent_elder/ +9001 arms +9002 defence +9003 goods +9004 bank +9005 hotel_grandfa +9006 hotel_grandma +9007 arms +9008 defence +9009 sailor +9010 goods_02 +9011 bank_02 +9012 oldster +10001 warp +10002 warp +10003 warp +10004 warp +10005 warp +10006 warp +10007 warp +10008 warp +10009 warp +10010 warp +10011 warp +10012 warp +10013 warp +10014 warp +10015 warp +10016 warp +10017 warp +10018 warp +10019 warp +10020 warp +10021 warp +10022 warp +10023 warp +10024 warp +10025 warp +10026 warp +10027 warp +10028 warp +10029 warp +10030 warp +10031 warp +10032 warp +10033 warp +10034 warp +10035 warp +10036 warp +10037 warp +10038 warp +10039 warp +10040 warp +10041 warp +10042 warp +10043 warp +10044 warp +10045 warp +10046 warp +10047 warp +10048 warp +10049 warp +10050 warp +10051 warp +10052 warp +10053 warp +10054 warp +10055 warp +10056 warp +10057 warp +10058 warp +10059 warp +10060 warp +10061 warp +10062 warp +10063 warp +10064 warp +10065 warp +10066 warp +10067 warp +10068 warp +10069 warp +10070 warp +10071 warp +10072 warp +10073 warp +10074 warp +10075 warp +10076 warp +10077 warp +10078 warp +10079 warp +10080 warp +10081 warp +10082 warp +10083 warp +10084 warp +10085 warp +10086 warp +10087 warp +10088 warp +10089 warp +10090 warp +10091 warp +10092 warp +10093 warp +10094 warp +10095 warp +10096 warp +10097 warp +10098 warp +10099 warp +10100 warp +10101 warp +10102 warp +10103 warp +10104 warp +10105 warp +10501 warp +10502 warp +10503 warp +10504 warp +10505 warp +10506 warp +10507 warp +10508 warp +10509 warp +10510 warp +10511 warp +10512 warp +10513 warp +10514 warp +10515 warp +10516 warp +10517 warp +10518 warp +10519 warp +10520 warp +10521 warp +10522 warp +10523 warp +10524 warp +10601 warp +10602 warp +10603 warp +10604 warp +10605 warp +10606 warp +10607 warp +10608 warp +10609 warp +10610 warp +10611 warp +10612 warp +10613 warp +10614 warp +10615 warp +10616 warp +10617 warp +10618 warp +10619 warp +10620 warp +10621 warp +10622 warp +10623 warp +10624 warp +10625 warp +10626 warp +10701 warp +10702 warp +10703 warp +10704 warp +10705 warp +10706 warp +10707 warp +10708 warp +10709 warp +10710 warp +10711 warp +10712 warp +10713 warp +10714 warp +10715 warp +10716 warp +10717 warp +10718 warp +10719 warp +10720 warp +10721 warp +10722 warp +10723 warp +10724 warp +10725 warp +10726 warp +11000 gangyo_patrol_spear +11001 gangyo_patrol_bow +11002 jinno_patrol_spear +11003 jinno_patrol_bow +11004 sinsu_patrol_spear +11005 sinsu_patrol_bow +11100 gangyo_patrol_spear +11100 #season1/npc/sinsu_guard_spear/ +11101 gangyo_patrol_bow +11101 #season1/npc/sinsu_guard_bow/ +11102 jinno_patrol_spear +11102 #season1/npc/chenjo_guard_spear/ +11103 jinno_patrol_bow +11103 #season1/npc/chenjo_guard_bow/ +11104 sinsu_patrol_spear +11104 #season1/npc/jinno_guard_spear/ +11105 sinsu_patrol_bow +11105 #season1/npc/jinno_guard_bow/ +11106 gangyo_patrol_spear +11107 gangyo_patrol_bow +11108 jinno_patrol_spear +11109 jinno_patrol_bow +11110 sinsu_patrol_spear +11111 sinsu_patrol_bow +11112 gangyo_patrol_spear +11113 gangyo_patrol_bow +11114 jinno_patrol_spear +11115 jinno_patrol_bow +11116 sinsu_patrol_spear +11117 sinsu_patrol_bow +11505 #season1/npc/goldenfrog/ +11506 #season2/npc/signal_fire/ +11507 #season2/npc/signal_fire/ +11508 #season2/npc/signal_fire/ +11509 #season2/npc/signal_fire/ +11510 #season2/npc/signal_fire/ +12000 campfire +13000 wooden_door +13001 stone_door +20001 alchemist +20002 auntie +20003 baby_and_mom +20004 beggar +20005 ceramist +20006 girl_lost_elder_brother +20007 hotel_grandfa +20008 mr_restaurant +20009 oldster +20010 peddler +20011 plant_researcher +20012 rice_cake_seller +20013 sailor +20014 timid_boy +20015 woodcutter +20016 blacksmith +20017 musician +20018 doctor +20019 hunter +20020 old_pirate +20021 widow +20022 young_merchant +20023 bookworm +20024 yu_hwa_rang +20029 pony_normal +20030 pony_normal +20031 santa +20032 christmas_tree_01 +20033 christmas_tree_02 +20034 christmas_tree_03 +20035 flag_red +20036 flag_blue +20037 flag_yellow +20040 jinno_patrol_spear +20041 beggar +20042 peddler +20044 blacksmith +20045 blacksmith +20046 blacksmith +20047 diamond +20048 amber +20049 fossil_tree +20050 copper +20051 silver +20052 gold +20053 jade +20054 ebony +20055 pearl +20056 white_gold +20057 quartz +20058 amethyst +20059 chunru +20060 alchemist +20061 alchemist +20062 alchemist +20063 alchemist +20064 alchemist +20065 alchemist +20066 alchemist +20067 alchemist +20068 alchemist +20069 alchemist +20070 alchemist +20071 alchemist +20072 alchemist +20073 seal_stone +20073 seal_stone +20074 blacksmith +20075 blacksmith +20076 blacksmith +20077 jinno_patrol_spear +20078 jinno_patrol_spear +20079 jinno_patrol_spear +20080 plant_researcher +20081 seal_stone +20082 GM +20083 oldster +20084 #season1/npc/chagirap/ +20086 #season1/npc/wondaim/ +20087 #season1/npc/handaup/ +20088 #season1/npc/visamun/ +20089 #season1/npc/jinmoo/ +20090 #season1/npc/samahi/ +20091 #season1/npc/backchon/ +20092 #season1/npc/ayuka/ +20093 #season1/npc/visal/ +20094 #season1/npc/yejin/ +20095 #season1/npc/sinseon/ +20096 seal_stone +20097 #season2/npc/sinsu_warpgate/ +20098 #season2/npc/chenjo_warpgate/ +20099 #season2/npc/jinno_warpgate/ +20101 pony_normal +20102 pony_member +20103 pony_master +20104 horse_normal +20105 horse_member +20106 horse_master +20107 horse2_normal +20108 horse2_member +20109 horse2_master +20110 boar +20111 dog_god +20112 fire_tiger +20113 lion +20114 lion_white +20115 boar_2 +20116 dog_god_2 +20117 fire_tiger_2 +20118 lion_2 +20119 horse_event1 +20120 fire_tiger_blue +20121 fire_tiger_darkred +20122 fire_tiger_gold +20123 fire_tiger_green +20124 fire_tiger_pied +20125 fire_tiger_white +20126 santa +20201 boar_0 +20202 dog_god_0 +20203 fire_tiger_0 +20204 lion_0 +20205 boar_2 +20206 dog_god_2 +20207 fire_tiger_2 +20208 lion_2 +20209 boar_3 +20210 dog_god_3 +20211 fire_tiger_3 +20212 lion_3 +20213 reindeer_male1 +20214 reindeer_male2 +20215 reindeer_male3 +20216 reindeer_female1 +20217 reindeer_female2 +20218 reindeer_female3 +20219 horse_halloween1 +20220 reindeer_male1_christmas1 +20221 bear +20222 panda +20223 dinosaur_1 +20224 dinosaur_2 +20225 dinosaur_3 +20226 unicorn +20227 unicorn1 +20228 turkey_1 +20229 turkey_2 +20230 turkey_3 +20231 leopard_black +20232 leopard_yellow +20300 sinsu_patrol_spear +20301 sinsu_patrol_spear +20302 sinsu_patrol_spear +20303 sinsu_patrol_spear +20304 sinsu_patrol_spear +20305 sinsu_patrol_spear +20306 sinsu_patrol_spear +20307 sinsu_patrol_spear +20320 gangyo_patrol_spear +20321 gangyo_patrol_spear +20322 gangyo_patrol_spear +20323 gangyo_patrol_spear +20324 gangyo_patrol_spear +20325 gangyo_patrol_spear +20326 gangyo_patrol_spear +20327 gangyo_patrol_spear +20340 jinno_patrol_spear +20341 jinno_patrol_spear +20342 jinno_patrol_spear +20343 jinno_patrol_spear +20344 jinno_patrol_spear +20345 jinno_patrol_spear +20346 jinno_patrol_spear +20347 jinno_patrol_spear +20348 jinno_patrol_spear +20349 jinno_patrol_spear +20350 jinno_patrol_spear +20351 jinno_patrol_spear +20352 tombstone +20353 tombstone1 +20354 guard_leader +20355 guard_leader +20356 #season1/npc/mirinae_brother/ +20357 #season1/npc/moonstone/ +20358 #season1/npc/nnflower/ +20359 #season1/npc/mailbox/ +20360 #season1/npc/firestone/ +20361 #season1/npc/waterstone/ +20362 #season1/npc/treestone/ +20363 #season1/npc/steelstone/ +20364 #season1/npc/naoki/ +20365 #season1/npc/steelstone/ +20366 #season1/npc/keyholestone/ +20367 jinno_patrol_spear +20368 peddler +20369 leechung +20370 spy1 +20371 #season1/npc/waterstone/ +20372 tombstone +20373 jinno_patrol_spear +20374 jinno_patrol_spear +20375 npc_fence +20376 chagirap +20377 jinno_patrol_spear_01 +20378 gangyo_patrol_spear_01 +20379 spy1_01 +20380 eojiryu +20381 gilaso +20382 #season1/npc/nnflower/ +20383 blacksmith +20384 christmas_tree +20385 flame_npc +20386 seal_stone +20387 bridge_block_chain +20388 flame_door_npc +20389 #season1/npc/keyholestone/ +20390 #season1/npc/keyholestone/ +20391 #season1/npc/nnflower/ +20392 spy1_01 +20393 spy1 +20394 jinno_patrol_spear +20395 jinno_patrol_spear +20396 redguild_soldier +20397 ICE_lionstone +20398 ice_keybox +20399 ice_stonepillar +30000 privateshop +30001 privateshop2 +30101 zombie_key_stone +30102 zombie_god_stone +30103 zombie_security_stone +30104 zombie_warp_stone +30111 zombie_ghost_door +30112 zombie_ghost_door +30113 zombie_ghost_door +30114 zombie_ghost_door +30115 zombie_ghost_door +30116 zombie_ghost_door +30117 zombie_ghost_door +30118 zombie_ghost_door +30119 zombie_ghost_door +30120 obj_bag003 +30121 suraghost +30122 warriorghost +30123 worship_dragon +30124 sura_skeleton1 +30125 sura_skeleton2 +30126 sura_skeleton3 +30127 sura_skeleton4 +30128 sura_skeleton5 +30129 rabbit +30130 #season1/npc/waterstone/ +30301 mineral2 +30302 mineral2_ruby +30303 mineral2_garnet +30304 mineral2_bery +30305 mineral2_sapphire +33001 sura_skeleton3 +33002 historian +33003 starveling +33004 starveling2 +33005 starveling3 +33006 starveling4 +33007 starveling5 +33008 halloween1 +34001 phoenix1 +34002 reindeer_young1 +34003 phoenix2 +34004 pwahuang1 +34005 pig_young1 +34006 dog_young1 +34007 tiger_young1 +34008 lion_young1 +34009 pwahuang1_2 +34010 reindeer_young1_christmas1 +34011 bear_young1 +34012 panda_young1 +34013 redthief2_officer_young1 +34014 redthief2_officer_young2 +34015 halloween_bonedog1 +34016 phoenix3 +34017 pig_young1_white +34018 dog_young1_white +34019 tiger_young1_white +34020 lion_young1_white +34021 egg_pet +34022 rabbit_pet +34023 leopard_young1_black +34024 leopard_young1_yellow +34025 phoenix1 +50000 goods +50001 goods +50002 goods +33009 alchemist +33010 alchemist +33011 alchemist +33012 alchemist +33013 alchemist diff --git a/root/playersettingmodule.py b/root/playersettingmodule.py new file mode 100644 index 0000000..1a39a85 --- /dev/null +++ b/root/playersettingmodule.py @@ -0,0 +1,1562 @@ +import chr +import chrmgr +import skill +import net +import item +import player +import effect +import constInfo +import localeInfo +import emotion + +import app + +JOB_WARRIOR = 0 +JOB_ASSASSIN = 1 +JOB_SURA = 2 +JOB_SHAMAN = 3 + +RACE_WARRIOR_M = 0 +RACE_ASSASSIN_W = 1 +RACE_SURA_M = 2 +RACE_SHAMAN_W = 3 +RACE_WARRIOR_W = 4 +RACE_ASSASSIN_M = 5 +RACE_SURA_W = 6 +RACE_SHAMAN_M = 7 + +COMBO_TYPE_1 = 0 +COMBO_TYPE_2 = 1 +COMBO_TYPE_3 = 2 + +COMBO_INDEX_1 = 0 +COMBO_INDEX_2 = 1 +COMBO_INDEX_3 = 2 +COMBO_INDEX_4 = 3 +COMBO_INDEX_5 = 4 +COMBO_INDEX_6 = 5 + +HORSE_SKILL_WILDATTACK = chr.MOTION_SKILL+121 +HORSE_SKILL_CHARGE = chr.MOTION_SKILL+122 +HORSE_SKILL_SPLASH = chr.MOTION_SKILL+123 + +GUILD_SKILL_DRAGONBLOOD = chr.MOTION_SKILL+101 +GUILD_SKILL_DRAGONBLESS = chr.MOTION_SKILL+102 +GUILD_SKILL_BLESSARMOR = chr.MOTION_SKILL+103 +GUILD_SKILL_SPPEDUP = chr.MOTION_SKILL+104 +GUILD_SKILL_DRAGONWRATH = chr.MOTION_SKILL+105 +GUILD_SKILL_MAGICUP = chr.MOTION_SKILL+106 + +PASSIVE_GUILD_SKILL_INDEX_LIST = ( 151, ) +ACTIVE_GUILD_SKILL_INDEX_LIST = ( 152, 153, 154, 155, 156, 157, ) + +NEW_678TH_SKILL_ENABLE = 0 +SKILL_INDEX_DICT = [] + +def DefineSkillIndexDict(): + global NEW_678TH_SKILL_ENABLE + global SKILL_INDEX_DICT + + NEW_678TH_SKILL_ENABLE = localeInfo.IsYMIR() + if NEW_678TH_SKILL_ENABLE: + SKILL_INDEX_DICT = { + JOB_WARRIOR : { + 1 : (1, 2, 3, 4, 5, 6, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (16, 17, 18, 19, 20, 21, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131, 141, 142,), + }, + JOB_ASSASSIN : { + 1 : (31, 32, 33, 34, 35, 36, 0, 0, 137, 0, 138, 0, 139, 0, 140,), + 2 : (46, 47, 48, 49, 50, 51, 0, 0, 137, 0, 138, 0, 139, 0, 140,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131, 141, 142,), + }, + JOB_SURA : { + 1 : (61, 62, 63, 64, 65, 66, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (76, 77, 78, 79, 80, 81, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131, 141, 142,), + }, + JOB_SHAMAN : { + 1 : (91, 92, 93, 94, 95, 96, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (106, 107, 108, 109, 110, 111, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131, 141, 142,), + }, + } + else: + SKILL_INDEX_DICT = { + JOB_WARRIOR : { + 1 : (1, 2, 3, 4, 5, 0, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (16, 17, 18, 19, 20, 0, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131,), + }, + JOB_ASSASSIN : { + 1 : (31, 32, 33, 34, 35, 0, 0, 0, 137, 0, 138, 0, 139, 0, 140,), + 2 : (46, 47, 48, 49, 50, 0, 0, 0, 137, 0, 138, 0, 139, 0, 140,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131,), + }, + JOB_SURA : { + 1 : (61, 62, 63, 64, 65, 66, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (76, 77, 78, 79, 80, 81, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131,), + }, + JOB_SHAMAN : { + 1 : (91, 92, 93, 94, 95, 96, 0, 0, 137, 0, 138, 0, 139, 0,), + 2 : (106, 107, 108, 109, 110, 111, 0, 0, 137, 0, 138, 0, 139, 0,), + "SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131,), + }, + } + +def RegisterSkill(race, group, empire=0): + + DefineSkillIndexDict() + + job = chr.RaceToJob(race) + + ## Character Skill + if SKILL_INDEX_DICT.has_key(job): + + if SKILL_INDEX_DICT[job].has_key(group): + + activeSkillList = SKILL_INDEX_DICT[job][group] + + for i in xrange(len(activeSkillList)): + skillIndex = activeSkillList[i] + + ## 7锅 8锅 胶懦篮 咯扁辑 汲沥窍搁 救凳 + if i != 6 and i != 7: + player.SetSkill(i+1, skillIndex) + + supportSkillList = SKILL_INDEX_DICT[job]["SUPPORT"] + + for i in xrange(len(supportSkillList)): + player.SetSkill(i+100+1, supportSkillList[i]) + + ## Language Skill + if 0 != empire: + languageSkillList = [] + for i in xrange(3): + if (i+1) != empire: + languageSkillList.append(player.SKILL_INDEX_LANGUAGE1+i) + for i in xrange(len(languageSkillList)): + player.SetSkill(107+i, languageSkillList[i]) + + ## Guild Skill + for i in xrange(len(PASSIVE_GUILD_SKILL_INDEX_LIST)): + player.SetSkill(200+i, PASSIVE_GUILD_SKILL_INDEX_LIST[i]) + + for i in xrange(len(ACTIVE_GUILD_SKILL_INDEX_LIST)): + player.SetSkill(210+i, ACTIVE_GUILD_SKILL_INDEX_LIST[i]) + +def RegisterSkillAt(race, group, pos, num): + + DefineSkillIndexDict() + + job = chr.RaceToJob(race) + tmp = list(SKILL_INDEX_DICT[job][group]) + tmp[pos] = num + SKILL_INDEX_DICT[job][group] = tuple(tmp) + player.SetSkill(pos+1, num) + +FACE_IMAGE_DICT = { + RACE_WARRIOR_M : "d:/ymir work/ui/game/windows/face_warrior.sub", + RACE_ASSASSIN_W : "d:/ymir work/ui/game/windows/face_assassin.sub", + RACE_SURA_M : "d:/ymir work/ui/game/windows/face_sura.sub", + RACE_SHAMAN_W : "d:/ymir work/ui/game/windows/face_shaman.sub", +} + +isInitData=0 + +def SetGeneralMotions(mode, folder): + chrmgr.SetPathName(folder) + chrmgr.RegisterMotionMode(mode) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE_FLYING, "damage_flying.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_STAND_UP, "falling_stand.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DAMAGE_FLYING_BACK, "back_damage_flying.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_STAND_UP_BACK, "back_falling_stand.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_DIG, "dig.msa") + +def SetIntroMotions(mode, folder): + chrmgr.SetPathName(folder) + chrmgr.RegisterMotionMode(mode) + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_INTRO_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_INTRO_SELECTED, "selected.msa") + chrmgr.RegisterCacheMotionData(mode, chr.MOTION_INTRO_NOT_SELECTED, "not_selected.msa") + + + +def __InitData(): + global isInitData + + if isInitData: + return + + isInitData = 1 + + chrmgr.SetDustGap(250) + chrmgr.SetHorseDustGap(500) + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DUST, "", "d:/ymir work/effect/etc/dust/dust.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HORSE_DUST, "", "d:/ymir work/effect/etc/dust/running_dust.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HIT, "", "d:/ymir work/effect/hit/blow_1/blow_1_low.mse") + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HPUP_RED, "", "d:/ymir work/effect/etc/recuperation/drugup_red.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_SPUP_BLUE, "", "d:/ymir work/effect/etc/recuperation/drugup_blue.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_SPEEDUP_GREEN, "", "d:/ymir work/effect/etc/recuperation/drugup_green.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DXUP_PURPLE, "", "d:/ymir work/effect/etc/recuperation/drugup_purple.mse") + + #磊悼拱距 HP, SP + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_AUTO_HPUP, "", "d:/ymir work/effect/etc/recuperation/autodrugup_red.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_AUTO_SPUP, "", "d:/ymir work/effect/etc/recuperation/autodrugup_blue.mse") + + #扼付窜 檬铰崔狼 馆瘤(71135) 馒侩鉴埃 惯悼 捞棋飘 + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_RAMADAN_RING_EQUIP, "", "d:/ymir work/effect/etc/buff/buff_item1.mse") + + #且肺扩 荤帕 馒侩鉴埃 惯悼 捞棋飘 + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HALLOWEEN_CANDY_EQUIP, "", "d:/ymir work/effect/etc/buff/buff_item2.mse") + + #青汗狼 馆瘤 馒侩鉴埃 惯悼 捞棋飘 + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HAPPINESS_RING_EQUIP, "", "d:/ymir work/effect/etc/buff/buff_item3.mse") + + #荤尔狼 埔带飘 馒侩鉴埃 惯悼 捞棋飘 + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_LOVE_PENDANT_EQUIP, "", "d:/ymir work/effect/etc/buff/buff_item4.mse") + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_PENETRATE, "Bip01", "d:/ymir work/effect/hit/gwantong.mse") + #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_BLOCK, "", "d:/ymir work/effect/etc/") + #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DODGE, "", "d:/ymir work/effect/etc/") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_FIRECRACKER, "", "d:/ymir work/effect/etc/firecracker/newyear_firecracker.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_SPIN_TOP, "", "d:/ymir work/effect/etc/firecracker/paing_i.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_SELECT, "", "d:/ymir work/effect/etc/click/click_select.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_TARGET, "", "d:/ymir work/effect/etc/click/click_glow_select.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_STUN, "Bip01 Head", "d:/ymir work/effect/etc/stun/stun.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_CRITICAL, "Bip01 R Hand", "d:/ymir work/effect/hit/critical.mse") + player.RegisterCacheEffect(player.EFFECT_PICK, "d:/ymir work/effect/etc/click/click.mse") + + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_TARGET, "", "d:/ymir work/effect/affect/damagevalue/target.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_NOT_TARGET, "", "d:/ymir work/effect/affect/damagevalue/nontarget.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_SELFDAMAGE, "", "d:/ymir work/effect/affect/damagevalue/damage.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_SELFDAMAGE2, "", "d:/ymir work/effect/affect/damagevalue/damage_1.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_POISON, "", "d:/ymir work/effect/affect/damagevalue/poison.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_MISS, "", "d:/ymir work/effect/affect/damagevalue/miss.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_TARGETMISS, "", "d:/ymir work/effect/affect/damagevalue/target_miss.mse") + #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_CRITICAL, "", "d:/ymir work/effect/affect/damagevalue/critical.mse") + + #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_SUCCESS, "", "season1/effect/success.mse") + #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_FAIL, "", "season1/effect/fail.mse") + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_LEVELUP_ON_14_FOR_GERMANY, "","season1/effect/paymessage_warning.mse") #饭骇诀 14老锭 ( 刀老傈侩 ) + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_LEVELUP_UNDER_15_FOR_GERMANY, "", "season1/effect/paymessage_decide.mse" )#饭骇诀 15老锭 ( 刀老傈侩 ) + + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_PERCENT_DAMAGE1, "", "d:/ymir work/effect/hit/percent_damage1.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_PERCENT_DAMAGE2, "", "d:/ymir work/effect/hit/percent_damage2.mse") + chrmgr.RegisterCacheEffect(chrmgr.EFFECT_PERCENT_DAMAGE3, "", "d:/ymir work/effect/hit/percent_damage3.mse") + + + + ############## + # WARRIOR + ############## + chrmgr.CreateRace(RACE_WARRIOR_M) + chrmgr.SelectRace(RACE_WARRIOR_M) + chrmgr.LoadLocalRaceData("warrior_m.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc/warrior/intro/") + + chrmgr.CreateRace(RACE_WARRIOR_W) + chrmgr.SelectRace(RACE_WARRIOR_W) + chrmgr.LoadLocalRaceData("warrior_w.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc2/warrior/intro/") + + + ############## + # ASSASSIN + ############## + chrmgr.CreateRace(RACE_ASSASSIN_W) + chrmgr.SelectRace(RACE_ASSASSIN_W) + chrmgr.LoadLocalRaceData("assassin_w.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc/assassin/intro/") + + chrmgr.CreateRace(RACE_ASSASSIN_M) + chrmgr.SelectRace(RACE_ASSASSIN_M) + chrmgr.LoadLocalRaceData("assassin_m.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc2/assassin/intro/") + + + ############## + # SURA + ############## + chrmgr.CreateRace(RACE_SURA_M) + chrmgr.SelectRace(RACE_SURA_M) + chrmgr.LoadLocalRaceData("sura_m.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc/sura/intro/") + + chrmgr.CreateRace(RACE_SURA_W) + chrmgr.SelectRace(RACE_SURA_W) + chrmgr.LoadLocalRaceData("sura_w.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc2/sura/intro/") + + + ############## + # SHAMAN + ############## + chrmgr.CreateRace(RACE_SHAMAN_W) + chrmgr.SelectRace(RACE_SHAMAN_W) + chrmgr.LoadLocalRaceData("shaman_w.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc/shaman/intro/") + + chrmgr.CreateRace(RACE_SHAMAN_M) + chrmgr.SelectRace(RACE_SHAMAN_M) + chrmgr.LoadLocalRaceData("shaman_m.msm") + SetIntroMotions(chr.MOTION_MODE_GENERAL, "d:/ymir work/pc2/shaman/intro/") + + + +def __LoadGameSound(): + item.SetUseSoundFileName(item.USESOUND_DEFAULT, "sound/ui/drop.wav") + item.SetUseSoundFileName(item.USESOUND_ACCESSORY, "sound/ui/equip_ring_amulet.wav") + item.SetUseSoundFileName(item.USESOUND_ARMOR, "sound/ui/equip_metal_armor.wav") + item.SetUseSoundFileName(item.USESOUND_BOW, "sound/ui/equip_bow.wav") + item.SetUseSoundFileName(item.USESOUND_WEAPON, "sound/ui/equip_metal_weapon.wav") + item.SetUseSoundFileName(item.USESOUND_POTION, "sound/ui/eat_potion.wav") + item.SetUseSoundFileName(item.USESOUND_PORTAL, "sound/ui/potal_scroll.wav") + + item.SetDropSoundFileName(item.DROPSOUND_DEFAULT, "sound/ui/drop.wav") + item.SetDropSoundFileName(item.DROPSOUND_ACCESSORY, "sound/ui/equip_ring_amulet.wav") + item.SetDropSoundFileName(item.DROPSOUND_ARMOR, "sound/ui/equip_metal_armor.wav") + item.SetDropSoundFileName(item.DROPSOUND_BOW, "sound/ui/equip_bow.wav") + item.SetDropSoundFileName(item.DROPSOUND_WEAPON, "sound/ui/equip_metal_weapon.wav") + +def __LoadGameEffect(): + chrmgr.RegisterEffect(chrmgr.EFFECT_SPAWN_APPEAR, "Bip01", "d:/ymir work/effect/etc/appear_die/monster_appear.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_SPAWN_DISAPPEAR, "Bip01", "d:/ymir work/effect/etc/appear_die/monster_die.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_FLAME_ATTACK, "equip_right_hand", "d:/ymir work/effect/hit/blow_flame/flame_3_weapon.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_FLAME_HIT, "", "d:/ymir work/effect/hit/blow_flame/flame_3_blow.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_FLAME_ATTACH, "", "d:/ymir work/effect/hit/blow_flame/flame_3_body.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_ELECTRIC_ATTACK, "equip_right", "d:/ymir work/effect/hit/blow_electric/light_1_weapon.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_ELECTRIC_HIT, "", "d:/ymir work/effect/hit/blow_electric/light_1_blow.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_ELECTRIC_ATTACH, "", "d:/ymir work/effect/hit/blow_electric/light_1_body.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_LEVELUP, "", "d:/ymir work/effect/etc/levelup_1/level_up.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_SKILLUP, "", "d:/ymir work/effect/etc/skillup/skillup_1.mse") + + if localeInfo.IsNEWCIBN(): + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+1, "Bip01", "locale/newcibn/effect/empire/empire_A.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+2, "Bip01", "locale/newcibn/effect/empire/empire_B.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+3, "Bip01", "locale/newcibn/effect/empire/empire_C.mse") + else : + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+1, "Bip01", "d:/ymir work/effect/etc/empire/empire_A.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+2, "Bip01", "d:/ymir work/effect/etc/empire/empire_B.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_EMPIRE+3, "Bip01", "d:/ymir work/effect/etc/empire/empire_C.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_WEAPON+1, "equip_right_hand", "d:/ymir work/pc/warrior/effect/geom_sword_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_WEAPON+2, "equip_right_hand", "d:/ymir work/pc/warrior/effect/geom_spear_loop.mse") + + # LOCALE + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+0, "Bip01", localeInfo.FN_GM_MARK) + # END_OF_LOCALE + + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+3, "Bip01", "d:/ymir work/effect/hit/blow_poison/poison_loop.mse") ## 吝刀 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+4, "", "d:/ymir work/effect/affect/slow.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+5, "Bip01 Head", "d:/ymir work/effect/etc/stun/stun_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+6, "", "d:/ymir work/effect/etc/ready/ready.mse") + #chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+8, "", "d:/ymir work/guild/effect/10_construction.mse") + #chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+9, "", "d:/ymir work/guild/effect/20_construction.mse") + #chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+10, "", "d:/ymir work/guild/effect/20_upgrade.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+16, "", "d:/ymir work/pc/warrior/effect/gyeokgongjang_loop.mse") ## 玫辟眠 (关俊档 乐蝶-_-) + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+17, "", "d:/ymir work/pc/assassin/effect/gyeonggong_loop.mse") ## 磊按 - 版傍 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+19, "Bip01 R Finger2", "d:/ymir work/pc/sura/effect/gwigeom_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+20, "", "d:/ymir work/pc/sura/effect/fear_loop.mse") ## 荐扼 - 傍器 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+21, "", "d:/ymir work/pc/sura/effect/jumagap_loop.mse") ## 荐扼 - 林付癌 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+22, "", "d:/ymir work/pc/shaman/effect/3hosin_loop.mse") ## 公寸 - 龋脚 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+23, "", "d:/ymir work/pc/shaman/effect/boho_loop.mse") ## 公寸 - 焊龋 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+24, "", "d:/ymir work/pc/shaman/effect/10kwaesok_loop.mse") ## 公寸 - 蔫加 + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+25, "", "d:/ymir work/pc/sura/effect/heuksin_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+26, "", "d:/ymir work/pc/sura/effect/muyeong_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+28, "Bip01", "d:/ymir work/effect/hit/blow_flame/flame_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+29, "Bip01 R Hand", "d:/ymir work/pc/shaman/effect/6gicheon_hand.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+30, "Bip01 L Hand", "d:/ymir work/pc/shaman/effect/jeungryeok_hand.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+32, "Bip01 Head", "d:/ymir work/pc/sura/effect/pabeop_loop.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+33, "", "d:/ymir work/pc/warrior/effect/gyeokgongjang_loop.mse") ## 玫辟眠 (Fallen) + ## 34 Polymoph + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+35, "", "d:/ymir work/effect/etc/guild_war_flag/flag_red.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+36, "", "d:/ymir work/effect/etc/guild_war_flag/flag_blue.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+37, "", "d:/ymir work/effect/etc/guild_war_flag/flag_yellow.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+1, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+2, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+3, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+4, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_7_b.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+5, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_8_b.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+6, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_9_b.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+7, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7_f.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+8, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8_f.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+9, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9_f.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+10, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_7_s.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+11, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_8_s.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+12, "PART_WEAPON", "D:/ymir work/pc/common/effect/sword/sword_9_s.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+13, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_7_s.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+14, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_8_s.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+15, "PART_WEAPON_LEFT", "D:/ymir work/pc/common/effect/sword/sword_9_s.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+16, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_7.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+17, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_8.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+18, "Bip01", "D:/ymir work/pc/common/effect/armor/armor_9.mse") + + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+19, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-1.mse") + chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+20, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-2.mse") + + ## FlyData + effect.RegisterIndexedFlyData(effect.FLY_EXP, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_yellow_small2.msf") ## 畴鄂祸 (EXP) + effect.RegisterIndexedFlyData(effect.FLY_HP_MEDIUM, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_red_small.msf") ## 弧埃祸 (HP) 累篮芭 + effect.RegisterIndexedFlyData(effect.FLY_HP_BIG, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_red_big.msf") ## 弧埃祸 (HP) 奴芭 + effect.RegisterIndexedFlyData(effect.FLY_SP_SMALL, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_blue_warrior_small.msf") ## 颇鄂祸 部府父 乐绰芭 + effect.RegisterIndexedFlyData(effect.FLY_SP_MEDIUM, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_blue_small.msf") ## 颇鄂祸 累篮芭 + effect.RegisterIndexedFlyData(effect.FLY_SP_BIG, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_blue_big.msf") ## 颇鄂祸 奴芭 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK1, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_1.msf") ## 气磷 1 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK2, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_2.msf") ## 气磷 2 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK3, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_3.msf") ## 气磷 3 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK4, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_4.msf") ## 气磷 4 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK5, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_5.msf") ## 气磷 5 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK6, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_6.msf") ## 气磷 6 + effect.RegisterIndexedFlyData(effect.FLY_FIREWORK_XMAS, effect.INDEX_FLY_TYPE_FIRE_CRACKER, "d:/ymir work/effect/etc/firecracker/firecracker_xmas.msf") ## 气磷 X-Mas + effect.RegisterIndexedFlyData(effect.FLY_CHAIN_LIGHTNING, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/pc/shaman/effect/pokroe.msf") ## 气汾拜 + effect.RegisterIndexedFlyData(effect.FLY_HP_SMALL, effect.INDEX_FLY_TYPE_NORMAL, "d:/ymir work/effect/etc/gathering/ga_piece_red_smallest.msf") ## 弧埃祸 概快 累篮芭 + effect.RegisterIndexedFlyData(effect.FLY_SKILL_MUYEONG, effect.INDEX_FLY_TYPE_AUTO_FIRE, "d:/ymir work/pc/sura/effect/muyeong_fly.msf") ## 公康柳 + + ######################################################################################### + ## Emoticon + EmoticonStr = "d:/ymir work/effect/etc/emoticon/" + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+0, "", EmoticonStr+"sweat.mse") + net.RegisterEmoticonString("(炔寸)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+1, "", EmoticonStr+"money.mse") + net.RegisterEmoticonString("(捣)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+2, "", EmoticonStr+"happy.mse") + net.RegisterEmoticonString("(扁惠)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+3, "", EmoticonStr+"love_s.mse") + net.RegisterEmoticonString("(亮酒)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+4, "", EmoticonStr+"love_l.mse") + net.RegisterEmoticonString("(荤尔)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+5, "", EmoticonStr+"angry.mse") + net.RegisterEmoticonString("(盒畴)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+6, "", EmoticonStr+"aha.mse") + net.RegisterEmoticonString("(酒窍)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+7, "", EmoticonStr+"gloom.mse") + net.RegisterEmoticonString("(快匡)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+8, "", EmoticonStr+"sorry.mse") + net.RegisterEmoticonString("(了价)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+9, "", EmoticonStr+"!_mix_back.mse") + net.RegisterEmoticonString("(!)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+10, "", EmoticonStr+"question.mse") + net.RegisterEmoticonString("(?)") + + chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+11, "", EmoticonStr+"fish.mse") + net.RegisterEmoticonString("(fish)") + + + ## Emoticon + ######################################################################################### + + +def __LoadGameWarrior(): + __LoadGameWarriorEx(RACE_WARRIOR_M, "d:/ymir work/pc/warrior/") + __LoadGameWarriorEx(RACE_WARRIOR_W, "d:/ymir work/pc2/warrior/") + +def __LoadGameAssassin(): + __LoadGameAssassinEx(RACE_ASSASSIN_W, "d:/ymir work/pc/assassin/") + __LoadGameAssassinEx(RACE_ASSASSIN_M, "d:/ymir work/pc2/assassin/") + +def __LoadGameSura(): + __LoadGameSuraEx(RACE_SURA_M, "d:/ymir work/pc/sura/") + __LoadGameSuraEx(RACE_SURA_W, "d:/ymir work/pc2/sura/") + +def __LoadGameShaman(): + __LoadGameShamanEx(RACE_SHAMAN_W, "d:/ymir work/pc/shaman/") + __LoadGameShamanEx(RACE_SHAMAN_M, "d:/ymir work/pc2/shaman/") + +def __LoadGameWarriorEx(race, path): + + ## Warrior + ######################################################################################### + chrmgr.SelectRace(race) + + ## GENERAL MODE + SetGeneralMotions(chr.MOTION_MODE_GENERAL, path + "general/") + chrmgr.SetMotionRandomWeight(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, 0, 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack_1.msa", 50) + + ## SKILL + chrmgr.SetPathName(path + "skill/") + for i in xrange(skill.SKILL_EFFECT_COUNT): + END_STRING = "" + if i != 0: END_STRING = "_%d" % (i+1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+1, "samyeon" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+2, "palbang" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+3, "jeongwi" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+4, "geomgyeong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+5, "tanhwan" + END_STRING + ".msa") + if NEW_678TH_SKILL_ENABLE: + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+6, "gihyeol" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+16, "gigongcham" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+17, "gyeoksan" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+18, "daejin" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+19, "cheongeun" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+20, "geompung" + END_STRING + ".msa") + if NEW_678TH_SKILL_ENABLE: + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+21, "noegeom" + END_STRING + ".msa") + + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLOOD, "guild_yongsinuipi.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLESS, "guild_yongsinuichukbok.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_BLESSARMOR, "guild_seonghwigap.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_SPPEDUP, "guild_gasokhwa.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONWRATH, "guild_yongsinuibunno.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_MAGICUP, "guild_jumunsul.msa") + + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + ## EMOTION + emotion.RegisterEmotionAnis(path) + + ## ONEHAND_SWORD BATTLE + chrmgr.SetPathName(path + "onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WAIT, "wait.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WAIT, "wait_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## TWOHAND_SWORD BATTLE + chrmgr.SetPathName(path + "twohand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_TWOHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_WAIT, "wait.msa", 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_TWOHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## FISHING + chrmgr.SetPathName(path + "fishing/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_FISHING) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_THROW, "throw.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_WAIT, "fishing_wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_STOP, "fishing_cancel.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_REACT, "fishing_react.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_CATCH, "fishing_catch.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_FAIL, "fishing_fail.msa") + + ## HORSE + chrmgr.SetPathName(path + "horse/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait.msa", 90) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_1.msa", 9) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_2.msa", 1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE_BACK, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_CHARGE, "skill_charge.msa") + + ## HORSE_ONEHAND_SWORD + chrmgr.SetPathName(path + "horse_onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa") + + ## HORSE_TWOHAND_SWORD + chrmgr.SetPathName(path + "horse_twohand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_TWOHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa") + + ## Bone + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON, "equip_right_hand") + +def __LoadGameAssassinEx(race, path): + ## Assassin + ######################################################################################### + chrmgr.SelectRace(race) + + ## GENERAL MOTION MODE + SetGeneralMotions(chr.MOTION_MODE_GENERAL, path + "general/") + chrmgr.SetMotionRandomWeight(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, 0, 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack_1.msa", 50) + + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + ## SKILL + chrmgr.SetPathName(path + "skill/") + for i in xrange(skill.SKILL_EFFECT_COUNT): + END_STRING = "" + if i != 0: END_STRING = "_%d" % (i+1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+1, "amseup" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+2, "gungsin" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+3, "charyun" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+4, "eunhyeong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+5, "sangong" + END_STRING + ".msa") + if NEW_678TH_SKILL_ENABLE: + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+6, "seomjeon" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+16, "yeonsa" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+17, "gwangyeok" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+18, "hwajo" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+19, "gyeonggong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+20, "dokgigung" + END_STRING + ".msa") + if NEW_678TH_SKILL_ENABLE: + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+21, "seomgwang" + END_STRING + ".msa") + + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLOOD, "guild_yongsinuipi.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLESS, "guild_yongsinuichukbok.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_BLESSARMOR, "guild_seonghwigap.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_SPPEDUP, "guild_gasokhwa.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONWRATH, "guild_yongsinuibunno.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_MAGICUP, "guild_jumunsul.msa") + + ## EMOTION + emotion.RegisterEmotionAnis(path) + + ## ONEHAND_SWORD BATTLE + chrmgr.SetPathName(path + "onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WAIT, "wait.msa", 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## DUALHAND_SWORD BATTLE + chrmgr.SetPathName(path + "dualhand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_DUALHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_WAIT, "wait.msa", 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_8, "combo_08.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_DUALHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_8) + + ## BOW BATTLE + chrmgr.SetPathName(path + "bow/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_BOW) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_WAIT, "wait.msa", 70) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_WAIT, "wait_1.msa", 30) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BOW, chr.MOTION_COMBO_ATTACK_1, "attack.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_BOW, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BOW, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + ## FISHING + chrmgr.SetPathName(path + "fishing/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_FISHING) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_THROW, "throw.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_WAIT, "fishing_wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_STOP, "fishing_cancel.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_REACT, "fishing_react.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_CATCH, "fishing_catch.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_FAIL, "fishing_fail.msa") + + ## HORSE + chrmgr.SetPathName(path + "horse/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait.msa", 90) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_1.msa", 9) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_2.msa", 1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE_BACK, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_CHARGE, "skill_charge.msa") + + ## HORSE_ONEHAND_SWORD + chrmgr.SetPathName(path + "horse_onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + + ## HORSE_DUALHAND_SWORD + chrmgr.SetPathName(path + "horse_dualhand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_DUALHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + + ## HORSE_BOW + chrmgr.SetPathName(path + "horse_bow/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_BOW) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_WAIT, "wait.msa", 90) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_WAIT, "wait_1.msa", 9) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_WAIT, "wait_2.msa", 1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, chr.MOTION_COMBO_ATTACK_1, "attack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, HORSE_SKILL_SPLASH, "skill_splash.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_BOW, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_BOW, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON, "equip_right") + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON_LEFT, "equip_left") + +def __LoadGameSuraEx(race, path): + ## Sura + ######################################################################################### + chrmgr.SelectRace(race) + + ## GENERAL MOTION MODE + SetGeneralMotions(chr.MOTION_MODE_GENERAL, path + "general/") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack_1.msa", 50) + + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + ## SKILL + chrmgr.SetPathName(path + "skill/") + # chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+4, "geongon.msa") + + for i in xrange(skill.SKILL_EFFECT_COUNT): + END_STRING = "" + if i != 0: END_STRING = "_%d" % (i+1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+1, "swaeryeong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+2, "yonggwon" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+3, "gwigeom" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+4, "gongpo" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+5, "jumagap" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+6, "pabeop" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+16, "maryeong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+17, "hwayeom" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+18, "muyeong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+19, "heuksin" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+20, "tusok" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+21, "mahwan" + END_STRING + ".msa") + + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLOOD, "guild_yongsinuipi.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLESS, "guild_yongsinuichukbok.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_BLESSARMOR, "guild_seonghwigap.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_SPPEDUP, "guild_gasokhwa.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONWRATH, "guild_yongsinuibunno.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_MAGICUP, "guild_jumunsul.msa") + + ## EMOTION + emotion.RegisterEmotionAnis(path) + + ## ONEHAND_SWORD BATTLE + chrmgr.SetPathName(path + "onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_ONEHAND_SWORD, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## FISHING + chrmgr.SetPathName(path + "fishing/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_FISHING) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_THROW, "throw.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_WAIT, "fishing_wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_STOP, "fishing_cancel.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_REACT, "fishing_react.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_CATCH, "fishing_catch.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_FAIL, "fishing_fail.msa") + + ## HORSE + chrmgr.SetPathName(path + "horse/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait.msa", 90) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_1.msa", 9) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_2.msa", 1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE_BACK, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_CHARGE, "skill_charge.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_SPLASH, "skill_splash.msa") + + ## HORSE_ONEHAND_SWORD + chrmgr.SetPathName(path + "horse_onehand_sword/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_ONEHAND_SWORD) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON, "equip_right") + +def __LoadGameShamanEx(race, path): + ## Shaman + ######################################################################################### + chrmgr.SelectRace(race) + + ## GENERAL MOTION MODE + SetGeneralMotions(chr.MOTION_MODE_GENERAL, path + "general/") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_COMBO_ATTACK_1, "attack_1.msa", 50) + + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, 1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_GENERAL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + + ## EMOTION + emotion.RegisterEmotionAnis(path) + + ## Fan + chrmgr.SetPathName(path + "fan/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_FAN) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FAN, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_FAN, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## Bell + chrmgr.SetPathName(path + "Bell/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_BELL) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_DAMAGE, "damage.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_DAMAGE, "damage_1.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_DAMAGE_BACK, "damage_2.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_DAMAGE_BACK, "damage_3.msa", 50) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_4, "combo_04.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_5, "combo_05.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_6, "combo_06.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_BELL, chr.MOTION_COMBO_ATTACK_7, "combo_07.msa") + + ## Combo Type 1 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_1, 4) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_1, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_4) + ## Combo Type 2 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, 5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_2, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_7) + ## Combo Type 3 + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, 6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_4, chr.MOTION_COMBO_ATTACK_5) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_5, chr.MOTION_COMBO_ATTACK_6) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_BELL, COMBO_TYPE_3, COMBO_INDEX_6, chr.MOTION_COMBO_ATTACK_4) + + ## SKILL + chrmgr.SetPathName(path + "skill/") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+1, "bipabu.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+2, "yongpa.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+3, "paeryong.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+4, "hosin_target.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+5, "boho_target.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+6, "gicheon_target.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+16, "noejeon.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+17, "byeorak.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+18, "pokroe.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+19, "jeongeop_target.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+20, "kwaesok_target.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+21, "jeungryeok_target.msa") + #chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+10, "budong.msa") + + START_INDEX = 0 + #skill.SKILL_EFFECT_COUNT 鳖瘤// + for i in (1, 2, 3): + END_STRING = "" + if i != 0: END_STRING = "_%d" % (i+1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+1, "bipabu" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+2, "yongpa" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+3, "paeryong" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+4, "hosin" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+5, "boho" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+6, "gicheon" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+16, "noejeon" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+17, "byeorak" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+18, "pokroe" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+19, "jeongeop" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+20, "kwaesok" + END_STRING + ".msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+21, "jeungryeok" + END_STRING + ".msa") + #chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+10, "budong" + END_STRING + ".msa") + + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLOOD, "guild_yongsinuipi.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONBLESS, "guild_yongsinuichukbok.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_BLESSARMOR, "guild_seonghwigap.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_SPPEDUP, "guild_gasokhwa.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_DRAGONWRATH, "guild_yongsinuibunno.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, GUILD_SKILL_MAGICUP, "guild_jumunsul.msa") + + ## FISHING + chrmgr.SetPathName(path + "fishing/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_FISHING) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_THROW, "throw.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_WAIT, "fishing_wait.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_STOP, "fishing_cancel.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_REACT, "fishing_react.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_CATCH, "fishing_catch.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_FISHING, chr.MOTION_FISHING_FAIL, "fishing_fail.msa") + + ## HORSE + chrmgr.SetPathName(path + "horse/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait.msa", 90) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_1.msa", 9) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WAIT, "wait_2.msa", 1) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DAMAGE_BACK, "damage.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_DEAD, "dead.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_CHARGE, "skill_charge.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_SPLASH, "skill_splash.msa") + + ## HORSE_FAN + chrmgr.SetPathName(path + "horse_fan/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_FAN) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_FAN, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_FAN, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_FAN, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_FAN, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_FAN, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_FAN, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_FAN, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_FAN, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + + ## HORSE_BELL + chrmgr.SetPathName(path + "horse_bell/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_HORSE_BELL) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BELL, chr.MOTION_COMBO_ATTACK_1, "combo_01.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BELL, chr.MOTION_COMBO_ATTACK_2, "combo_02.msa") + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BELL, chr.MOTION_COMBO_ATTACK_3, "combo_03.msa") + chrmgr.ReserveComboAttackNew(chr.MOTION_MODE_HORSE_BELL, COMBO_TYPE_1, 3) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_BELL, COMBO_TYPE_1, COMBO_INDEX_1, chr.MOTION_COMBO_ATTACK_1) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_BELL, COMBO_TYPE_1, COMBO_INDEX_2, chr.MOTION_COMBO_ATTACK_2) + chrmgr.RegisterComboAttackNew(chr.MOTION_MODE_HORSE_BELL, COMBO_TYPE_1, COMBO_INDEX_3, chr.MOTION_COMBO_ATTACK_3) + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BELL, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa") + + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON, "equip_right") + chrmgr.RegisterAttachingBoneName(chr.PART_WEAPON_LEFT, "equip_left") + + +def __LoadGameSkill(): + + try: + skill.LoadSkillData() + except: + import exception + exception.Abort("__LoadGameSkill") + +def __LoadGameEnemy(): + pass + +def __LoadGameNPC(): + try: + lines = pack_open("npclist.txt", "r").readlines() + except IOError: + import dbg + dbg.LogBox("LoadLocaleError(%(srcFileName)s)" % locals()) + app.Abort() + + for line in lines: + tokens = line[:-1].split("\t") + if len(tokens) == 0 or not tokens[0]: + continue + + try: + vnum = int(tokens[0]) + except ValueError: + import dbg + dbg.LogBox("LoadGameNPC() - %s - line #%d: %s" % (tokens, lines.index(line), line)) + app.Abort() + + try: + if vnum: + chrmgr.RegisterRaceName(vnum, tokens[1].strip()) + else: + chrmgr.RegisterRaceSrcName(tokens[1].strip(), tokens[2].strip()) + except IndexError: + import dbg + dbg.LogBox("LoadGameNPC() - %d, %s - line #%d: %s " % (vnum, tokens, lines.index(line), line)) + app.Abort() + + +# GUILD_BUILDING +def LoadGuildBuildingList(filename): + import uiGuild + uiGuild.BUILDING_DATA_LIST = [] + + handle = app.OpenTextFile(filename) + count = app.GetTextFileLineCount(handle) + for i in xrange(count): + line = app.GetTextFileLine(handle, i) + tokens = line.split("\t") + + TOKEN_VNUM = 0 + TOKEN_TYPE = 1 + TOKEN_NAME = 2 + TOKEN_LOCAL_NAME = 3 + NO_USE_TOKEN_SIZE_1 = 4 + NO_USE_TOKEN_SIZE_2 = 5 + NO_USE_TOKEN_SIZE_3 = 6 + NO_USE_TOKEN_SIZE_4 = 7 + TOKEN_X_ROT_LIMIT = 8 + TOKEN_Y_ROT_LIMIT = 9 + TOKEN_Z_ROT_LIMIT = 10 + TOKEN_PRICE = 11 + TOKEN_MATERIAL = 12 + TOKEN_NPC = 13 + TOKEN_GROUP = 14 + TOKEN_DEPEND_GROUP = 15 + TOKEN_ENABLE_FLAG = 16 + LIMIT_TOKEN_COUNT = 17 + + if not tokens[TOKEN_VNUM].isdigit(): + continue + + if len(tokens) < LIMIT_TOKEN_COUNT: + import dbg + dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line)) + continue + + ENABLE_FLAG_TYPE_NOT_USE = False + ENABLE_FLAG_TYPE_USE = True + ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2 + + if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]): + continue + + vnum = int(tokens[TOKEN_VNUM]) + type = tokens[TOKEN_TYPE] + name = tokens[TOKEN_NAME] + localName = tokens[TOKEN_LOCAL_NAME] + xRotLimit = int(tokens[TOKEN_X_ROT_LIMIT]) + yRotLimit = int(tokens[TOKEN_Y_ROT_LIMIT]) + zRotLimit = int(tokens[TOKEN_Z_ROT_LIMIT]) + price = tokens[TOKEN_PRICE] + material = tokens[TOKEN_MATERIAL] + + folderName = "" + if "HEADQUARTER" == type: + folderName = "headquarter" + elif "FACILITY" == type: + folderName = "facility" + elif "OBJECT" == type: + folderName = "object" + elif "WALL" == type: + folderName = "fence" + + materialList = ["0", "0", "0"] + if material: + if material[0] == "\"": + material = material[1:] + if material[-1] == "\"": + material = material[:-1] + for one in material.split("/"): + data = one.split(",") + if 2 != len(data): + continue + itemID = int(data[0]) + count = data[1] + + if itemID == uiGuild.MATERIAL_STONE_ID: + materialList[uiGuild.MATERIAL_STONE_INDEX] = count + elif itemID == uiGuild.MATERIAL_LOG_ID: + materialList[uiGuild.MATERIAL_LOG_INDEX] = count + elif itemID == uiGuild.MATERIAL_PLYWOOD_ID: + materialList[uiGuild.MATERIAL_PLYWOOD_INDEX] = count + + ## GuildSymbol 篮 老馆 NPC 甸苞 窃膊 殿废茄促. + import chrmgr + chrmgr.RegisterRaceSrcName(name, folderName) + chrmgr.RegisterRaceName(vnum, name) + + appendingData = { "VNUM":vnum, + "TYPE":type, + "NAME":name, + "LOCAL_NAME":localName, + "X_ROT_LIMIT":xRotLimit, + "Y_ROT_LIMIT":yRotLimit, + "Z_ROT_LIMIT":zRotLimit, + "PRICE":price, + "MATERIAL":materialList, + "SHOW" : True } + + if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]): + appendingData["SHOW"] = False + + uiGuild.BUILDING_DATA_LIST.append(appendingData) + + app.CloseTextFile(handle) + +# END_OF_GUILD_BUILDING + +loadGameDataDict={ + "INIT" : __InitData, + "SOUND" : __LoadGameSound, + "EFFECT" : __LoadGameEffect, + "WARRIOR" : __LoadGameWarrior, + "ASSASSIN" : __LoadGameAssassin, + "SURA" : __LoadGameSura, + "SHAMAN" : __LoadGameShaman, + "SKILL" : __LoadGameSkill, + "ENEMY" : __LoadGameEnemy, + "NPC" : __LoadGameNPC, +} + +def LoadGameData(name): + global loadGameDataDict + + load=loadGameDataDict.get(name, 0) + if load: + loadGameDataDict[name]=0 + try: + load() + except: + print name + import exception + exception.Abort("LoadGameData") + raise + + +## NPC + +def SetMovingNPC(race, name): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + + ## RESERVED + chrmgr.SetPathName("d:/ymir work/npc/" + name + "/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WALK, "walk.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, "run.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DEAD, "die.msa") + chrmgr.LoadRaceData(name + ".msm") + +def SetOneNPC(race, name): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + + ## RESERVED + chrmgr.SetPathName("d:/ymir work/npc/" + name + "/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa") + chrmgr.LoadRaceData(name + ".msm") + +def SetGuard(race, name): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + + ## Script Data + chrmgr.SetPathName("d:/ymir work/npc/" + name + "/") + chrmgr.LoadRaceData(name + ".msm") + + ## GENERAL + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_SPAWN, "00.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "00.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, "03.msa") + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE, "30.msa", 50) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE, "30_1.msa", 50) + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE_BACK, "34.msa", 50) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE_BACK, "34_1.msa", 50) + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE_FLYING,"32.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_STAND_UP, "33.msa") + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DAMAGE_FLYING_BACK, "35.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_STAND_UP_BACK, "36.msa") + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DEAD, "31.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DEAD_BACK, "37.msa") + + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_NORMAL_ATTACK, "20.msa") + + ## Attacking Data + chrmgr.RegisterNormalAttack(chr.MOTION_MODE_GENERAL, chr.MOTION_NORMAL_ATTACK) + +def SetWarp(race): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + + chrmgr.SetPathName("d:/ymir work/npc/warp/") + chrmgr.LoadRaceData("warp.msm") + + ## GENERAL + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa") + +def SetDoor(race, name): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + chrmgr.SetPathName("d:/ymir work/npc/"+name+"/") + chrmgr.LoadRaceData(name + ".msm") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "close_wait.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DEAD, "open.msa") + +def SetGuildBuilding(race, name, grade): + chrmgr.CreateRace(race) + chrmgr.SelectRace(race) + chrmgr.SetPathName("d:/ymir work/guild/building/%s/" % name) + chrmgr.LoadRaceData("%s%02d.msm" % (name, grade)) + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + #chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_DEAD, name + "_destruction.msa") + +def OLD_SetNPC(): + SetOneNPC(9001, "arms") + SetOneNPC(9002, "defence") + SetOneNPC(9003, "goods") + SetOneNPC(9004, "bank") + SetOneNPC(9005, "hotel_grandfa") + SetOneNPC(9006, "hotel_grandma") + SetOneNPC(9007, "arms") + SetOneNPC(9008, "defence") + SetOneNPC(9009, "sailor") + + SetMovingNPC(20001, "alchemist") + SetMovingNPC(20002, "auntie") + SetMovingNPC(20003, "baby_and_mom") + SetMovingNPC(20004, "beggar") + SetMovingNPC(20005, "ceramist") + SetMovingNPC(20006, "girl_lost_elder_brother") + SetMovingNPC(20007, "hotel_grandfa") + SetMovingNPC(20008, "mr_restaurant") + SetMovingNPC(20009, "oldster") + SetMovingNPC(20010, "peddler") + SetMovingNPC(20011, "plant_researcher") + SetMovingNPC(20012, "rice_cake_seller") + SetMovingNPC(20013, "sailor") + SetMovingNPC(20014, "timid_boy") + SetMovingNPC(20015, "woodcutter") + SetMovingNPC(20016, "blacksmith") + SetMovingNPC(20017, "musician") + SetMovingNPC(20018, "doctor") + SetMovingNPC(20019, "hunter") + SetMovingNPC(20020, "old_pirate") + SetMovingNPC(20021, "widow") + SetMovingNPC(20022, "young_merchant") + SetMovingNPC(20023, "bookworm") + SetMovingNPC(20024, "yu_hwa_rang") + SetMovingNPC(20041, "beggar") + SetMovingNPC(20042, "peddler") + + SetGuard(20300, "sinsu_patrol_spear") + SetGuard(20301, "sinsu_patrol_spear") + SetGuard(20302, "sinsu_patrol_spear") + SetGuard(20303, "sinsu_patrol_spear") + SetGuard(20304, "sinsu_patrol_spear") + SetGuard(20305, "sinsu_patrol_spear") + SetGuard(20306, "sinsu_patrol_spear") + SetGuard(20307, "sinsu_patrol_spear") + + SetGuard(20320, "gangyo_patrol_spear") + SetGuard(20321, "gangyo_patrol_spear") + SetGuard(20322, "gangyo_patrol_spear") + SetGuard(20323, "gangyo_patrol_spear") + SetGuard(20324, "gangyo_patrol_spear") + SetGuard(20325, "gangyo_patrol_spear") + SetGuard(20326, "gangyo_patrol_spear") + SetGuard(20327, "gangyo_patrol_spear") + + SetGuard(20340, "jinno_patrol_spear") + SetGuard(20341, "jinno_patrol_spear") + SetGuard(20342, "jinno_patrol_spear") + SetGuard(20343, "jinno_patrol_spear") + SetGuard(20344, "jinno_patrol_spear") + SetGuard(20345, "jinno_patrol_spear") + SetGuard(20346, "jinno_patrol_spear") + SetGuard(20347, "jinno_patrol_spear") + + ## Warp + for i in xrange(18): + SetWarp(10001 + i) + + SetGuard(11000, "gangyo_patrol_spear") + SetGuard(11001, "gangyo_patrol_bow") + SetGuard(11002, "jinno_patrol_spear") + SetGuard(11003, "jinno_patrol_bow") + SetGuard(11004, "sinsu_patrol_spear") + SetGuard(11005, "sinsu_patrol_bow") + + ## Campfire (Bonfire) + chrmgr.CreateRace(12000) + chrmgr.SelectRace(12000) + chrmgr.SetPathName("d:/ymir Work/npc/campfire/") + chrmgr.LoadRaceData("campfire.msm") + + ## Door + SetDoor(13000, "wooden_door") + SetDoor(13001, "stone_door") diff --git a/root/prototype.py b/root/prototype.py new file mode 100644 index 0000000..442f7ff --- /dev/null +++ b/root/prototype.py @@ -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() + diff --git a/root/rootlibcythonizer.py b/root/rootlibcythonizer.py new file mode 100644 index 0000000..22321a5 --- /dev/null +++ b/root/rootlibcythonizer.py @@ -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') + diff --git a/root/servercommandparser.py b/root/servercommandparser.py new file mode 100644 index 0000000..b46cd87 --- /dev/null +++ b/root/servercommandparser.py @@ -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() diff --git a/root/serverinfo.py b/root/serverinfo.py new file mode 100644 index 0000000..56decdd --- /dev/null +++ b/root/serverinfo.py @@ -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", }, +} \ No newline at end of file diff --git a/root/shaman_m.msm b/root/shaman_m.msm new file mode 100644 index 0000000..a54c6aa --- /dev/null +++ b/root/shaman_m.msm @@ -0,0 +1,1594 @@ +ScriptType RaceDataScript + +BaseModelFileName "D:/YMIR WORK/pc2/shaman/shaman_novice.GR2" + +Group HairData +{ + PathName "d:/ymir Work/pc2/shaman/" + + HairDataCount 61 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 4001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 4002 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 4003 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 4004 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 4005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 4006 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 4007 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 4008 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 4009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 4010 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 4011 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 4012 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_4.dds" + } + Group HairData18 + { + HairIndex 4013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 4014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 4015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 4016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + + HairIndex 4017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + + HairIndex 4018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + + Group HairData26 + { + + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + Group HairData27 + { + + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + Group HairData29 + { + + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData30 + { + + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + Group HairData31 + { + + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + Group HairData32 + { + + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData33 + { + HairIndex 5028 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_3.dds" + } + Group HairData34 + { + HairIndex 5029 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_2.dds" + } + Group HairData35 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData36 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData37 + { + HairIndex 5033 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData38 + { + HairIndex 5035 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData39 + { + HairIndex 5037 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData40 + { + HairIndex 5039 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData41 + { + HairIndex 5041 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData42 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData43 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData44 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData45 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData46 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData47 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData48 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData49 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData50 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData51 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData52 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData53 + { + HairIndex 5055 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData54 + { + HairIndex 5057 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData55 + { + HairIndex 5059 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData56 + { + HairIndex 5061 + Model "hair/hair_35_1.gr2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData57 + { + HairIndex 5063 + Model "hair/hair_37_1.gr2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + Group HairData58 + { + HairIndex 5064 + Model "hair/hair_36_1.gr2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + Group HairData59 + { + HairIndex 5065 + Model "hair/hair_38_1.gr2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + + Group HairData60 + { + HairIndex 5022 + Model "hair/hair_12_1.gr2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } + +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc2/shaman/" + + ShapeDataCount 146 + + Group ShapeData00 + { + ShapeIndex 0 + + Model "shaman_novice.GR2" + } + Group ShapeData01 + { + ShapeIndex 1 + + Model "shaman_novice.GR2" + SourceSkin "shaman_novice_red.dds" + TargetSkin "shaman_novice_green.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_cheongnang.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_nabong.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_bihong.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_miyeom.dds" + } + Group ShapeData06 + { + ShapeIndex 7 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_seocheon.dds" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_ilseon.dds" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_cheonryun.dds" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_amyo.dds" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_bongsin.dds" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 201 + Model "shaman_marry_01.gr2" + SourceSkin "shaman_marry_01.dds" + TargetSkin "shaman_marry_01.dds" + } + Group ShapeData16 + { + ShapeIndex 12 + Model "shaman_4-1.GR2" + SourceSkin "shaman_4-1.dds" + TargetSkin "shaman_4-1.dds" + } + + + Group ShapeData17 + { + ShapeIndex 14 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_1-1cheongnang_a.DDS" + } + Group ShapeData18 + { + ShapeIndex 15 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_1-2_nabong_a.DDS" + } + Group ShapeData19 + { + ShapeIndex 16 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_bihong_a.dds" + } + Group ShapeData20 + { + ShapeIndex 17 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-1_miyeon_a.DDS" + } + Group ShapeData21 + { + ShapeIndex 18 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-2_seocheon_a.DDS" + } + Group ShapeData22 + { + ShapeIndex 19 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-3_ilseon_a.DDS" + } + Group ShapeData23 + { + ShapeIndex 20 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_3-1_cheonryun_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 21 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_3-2_amyo_a.DDS" + } + Group ShapeData25 + { + ShapeIndex 24 + Model "shaman_lord.GR2" + SourceSkin "shaman_queen01.dds" + TargetSkin "shaman_queen01.dds" + } + Group ShapeData26 + { + ShapeIndex 25 + Model "shaman_lord.GR2" + SourceSkin "shaman_queen01.dds" + TargetSkin "shaman_queen02.dds" + } + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 26 + Model "shaman_4-1.GR2" + SourceSkin "shaman_4-1.dds" + TargetSkin "shaman_4-2.dds" + } + Group ShapeData28 + { + + ShapeIndex 27 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_blue.dds" + } + Group ShapeData31 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 30 + Model "shaman_cheongnang.gr2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_costume1.dds" + } + Group ShapeData32 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40031 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1.dds" + } + Group ShapeData33 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40033 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_London.dds" + } + Group ShapeData34 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40034 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Germany.dds" + } + Group ShapeData35 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40035 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Turkey.dds" + } + Group ShapeData36 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40036 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Brazil.dds" + } + Group ShapeData37 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40037 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_London.dds" + } + Group ShapeData38 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40038 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Germany.dds" + } + Group ShapeData39 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40039 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Turkey.dds" + } + Group ShapeData40 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40040 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Brazil.dds" + } + Group ShapeData41 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40041 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_London.dds" + } + Group ShapeData42 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40042 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Germany.dds" + } + Group ShapeData43 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40043 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Turkey.dds" + } + Group ShapeData44 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40044 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Brazil.dds" + } + Group ShapeData45 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40032 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin1.dds" + } + Group ShapeData46 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40045 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_France.dds" + } + Group ShapeData47 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40046 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Italy.dds" + } + Group ShapeData48 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40047 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Poland.dds" + } + Group ShapeData49 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40048 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Romania.dds" + } + Group ShapeData50 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40049 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Spain.dds" + } + Group ShapeData51 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40050 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_France.dds" + } + Group ShapeData52 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + ShapeIndex 40051 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Italy.dds" + } + Group ShapeData53 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40052 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Poland.dds" + } + Group ShapeData54 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40053 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Romania.dds" + } + Group ShapeData55 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + ShapeIndex 40054 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Spain.dds" + } + Group ShapeData56 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40055 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_France.dds" + } + Group ShapeData57 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40056 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Italy.dds" + } + Group ShapeData58 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40057 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Poland.dds" + } + Group ShapeData59 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + ShapeIndex 40058 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Romania.dds" + } + Group ShapeData60 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40059 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Spain.dds" + } + Group ShapeData61 + { + SpecialPath "d:/ymir Work/pc2/shaman/" + + ShapeIndex 40065 + Model "shaman_halloween1.GR2" + SourceSkin "shaman_halloween1.dds" + TargetSkin "shaman_halloween1.dds" + } + Group ShapeData62 + { + ShapeIndex 13 + Model "shaman_5_1.GR2" + SourceSkin "shaman_5_1.dds" + TargetSkin "shaman_5_1.dds" + } + Group ShapeData63 + { + ShapeIndex 40062 + Model "shaman_salsa1.GR2" + SourceSkin "shaman_salsa1.dds" + TargetSkin "shaman_salsa1.dds" + } + Group ShapeData64 + { + ShapeIndex 40063 + Model "shaman_Springwear1.GR2" + SourceSkin "shaman_Springwear1.dds" + TargetSkin "shaman_Springwear1.dds" + } + Group ShapeData65 + { + ShapeIndex 40061 + Model "shaman_tailcoat1.GR2" + SourceSkin "shaman_tailcoat1.dds" + TargetSkin "shaman_tailcoat1.dds" + } + Group ShapeData66 + { + ShapeIndex 40069 + Model "shaman_deer1.gr2" + SourceSkin "shaman_deer1.dds" + TargetSkin "shaman_deer1.dds" + } + Group ShapeData67 + { + ShapeIndex 40066 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_red.dds" + } + Group ShapeData68 + { + ShapeIndex 40067 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_green.dds" + } + Group ShapeData69 + { + ShapeIndex 40068 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "shaman_samurai1.GR2" + SourceSkin "shaman_samurai1.dds" + TargetSkin "shaman_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "shaman_BlackSnake1.GR2" + SourceSkin "shaman_BlackSnake1.dds" + TargetSkin "shaman_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "shaman_BlackSnake1.GR2" + SourceSkin "shaman_BlackSnake1.dds" + TargetSkin "shaman_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40112 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40114 + Model "shaman_pwahuang1.GR2" + SourceSkin "shaman_pwahuang1.dds" + TargetSkin "shaman_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40116 + Model "shaman_halloween2.GR2" + SourceSkin "shaman_halloween2.dds" + TargetSkin "shaman_halloween2.dds" + } + Group ShapeData112 + { + ShapeIndex 40118 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin3.dds" + } + Group ShapeData113 + { + ShapeIndex 40060 + Model "shaman_capoeira1.gr2" + SourceSkin "shaman_capoeira1.dds" + TargetSkin "shaman_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40120 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40122 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40124 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40126 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40128 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40130 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40132 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40134 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40136 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40138 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40140 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40142 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40144 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40146 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40148 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40150 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40152 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40154 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40156 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40158 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40160 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40162 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40164 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40166 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40168 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40170 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40172 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40174 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40176 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40178 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40180 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40182 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC32.dds" + } +} + +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 90.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 90.000000 + } + } +} diff --git a/root/shaman_w.msm b/root/shaman_w.msm new file mode 100644 index 0000000..0be6d8d --- /dev/null +++ b/root/shaman_w.msm @@ -0,0 +1,1628 @@ +ScriptType RaceDataScript + +BaseModelFileName "D:/YMIR WORK/pc/shaman/shaman_novice.GR2" + +Group HairData +{ + PathName "d:/ymir Work/pc/shaman/" + + HairDataCount 75 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "shaman_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 4001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 4002 + Model "hair/hair_2_2.gr2" + SourceSkin "hair/hair_2_2.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 4003 + Model "hair/hair_2_3.gr2" + SourceSkin "hair/hair_2_3.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 4004 + Model "hair/hair_2_4.gr2" + SourceSkin "hair/hair_2_4.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 4005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 4006 + Model "hair/hair_3_2.gr2" + SourceSkin "hair/hair_3_2.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 4007 + Model "hair/hair_3_3.gr2" + SourceSkin "hair/hair_3_3.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 4008 + Model "hair/hair_3_4.gr2" + SourceSkin "hair/hair_3_4.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 4009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 4010 + Model "hair/hair_4_2.gr2" + SourceSkin "hair/hair_4_2.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 4011 + Model "hair/hair_4_3.gr2" + SourceSkin "hair/hair_4_3.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 4012 + Model "hair/hair_4_4.gr2" + SourceSkin "hair/hair_4_4.dds" + TargetSkin "hair/hair_4_4.dds" + } + Group HairData18 + { + HairIndex 4013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 4014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 4015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 4016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + HairIndex 4017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + HairIndex 4018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + Group HairData26 + { + HairIndex 5008 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + + Group HairData27 + { + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + HairIndex 5016 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + Group HairData29 + { + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_2.dds" + } + Group HairData30 + { + HairIndex 5007 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_3.dds" + } + Group HairData31 + { + HairIndex 5006 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_4.dds" + } + Group HairData32 + { + HairIndex 5009 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_5.dds" + } + Group HairData33 + { + HairIndex 5010 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_6.dds" + } + Group HairData34 + { + HairIndex 5011 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_7.dds" + } + Group HairData35 + { + HairIndex 5012 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_8.dds" + } + Group HairData36 + { + HairIndex 5013 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_9.dds" + } + Group HairData37 + { + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_2.dds" + } + Group HairData38 + { + HairIndex 5015 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_3.dds" + } + Group HairData39 + { + HairIndex 5014 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_4.dds" + } + Group HairData40 + { + HairIndex 5017 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_5.dds" + } + Group HairData41 + { + HairIndex 5018 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_6.dds" + } + Group HairData42 + { + HairIndex 5019 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_7.dds" + } + Group HairData43 + { + HairIndex 5020 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_8.dds" + } + Group HairData44 + { + HairIndex 5021 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_9.dds" + } + Group HairData45 + { + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData46 + { + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + + Group HairData47 + { + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + + Group HairData48 + { + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData49 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData50 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData51 + { + HairIndex 5034 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData52 + { + HairIndex 5036 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData53 + { + HairIndex 5038 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData54 + { + HairIndex 5040 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData55 + { + HairIndex 5042 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData56 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData57 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData58 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData59 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData60 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData61 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData62 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData63 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData64 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData65 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData66 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData67 + { + HairIndex 5056 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData68 + { + HairIndex 5058 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData69 + { + HairIndex 5060 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData70 + { + HairIndex 5062 + Model "hair/hair_35_1.GR2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData71 + { + HairIndex 5063 + Model "hair/hair_37_1.GR2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + Group HairData72 + { + HairIndex 5064 + Model "hair/hair_36_1.GR2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + Group HairData73 + { + HairIndex 5065 + Model "hair/hair_38_1.GR2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + Group HairData74 + { + HairIndex 5022 + Model "hair/hair_12_1.GR2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc/shaman/" + + ShapeDataCount 146 + + Group ShapeData00 + { + ShapeIndex 0 + + Model "shaman_novice.GR2" + } + Group ShapeData01 + { + ShapeIndex 1 + + Model "shaman_novice.GR2" + SourceSkin "shaman_novice_red.dds" + TargetSkin "shaman_novice_green.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_cheongnang.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_nabong.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_bihong.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_miyeom.dds" + } + Group ShapeData06 + { + ShapeIndex 7 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_seocheon.dds" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_ilseon.dds" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_cheonryun.dds" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_amyo.dds" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "shaman_bongsin.GR2" + SourceSkin "shaman_bongsin.dds" + TargetSkin "shaman_bongsin.dds" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir Work/pc/shaman/" + + ShapeIndex 201 + Model "shaman_marry_01.gr2" + SourceSkin "shaman_marry_01.dds" + TargetSkin "shaman_marry_01.dds" + } + Group ShapeData16 + { + ShapeIndex 12 + Model "shaman_4-1.GR2" + SourceSkin "shaman_4-1.dds" + TargetSkin "shaman_4-1.dds" + } + + + Group ShapeData17 + { + ShapeIndex 14 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_1-1cheongnang_a.DDS" + } + Group ShapeData18 + { + ShapeIndex 15 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_1-2_nabong_a.DDS" + } + Group ShapeData19 + { + ShapeIndex 16 + Model "shaman_cheongnang.GR2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_bihong_a.dds" + } + Group ShapeData20 + { + ShapeIndex 17 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-1_miyeon_a.DDS" + } + Group ShapeData21 + { + ShapeIndex 18 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-2_seocheon_a.DDS" + } + Group ShapeData22 + { + ShapeIndex 19 + Model "shaman_miyeom.GR2" + SourceSkin "shaman_miyeom.dds" + TargetSkin "shaman_2-3_ilseon_a.DDS" + } + Group ShapeData23 + { + ShapeIndex 20 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_3-1_cheonryun_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 21 + Model "shaman_cheonryun.GR2" + SourceSkin "shaman_cheonryun.dds" + TargetSkin "shaman_3-2_amyo_a.DDS" + } + Group ShapeData25 + { + SpecialPath "d:/ymir Work/pc/shaman/" + + ShapeIndex 24 + Model "shaman_lord.GR2" + SourceSkin "shaman_queen01.dds" + TargetSkin "shaman_queen01.dds" + } + Group ShapeData26 + { + SpecialPath "d:/ymir Work/pc/shaman/" + + ShapeIndex 25 + Model "shaman_lord.GR2" + SourceSkin "shaman_queen01.dds" + TargetSkin "shaman_queen02.dds" + } + + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc/shaman/" + + ShapeIndex 26 + Model "shaman_4-1.GR2" + SourceSkin "shaman_4-1.dds" + TargetSkin "shaman_4-2.dds" + } + Group ShapeData28 + { + ShapeIndex 27 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "shaman_event1.GR2" + SourceSkin "shaman_event1_yellow.dds" + TargetSkin "shaman_event1_blue.dds" + } + Group ShapeData31 + { + ShapeIndex 30 + Model "shaman_cheongnang.gr2" + SourceSkin "shaman_cheongnang.dds" + TargetSkin "shaman_costume1.dds" + } + Group ShapeData32 + { + ShapeIndex 40031 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1.dds" + } + Group ShapeData33 + { + ShapeIndex 40033 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_London.dds" + } + Group ShapeData34 + { + ShapeIndex 40034 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Germany.dds" + } + Group ShapeData35 + { + ShapeIndex 40035 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Turkey.dds" + } + Group ShapeData36 + { + ShapeIndex 40036 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Brazil.dds" + } + Group ShapeData37 + { + ShapeIndex 40037 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_London.dds" + } + Group ShapeData38 + { + ShapeIndex 40038 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Germany.dds" + } + Group ShapeData39 + { + ShapeIndex 40039 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Turkey.dds" + } + Group ShapeData40 + { + ShapeIndex 40040 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Brazil.dds" + } + Group ShapeData41 + { + ShapeIndex 40041 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_London.dds" + } + Group ShapeData42 + { + ShapeIndex 40042 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Germany.dds" + } + Group ShapeData43 + { + ShapeIndex 40043 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Turkey.dds" + } + Group ShapeData44 + { + ShapeIndex 40044 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Brazil.dds" + } + Group ShapeData45 + { + ShapeIndex 40032 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin1.dds" + } + Group ShapeData46 + { + ShapeIndex 40045 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_France.dds" + } + Group ShapeData47 + { + ShapeIndex 40046 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Italy.dds" + } + Group ShapeData48 + { + ShapeIndex 40047 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Poland.dds" + } + Group ShapeData49 + { + ShapeIndex 40048 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Romania.dds" + } + Group ShapeData50 + { + ShapeIndex 40049 + Model "shaman_fencing1_Germany.GR2" + SourceSkin "shaman_fencing1_Germany.dds" + TargetSkin "shaman_fencing1_Spain.dds" + } + Group ShapeData51 + { + ShapeIndex 40050 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_France.dds" + } + Group ShapeData52 + { + ShapeIndex 40051 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Italy.dds" + } + Group ShapeData53 + { + ShapeIndex 40052 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Poland.dds" + } + Group ShapeData54 + { + ShapeIndex 40053 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Romania.dds" + } + Group ShapeData55 + { + ShapeIndex 40054 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_soccer1_Spain.dds" + } + Group ShapeData56 + { + ShapeIndex 40055 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_France.dds" + } + Group ShapeData57 + { + ShapeIndex 40056 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Italy.dds" + } + Group ShapeData58 + { + ShapeIndex 40057 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Poland.dds" + } + Group ShapeData59 + { + ShapeIndex 40058 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Romania.dds" + + } + Group ShapeData60 + { + ShapeIndex 40059 + Model "shaman_boxing1_Germany.GR2" + SourceSkin "shaman_boxing1_Germany.dds" + TargetSkin "shaman_boxing1_Spain.dds" + + } + Group ShapeData61 + { + ShapeIndex 40065 + Model "shaman_halloween1.GR2" + SourceSkin "shaman_halloween1.dds" + TargetSkin "shaman_halloween1.dds" + + } + Group ShapeData62 + { + ShapeIndex 13 + Model "shaman_5_1.GR2" + SourceSkin "shaman_5_1.dds" + TargetSkin "shaman_5_1.dds" + } + Group ShapeData63 + { + ShapeIndex 40062 + Model "shaman_salsa1.GR2" + SourceSkin "shaman_salsa1.dds" + TargetSkin "shaman_salsa1.dds" + } + Group ShapeData64 + { + ShapeIndex 40063 + Model "shaman_Springwear1.GR2" + SourceSkin "shaman_Springwear1.dds" + TargetSkin "shaman_Springwear1.dds" + } + Group ShapeData65 + { + ShapeIndex 40061 + Model "shaman_tailcoat1.GR2" + SourceSkin "shaman_tailcoat1.dds" + TargetSkin "shaman_tailcoat1.dds" + } + Group ShapeData66 + { + ShapeIndex 40069 + Model "shaman_deer1.gr2" + SourceSkin "shaman_deer1.dds" + TargetSkin "shaman_deer1.dds" + } + Group ShapeData67 + { + ShapeIndex 40066 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_red.dds" + } + Group ShapeData68 + { + ShapeIndex 40067 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_green.dds" + } + Group ShapeData69 + { + ShapeIndex 40068 + Model "shaman_santa1_black.gr2" + SourceSkin "shaman_santa1_black.dds" + TargetSkin "shaman_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "shaman_samurai1.GR2" + SourceSkin "shaman_samurai1.dds" + TargetSkin "shaman_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "shaman_rabbit1.GR2" + SourceSkin "shaman_rabbit1.dds" + TargetSkin "shaman_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "shaman_BlackSnake1.GR2" + SourceSkin "shaman_BlackSnake1.dds" + TargetSkin "shaman_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "shaman_BlackSnake1.GR2" + SourceSkin "shaman_BlackSnake1.dds" + TargetSkin "shaman_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40113 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40115 + Model "shaman_pwahuang1.GR2" + SourceSkin "shaman_pwahuang1.dds" + TargetSkin "shaman_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40117 + Model "shaman_halloween2.GR2" + SourceSkin "shaman_halloween2.dds" + TargetSkin "shaman_halloween2.dds" + } + Group ShapeData112 + { + ShapeIndex 40119 + Model "shaman_assasin1.GR2" + SourceSkin "shaman_assassin1.dds" + TargetSkin "shaman_assassin3.dds" + } + Group ShapeData113 + { + ShapeIndex 40060 + Model "shaman_capoeira1.GR2" + SourceSkin "shaman_capoeira1.dds" + TargetSkin "shaman_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40121 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40123 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40125 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40127 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40129 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40131 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40133 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40135 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40137 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40139 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40141 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40143 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40145 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40147 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40149 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40151 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40153 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40155 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40157 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40159 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40161 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40163 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40165 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40167 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40169 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40171 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40173 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40175 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40177 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40179 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40181 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40183 + Model "shaman_soccer1_Germany.GR2" + SourceSkin "shaman_soccer1_Germany.dds" + TargetSkin "shaman_WC32.dds" + } +} +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 90.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 90.000000 + } + } +} diff --git a/root/stringcommander.py b/root/stringcommander.py new file mode 100644 index 0000000..ba49302 --- /dev/null +++ b/root/stringcommander.py @@ -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)1: + self.call=__mem_func__.__arg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func) + else: + self.call=__mem_func__.__noarg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func) + + def __call__(self, *arg): + return self.call(*arg) + + +class Window(object): + def NoneMethod(cls): + pass + + NoneMethod = classmethod(NoneMethod) + + def __init__(self, layer = "UI"): + self.hWnd = None + self.parentWindow = 0 + self.onMouseLeftButtonUpEvent = None + self.RegisterWindow(layer) + self.Hide() + + def __del__(self): + wndMgr.Destroy(self.hWnd) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.Register(self, layer) + + def Destroy(self): + pass + + def GetWindowHandle(self): + return self.hWnd + + def AddFlag(self, style): + wndMgr.AddFlag(self.hWnd, style) + + def IsRTL(self): + return wndMgr.IsRTL(self.hWnd) + + def SetWindowName(self, Name): + wndMgr.SetName(self.hWnd, Name) + + def GetWindowName(self): + return wndMgr.GetName(self.hWnd) + + def SetParent(self, parent): + wndMgr.SetParent(self.hWnd, parent.hWnd) + + def SetParentProxy(self, parent): + self.parentWindow=proxy(parent) + wndMgr.SetParent(self.hWnd, parent.hWnd) + + + def GetParentProxy(self): + return self.parentWindow + + def SetPickAlways(self): + wndMgr.SetPickAlways(self.hWnd) + + def SetWindowHorizontalAlignLeft(self): + wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_LEFT) + + def SetWindowHorizontalAlignCenter(self): + wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_CENTER) + + def SetWindowHorizontalAlignRight(self): + wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_RIGHT) + + def SetWindowVerticalAlignTop(self): + wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_TOP) + + def SetWindowVerticalAlignCenter(self): + wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_CENTER) + + def SetWindowVerticalAlignBottom(self): + wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_BOTTOM) + + def SetTop(self): + wndMgr.SetTop(self.hWnd) + + def Show(self): + wndMgr.Show(self.hWnd) + + def Hide(self): + wndMgr.Hide(self.hWnd) + + def Lock(self): + wndMgr.Lock(self.hWnd) + + def Unlock(self): + wndMgr.Unlock(self.hWnd) + + def IsShow(self): + return wndMgr.IsShow(self.hWnd) + + def UpdateRect(self): + wndMgr.UpdateRect(self.hWnd) + + def SetSize(self, width, height): + wndMgr.SetWindowSize(self.hWnd, width, height) + + def GetWidth(self): + return wndMgr.GetWindowWidth(self.hWnd) + + def GetHeight(self): + return wndMgr.GetWindowHeight(self.hWnd) + + def GetLocalPosition(self): + return wndMgr.GetWindowLocalPosition(self.hWnd) + + def GetGlobalPosition(self): + return wndMgr.GetWindowGlobalPosition(self.hWnd) + + def GetMouseLocalPosition(self): + return wndMgr.GetMouseLocalPosition(self.hWnd) + + def GetRect(self): + return wndMgr.GetWindowRect(self.hWnd) + + def SetPosition(self, x, y): + wndMgr.SetWindowPosition(self.hWnd, x, y) + + def SetCenterPosition(self, x = 0, y = 0): + self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y) + + def IsFocus(self): + return wndMgr.IsFocus(self.hWnd) + + def SetFocus(self): + wndMgr.SetFocus(self.hWnd) + + def KillFocus(self): + wndMgr.KillFocus(self.hWnd) + + def GetChildCount(self): + return wndMgr.GetChildCount(self.hWnd) + + def IsIn(self): + return wndMgr.IsIn(self.hWnd) + + def SetOnMouseLeftButtonUpEvent(self, event): + self.onMouseLeftButtonUpEvent = event + + def OnMouseLeftButtonUp(self): + if self.onMouseLeftButtonUpEvent: + self.onMouseLeftButtonUpEvent() + +class ListBoxEx(Window): + + class Item(Window): + def __init__(self): + Window.__init__(self) + + def __del__(self): + Window.__del__(self) + + def SetParent(self, parent): + Window.SetParent(self, parent) + self.parent=proxy(parent) + + def OnMouseLeftButtonDown(self): + self.parent.SelectItem(self) + + def OnRender(self): + if self.parent.GetSelectedItem()==self: + self.OnSelectedRender() + + def OnSelectedRender(self): + x, y = self.GetGlobalPosition() + grp.SetColor(grp.GenerateColor(0.0, 0.0, 0.7, 0.7)) + grp.RenderBar(x, y, self.GetWidth(), self.GetHeight()) + + def __init__(self): + Window.__init__(self) + + self.viewItemCount=10 + self.basePos=0 + self.itemHeight=16 + self.itemStep=20 + self.selItem=0 + self.itemList=[] + self.onSelectItemEvent = lambda *arg: None + + if localeInfo.IsARABIC(): + self.itemWidth=130 + else: + self.itemWidth=100 + + self.scrollBar=None + self.__UpdateSize() + + def __del__(self): + Window.__del__(self) + + def __UpdateSize(self): + height=self.itemStep*self.__GetViewItemCount() + + self.SetSize(self.itemWidth, height) + + def IsEmpty(self): + if len(self.itemList)==0: + return 1 + return 0 + + def SetItemStep(self, itemStep): + self.itemStep=itemStep + self.__UpdateSize() + + def SetItemSize(self, itemWidth, itemHeight): + self.itemWidth=itemWidth + self.itemHeight=itemHeight + self.__UpdateSize() + + def SetViewItemCount(self, viewItemCount): + self.viewItemCount=viewItemCount + + def SetSelectEvent(self, event): + self.onSelectItemEvent = event + + def SetBasePos(self, basePos): + for oldItem in self.itemList[self.basePos:self.basePos+self.viewItemCount]: + oldItem.Hide() + + self.basePos=basePos + + pos=basePos + for newItem in self.itemList[self.basePos:self.basePos+self.viewItemCount]: + (x, y)=self.GetItemViewCoord(pos, newItem.GetWidth()) + newItem.SetPosition(x, y) + newItem.Show() + pos+=1 + + def GetItemIndex(self, argItem): + return self.itemList.index(argItem) + + def GetSelectedItem(self): + return self.selItem + + def SelectIndex(self, index): + + if index >= len(self.itemList) or index < 0: + self.selItem = None + return + + try: + self.selItem=self.itemList[index] + except: + pass + + def SelectItem(self, selItem): + self.selItem=selItem + self.onSelectItemEvent(selItem) + + def RemoveAllItems(self): + self.selItem=None + self.itemList=[] + + if self.scrollBar: + self.scrollBar.SetPos(0) + + def RemoveItem(self, delItem): + if delItem==self.selItem: + self.selItem=None + + self.itemList.remove(delItem) + + def AppendItem(self, newItem): + newItem.SetParent(self) + newItem.SetSize(self.itemWidth, self.itemHeight) + + pos=len(self.itemList) + if self.__IsInViewRange(pos): + (x, y)=self.GetItemViewCoord(pos, newItem.GetWidth()) + newItem.SetPosition(x, y) + newItem.Show() + else: + newItem.Hide() + + self.itemList.append(newItem) + + def SetScrollBar(self, scrollBar): + scrollBar.SetScrollEvent(__mem_func__(self.__OnScroll)) + self.scrollBar=scrollBar + + def __OnScroll(self): + self.SetBasePos(int(self.scrollBar.GetPos()*self.__GetScrollLen())) + + def __GetScrollLen(self): + scrollLen=self.__GetItemCount()-self.__GetViewItemCount() + if scrollLen<0: + return 0 + + return scrollLen + + def __GetViewItemCount(self): + return self.viewItemCount + + def __GetItemCount(self): + return len(self.itemList) + + def GetItemViewCoord(self, pos, itemWidth): + if localeInfo.IsARABIC(): + return (self.GetWidth()-itemWidth-10, (pos-self.basePos)*self.itemStep) + else: + return (0, (pos-self.basePos)*self.itemStep) + + def __IsInViewRange(self, pos): + if pos=self.basePos+self.viewItemCount: + return 0 + return 1 + +class CandidateListBox(ListBoxEx): + + HORIZONTAL_MODE = 0 + VERTICAL_MODE = 1 + + class Item(ListBoxEx.Item): + def __init__(self, text): + ListBoxEx.Item.__init__(self) + + self.textBox=TextLine() + self.textBox.SetParent(self) + self.textBox.SetText(text) + self.textBox.Show() + + def __del__(self): + ListBoxEx.Item.__del__(self) + + def __init__(self, mode = HORIZONTAL_MODE): + ListBoxEx.__init__(self) + self.itemWidth=32 + self.itemHeight=32 + self.mode = mode + + def __del__(self): + ListBoxEx.__del__(self) + + def SetMode(self, mode): + self.mode = mode + + def AppendItem(self, newItem): + ListBoxEx.AppendItem(self, newItem) + + def GetItemViewCoord(self, pos): + if self.mode == self.HORIZONTAL_MODE: + return ((pos-self.basePos)*self.itemStep, 0) + elif self.mode == self.VERTICAL_MODE: + return (0, (pos-self.basePos)*self.itemStep) + + +class TextLine(Window): + def __init__(self): + Window.__init__(self) + self.max = 0 + self.SetFontName(localeInfo.UI_DEF_FONT) + + def __del__(self): + Window.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterTextLine(self, layer) + + def SetMax(self, max): + wndMgr.SetMax(self.hWnd, max) + + def SetLimitWidth(self, width): + wndMgr.SetLimitWidth(self.hWnd, width) + + def SetMultiLine(self): + wndMgr.SetMultiLine(self.hWnd, True) + + def SetHorizontalAlignArabic(self): + wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_ARABIC) + + def SetHorizontalAlignLeft(self): + wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_LEFT) + + def SetHorizontalAlignRight(self): + wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_RIGHT) + + def SetHorizontalAlignCenter(self): + wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER) + + def SetVerticalAlignTop(self): + wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_TOP) + + def SetVerticalAlignBottom(self): + wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_BOTTOM) + + def SetVerticalAlignCenter(self): + wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_CENTER) + + def SetSecret(self, Value=True): + wndMgr.SetSecret(self.hWnd, Value) + + def SetOutline(self, Value=True): + wndMgr.SetOutline(self.hWnd, Value) + + def SetFeather(self, value=True): + wndMgr.SetFeather(self.hWnd, value) + + def SetFontName(self, fontName): + wndMgr.SetFontName(self.hWnd, fontName) + + def SetDefaultFontName(self): + wndMgr.SetFontName(self.hWnd, localeInfo.UI_DEF_FONT) + + def SetFontColor(self, red, green, blue): + wndMgr.SetFontColor(self.hWnd, red, green, blue) + + def SetPackedFontColor(self, color): + wndMgr.SetFontColor(self.hWnd, color) + + def SetText(self, text): + wndMgr.SetText(self.hWnd, text) + + def GetText(self): + return wndMgr.GetText(self.hWnd) + + def GetTextSize(self): + return wndMgr.GetTextSize(self.hWnd) + +class EmptyCandidateWindow(Window): + def __init__(self): + Window.__init__(self) + + def __del__(self): + Window.__init__(self) + + def Load(self): + pass + + def SetCandidatePosition(self, x, y, textCount): + pass + + def Clear(self): + pass + + def Append(self, text): + pass + + def Refresh(self): + pass + + def Select(self): + pass + +class EditLine(TextLine): + candidateWindowClassDict = {} + + def __init__(self): + TextLine.__init__(self) + + self.eventReturn = Window.NoneMethod + self.eventEscape = Window.NoneMethod + self.eventTab = None + self.numberMode = False + self.useIME = True + + self.bCodePage = False + + self.candidateWindowClass = None + self.candidateWindow = None + self.SetCodePage(app.GetDefaultCodePage()) + + self.readingWnd = ReadingWnd() + self.readingWnd.Hide() + + def __del__(self): + TextLine.__del__(self) + + self.eventReturn = Window.NoneMethod + self.eventEscape = Window.NoneMethod + self.eventTab = None + + + def SetCodePage(self, codePage): + candidateWindowClass=EditLine.candidateWindowClassDict.get(codePage, EmptyCandidateWindow) + self.__SetCandidateClass(candidateWindowClass) + + def __SetCandidateClass(self, candidateWindowClass): + if self.candidateWindowClass==candidateWindowClass: + return + + self.candidateWindowClass = candidateWindowClass + self.candidateWindow = self.candidateWindowClass() + self.candidateWindow.Load() + self.candidateWindow.Hide() + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterTextLine(self, layer) + + def SAFE_SetReturnEvent(self, event): + self.eventReturn = __mem_func__(event) + + def SetReturnEvent(self, event): + self.eventReturn = event + + def SetEscapeEvent(self, event): + self.eventEscape = event + + def SetTabEvent(self, event): + self.eventTab = event + + def SetMax(self, max): + self.max = max + wndMgr.SetMax(self.hWnd, self.max) + ime.SetMax(self.max) + self.SetUserMax(self.max) + + def SetUserMax(self, max): + self.userMax = max + ime.SetUserMax(self.userMax) + + def SetNumberMode(self): + self.numberMode = True + + #def AddExceptKey(self, key): + # ime.AddExceptKey(key) + + #def ClearExceptKey(self): + # ime.ClearExceptKey() + + def SetIMEFlag(self, flag): + self.useIME = flag + + def SetText(self, text): + wndMgr.SetText(self.hWnd, text) + + if self.IsFocus(): + ime.SetText(text) + + def Enable(self): + wndMgr.ShowCursor(self.hWnd) + + def Disable(self): + wndMgr.HideCursor(self.hWnd) + + def SetEndPosition(self): + ime.MoveEnd() + + def OnSetFocus(self): + Text = self.GetText() + ime.SetText(Text) + ime.SetMax(self.max) + ime.SetUserMax(self.userMax) + ime.SetCursorPosition(-1) + if self.numberMode: + ime.SetNumberMode() + else: + ime.SetStringMode() + ime.EnableCaptureInput() + if self.useIME: + ime.EnableIME() + else: + ime.DisableIME() + wndMgr.ShowCursor(self.hWnd, True) + + def OnKillFocus(self): + self.SetText(ime.GetText(self.bCodePage)) + self.OnIMECloseCandidateList() + self.OnIMECloseReadingWnd() + ime.DisableIME() + ime.DisableCaptureInput() + wndMgr.HideCursor(self.hWnd) + + def OnIMEChangeCodePage(self): + self.SetCodePage(ime.GetCodePage()) + + def OnIMEOpenCandidateList(self): + self.candidateWindow.Show() + self.candidateWindow.Clear() + self.candidateWindow.Refresh() + + gx, gy = self.GetGlobalPosition() + self.candidateWindow.SetCandidatePosition(gx, gy, len(self.GetText())) + + return True + + def OnIMECloseCandidateList(self): + self.candidateWindow.Hide() + return True + + def OnIMEOpenReadingWnd(self): + gx, gy = self.GetGlobalPosition() + textlen = len(self.GetText())-2 + reading = ime.GetReading() + readinglen = len(reading) + self.readingWnd.SetReadingPosition( gx + textlen*6-24-readinglen*6, gy ) + self.readingWnd.SetText(reading) + if ime.GetReadingError() == 0: + self.readingWnd.SetTextColor(0xffffffff) + else: + self.readingWnd.SetTextColor(0xffff0000) + self.readingWnd.SetSize(readinglen * 6 + 4, 19) + self.readingWnd.Show() + return True + + def OnIMECloseReadingWnd(self): + self.readingWnd.Hide() + return True + + def OnIMEUpdate(self): + snd.PlaySound("sound/ui/type.wav") + TextLine.SetText(self, ime.GetText(self.bCodePage)) + + def OnIMETab(self): + if self.eventTab: + self.eventTab() + return True + + return False + + def OnIMEReturn(self): + snd.PlaySound("sound/ui/click.wav") + self.eventReturn() + + return True + + def OnPressEscapeKey(self): + self.eventEscape() + return True + + def OnKeyDown(self, key): + if app.DIK_F1 == key: + return False + if app.DIK_F2 == key: + return False + if app.DIK_F3 == key: + return False + if app.DIK_F4 == key: + return False + if app.DIK_LALT == key: + return False + if app.DIK_SYSRQ == key: + return False + if app.DIK_LCONTROL == key: + return False + if app.DIK_V == key: + if app.IsPressed(app.DIK_LCONTROL): + ime.PasteTextFromClipBoard() + + return True + + def OnKeyUp(self, key): + if app.DIK_F1 == key: + return False + if app.DIK_F2 == key: + return False + if app.DIK_F3 == key: + return False + if app.DIK_F4 == key: + return False + if app.DIK_LALT == key: + return False + if app.DIK_SYSRQ == key: + return False + if app.DIK_LCONTROL == key: + return False + + return True + + def OnIMEKeyDown(self, key): + # Left + if app.VK_LEFT == key: + ime.MoveLeft() + return True + # Right + if app.VK_RIGHT == key: + ime.MoveRight() + return True + + # Home + if app.VK_HOME == key: + ime.MoveHome() + return True + # End + if app.VK_END == key: + ime.MoveEnd() + return True + + # Delete + if app.VK_DELETE == key: + ime.Delete() + TextLine.SetText(self, ime.GetText(self.bCodePage)) + return True + + return True + + #def OnMouseLeftButtonDown(self): + # self.SetFocus() + def OnMouseLeftButtonDown(self): + if False == self.IsIn(): + return False + + self.SetFocus() + PixelPosition = wndMgr.GetCursorPosition(self.hWnd) + ime.SetCursorPosition(PixelPosition) + +class MarkBox(Window): + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + def __del__(self): + Window.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterMarkBox(self, layer) + + def Load(self): + wndMgr.MarkBox_Load(self.hWnd) + + def SetScale(self, scale): + wndMgr.MarkBox_SetScale(self.hWnd, scale) + + def SetIndex(self, guildID): + MarkID = guild.GuildIDToMarkID(guildID) + wndMgr.MarkBox_SetImageFilename(self.hWnd, guild.GetMarkImageFilenameByMarkID(MarkID)) + wndMgr.MarkBox_SetIndex(self.hWnd, guild.GetMarkIndexByMarkID(MarkID)) + + def SetAlpha(self, alpha): + wndMgr.MarkBox_SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) + +class ImageBox(Window): + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + self.eventDict={} + + def __del__(self): + Window.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterImageBox(self, layer) + + def LoadImage(self, imageName): + self.name=imageName + wndMgr.LoadImage(self.hWnd, imageName) + + if len(self.eventDict)!=0: + print "LOAD IMAGE", self, self.eventDict + + def SetAlpha(self, alpha): + wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) + + def GetWidth(self): + return wndMgr.GetWidth(self.hWnd) + + def GetHeight(self): + return wndMgr.GetHeight(self.hWnd) + + def OnMouseOverIn(self): + try: + self.eventDict["MOUSE_OVER_IN"]() + except KeyError: + pass + + def OnMouseOverOut(self): + try: + self.eventDict["MOUSE_OVER_OUT"]() + except KeyError: + pass + + def SAFE_SetStringEvent(self, event, func): + self.eventDict[event]=__mem_func__(func) + + +class ExpandedImageBox(ImageBox): + def __init__(self, layer = "UI"): + ImageBox.__init__(self, layer) + + def __del__(self): + ImageBox.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterExpandedImageBox(self, layer) + + def SetScale(self, xScale, yScale): + wndMgr.SetScale(self.hWnd, xScale, yScale) + + def SetOrigin(self, x, y): + wndMgr.SetOrigin(self.hWnd, x, y) + + def SetRotation(self, rotation): + wndMgr.SetRotation(self.hWnd, rotation) + + def SetRenderingMode(self, mode): + wndMgr.SetRenderingMode(self.hWnd, mode) + + # [0.0, 1.0] 荤捞狼 蔼父怒 欺季飘肺 弊府瘤 臼绰促. + def SetRenderingRect(self, left, top, right, bottom): + wndMgr.SetRenderingRect(self.hWnd, left, top, right, bottom) + + def SetPercentage(self, curValue, maxValue): + if maxValue: + self.SetRenderingRect(0.0, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0) + else: + self.SetRenderingRect(0.0, 0.0, 0.0, 0.0) + + def GetWidth(self): + return wndMgr.GetWindowWidth(self.hWnd) + + def GetHeight(self): + return wndMgr.GetWindowHeight(self.hWnd) + +class AniImageBox(Window): + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + def __del__(self): + Window.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterAniImageBox(self, layer) + + def SetDelay(self, delay): + wndMgr.SetDelay(self.hWnd, delay) + + def AppendImage(self, filename): + wndMgr.AppendImage(self.hWnd, filename) + + def SetPercentage(self, curValue, maxValue): + wndMgr.SetRenderingRect(self.hWnd, 0.0, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0) + + def OnEndFrame(self): + pass + +class Button(Window): + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + self.eventFunc = None + self.eventArgs = None + + self.ButtonText = None + self.ToolTipText = None + + def __del__(self): + Window.__del__(self) + + self.eventFunc = None + self.eventArgs = None + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterButton(self, layer) + + def SetUpVisual(self, filename): + wndMgr.SetUpVisual(self.hWnd, filename) + + def SetOverVisual(self, filename): + wndMgr.SetOverVisual(self.hWnd, filename) + + def SetDownVisual(self, filename): + wndMgr.SetDownVisual(self.hWnd, filename) + + def SetDisableVisual(self, filename): + wndMgr.SetDisableVisual(self.hWnd, filename) + + def GetUpVisualFileName(self): + return wndMgr.GetUpVisualFileName(self.hWnd) + + def GetOverVisualFileName(self): + return wndMgr.GetOverVisualFileName(self.hWnd) + + def GetDownVisualFileName(self): + return wndMgr.GetDownVisualFileName(self.hWnd) + + def Flash(self): + wndMgr.Flash(self.hWnd) + + def Enable(self): + wndMgr.Enable(self.hWnd) + + def Disable(self): + wndMgr.Disable(self.hWnd) + + def Down(self): + wndMgr.Down(self.hWnd) + + def SetUp(self): + wndMgr.SetUp(self.hWnd) + + def SAFE_SetEvent(self, func, *args): + self.eventFunc = __mem_func__(func) + self.eventArgs = args + + def SetEvent(self, func, *args): + self.eventFunc = func + self.eventArgs = args + + def SetTextColor(self, color): + if not self.ButtonText: + return + self.ButtonText.SetPackedFontColor(color) + + def SetText(self, text, height = 4): + + if not self.ButtonText: + textLine = TextLine() + textLine.SetParent(self) + textLine.SetPosition(self.GetWidth()/2, self.GetHeight()/2) + textLine.SetVerticalAlignCenter() + textLine.SetHorizontalAlignCenter() + textLine.Show() + self.ButtonText = textLine + + self.ButtonText.SetText(text) + + def SetFormToolTipText(self, type, text, x, y): + if not self.ToolTipText: + toolTip=createToolTipWindowDict[type]() + toolTip.SetParent(self) + toolTip.SetSize(0, 0) + toolTip.SetHorizontalAlignCenter() + toolTip.SetOutline() + toolTip.Hide() + toolTip.SetPosition(x + self.GetWidth()/2, y) + self.ToolTipText=toolTip + + self.ToolTipText.SetText(text) + + def SetToolTipWindow(self, toolTip): + self.ToolTipText=toolTip + self.ToolTipText.SetParentProxy(self) + + def SetToolTipText(self, text, x=0, y = -19): + self.SetFormToolTipText("TEXT", text, x, y) + + def CallEvent(self): + snd.PlaySound("sound/ui/click.wav") + + if self.eventFunc: + apply(self.eventFunc, self.eventArgs) + + def ShowToolTip(self): + if self.ToolTipText: + self.ToolTipText.Show() + + def HideToolTip(self): + if self.ToolTipText: + self.ToolTipText.Hide() + + def IsDown(self): + return wndMgr.IsDown(self.hWnd) + +class RadioButton(Button): + def __init__(self): + Button.__init__(self) + + def __del__(self): + Button.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterRadioButton(self, layer) + +class RadioButtonGroup: + def __init__(self): + self.buttonGroup = [] + self.selectedBtnIdx = -1 + + def __del__(self): + for button, ue, de in self.buttonGroup: + button.__del__() + + def Show(self): + for (button, selectEvent, unselectEvent) in self.buttonGroup: + button.Show() + + def Hide(self): + for (button, selectEvent, unselectEvent) in self.buttonGroup: + button.Hide() + + def SetText(self, idx, text): + if idx >= len(self.buttonGroup): + return + (button, selectEvent, unselectEvent) = self.buttonGroup[idx] + button.SetText(text) + + def OnClick(self, btnIdx): + if btnIdx == self.selectedBtnIdx: + return + (button, selectEvent, unselectEvent) = self.buttonGroup[self.selectedBtnIdx] + if unselectEvent: + unselectEvent() + button.SetUp() + + self.selectedBtnIdx = btnIdx + (button, selectEvent, unselectEvent) = self.buttonGroup[btnIdx] + if selectEvent: + selectEvent() + + button.Down() + + def AddButton(self, button, selectEvent, unselectEvent): + i = len(self.buttonGroup) + button.SetEvent(lambda : self.OnClick(i)) + self.buttonGroup.append([button, selectEvent, unselectEvent]) + button.SetUp() + + def Create(rawButtonGroup): + radioGroup = RadioButtonGroup() + for (button, selectEvent, unselectEvent) in rawButtonGroup: + radioGroup.AddButton(button, selectEvent, unselectEvent) + + radioGroup.OnClick(0) + + return radioGroup + + Create=staticmethod(Create) + +class ToggleButton(Button): + def __init__(self): + Button.__init__(self) + + self.eventUp = None + self.eventDown = None + + def __del__(self): + Button.__del__(self) + + self.eventUp = None + self.eventDown = None + + def SetToggleUpEvent(self, event): + self.eventUp = event + + def SetToggleDownEvent(self, event): + self.eventDown = event + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterToggleButton(self, layer) + + def OnToggleUp(self): + if self.eventUp: + self.eventUp() + + def OnToggleDown(self): + if self.eventDown: + self.eventDown() + +class DragButton(Button): + def __init__(self): + Button.__init__(self) + self.AddFlag("movable") + + self.callbackEnable = True + self.eventMove = lambda: None + + def __del__(self): + Button.__del__(self) + + self.eventMove = lambda: None + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterDragButton(self, layer) + + def SetMoveEvent(self, event): + self.eventMove = event + + def SetRestrictMovementArea(self, x, y, width, height): + wndMgr.SetRestrictMovementArea(self.hWnd, x, y, width, height) + + def TurnOnCallBack(self): + self.callbackEnable = True + + def TurnOffCallBack(self): + self.callbackEnable = False + + def OnMove(self): + if self.callbackEnable: + self.eventMove() + +class NumberLine(Window): + + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + def __del__(self): + Window.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterNumberLine(self, layer) + + def SetHorizontalAlignCenter(self): + wndMgr.SetNumberHorizontalAlignCenter(self.hWnd) + + def SetHorizontalAlignRight(self): + wndMgr.SetNumberHorizontalAlignRight(self.hWnd) + + def SetPath(self, path): + wndMgr.SetPath(self.hWnd, path) + + def SetNumber(self, number): + wndMgr.SetNumber(self.hWnd, number) + +################################################################################################### +## PythonScript Element +################################################################################################### + +class Box(Window): + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterBox(self, layer) + + def SetColor(self, color): + wndMgr.SetColor(self.hWnd, color) + +class Bar(Window): + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterBar(self, layer) + + def SetColor(self, color): + wndMgr.SetColor(self.hWnd, color) + +class Line(Window): + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterLine(self, layer) + + def SetColor(self, color): + wndMgr.SetColor(self.hWnd, color) + +class SlotBar(Window): + + def __init__(self): + Window.__init__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterBar3D(self, layer) + +## Same with SlotBar +class Bar3D(Window): + + def __init__(self): + Window.__init__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterBar3D(self, layer) + + def SetColor(self, left, right, center): + wndMgr.SetColor(self.hWnd, left, right, center) + +class SlotWindow(Window): + + def __init__(self): + Window.__init__(self) + + self.StartIndex = 0 + + self.eventSelectEmptySlot = None + self.eventSelectItemSlot = None + self.eventUnselectEmptySlot = None + self.eventUnselectItemSlot = None + self.eventUseSlot = None + self.eventOverInItem = None + self.eventOverOutItem = None + self.eventPressedSlotButton = None + + def __del__(self): + Window.__del__(self) + + self.eventSelectEmptySlot = None + self.eventSelectItemSlot = None + self.eventUnselectEmptySlot = None + self.eventUnselectItemSlot = None + self.eventUseSlot = None + self.eventOverInItem = None + self.eventOverOutItem = None + self.eventPressedSlotButton = None + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterSlotWindow(self, layer) + + def SetSlotStyle(self, style): + wndMgr.SetSlotStyle(self.hWnd, style) + + def HasSlot(self, slotIndex): + return wndMgr.HasSlot(self.hWnd, slotIndex) + + def SetSlotBaseImage(self, imageFileName, r, g, b, a): + wndMgr.SetSlotBaseImage(self.hWnd, imageFileName, r, g, b, a) + + def SetCoverButton(self,\ + slotIndex,\ + upName="d:/ymir work/ui/public/slot_cover_button_01.sub",\ + overName="d:/ymir work/ui/public/slot_cover_button_02.sub",\ + downName="d:/ymir work/ui/public/slot_cover_button_03.sub",\ + disableName="d:/ymir work/ui/public/slot_cover_button_04.sub",\ + LeftButtonEnable = False,\ + RightButtonEnable = True): + wndMgr.SetCoverButton(self.hWnd, slotIndex, upName, overName, downName, disableName, LeftButtonEnable, RightButtonEnable) + + def EnableCoverButton(self, slotIndex): + wndMgr.EnableCoverButton(self.hWnd, slotIndex) + + def DisableCoverButton(self, slotIndex): + wndMgr.DisableCoverButton(self.hWnd, slotIndex) + + def SetAlwaysRenderCoverButton(self, slotIndex, bAlwaysRender = TRUE): + wndMgr.SetAlwaysRenderCoverButton(self.hWnd, slotIndex, bAlwaysRender) + + def AppendSlotButton(self, upName, overName, downName): + wndMgr.AppendSlotButton(self.hWnd, upName, overName, downName) + + def ShowSlotButton(self, slotNumber): + wndMgr.ShowSlotButton(self.hWnd, slotNumber) + + def HideAllSlotButton(self): + wndMgr.HideAllSlotButton(self.hWnd) + + def AppendRequirementSignImage(self, filename): + wndMgr.AppendRequirementSignImage(self.hWnd, filename) + + def ShowRequirementSign(self, slotNumber): + wndMgr.ShowRequirementSign(self.hWnd, slotNumber) + + def HideRequirementSign(self, slotNumber): + wndMgr.HideRequirementSign(self.hWnd, slotNumber) + + def ActivateSlot(self, slotNumber): + wndMgr.ActivateSlot(self.hWnd, slotNumber) + + def DeactivateSlot(self, slotNumber): + wndMgr.DeactivateSlot(self.hWnd, slotNumber) + + def ShowSlotBaseImage(self, slotNumber): + wndMgr.ShowSlotBaseImage(self.hWnd, slotNumber) + + def HideSlotBaseImage(self, slotNumber): + wndMgr.HideSlotBaseImage(self.hWnd, slotNumber) + + def SAFE_SetButtonEvent(self, button, state, event): + if "LEFT"==button: + if "EMPTY"==state: + self.eventSelectEmptySlot=__mem_func__(event) + elif "EXIST"==state: + self.eventSelectItemSlot=__mem_func__(event) + elif "ALWAYS"==state: + self.eventSelectEmptySlot=__mem_func__(event) + self.eventSelectItemSlot=__mem_func__(event) + elif "RIGHT"==button: + if "EMPTY"==state: + self.eventUnselectEmptySlot=__mem_func__(event) + elif "EXIST"==state: + self.eventUnselectItemSlot=__mem_func__(event) + elif "ALWAYS"==state: + self.eventUnselectEmptySlot=__mem_func__(event) + self.eventUnselectItemSlot=__mem_func__(event) + + def SetSelectEmptySlotEvent(self, empty): + self.eventSelectEmptySlot = empty + + def SetSelectItemSlotEvent(self, item): + self.eventSelectItemSlot = item + + def SetUnselectEmptySlotEvent(self, empty): + self.eventUnselectEmptySlot = empty + + def SetUnselectItemSlotEvent(self, item): + self.eventUnselectItemSlot = item + + def SetUseSlotEvent(self, use): + self.eventUseSlot = use + + def SetOverInItemEvent(self, event): + self.eventOverInItem = event + + def SetOverOutItemEvent(self, event): + self.eventOverOutItem = event + + def SetPressedSlotButtonEvent(self, event): + self.eventPressedSlotButton = event + + def GetSlotCount(self): + return wndMgr.GetSlotCount(self.hWnd) + + def SetUseMode(self, flag): + "True老锭父 ItemToItem 捞 啊瓷茄瘤 焊咯霖促" + wndMgr.SetUseMode(self.hWnd, flag) + + def SetUsableItem(self, flag): + "True搁 泅犁 啊府挪 酒捞袍捞 ItemToItem 利侩 啊瓷窍促" + wndMgr.SetUsableItem(self.hWnd, flag) + + ## Slot + def SetSlotCoolTime(self, slotIndex, coolTime, elapsedTime = 0.0): + wndMgr.SetSlotCoolTime(self.hWnd, slotIndex, coolTime, elapsedTime) + + def DisableSlot(self, slotIndex): + wndMgr.DisableSlot(self.hWnd, slotIndex) + + def EnableSlot(self, slotIndex): + wndMgr.EnableSlot(self.hWnd, slotIndex) + + def LockSlot(self, slotIndex): + wndMgr.LockSlot(self.hWnd, slotIndex) + + def UnlockSlot(self, slotIndex): + wndMgr.UnlockSlot(self.hWnd, slotIndex) + + def RefreshSlot(self): + wndMgr.RefreshSlot(self.hWnd) + + def ClearSlot(self, slotNumber): + wndMgr.ClearSlot(self.hWnd, slotNumber) + + def ClearAllSlot(self): + wndMgr.ClearAllSlot(self.hWnd) + + def AppendSlot(self, index, x, y, width, height): + wndMgr.AppendSlot(self.hWnd, index, x, y, width, height) + + def SetSlot(self, slotIndex, itemIndex, width, height, icon, diffuseColor = (1.0, 1.0, 1.0, 1.0)): + wndMgr.SetSlot(self.hWnd, slotIndex, itemIndex, width, height, icon, diffuseColor) + + def SetSlotCount(self, slotNumber, count): + wndMgr.SetSlotCount(self.hWnd, slotNumber, count) + + def SetSlotCountNew(self, slotNumber, grade, count): + wndMgr.SetSlotCountNew(self.hWnd, slotNumber, grade, count) + + def SetItemSlot(self, renderingSlotNumber, ItemIndex, ItemCount = 0, diffuseColor = (1.0, 1.0, 1.0, 1.0)): + if 0 == ItemIndex or None == ItemIndex: + wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) + return + + item.SelectItem(ItemIndex) + itemIcon = item.GetIconImage() + + item.SelectItem(ItemIndex) + (width, height) = item.GetItemSize() + + wndMgr.SetSlot(self.hWnd, renderingSlotNumber, ItemIndex, width, height, itemIcon, diffuseColor) + wndMgr.SetSlotCount(self.hWnd, renderingSlotNumber, ItemCount) + + def SetSkillSlot(self, renderingSlotNumber, skillIndex, skillLevel): + + skillIcon = skill.GetIconImage(skillIndex) + + if 0 == skillIcon: + wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) + return + + wndMgr.SetSlot(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon) + wndMgr.SetSlotCount(self.hWnd, renderingSlotNumber, skillLevel) + + def SetSkillSlotNew(self, renderingSlotNumber, skillIndex, skillGrade, skillLevel): + + skillIcon = skill.GetIconImageNew(skillIndex, skillGrade) + + if 0 == skillIcon: + wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) + return + + wndMgr.SetSlot(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon) + + def SetEmotionSlot(self, renderingSlotNumber, emotionIndex): + import player + icon = player.GetEmotionIconImage(emotionIndex) + + if 0 == icon: + wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) + return + + wndMgr.SetSlot(self.hWnd, renderingSlotNumber, emotionIndex, 1, 1, icon) + + ## Event + def OnSelectEmptySlot(self, slotNumber): + if self.eventSelectEmptySlot: + self.eventSelectEmptySlot(slotNumber) + + def OnSelectItemSlot(self, slotNumber): + if self.eventSelectItemSlot: + self.eventSelectItemSlot(slotNumber) + + def OnUnselectEmptySlot(self, slotNumber): + if self.eventUnselectEmptySlot: + self.eventUnselectEmptySlot(slotNumber) + + def OnUnselectItemSlot(self, slotNumber): + if self.eventUnselectItemSlot: + self.eventUnselectItemSlot(slotNumber) + + def OnUseSlot(self, slotNumber): + if self.eventUseSlot: + self.eventUseSlot(slotNumber) + + def OnOverInItem(self, slotNumber): + if self.eventOverInItem: + self.eventOverInItem(slotNumber) + + def OnOverOutItem(self): + if self.eventOverOutItem: + self.eventOverOutItem() + + def OnPressedSlotButton(self, slotNumber): + if self.eventPressedSlotButton: + self.eventPressedSlotButton(slotNumber) + + def GetStartIndex(self): + return 0 + +class GridSlotWindow(SlotWindow): + + def __init__(self): + SlotWindow.__init__(self) + + self.startIndex = 0 + + def __del__(self): + SlotWindow.__del__(self) + + def RegisterWindow(self, layer): + self.hWnd = wndMgr.RegisterGridSlotWindow(self, layer) + + def ArrangeSlot(self, StartIndex, xCount, yCount, xSize, ySize, xBlank, yBlank): + + self.startIndex = StartIndex + + wndMgr.ArrangeSlot(self.hWnd, StartIndex, xCount, yCount, xSize, ySize, xBlank, yBlank) + self.startIndex = StartIndex + + def GetStartIndex(self): + return self.startIndex + +class TitleBar(Window): + + BLOCK_WIDTH = 32 + BLOCK_HEIGHT = 23 + + def __init__(self): + Window.__init__(self) + self.AddFlag("attach") + + def __del__(self): + Window.__del__(self) + + def MakeTitleBar(self, width, color): + + ## 泅犁 Color绰 荤侩窍绊 乐瘤 臼澜 + + width = max(64, width) + + imgLeft = ImageBox() + imgCenter = ExpandedImageBox() + imgRight = ImageBox() + imgLeft.AddFlag("not_pick") + imgCenter.AddFlag("not_pick") + imgRight.AddFlag("not_pick") + imgLeft.SetParent(self) + imgCenter.SetParent(self) + imgRight.SetParent(self) + + if localeInfo.IsARABIC(): + imgLeft.LoadImage("locale/ae/ui/pattern/titlebar_left.tga") + imgCenter.LoadImage("locale/ae/ui/pattern/titlebar_center.tga") + imgRight.LoadImage("locale/ae/ui/pattern/titlebar_right.tga") + else: + imgLeft.LoadImage("d:/ymir work/ui/pattern/titlebar_left.tga") + imgCenter.LoadImage("d:/ymir work/ui/pattern/titlebar_center.tga") + imgRight.LoadImage("d:/ymir work/ui/pattern/titlebar_right.tga") + + imgLeft.Show() + imgCenter.Show() + imgRight.Show() + + btnClose = Button() + btnClose.SetParent(self) + btnClose.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub") + btnClose.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub") + btnClose.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub") + btnClose.SetToolTipText(localeInfo.UI_CLOSE, 0, -23) + btnClose.Show() + + self.imgLeft = imgLeft + self.imgCenter = imgCenter + self.imgRight = imgRight + self.btnClose = btnClose + + self.SetWidth(width) + + def SetWidth(self, width): + self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2) - self.BLOCK_WIDTH) / self.BLOCK_WIDTH, 0.0) + self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0) + self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0) + + if localeInfo.IsARABIC(): + self.btnClose.SetPosition(3, 3) + else: + self.btnClose.SetPosition(width - self.btnClose.GetWidth() - 3, 3) + + self.SetSize(width, self.BLOCK_HEIGHT) + + def SetCloseEvent(self, event): + self.btnClose.SetEvent(event) + +class HorizontalBar(Window): + + BLOCK_WIDTH = 32 + BLOCK_HEIGHT = 17 + + def __init__(self): + Window.__init__(self) + self.AddFlag("attach") + + def __del__(self): + Window.__del__(self) + + def Create(self, width): + + width = max(96, width) + + imgLeft = ImageBox() + imgLeft.SetParent(self) + imgLeft.AddFlag("not_pick") + imgLeft.LoadImage("d:/ymir work/ui/pattern/horizontalbar_left.tga") + imgLeft.Show() + + imgCenter = ExpandedImageBox() + imgCenter.SetParent(self) + imgCenter.AddFlag("not_pick") + imgCenter.LoadImage("d:/ymir work/ui/pattern/horizontalbar_center.tga") + imgCenter.Show() + + imgRight = ImageBox() + imgRight.SetParent(self) + imgRight.AddFlag("not_pick") + imgRight.LoadImage("d:/ymir work/ui/pattern/horizontalbar_right.tga") + imgRight.Show() + + self.imgLeft = imgLeft + self.imgCenter = imgCenter + self.imgRight = imgRight + self.SetWidth(width) + + def SetWidth(self, width): + self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2) - self.BLOCK_WIDTH) / self.BLOCK_WIDTH, 0.0) + self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0) + self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0) + self.SetSize(width, self.BLOCK_HEIGHT) + +class Gauge(Window): + + SLOT_WIDTH = 16 + SLOT_HEIGHT = 7 + + GAUGE_TEMPORARY_PLACE = 12 + GAUGE_WIDTH = 16 + + def __init__(self): + Window.__init__(self) + self.width = 0 + def __del__(self): + Window.__del__(self) + + def MakeGauge(self, width, color): + + self.width = max(48, width) + + imgSlotLeft = ImageBox() + imgSlotLeft.SetParent(self) + imgSlotLeft.LoadImage("d:/ymir work/ui/pattern/gauge_slot_left.tga") + imgSlotLeft.Show() + + imgSlotRight = ImageBox() + imgSlotRight.SetParent(self) + imgSlotRight.LoadImage("d:/ymir work/ui/pattern/gauge_slot_right.tga") + imgSlotRight.Show() + imgSlotRight.SetPosition(width - self.SLOT_WIDTH, 0) + + imgSlotCenter = ExpandedImageBox() + imgSlotCenter.SetParent(self) + imgSlotCenter.LoadImage("d:/ymir work/ui/pattern/gauge_slot_center.tga") + imgSlotCenter.Show() + imgSlotCenter.SetRenderingRect(0.0, 0.0, float((width - self.SLOT_WIDTH*2) - self.SLOT_WIDTH) / self.SLOT_WIDTH, 0.0) + imgSlotCenter.SetPosition(self.SLOT_WIDTH, 0) + + imgGauge = ExpandedImageBox() + imgGauge.SetParent(self) + imgGauge.LoadImage("d:/ymir work/ui/pattern/gauge_" + color + ".tga") + imgGauge.Show() + imgGauge.SetRenderingRect(0.0, 0.0, 0.0, 0.0) + imgGauge.SetPosition(self.GAUGE_TEMPORARY_PLACE, 0) + + imgSlotLeft.AddFlag("attach") + imgSlotCenter.AddFlag("attach") + imgSlotRight.AddFlag("attach") + + self.imgLeft = imgSlotLeft + self.imgCenter = imgSlotCenter + self.imgRight = imgSlotRight + self.imgGauge = imgGauge + + self.SetSize(width, self.SLOT_HEIGHT) + + def SetPercentage(self, curValue, maxValue): + + # PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR + if maxValue > 0.0: + percentage = min(1.0, float(curValue)/float(maxValue)) + else: + percentage = 0.0 + # END_OF_PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR + + gaugeSize = -1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * percentage / self.GAUGE_WIDTH + self.imgGauge.SetRenderingRect(0.0, 0.0, gaugeSize, 0.0) + +class Board(Window): + + CORNER_WIDTH = 32 + CORNER_HEIGHT = 32 + LINE_WIDTH = 128 + LINE_HEIGHT = 128 + + LT = 0 + LB = 1 + RT = 2 + RB = 3 + L = 0 + R = 1 + T = 2 + B = 3 + + def __init__(self): + Window.__init__(self) + + self.MakeBoard("d:/ymir work/ui/pattern/Board_Corner_", "d:/ymir work/ui/pattern/Board_Line_") + self.MakeBase() + + def MakeBoard(self, cornerPath, linePath): + + CornerFileNames = [ cornerPath+dir+".tga" for dir in ("LeftTop", "LeftBottom", "RightTop", "RightBottom", ) ] + LineFileNames = [ linePath+dir+".tga" for dir in ("Left", "Right", "Top", "Bottom", ) ] + """ + CornerFileNames = ( + "d:/ymir work/ui/pattern/Board_Corner_LeftTop.tga", + "d:/ymir work/ui/pattern/Board_Corner_LeftBottom.tga", + "d:/ymir work/ui/pattern/Board_Corner_RightTop.tga", + "d:/ymir work/ui/pattern/Board_Corner_RightBottom.tga", + ) + LineFileNames = ( + "d:/ymir work/ui/pattern/Board_Line_Left.tga", + "d:/ymir work/ui/pattern/Board_Line_Right.tga", + "d:/ymir work/ui/pattern/Board_Line_Top.tga", + "d:/ymir work/ui/pattern/Board_Line_Bottom.tga", + ) + """ + + self.Corners = [] + for fileName in CornerFileNames: + Corner = ExpandedImageBox() + Corner.AddFlag("not_pick") + Corner.LoadImage(fileName) + Corner.SetParent(self) + Corner.SetPosition(0, 0) + Corner.Show() + self.Corners.append(Corner) + + self.Lines = [] + for fileName in LineFileNames: + Line = ExpandedImageBox() + Line.AddFlag("not_pick") + Line.LoadImage(fileName) + Line.SetParent(self) + Line.SetPosition(0, 0) + Line.Show() + self.Lines.append(Line) + + self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) + self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) + + def MakeBase(self): + self.Base = ExpandedImageBox() + self.Base.AddFlag("not_pick") + self.Base.LoadImage("d:/ymir work/ui/pattern/Board_Base.tga") + self.Base.SetParent(self) + self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) + self.Base.Show() + + def __del__(self): + Window.__del__(self) + + def SetSize(self, width, height): + + width = max(self.CORNER_WIDTH*2, width) + height = max(self.CORNER_HEIGHT*2, height) + Window.SetSize(self, width, height) + + self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) + self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) + self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) + self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) + self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) + + verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT + horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH + self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) + self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) + self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) + self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) + + if self.Base: + self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) + +class BoardWithTitleBar(Board): + def __init__(self): + Board.__init__(self) + + titleBar = TitleBar() + titleBar.SetParent(self) + titleBar.MakeTitleBar(0, "red") + titleBar.SetPosition(8, 7) + titleBar.Show() + + titleName = TextLine() + titleName.SetParent(titleBar) + titleName.SetPosition(0, 4) + titleName.SetWindowHorizontalAlignCenter() + titleName.SetHorizontalAlignCenter() + titleName.Show() + + self.titleBar = titleBar + self.titleName = titleName + + self.SetCloseEvent(self.Hide) + + def __del__(self): + Board.__del__(self) + self.titleBar = None + self.titleName = None + + def SetSize(self, width, height): + self.titleBar.SetWidth(width - 15) + #self.pickRestrictWindow.SetSize(width, height - 30) + Board.SetSize(self, width, height) + self.titleName.UpdateRect() + + def SetTitleColor(self, color): + self.titleName.SetPackedFontColor(color) + + def SetTitleName(self, name): + self.titleName.SetText(name) + + def SetCloseEvent(self, event): + self.titleBar.SetCloseEvent(event) + +class ThinBoard(Window): + + CORNER_WIDTH = 16 + CORNER_HEIGHT = 16 + LINE_WIDTH = 16 + LINE_HEIGHT = 16 + BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.51) + + LT = 0 + LB = 1 + RT = 2 + RB = 3 + L = 0 + R = 1 + T = 2 + B = 3 + + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + + CornerFileNames = [ "d:/ymir work/ui/pattern/ThinBoard_Corner_"+dir+".tga" for dir in ["LeftTop","LeftBottom","RightTop","RightBottom"] ] + LineFileNames = [ "d:/ymir work/ui/pattern/ThinBoard_Line_"+dir+".tga" for dir in ["Left","Right","Top","Bottom"] ] + + self.Corners = [] + for fileName in CornerFileNames: + Corner = ExpandedImageBox() + Corner.AddFlag("attach") + Corner.AddFlag("not_pick") + Corner.LoadImage(fileName) + Corner.SetParent(self) + Corner.SetPosition(0, 0) + Corner.Show() + self.Corners.append(Corner) + + self.Lines = [] + for fileName in LineFileNames: + Line = ExpandedImageBox() + Line.AddFlag("attach") + Line.AddFlag("not_pick") + Line.LoadImage(fileName) + Line.SetParent(self) + Line.SetPosition(0, 0) + Line.Show() + self.Lines.append(Line) + + Base = Bar() + Base.SetParent(self) + Base.AddFlag("attach") + Base.AddFlag("not_pick") + Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) + Base.SetColor(self.BOARD_COLOR) + Base.Show() + self.Base = Base + + self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) + self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) + + def __del__(self): + Window.__del__(self) + + def SetSize(self, width, height): + + width = max(self.CORNER_WIDTH*2, width) + height = max(self.CORNER_HEIGHT*2, height) + Window.SetSize(self, width, height) + + self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) + self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) + self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) + self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) + self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) + + verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT + horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH + self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) + self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) + self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) + self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) + self.Base.SetSize(width - self.CORNER_WIDTH*2, height - self.CORNER_HEIGHT*2) + + def ShowInternal(self): + self.Base.Show() + for wnd in self.Lines: + wnd.Show() + for wnd in self.Corners: + wnd.Show() + + def HideInternal(self): + self.Base.Hide() + for wnd in self.Lines: + wnd.Hide() + for wnd in self.Corners: + wnd.Hide() + +class ScrollBar(Window): + + SCROLLBAR_WIDTH = 17 + SCROLLBAR_MIDDLE_HEIGHT = 9 + SCROLLBAR_BUTTON_WIDTH = 17 + SCROLLBAR_BUTTON_HEIGHT = 17 + MIDDLE_BAR_POS = 5 + MIDDLE_BAR_UPPER_PLACE = 3 + MIDDLE_BAR_DOWNER_PLACE = 4 + TEMP_SPACE = MIDDLE_BAR_UPPER_PLACE + MIDDLE_BAR_DOWNER_PLACE + + class MiddleBar(DragButton): + def __init__(self): + DragButton.__init__(self) + self.AddFlag("movable") + #self.AddFlag("restrict_x") + + def MakeImage(self): + top = ImageBox() + top.SetParent(self) + top.LoadImage("d:/ymir work/ui/pattern/ScrollBar_Top.tga") + top.SetPosition(0, 0) + top.AddFlag("not_pick") + top.Show() + bottom = ImageBox() + bottom.SetParent(self) + bottom.LoadImage("d:/ymir work/ui/pattern/ScrollBar_Bottom.tga") + bottom.AddFlag("not_pick") + bottom.Show() + + middle = ExpandedImageBox() + middle.SetParent(self) + middle.LoadImage("d:/ymir work/ui/pattern/ScrollBar_Middle.tga") + middle.SetPosition(0, 4) + middle.AddFlag("not_pick") + middle.Show() + + self.top = top + self.bottom = bottom + self.middle = middle + + def SetSize(self, height): + height = max(12, height) + DragButton.SetSize(self, 10, height) + self.bottom.SetPosition(0, height-4) + + height -= 4*3 + self.middle.SetRenderingRect(0, 0, 0, float(height)/4.0) + + def __init__(self): + Window.__init__(self) + + self.pageSize = 1 + self.curPos = 0.0 + self.eventScroll = lambda *arg: None + self.lockFlag = False + self.scrollStep = 0.20 + + + self.CreateScrollBar() + + def __del__(self): + Window.__del__(self) + + def CreateScrollBar(self): + barSlot = Bar3D() + barSlot.SetParent(self) + barSlot.AddFlag("not_pick") + barSlot.Show() + + middleBar = self.MiddleBar() + middleBar.SetParent(self) + middleBar.SetMoveEvent(__mem_func__(self.OnMove)) + middleBar.Show() + middleBar.MakeImage() + middleBar.SetSize(12) + + upButton = Button() + upButton.SetParent(self) + upButton.SetEvent(__mem_func__(self.OnUp)) + upButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_up_button_01.sub") + upButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_up_button_02.sub") + upButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_up_button_03.sub") + upButton.Show() + + downButton = Button() + downButton.SetParent(self) + downButton.SetEvent(__mem_func__(self.OnDown)) + downButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_down_button_01.sub") + downButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_down_button_02.sub") + downButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_down_button_03.sub") + downButton.Show() + + self.upButton = upButton + self.downButton = downButton + self.middleBar = middleBar + self.barSlot = barSlot + + self.SCROLLBAR_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() + self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() + + def Destroy(self): + self.middleBar = None + self.upButton = None + self.downButton = None + self.eventScroll = lambda *arg: None + + def SetScrollEvent(self, event): + self.eventScroll = event + + def SetMiddleBarSize(self, pageScale): + realHeight = self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT*2 + self.SCROLLBAR_MIDDLE_HEIGHT = int(pageScale * float(realHeight)) + self.middleBar.SetSize(self.SCROLLBAR_MIDDLE_HEIGHT) + self.pageSize = (self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT*2) - self.SCROLLBAR_MIDDLE_HEIGHT - (self.TEMP_SPACE) + + def SetScrollBarSize(self, height): + self.pageSize = (height - self.SCROLLBAR_BUTTON_HEIGHT*2) - self.SCROLLBAR_MIDDLE_HEIGHT - (self.TEMP_SPACE) + self.SetSize(self.SCROLLBAR_WIDTH, height) + self.upButton.SetPosition(0, 0) + self.downButton.SetPosition(0, height - self.SCROLLBAR_BUTTON_HEIGHT) + self.middleBar.SetRestrictMovementArea(self.MIDDLE_BAR_POS, self.SCROLLBAR_BUTTON_HEIGHT + self.MIDDLE_BAR_UPPER_PLACE, self.MIDDLE_BAR_POS+2, height - self.SCROLLBAR_BUTTON_HEIGHT*2 - self.TEMP_SPACE) + self.middleBar.SetPosition(self.MIDDLE_BAR_POS, 0) + + self.UpdateBarSlot() + + def UpdateBarSlot(self): + self.barSlot.SetPosition(0, self.SCROLLBAR_BUTTON_HEIGHT) + self.barSlot.SetSize(self.GetWidth() - 2, self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT*2 - 2) + + def GetPos(self): + return self.curPos + + def SetPos(self, pos): + pos = max(0.0, pos) + pos = min(1.0, pos) + + newPos = float(self.pageSize) * pos + self.middleBar.SetPosition(self.MIDDLE_BAR_POS, int(newPos) + self.SCROLLBAR_BUTTON_HEIGHT + self.MIDDLE_BAR_UPPER_PLACE) + self.OnMove() + + def SetScrollStep(self, step): + self.scrollStep = step + + def GetScrollStep(self): + return self.scrollStep + + def OnUp(self): + self.SetPos(self.curPos-self.scrollStep) + + def OnDown(self): + self.SetPos(self.curPos+self.scrollStep) + + def OnMove(self): + + if self.lockFlag: + return + + if 0 == self.pageSize: + return + + (xLocal, yLocal) = self.middleBar.GetLocalPosition() + self.curPos = float(yLocal - self.SCROLLBAR_BUTTON_HEIGHT - self.MIDDLE_BAR_UPPER_PLACE) / float(self.pageSize) + + self.eventScroll() + + def OnMouseLeftButtonDown(self): + (xMouseLocalPosition, yMouseLocalPosition) = self.GetMouseLocalPosition() + pickedPos = yMouseLocalPosition - self.SCROLLBAR_BUTTON_HEIGHT - self.SCROLLBAR_MIDDLE_HEIGHT/2 + newPos = float(pickedPos) / float(self.pageSize) + self.SetPos(newPos) + + def LockScroll(self): + self.lockFlag = True + + def UnlockScroll(self): + self.lockFlag = False + +class ThinScrollBar(ScrollBar): + + def CreateScrollBar(self): + middleBar = self.MiddleBar() + middleBar.SetParent(self) + middleBar.SetMoveEvent(__mem_func__(self.OnMove)) + middleBar.Show() + middleBar.SetUpVisual("d:/ymir work/ui/public/scrollbar_thin_middle_button_01.sub") + middleBar.SetOverVisual("d:/ymir work/ui/public/scrollbar_thin_middle_button_02.sub") + middleBar.SetDownVisual("d:/ymir work/ui/public/scrollbar_thin_middle_button_03.sub") + + upButton = Button() + upButton.SetParent(self) + upButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_thin_up_button_01.sub") + upButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_thin_up_button_02.sub") + upButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_thin_up_button_03.sub") + upButton.SetEvent(__mem_func__(self.OnUp)) + upButton.Show() + + downButton = Button() + downButton.SetParent(self) + downButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_thin_down_button_01.sub") + downButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_thin_down_button_02.sub") + downButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_thin_down_button_03.sub") + downButton.SetEvent(__mem_func__(self.OnDown)) + downButton.Show() + + self.middleBar = middleBar + self.upButton = upButton + self.downButton = downButton + + self.SCROLLBAR_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() + self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() + self.MIDDLE_BAR_POS = 0 + self.MIDDLE_BAR_UPPER_PLACE = 0 + self.MIDDLE_BAR_DOWNER_PLACE = 0 + self.TEMP_SPACE = 0 + + def UpdateBarSlot(self): + pass + +class SmallThinScrollBar(ScrollBar): + + def CreateScrollBar(self): + middleBar = self.MiddleBar() + middleBar.SetParent(self) + middleBar.SetMoveEvent(__mem_func__(self.OnMove)) + middleBar.Show() + middleBar.SetUpVisual("d:/ymir work/ui/public/scrollbar_small_thin_middle_button_01.sub") + middleBar.SetOverVisual("d:/ymir work/ui/public/scrollbar_small_thin_middle_button_01.sub") + middleBar.SetDownVisual("d:/ymir work/ui/public/scrollbar_small_thin_middle_button_01.sub") + + upButton = Button() + upButton.SetParent(self) + upButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_small_thin_up_button_01.sub") + upButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_small_thin_up_button_02.sub") + upButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_small_thin_up_button_03.sub") + upButton.SetEvent(__mem_func__(self.OnUp)) + upButton.Show() + + downButton = Button() + downButton.SetParent(self) + downButton.SetUpVisual("d:/ymir work/ui/public/scrollbar_small_thin_down_button_01.sub") + downButton.SetOverVisual("d:/ymir work/ui/public/scrollbar_small_thin_down_button_02.sub") + downButton.SetDownVisual("d:/ymir work/ui/public/scrollbar_small_thin_down_button_03.sub") + downButton.SetEvent(__mem_func__(self.OnDown)) + downButton.Show() + + self.middleBar = middleBar + self.upButton = upButton + self.downButton = downButton + + self.SCROLLBAR_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() + self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() + self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() + self.MIDDLE_BAR_POS = 0 + self.MIDDLE_BAR_UPPER_PLACE = 0 + self.MIDDLE_BAR_DOWNER_PLACE = 0 + self.TEMP_SPACE = 0 + + def UpdateBarSlot(self): + pass + +class SliderBar(Window): + + def __init__(self): + Window.__init__(self) + + self.curPos = 1.0 + self.pageSize = 1.0 + self.eventChange = None + + self.__CreateBackGroundImage() + self.__CreateCursor() + + def __del__(self): + Window.__del__(self) + + def __CreateBackGroundImage(self): + img = ImageBox() + img.SetParent(self) + img.LoadImage("d:/ymir work/ui/game/windows/sliderbar.sub") + img.Show() + self.backGroundImage = img + + ## + self.SetSize(self.backGroundImage.GetWidth(), self.backGroundImage.GetHeight()) + + def __CreateCursor(self): + cursor = DragButton() + cursor.AddFlag("movable") + cursor.AddFlag("restrict_y") + cursor.SetParent(self) + cursor.SetMoveEvent(__mem_func__(self.__OnMove)) + cursor.SetUpVisual("d:/ymir work/ui/game/windows/sliderbar_cursor.sub") + cursor.SetOverVisual("d:/ymir work/ui/game/windows/sliderbar_cursor.sub") + cursor.SetDownVisual("d:/ymir work/ui/game/windows/sliderbar_cursor.sub") + cursor.Show() + self.cursor = cursor + + ## + self.cursor.SetRestrictMovementArea(0, 0, self.backGroundImage.GetWidth(), 0) + self.pageSize = self.backGroundImage.GetWidth() - self.cursor.GetWidth() + + def __OnMove(self): + (xLocal, yLocal) = self.cursor.GetLocalPosition() + self.curPos = float(xLocal) / float(self.pageSize) + + if self.eventChange: + self.eventChange() + + def SetSliderPos(self, pos): + self.curPos = pos + self.cursor.SetPosition(int(self.pageSize * pos), 0) + + def GetSliderPos(self): + return self.curPos + + def SetEvent(self, event): + self.eventChange = event + + def Enable(self): + self.cursor.Show() + + def Disable(self): + self.cursor.Hide() + +class ListBox(Window): + + TEMPORARY_PLACE = 3 + + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + self.overLine = -1 + self.selectedLine = -1 + self.width = 0 + self.height = 0 + self.stepSize = 17 + self.basePos = 0 + self.showLineCount = 0 + self.itemCenterAlign = True + self.itemList = [] + self.keyDict = {} + self.textDict = {} + self.event = lambda *arg: None + def __del__(self): + Window.__del__(self) + + def SetWidth(self, width): + self.SetSize(width, self.height) + + def SetSize(self, width, height): + Window.SetSize(self, width, height) + self.width = width + self.height = height + + def SetTextCenterAlign(self, flag): + self.itemCenterAlign = flag + + def SetBasePos(self, pos): + self.basePos = pos + self._LocateItem() + + def ClearItem(self): + self.keyDict = {} + self.textDict = {} + self.itemList = [] + self.overLine = -1 + self.selectedLine = -1 + + def InsertItem(self, number, text): + self.keyDict[len(self.itemList)] = number + self.textDict[len(self.itemList)] = text + + textLine = TextLine() + textLine.SetParent(self) + textLine.SetText(text) + textLine.Show() + + if self.itemCenterAlign: + textLine.SetWindowHorizontalAlignCenter() + textLine.SetHorizontalAlignCenter() + + self.itemList.append(textLine) + + self._LocateItem() + + def ChangeItem(self, number, text): + for key, value in self.keyDict.items(): + if value == number: + self.textDict[key] = text + + if number < len(self.itemList): + self.itemList[key].SetText(text) + + return + + def LocateItem(self): + self._LocateItem() + + def _LocateItem(self): + + skipCount = self.basePos + yPos = 0 + self.showLineCount = 0 + + for textLine in self.itemList: + textLine.Hide() + + if skipCount > 0: + skipCount -= 1 + continue + + if localeInfo.IsARABIC(): + w, h = textLine.GetTextSize() + textLine.SetPosition(w+10, yPos + 3) + else: + textLine.SetPosition(0, yPos + 3) + + yPos += self.stepSize + + if yPos <= self.GetHeight(): + self.showLineCount += 1 + textLine.Show() + + def ArrangeItem(self): + self.SetSize(self.width, len(self.itemList) * self.stepSize) + self._LocateItem() + + def GetViewItemCount(self): + return int(self.GetHeight() / self.stepSize) + + def GetItemCount(self): + return len(self.itemList) + + def SetEvent(self, event): + self.event = event + + def SelectItem(self, line): + + if not self.keyDict.has_key(line): + return + + if line == self.selectedLine: + return + + self.selectedLine = line + self.event(self.keyDict.get(line, 0), self.textDict.get(line, "None")) + + def GetSelectedItem(self): + return self.keyDict.get(self.selectedLine, 0) + + def OnMouseLeftButtonDown(self): + if self.overLine < 0: + return + + def OnMouseLeftButtonUp(self): + if self.overLine >= 0: + self.SelectItem(self.overLine+self.basePos) + + def OnUpdate(self): + + self.overLine = -1 + + if self.IsIn(): + x, y = self.GetGlobalPosition() + height = self.GetHeight() + xMouse, yMouse = wndMgr.GetMousePosition() + + if yMouse - y < height - 1: + self.overLine = (yMouse - y) / self.stepSize + + if self.overLine < 0: + self.overLine = -1 + if self.overLine >= len(self.itemList): + self.overLine = -1 + + def OnRender(self): + xRender, yRender = self.GetGlobalPosition() + yRender -= self.TEMPORARY_PLACE + widthRender = self.width + heightRender = self.height + self.TEMPORARY_PLACE*2 + + if localeInfo.IsCIBN10: + if -1 != self.overLine and self.keyDict[self.overLine] != -1: + grp.SetColor(HALF_WHITE_COLOR) + grp.RenderBar(xRender + 2, yRender + self.overLine*self.stepSize + 4, self.width - 3, self.stepSize) + + if -1 != self.selectedLine and self.keyDict[self.selectedLine] != -1: + if self.selectedLine >= self.basePos: + if self.selectedLine - self.basePos < self.showLineCount: + grp.SetColor(SELECT_COLOR) + grp.RenderBar(xRender + 2, yRender + (self.selectedLine-self.basePos)*self.stepSize + 4, self.width - 3, self.stepSize) + + else: + if -1 != self.overLine: + grp.SetColor(HALF_WHITE_COLOR) + grp.RenderBar(xRender + 2, yRender + self.overLine*self.stepSize + 4, self.width - 3, self.stepSize) + + if -1 != self.selectedLine: + if self.selectedLine >= self.basePos: + if self.selectedLine - self.basePos < self.showLineCount: + grp.SetColor(SELECT_COLOR) + grp.RenderBar(xRender + 2, yRender + (self.selectedLine-self.basePos)*self.stepSize + 4, self.width - 3, self.stepSize) + + + +class ListBox2(ListBox): + def __init__(self, *args, **kwargs): + ListBox.__init__(self, *args, **kwargs) + self.rowCount = 10 + self.barWidth = 0 + self.colCount = 0 + + def SetRowCount(self, rowCount): + self.rowCount = rowCount + + def SetSize(self, width, height): + ListBox.SetSize(self, width, height) + self._RefreshForm() + + def ClearItem(self): + ListBox.ClearItem(self) + self._RefreshForm() + + def InsertItem(self, *args, **kwargs): + ListBox.InsertItem(self, *args, **kwargs) + self._RefreshForm() + + def OnUpdate(self): + mpos = wndMgr.GetMousePosition() + self.overLine = self._CalcPointIndex(mpos) + + def OnRender(self): + x, y = self.GetGlobalPosition() + pos = (x + 2, y) + + if -1 != self.overLine: + grp.SetColor(HALF_WHITE_COLOR) + self._RenderBar(pos, self.overLine) + + if -1 != self.selectedLine: + if self.selectedLine >= self.basePos: + if self.selectedLine - self.basePos < self.showLineCount: + grp.SetColor(SELECT_COLOR) + self._RenderBar(pos, self.selectedLine-self.basePos) + + + + def _CalcPointIndex(self, mpos): + if self.IsIn(): + px, py = mpos + gx, gy = self.GetGlobalPosition() + lx, ly = px - gx, py - gy + + col = lx / self.barWidth + row = ly / self.stepSize + idx = col * self.rowCount + row + if col >= 0 and col < self.colCount: + if row >= 0 and row < self.rowCount: + if idx >= 0 and idx < len(self.itemList): + return idx + + return -1 + + def _CalcRenderPos(self, pos, idx): + x, y = pos + row = idx % self.rowCount + col = idx / self.rowCount + return (x + col * self.barWidth, y + row * self.stepSize) + + def _RenderBar(self, basePos, idx): + x, y = self._CalcRenderPos(basePos, idx) + grp.RenderBar(x, y, self.barWidth - 3, self.stepSize) + + def _LocateItem(self): + pos = (0, self.TEMPORARY_PLACE) + + self.showLineCount = 0 + for textLine in self.itemList: + x, y = self._CalcRenderPos(pos, self.showLineCount) + textLine.SetPosition(x, y) + textLine.Show() + + self.showLineCount += 1 + + def _RefreshForm(self): + if len(self.itemList) % self.rowCount: + self.colCount = len(self.itemList) / self.rowCount + 1 + else: + self.colCount = len(self.itemList) / self.rowCount + + if self.colCount: + self.barWidth = self.width / self.colCount + else: + self.barWidth = self.width + + +class ComboBox(Window): + + class ListBoxWithBoard(ListBox): + + def __init__(self, layer): + ListBox.__init__(self, layer) + + def OnRender(self): + xRender, yRender = self.GetGlobalPosition() + yRender -= self.TEMPORARY_PLACE + widthRender = self.width + heightRender = self.height + self.TEMPORARY_PLACE*2 + grp.SetColor(BACKGROUND_COLOR) + grp.RenderBar(xRender, yRender, widthRender, heightRender) + grp.SetColor(DARK_COLOR) + grp.RenderLine(xRender, yRender, widthRender, 0) + grp.RenderLine(xRender, yRender, 0, heightRender) + grp.SetColor(BRIGHT_COLOR) + grp.RenderLine(xRender, yRender+heightRender, widthRender, 0) + grp.RenderLine(xRender+widthRender, yRender, 0, heightRender) + + ListBox.OnRender(self) + + def __init__(self): + Window.__init__(self) + self.x = 0 + self.y = 0 + self.width = 0 + self.height = 0 + self.isSelected = False + self.isOver = False + self.isListOpened = False + self.event = lambda *arg: None + self.enable = True + + self.textLine = MakeTextLine(self) + self.textLine.SetText(localeInfo.UI_ITEM) + + self.listBox = self.ListBoxWithBoard("TOP_MOST") + self.listBox.SetPickAlways() + self.listBox.SetParent(self) + self.listBox.SetEvent(__mem_func__(self.OnSelectItem)) + self.listBox.Hide() + + def __del__(self): + Window.__del__(self) + + def Destroy(self): + self.textLine = None + self.listBox = None + + def SetPosition(self, x, y): + Window.SetPosition(self, x, y) + self.x = x + self.y = y + self.__ArrangeListBox() + + def SetSize(self, width, height): + Window.SetSize(self, width, height) + self.width = width + self.height = height + self.textLine.UpdateRect() + self.__ArrangeListBox() + + def __ArrangeListBox(self): + self.listBox.SetPosition(0, self.height + 5) + self.listBox.SetWidth(self.width) + + def Enable(self): + self.enable = True + + def Disable(self): + self.enable = False + self.textLine.SetText("") + self.CloseListBox() + + def SetEvent(self, event): + self.event = event + + def ClearItem(self): + self.CloseListBox() + self.listBox.ClearItem() + + def InsertItem(self, index, name): + self.listBox.InsertItem(index, name) + self.listBox.ArrangeItem() + + def SetCurrentItem(self, text): + self.textLine.SetText(text) + + def SelectItem(self, key): + self.listBox.SelectItem(key) + + def OnSelectItem(self, index, name): + + self.CloseListBox() + self.event(index) + + def CloseListBox(self): + self.isListOpened = False + self.listBox.Hide() + + def OnMouseLeftButtonDown(self): + + if not self.enable: + return + + self.isSelected = True + + def OnMouseLeftButtonUp(self): + + if not self.enable: + return + + self.isSelected = False + + if self.isListOpened: + self.CloseListBox() + else: + if self.listBox.GetItemCount() > 0: + self.isListOpened = True + self.listBox.Show() + self.__ArrangeListBox() + + def OnUpdate(self): + + if not self.enable: + return + + if self.IsIn(): + self.isOver = True + else: + self.isOver = False + + def OnRender(self): + self.x, self.y = self.GetGlobalPosition() + xRender = self.x + yRender = self.y + widthRender = self.width + heightRender = self.height + grp.SetColor(BACKGROUND_COLOR) + grp.RenderBar(xRender, yRender, widthRender, heightRender) + grp.SetColor(DARK_COLOR) + grp.RenderLine(xRender, yRender, widthRender, 0) + grp.RenderLine(xRender, yRender, 0, heightRender) + grp.SetColor(BRIGHT_COLOR) + grp.RenderLine(xRender, yRender+heightRender, widthRender, 0) + grp.RenderLine(xRender+widthRender, yRender, 0, heightRender) + + if self.isOver: + grp.SetColor(HALF_WHITE_COLOR) + grp.RenderBar(xRender + 2, yRender + 3, self.width - 3, heightRender - 5) + + if self.isSelected: + grp.SetColor(WHITE_COLOR) + grp.RenderBar(xRender + 2, yRender + 3, self.width - 3, heightRender - 5) + +################################################################################################### +## Python Script Loader +################################################################################################### + +class ScriptWindow(Window): + def __init__(self, layer = "UI"): + Window.__init__(self, layer) + self.Children = [] + self.ElementDictionary = {} + def __del__(self): + Window.__del__(self) + + def ClearDictionary(self): + self.Children = [] + self.ElementDictionary = {} + def InsertChild(self, name, child): + self.ElementDictionary[name] = child + + def IsChild(self, name): + return self.ElementDictionary.has_key(name) + def GetChild(self, name): + return self.ElementDictionary[name] + + def GetChild2(self, name): + return self.ElementDictionary.get(name, None) + + +class PythonScriptLoader(object): + + BODY_KEY_LIST = ( "x", "y", "width", "height" ) + + ##### + + DEFAULT_KEY_LIST = ( "type", "x", "y", ) + WINDOW_KEY_LIST = ( "width", "height", ) + IMAGE_KEY_LIST = ( "image", ) + EXPANDED_IMAGE_KEY_LIST = ( "image", ) + ANI_IMAGE_KEY_LIST = ( "images", ) + SLOT_KEY_LIST = ( "width", "height", "slot", ) + CANDIDATE_LIST_KEY_LIST = ( "item_step", "item_xsize", "item_ysize", ) + GRID_TABLE_KEY_LIST = ( "start_index", "x_count", "y_count", "x_step", "y_step", ) + EDIT_LINE_KEY_LIST = ( "width", "height", "input_limit", ) + COMBO_BOX_KEY_LIST = ( "width", "height", "item", ) + TITLE_BAR_KEY_LIST = ( "width", ) + HORIZONTAL_BAR_KEY_LIST = ( "width", ) + BOARD_KEY_LIST = ( "width", "height", ) + BOARD_WITH_TITLEBAR_KEY_LIST = ( "width", "height", "title", ) + BOX_KEY_LIST = ( "width", "height", ) + BAR_KEY_LIST = ( "width", "height", ) + LINE_KEY_LIST = ( "width", "height", ) + SLOTBAR_KEY_LIST = ( "width", "height", ) + GAUGE_KEY_LIST = ( "width", "color", ) + SCROLLBAR_KEY_LIST = ( "size", ) + LIST_BOX_KEY_LIST = ( "width", "height", ) + + def __init__(self): + self.Clear() + + def Clear(self): + self.ScriptDictionary = { "SCREEN_WIDTH" : wndMgr.GetScreenWidth(), "SCREEN_HEIGHT" : wndMgr.GetScreenHeight() } + self.InsertFunction = 0 + + def LoadScriptFile(self, window, FileName): + import exception + import exceptions + import os + import errno + self.Clear() + + print "===== Load Script File : %s" % (FileName) + + try: + # chr, player 殿篮 sandbox 郴俊辑 import啊 倾侩登瘤 臼扁 锭巩俊,(嚎捞 厩侩且 咯瘤啊 概快 怒.) + # 固府 script dictionary俊 鞘夸茄 惑荐甫 持绢初绰促. + import chr + import player + import app + self.ScriptDictionary["PLAYER_NAME_MAX_LEN"] = chr.PLAYER_NAME_MAX_LEN + self.ScriptDictionary["DRAGON_SOUL_EQUIPMENT_SLOT_START"] = player.DRAGON_SOUL_EQUIPMENT_SLOT_START + self.ScriptDictionary["LOCALE_PATH"] = app.GetLocalePath() + execfile(FileName, self.ScriptDictionary) + except IOError, err: + import sys + import dbg + dbg.TraceError("Failed to load script file : %s" % (FileName)) + dbg.TraceError("error : %s" % (err)) + exception.Abort("LoadScriptFile1") + except RuntimeError,err: + import sys + import dbg + dbg.TraceError("Failed to load script file : %s" % (FileName)) + dbg.TraceError("error : %s" % (err)) + exception.Abort("LoadScriptFile2") + except: + import sys + import dbg + dbg.TraceError("Failed to load script file : %s" % (FileName)) + exception.Abort("LoadScriptFile!!!!!!!!!!!!!!") + + ##### + + Body = self.ScriptDictionary["window"] + self.CheckKeyList("window", Body, self.BODY_KEY_LIST) + + window.ClearDictionary() + self.InsertFunction = window.InsertChild + + window.SetPosition(int(Body["x"]), int(Body["y"])) + + if localeInfo.IsARABIC(): + w = wndMgr.GetScreenWidth() + h = wndMgr.GetScreenHeight() + if Body.has_key("width"): + w = int(Body["width"]) + if Body.has_key("height"): + h = int(Body["height"]) + + window.SetSize(w, h) + else: + window.SetSize(int(Body["width"]), int(Body["height"])) + if True == Body.has_key("style"): + for StyleList in Body["style"]: + window.AddFlag(StyleList) + + + self.LoadChildren(window, Body) + + def LoadChildren(self, parent, dicChildren): + + if localeInfo.IsARABIC(): + parent.AddFlag( "rtl" ) + + if True == dicChildren.has_key("style"): + for style in dicChildren["style"]: + parent.AddFlag(style) + + if False == dicChildren.has_key("children"): + return False + + Index = 0 + + ChildrenList = dicChildren["children"] + parent.Children = range(len(ChildrenList)) + for ElementValue in ChildrenList: + try: + Name = ElementValue["name"] + except KeyError: + Name = ElementValue["name"] = "NONAME" + + try: + Type = ElementValue["type"] + except KeyError: + Type = ElementValue["type"] = "window" + + if False == self.CheckKeyList(Name, ElementValue, self.DEFAULT_KEY_LIST): + del parent.Children[Index] + continue + + if Type == "window": + parent.Children[Index] = ScriptWindow() + parent.Children[Index].SetParent(parent) + self.LoadElementWindow(parent.Children[Index], ElementValue, parent) + + elif Type == "button": + parent.Children[Index] = Button() + parent.Children[Index].SetParent(parent) + self.LoadElementButton(parent.Children[Index], ElementValue, parent) + + elif Type == "radio_button": + parent.Children[Index] = RadioButton() + parent.Children[Index].SetParent(parent) + self.LoadElementButton(parent.Children[Index], ElementValue, parent) + + elif Type == "toggle_button": + parent.Children[Index] = ToggleButton() + parent.Children[Index].SetParent(parent) + self.LoadElementButton(parent.Children[Index], ElementValue, parent) + + elif Type == "mark": + parent.Children[Index] = MarkBox() + parent.Children[Index].SetParent(parent) + self.LoadElementMark(parent.Children[Index], ElementValue, parent) + + elif Type == "image": + parent.Children[Index] = ImageBox() + parent.Children[Index].SetParent(parent) + self.LoadElementImage(parent.Children[Index], ElementValue, parent) + + elif Type == "expanded_image": + parent.Children[Index] = ExpandedImageBox() + parent.Children[Index].SetParent(parent) + self.LoadElementExpandedImage(parent.Children[Index], ElementValue, parent) + + elif Type == "ani_image": + parent.Children[Index] = AniImageBox() + parent.Children[Index].SetParent(parent) + self.LoadElementAniImage(parent.Children[Index], ElementValue, parent) + + elif Type == "slot": + parent.Children[Index] = SlotWindow() + parent.Children[Index].SetParent(parent) + self.LoadElementSlot(parent.Children[Index], ElementValue, parent) + + elif Type == "candidate_list": + parent.Children[Index] = CandidateListBox() + parent.Children[Index].SetParent(parent) + self.LoadElementCandidateList(parent.Children[Index], ElementValue, parent) + + elif Type == "grid_table": + parent.Children[Index] = GridSlotWindow() + parent.Children[Index].SetParent(parent) + self.LoadElementGridTable(parent.Children[Index], ElementValue, parent) + + elif Type == "text": + parent.Children[Index] = TextLine() + parent.Children[Index].SetParent(parent) + self.LoadElementText(parent.Children[Index], ElementValue, parent) + + elif Type == "editline": + parent.Children[Index] = EditLine() + parent.Children[Index].SetParent(parent) + self.LoadElementEditLine(parent.Children[Index], ElementValue, parent) + + elif Type == "titlebar": + parent.Children[Index] = TitleBar() + parent.Children[Index].SetParent(parent) + self.LoadElementTitleBar(parent.Children[Index], ElementValue, parent) + + elif Type == "horizontalbar": + parent.Children[Index] = HorizontalBar() + parent.Children[Index].SetParent(parent) + self.LoadElementHorizontalBar(parent.Children[Index], ElementValue, parent) + + elif Type == "board": + parent.Children[Index] = Board() + parent.Children[Index].SetParent(parent) + self.LoadElementBoard(parent.Children[Index], ElementValue, parent) + + elif Type == "board_with_titlebar": + parent.Children[Index] = BoardWithTitleBar() + parent.Children[Index].SetParent(parent) + self.LoadElementBoardWithTitleBar(parent.Children[Index], ElementValue, parent) + + elif Type == "thinboard": + parent.Children[Index] = ThinBoard() + parent.Children[Index].SetParent(parent) + self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent) + + elif Type == "box": + parent.Children[Index] = Box() + parent.Children[Index].SetParent(parent) + self.LoadElementBox(parent.Children[Index], ElementValue, parent) + + elif Type == "bar": + parent.Children[Index] = Bar() + parent.Children[Index].SetParent(parent) + self.LoadElementBar(parent.Children[Index], ElementValue, parent) + + elif Type == "line": + parent.Children[Index] = Line() + parent.Children[Index].SetParent(parent) + self.LoadElementLine(parent.Children[Index], ElementValue, parent) + + elif Type == "slotbar": + parent.Children[Index] = SlotBar() + parent.Children[Index].SetParent(parent) + self.LoadElementSlotBar(parent.Children[Index], ElementValue, parent) + + elif Type == "gauge": + parent.Children[Index] = Gauge() + parent.Children[Index].SetParent(parent) + self.LoadElementGauge(parent.Children[Index], ElementValue, parent) + + elif Type == "scrollbar": + parent.Children[Index] = ScrollBar() + parent.Children[Index].SetParent(parent) + self.LoadElementScrollBar(parent.Children[Index], ElementValue, parent) + + elif Type == "thin_scrollbar": + parent.Children[Index] = ThinScrollBar() + parent.Children[Index].SetParent(parent) + self.LoadElementScrollBar(parent.Children[Index], ElementValue, parent) + + elif Type == "small_thin_scrollbar": + parent.Children[Index] = SmallThinScrollBar() + parent.Children[Index].SetParent(parent) + self.LoadElementScrollBar(parent.Children[Index], ElementValue, parent) + + elif Type == "sliderbar": + parent.Children[Index] = SliderBar() + parent.Children[Index].SetParent(parent) + self.LoadElementSliderBar(parent.Children[Index], ElementValue, parent) + + elif Type == "listbox": + parent.Children[Index] = ListBox() + parent.Children[Index].SetParent(parent) + self.LoadElementListBox(parent.Children[Index], ElementValue, parent) + + elif Type == "listbox2": + parent.Children[Index] = ListBox2() + parent.Children[Index].SetParent(parent) + self.LoadElementListBox2(parent.Children[Index], ElementValue, parent) + elif Type == "listboxex": + parent.Children[Index] = ListBoxEx() + parent.Children[Index].SetParent(parent) + self.LoadElementListBoxEx(parent.Children[Index], ElementValue, parent) + + else: + Index += 1 + continue + + parent.Children[Index].SetWindowName(Name) + if 0 != self.InsertFunction: + self.InsertFunction(Name, parent.Children[Index]) + + self.LoadChildren(parent.Children[Index], ElementValue) + Index += 1 + + def CheckKeyList(self, name, value, key_list): + + for DataKey in key_list: + if False == value.has_key(DataKey): + print "Failed to find data key", "[" + name + "/" + DataKey + "]" + return False + + return True + + def LoadDefaultData(self, window, value, parentWindow): + loc_x = int(value["x"]) + loc_y = int(value["y"]) + if value.has_key("vertical_align"): + if "center" == value["vertical_align"]: + window.SetWindowVerticalAlignCenter() + elif "bottom" == value["vertical_align"]: + window.SetWindowVerticalAlignBottom() + + if parentWindow.IsRTL(): + loc_x = int(value["x"]) + window.GetWidth() + if value.has_key("horizontal_align"): + if "center" == value["horizontal_align"]: + window.SetWindowHorizontalAlignCenter() + loc_x = - int(value["x"]) + elif "right" == value["horizontal_align"]: + window.SetWindowHorizontalAlignLeft() + loc_x = int(value["x"]) - window.GetWidth() + ## loc_x = parentWindow.GetWidth() - int(value["x"]) + window.GetWidth() + else: + window.SetWindowHorizontalAlignRight() + + if value.has_key("all_align"): + window.SetWindowVerticalAlignCenter() + window.SetWindowHorizontalAlignCenter() + loc_x = - int(value["x"]) + else: + if value.has_key("horizontal_align"): + if "center" == value["horizontal_align"]: + window.SetWindowHorizontalAlignCenter() + elif "right" == value["horizontal_align"]: + window.SetWindowHorizontalAlignRight() + + window.SetPosition(loc_x, loc_y) + window.Show() + + ## Window + def LoadElementWindow(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.WINDOW_KEY_LIST): + return False + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Button + def LoadElementButton(self, window, value, parentWindow): + + if value.has_key("width") and value.has_key("height"): + window.SetSize(int(value["width"]), int(value["height"])) + + if True == value.has_key("default_image"): + window.SetUpVisual(value["default_image"]) + if True == value.has_key("over_image"): + window.SetOverVisual(value["over_image"]) + if True == value.has_key("down_image"): + window.SetDownVisual(value["down_image"]) + if True == value.has_key("disable_image"): + window.SetDisableVisual(value["disable_image"]) + + if True == value.has_key("text"): + if True == value.has_key("text_height"): + window.SetText(value["text"], value["text_height"]) + else: + window.SetText(value["text"]) + + if value.has_key("text_color"): + window.SetTextColor(value["text_color"]) + + if True == value.has_key("tooltip_text"): + if True == value.has_key("tooltip_x") and True == value.has_key("tooltip_y"): + window.SetToolTipText(value["tooltip_text"], int(value["tooltip_x"]), int(value["tooltip_y"])) + else: + window.SetToolTipText(value["tooltip_text"]) + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Mark + def LoadElementMark(self, window, value, parentWindow): + + #if False == self.CheckKeyList(value["name"], value, self.MARK_KEY_LIST): + # return False + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Image + def LoadElementImage(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.IMAGE_KEY_LIST): + return False + + window.LoadImage(value["image"]) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## AniImage + def LoadElementAniImage(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.ANI_IMAGE_KEY_LIST): + return False + + if True == value.has_key("delay"): + window.SetDelay(value["delay"]) + + for image in value["images"]: + window.AppendImage(image) + + if value.has_key("width") and value.has_key("height"): + window.SetSize(value["width"], value["height"]) + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Expanded Image + def LoadElementExpandedImage(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.EXPANDED_IMAGE_KEY_LIST): + return False + + window.LoadImage(value["image"]) + + if True == value.has_key("x_origin") and True == value.has_key("y_origin"): + window.SetOrigin(float(value["x_origin"]), float(value["y_origin"])) + + if True == value.has_key("x_scale") and True == value.has_key("y_scale"): + window.SetScale(float(value["x_scale"]), float(value["y_scale"])) + + if True == value.has_key("rect"): + RenderingRect = value["rect"] + window.SetRenderingRect(RenderingRect[0], RenderingRect[1], RenderingRect[2], RenderingRect[3]) + + if True == value.has_key("mode"): + mode = value["mode"] + if "MODULATE" == mode: + window.SetRenderingMode(wndMgr.RENDERING_MODE_MODULATE) + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Slot + def LoadElementSlot(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.SLOT_KEY_LIST): + return False + + global_x = int(value["x"]) + global_y = int(value["y"]) + global_width = int(value["width"]) + global_height = int(value["height"]) + + window.SetPosition(global_x, global_y) + window.SetSize(global_width, global_height) + window.Show() + + r = 1.0 + g = 1.0 + b = 1.0 + a = 1.0 + + if True == value.has_key("image_r") and \ + True == value.has_key("image_g") and \ + True == value.has_key("image_b") and \ + True == value.has_key("image_a"): + r = float(value["image_r"]) + g = float(value["image_g"]) + b = float(value["image_b"]) + a = float(value["image_a"]) + + SLOT_ONE_KEY_LIST = ("index", "x", "y", "width", "height") + + for slot in value["slot"]: + if True == self.CheckKeyList(value["name"] + " - one", slot, SLOT_ONE_KEY_LIST): + wndMgr.AppendSlot(window.hWnd, + int(slot["index"]), + int(slot["x"]), + int(slot["y"]), + int(slot["width"]), + int(slot["height"])) + + if True == value.has_key("image"): + wndMgr.SetSlotBaseImage(window.hWnd, + value["image"], + r, g, b, a) + + return True + + def LoadElementCandidateList(self, window, value, parentWindow): + if False == self.CheckKeyList(value["name"], value, self.CANDIDATE_LIST_KEY_LIST): + return False + + window.SetPosition(int(value["x"]), int(value["y"])) + window.SetItemSize(int(value["item_xsize"]), int(value["item_ysize"])) + window.SetItemStep(int(value["item_step"])) + window.Show() + + return True + + ## Table + def LoadElementGridTable(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.GRID_TABLE_KEY_LIST): + return False + + xBlank = 0 + yBlank = 0 + if True == value.has_key("x_blank"): + xBlank = int(value["x_blank"]) + if True == value.has_key("y_blank"): + yBlank = int(value["y_blank"]) + + if localeInfo.IsARABIC(): + pass + else: + window.SetPosition(int(value["x"]), int(value["y"])) + + window.ArrangeSlot( int(value["start_index"]), + int(value["x_count"]), + int(value["y_count"]), + int(value["x_step"]), + int(value["y_step"]), + xBlank, + yBlank) + if True == value.has_key("image"): + r = 1.0 + g = 1.0 + b = 1.0 + a = 1.0 + if True == value.has_key("image_r") and \ + True == value.has_key("image_g") and \ + True == value.has_key("image_b") and \ + True == value.has_key("image_a"): + r = float(value["image_r"]) + g = float(value["image_g"]) + b = float(value["image_b"]) + a = float(value["image_a"]) + wndMgr.SetSlotBaseImage(window.hWnd, value["image"], r, g, b, a) + + if True == value.has_key("style"): + if "select" == value["style"]: + wndMgr.SetSlotStyle(window.hWnd, wndMgr.SLOT_STYLE_SELECT) + if localeInfo.IsARABIC(): + self.LoadDefaultData(window, value, parentWindow) + else: + window.Show() + + return True + + ## Text + def LoadElementText(self, window, value, parentWindow): + + if value.has_key("fontsize"): + fontSize = value["fontsize"] + + if "LARGE" == fontSize: + window.SetFontName(localeInfo.UI_DEF_FONT_LARGE) + + elif value.has_key("fontname"): + fontName = value["fontname"] + window.SetFontName(fontName) + + if value.has_key("text_horizontal_align"): + if "left" == value["text_horizontal_align"]: + window.SetHorizontalAlignLeft() + elif "center" == value["text_horizontal_align"]: + window.SetHorizontalAlignCenter() + elif "right" == value["text_horizontal_align"]: + window.SetHorizontalAlignRight() + + if value.has_key("text_vertical_align"): + if "top" == value["text_vertical_align"]: + window.SetVerticalAlignTop() + elif "center" == value["text_vertical_align"]: + window.SetVerticalAlignCenter() + elif "bottom" == value["text_vertical_align"]: + window.SetVerticalAlignBottom() + + if value.has_key("all_align"): + window.SetHorizontalAlignCenter() + window.SetVerticalAlignCenter() + window.SetWindowHorizontalAlignCenter() + window.SetWindowVerticalAlignCenter() + + if value.has_key("r") and value.has_key("g") and value.has_key("b"): + window.SetFontColor(float(value["r"]), float(value["g"]), float(value["b"])) + elif value.has_key("color"): + window.SetPackedFontColor(value["color"]) + else: + window.SetFontColor(0.8549, 0.8549, 0.8549) + + if value.has_key("outline"): + if value["outline"]: + window.SetOutline() + if True == value.has_key("text"): + window.SetText(value["text"]) + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## EditLine + def LoadElementEditLine(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.EDIT_LINE_KEY_LIST): + return False + + + if value.has_key("secret_flag"): + window.SetSecret(value["secret_flag"]) + if value.has_key("with_codepage"): + if value["with_codepage"]: + window.bCodePage = True + if value.has_key("only_number"): + if value["only_number"]: + window.SetNumberMode() + if value.has_key("enable_codepage"): + window.SetIMEFlag(value["enable_codepage"]) + if value.has_key("enable_ime"): + window.SetIMEFlag(value["enable_ime"]) + if value.has_key("limit_width"): + window.SetLimitWidth(value["limit_width"]) + if value.has_key("multi_line"): + if value["multi_line"]: + window.SetMultiLine() + + window.SetMax(int(value["input_limit"])) + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadElementText(window, value, parentWindow) + + return True + + ## TitleBar + def LoadElementTitleBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.TITLE_BAR_KEY_LIST): + return False + + window.MakeTitleBar(int(value["width"]), value.get("color", "red")) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## HorizontalBar + def LoadElementHorizontalBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.HORIZONTAL_BAR_KEY_LIST): + return False + + window.Create(int(value["width"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Board + def LoadElementBoard(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.BOARD_KEY_LIST): + return False + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Board With TitleBar + def LoadElementBoardWithTitleBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.BOARD_WITH_TITLEBAR_KEY_LIST): + return False + + window.SetSize(int(value["width"]), int(value["height"])) + window.SetTitleName(value["title"]) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## ThinBoard + def LoadElementThinBoard(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.BOARD_KEY_LIST): + return False + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Box + def LoadElementBox(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.BOX_KEY_LIST): + return False + + if True == value.has_key("color"): + window.SetColor(value["color"]) + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Bar + def LoadElementBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.BAR_KEY_LIST): + return False + + if True == value.has_key("color"): + window.SetColor(value["color"]) + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Line + def LoadElementLine(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.LINE_KEY_LIST): + return False + + if True == value.has_key("color"): + window.SetColor(value["color"]) + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Slot + def LoadElementSlotBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.SLOTBAR_KEY_LIST): + return False + + window.SetSize(int(value["width"]), int(value["height"])) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## Gauge + def LoadElementGauge(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.GAUGE_KEY_LIST): + return False + + window.MakeGauge(value["width"], value["color"]) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## ScrollBar + def LoadElementScrollBar(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.SCROLLBAR_KEY_LIST): + return False + + window.SetScrollBarSize(value["size"]) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## SliderBar + def LoadElementSliderBar(self, window, value, parentWindow): + + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## ListBox + def LoadElementListBox(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.LIST_BOX_KEY_LIST): + return False + + if value.has_key("item_align"): + window.SetTextCenterAlign(value["item_align"]) + + window.SetSize(value["width"], value["height"]) + self.LoadDefaultData(window, value, parentWindow) + + return True + + ## ListBox2 + def LoadElementListBox2(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.LIST_BOX_KEY_LIST): + return False + + window.SetRowCount(value.get("row_count", 10)) + window.SetSize(value["width"], value["height"]) + self.LoadDefaultData(window, value, parentWindow) + + if value.has_key("item_align"): + window.SetTextCenterAlign(value["item_align"]) + + return True + def LoadElementListBoxEx(self, window, value, parentWindow): + + if False == self.CheckKeyList(value["name"], value, self.LIST_BOX_KEY_LIST): + return False + + window.SetSize(value["width"], value["height"]) + self.LoadDefaultData(window, value, parentWindow) + + if value.has_key("itemsize_x") and value.has_key("itemsize_y"): + window.SetItemSize(int(value["itemsize_x"]), int(value["itemsize_y"])) + + if value.has_key("itemstep"): + window.SetItemStep(int(value["itemstep"])) + + if value.has_key("viewcount"): + window.SetViewItemCount(int(value["viewcount"])) + + return True + +class ReadingWnd(Bar): + + def __init__(self): + Bar.__init__(self,"TOP_MOST") + + self.__BuildText() + self.SetSize(80, 19) + self.Show() + + def __del__(self): + Bar.__del__(self) + + def __BuildText(self): + self.text = TextLine() + self.text.SetParent(self) + self.text.SetPosition(4, 3) + self.text.Show() + + def SetText(self, text): + self.text.SetText(text) + + def SetReadingPosition(self, x, y): + xPos = x + 2 + yPos = y - self.GetHeight() - 2 + self.SetPosition(xPos, yPos) + + def SetTextColor(self, color): + self.text.SetPackedFontColor(color) + + +def MakeSlotBar(parent, x, y, width, height): + slotBar = SlotBar() + slotBar.SetParent(parent) + slotBar.SetSize(width, height) + slotBar.SetPosition(x, y) + slotBar.Show() + return slotBar + +def MakeImageBox(parent, name, x, y): + image = ImageBox() + image.SetParent(parent) + image.LoadImage(name) + image.SetPosition(x, y) + image.Show() + return image + +def MakeTextLine(parent): + textLine = TextLine() + textLine.SetParent(parent) + textLine.SetWindowHorizontalAlignCenter() + textLine.SetWindowVerticalAlignCenter() + textLine.SetHorizontalAlignCenter() + textLine.SetVerticalAlignCenter() + textLine.Show() + return textLine + +def MakeButton(parent, x, y, tooltipText, path, up, over, down): + button = Button() + button.SetParent(parent) + button.SetPosition(x, y) + button.SetUpVisual(path + up) + button.SetOverVisual(path + over) + button.SetDownVisual(path + down) + button.SetToolTipText(tooltipText) + button.Show() + return button + +def RenderRoundBox(x, y, width, height, color): + grp.SetColor(color) + grp.RenderLine(x+2, y, width-3, 0) + grp.RenderLine(x+2, y+height, width-3, 0) + grp.RenderLine(x, y+2, 0, height-4) + grp.RenderLine(x+width, y+1, 0, height-3) + grp.RenderLine(x, y+2, 2, -2) + grp.RenderLine(x, y+height-2, 2, 2) + grp.RenderLine(x+width-2, y, 2, 2) + grp.RenderLine(x+width-2, y+height, 2, -2) + +def GenerateColor(r, g, b): + r = float(r) / 255.0 + g = float(g) / 255.0 + b = float(b) / 255.0 + return grp.GenerateColor(r, g, b, 1.0) + +def EnablePaste(flag): + ime.EnablePaste(flag) + +def GetHyperlink(): + return wndMgr.GetHyperlink() + +RegisterToolTipWindow("TEXT", TextLine) diff --git a/root/uiaffectshower.py b/root/uiaffectshower.py new file mode 100644 index 0000000..2d1ad67 --- /dev/null +++ b/root/uiaffectshower.py @@ -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 + diff --git a/root/uiattachmetin.py b/root/uiattachmetin.py new file mode 100644 index 0000000..96b20c3 --- /dev/null +++ b/root/uiattachmetin.py @@ -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() diff --git a/root/uiauction.py b/root/uiauction.py new file mode 100644 index 0000000..8e281d3 --- /dev/null +++ b/root/uiauction.py @@ -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]) diff --git a/root/uiautoban.py b/root/uiautoban.py new file mode 100644 index 0000000..2a95dd2 --- /dev/null +++ b/root/uiautoban.py @@ -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() diff --git a/root/uicandidate.py b/root/uicandidate.py new file mode 100644 index 0000000..c275ed9 --- /dev/null +++ b/root/uicandidate.py @@ -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) diff --git a/root/uicharacter.py b/root/uicharacter.py new file mode 100644 index 0000000..0e6b92c --- /dev/null +++ b/root/uicharacter.py @@ -0,0 +1,1236 @@ +import ui +import uiScriptLocale +import app +import net +import dbg +import snd +import player +import mouseModule +import wndMgr +import skill +import playerSettingModule +import quest +import localeInfo +import uiToolTip +import constInfo +import emotion +import chr + +SHOW_ONLY_ACTIVE_SKILL = False +SHOW_LIMIT_SUPPORT_SKILL_LIST = [] +HIDE_SUPPORT_SKILL_POINT = False + +if localeInfo.IsYMIR(): + SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139, 140,141,142] + if not localeInfo.IsCHEONMA(): + HIDE_SUPPORT_SKILL_POINT = True + SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139, 140,141,142] +elif localeInfo.IsJAPAN() or (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"): + HIDE_SUPPORT_SKILL_POINT = True + SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139, 140] +else: + HIDE_SUPPORT_SKILL_POINT = True + +FACE_IMAGE_DICT = { + playerSettingModule.RACE_WARRIOR_M : "icon/face/warrior_m.tga", + playerSettingModule.RACE_WARRIOR_W : "icon/face/warrior_w.tga", + playerSettingModule.RACE_ASSASSIN_M : "icon/face/assassin_m.tga", + playerSettingModule.RACE_ASSASSIN_W : "icon/face/assassin_w.tga", + playerSettingModule.RACE_SURA_M : "icon/face/sura_m.tga", + playerSettingModule.RACE_SURA_W : "icon/face/sura_w.tga", + playerSettingModule.RACE_SHAMAN_M : "icon/face/shaman_m.tga", + playerSettingModule.RACE_SHAMAN_W : "icon/face/shaman_w.tga", +} +def unsigned32(n): + return n & 0xFFFFFFFFL + +class CharacterWindow(ui.ScriptWindow): + + ACTIVE_PAGE_SLOT_COUNT = 8 + SUPPORT_PAGE_SLOT_COUNT = 12 + + PAGE_SLOT_COUNT = 12 + PAGE_HORSE = 2 + + SKILL_GROUP_NAME_DICT = { + playerSettingModule.JOB_WARRIOR : { 1 : localeInfo.SKILL_GROUP_WARRIOR_1, 2 : localeInfo.SKILL_GROUP_WARRIOR_2, }, + playerSettingModule.JOB_ASSASSIN : { 1 : localeInfo.SKILL_GROUP_ASSASSIN_1, 2 : localeInfo.SKILL_GROUP_ASSASSIN_2, }, + playerSettingModule.JOB_SURA : { 1 : localeInfo.SKILL_GROUP_SURA_1, 2 : localeInfo.SKILL_GROUP_SURA_2, }, + playerSettingModule.JOB_SHAMAN : { 1 : localeInfo.SKILL_GROUP_SHAMAN_1, 2 : localeInfo.SKILL_GROUP_SHAMAN_2, }, + } + + STAT_DESCRIPTION = { + "HTH" : localeInfo.STAT_TOOLTIP_CON, + "INT" : localeInfo.STAT_TOOLTIP_INT, + "STR" : localeInfo.STAT_TOOLTIP_STR, + "DEX" : localeInfo.STAT_TOOLTIP_DEX, + } + + + STAT_MINUS_DESCRIPTION = localeInfo.STAT_MINUS_DESCRIPTION + + def __init__(self): + ui.ScriptWindow.__init__(self) + self.state = "STATUS" + self.isLoaded = 0 + + self.toolTipSkill = 0 + + self.__Initialize() + self.__LoadWindow() + + self.statusPlusCommandDict={ + "HTH" : "/stat ht", + "INT" : "/stat iq", + "STR" : "/stat st", + "DEX" : "/stat dx", + } + + self.statusMinusCommandDict={ + "HTH-" : "/stat- ht", + "INT-" : "/stat- iq", + "STR-" : "/stat- st", + "DEX-" : "/stat- dx", + } + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def __Initialize(self): + self.refreshToolTip = 0 + self.curSelectedSkillGroup = 0 + self.canUseHorseSkill = -1 + + self.toolTip = None + self.toolTipJob = None + self.toolTipAlignment = None + self.toolTipSkill = None + + self.faceImage = None + self.statusPlusLabel = None + self.statusPlusValue = None + self.activeSlot = None + self.tabDict = None + self.tabButtonDict = None + self.pageDict = None + self.titleBarDict = None + self.statusPlusButtonDict = None + self.statusMinusButtonDict = None + + self.skillPageDict = None + self.questShowingStartIndex = 0 + self.questScrollBar = None + self.questSlot = None + self.questNameList = None + self.questLastTimeList = None + self.questLastCountList = None + self.skillGroupButton = () + + self.activeSlot = None + self.activeSkillPointValue = None + self.supportSkillPointValue = None + self.skillGroupButton1 = None + self.skillGroupButton2 = None + self.activeSkillGroupName = None + + self.guildNameSlot = None + self.guildNameValue = None + self.characterNameSlot = None + self.characterNameValue = None + + self.emotionToolTip = None + self.soloEmotionSlot = None + self.dualEmotionSlot = None + + def Show(self): + self.__LoadWindow() + + ui.ScriptWindow.Show(self) + + def __LoadScript(self, fileName): + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, fileName) + + def __BindObject(self): + self.toolTip = uiToolTip.ToolTip() + self.toolTipJob = uiToolTip.ToolTip() + self.toolTipAlignment = uiToolTip.ToolTip(130) + + self.faceImage = self.GetChild("Face_Image") + + faceSlot=self.GetChild("Face_Slot") + if 949 == app.GetDefaultCodePage(): + faceSlot.SAFE_SetStringEvent("MOUSE_OVER_IN", self.__ShowJobToolTip) + faceSlot.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.__HideJobToolTip) + + self.statusPlusLabel = self.GetChild("Status_Plus_Label") + self.statusPlusValue = self.GetChild("Status_Plus_Value") + + self.characterNameSlot = self.GetChild("Character_Name_Slot") + self.characterNameValue = self.GetChild("Character_Name") + self.guildNameSlot = self.GetChild("Guild_Name_Slot") + self.guildNameValue = self.GetChild("Guild_Name") + self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_IN", self.__ShowAlignmentToolTip) + self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.__HideAlignmentToolTip) + + self.activeSlot = self.GetChild("Skill_Active_Slot") + self.activeSkillPointValue = self.GetChild("Active_Skill_Point_Value") + self.supportSkillPointValue = self.GetChild("Support_Skill_Point_Value") + self.skillGroupButton1 = self.GetChild("Skill_Group_Button_1") + self.skillGroupButton2 = self.GetChild("Skill_Group_Button_2") + self.activeSkillGroupName = self.GetChild("Active_Skill_Group_Name") + + self.tabDict = { + "STATUS" : self.GetChild("Tab_01"), + "SKILL" : self.GetChild("Tab_02"), + "EMOTICON" : self.GetChild("Tab_03"), + "QUEST" : self.GetChild("Tab_04"), + } + + self.tabButtonDict = { + "STATUS" : self.GetChild("Tab_Button_01"), + "SKILL" : self.GetChild("Tab_Button_02"), + "EMOTICON" : self.GetChild("Tab_Button_03"), + "QUEST" : self.GetChild("Tab_Button_04") + } + + self.pageDict = { + "STATUS" : self.GetChild("Character_Page"), + "SKILL" : self.GetChild("Skill_Page"), + "EMOTICON" : self.GetChild("Emoticon_Page"), + "QUEST" : self.GetChild("Quest_Page") + } + + self.titleBarDict = { + "STATUS" : self.GetChild("Character_TitleBar"), + "SKILL" : self.GetChild("Skill_TitleBar"), + "EMOTICON" : self.GetChild("Emoticon_TitleBar"), + "QUEST" : self.GetChild("Quest_TitleBar") + } + + self.statusPlusButtonDict = { + "HTH" : self.GetChild("HTH_Plus"), + "INT" : self.GetChild("INT_Plus"), + "STR" : self.GetChild("STR_Plus"), + "DEX" : self.GetChild("DEX_Plus"), + } + + self.statusMinusButtonDict = { + "HTH-" : self.GetChild("HTH_Minus"), + "INT-" : self.GetChild("INT_Minus"), + "STR-" : self.GetChild("STR_Minus"), + "DEX-" : self.GetChild("DEX_Minus"), + } + + self.skillPageDict = { + "ACTIVE" : self.GetChild("Skill_Active_Slot"), + "SUPPORT" : self.GetChild("Skill_ETC_Slot"), + "HORSE" : self.GetChild("Skill_Active_Slot"), + } + + self.skillPageStatDict = { + "SUPPORT" : player.SKILL_SUPPORT, + "ACTIVE" : player.SKILL_ACTIVE, + "HORSE" : player.SKILL_HORSE, + } + + self.skillGroupButton = ( + self.GetChild("Skill_Group_Button_1"), + self.GetChild("Skill_Group_Button_2"), + ) + + + global SHOW_ONLY_ACTIVE_SKILL + global HIDE_SUPPORT_SKILL_POINT + if SHOW_ONLY_ACTIVE_SKILL or HIDE_SUPPORT_SKILL_POINT: + self.GetChild("Support_Skill_Point_Label").Hide() + + self.soloEmotionSlot = self.GetChild("SoloEmotionSlot") + self.dualEmotionSlot = self.GetChild("DualEmotionSlot") + self.__SetEmotionSlot() + + self.questShowingStartIndex = 0 + self.questScrollBar = self.GetChild("Quest_ScrollBar") + self.questScrollBar.SetScrollEvent(ui.__mem_func__(self.OnQuestScroll)) + self.questSlot = self.GetChild("Quest_Slot") + for i in xrange(quest.QUEST_MAX_NUM): + self.questSlot.HideSlotBaseImage(i) + self.questSlot.SetCoverButton(i,\ + "d:/ymir work/ui/game/quest/slot_button_01.sub",\ + "d:/ymir work/ui/game/quest/slot_button_02.sub",\ + "d:/ymir work/ui/game/quest/slot_button_03.sub",\ + "d:/ymir work/ui/game/quest/slot_button_03.sub", True) + + self.questNameList = [] + self.questLastTimeList = [] + self.questLastCountList = [] + for i in xrange(quest.QUEST_MAX_NUM): + self.questNameList.append(self.GetChild("Quest_Name_0" + str(i))) + self.questLastTimeList.append(self.GetChild("Quest_LastTime_0" + str(i))) + self.questLastCountList.append(self.GetChild("Quest_LastCount_0" + str(i))) + + def __SetSkillSlotEvent(self): + for skillPageValue in self.skillPageDict.itervalues(): + skillPageValue.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + skillPageValue.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectSkill)) + skillPageValue.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot)) + skillPageValue.SetUnselectItemSlotEvent(ui.__mem_func__(self.ClickSkillSlot)) + skillPageValue.SetUseSlotEvent(ui.__mem_func__(self.ClickSkillSlot)) + skillPageValue.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) + skillPageValue.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + skillPageValue.SetPressedSlotButtonEvent(ui.__mem_func__(self.OnPressedSlotButton)) + skillPageValue.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_over.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_down.sub") + + def __SetEmotionSlot(self): + + self.emotionToolTip = uiToolTip.ToolTip() + + for slot in (self.soloEmotionSlot, self.dualEmotionSlot): + slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + slot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectEmotion)) + slot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot)) + slot.SetUseSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot)) + slot.SetOverInItemEvent(ui.__mem_func__(self.__OverInEmotion)) + slot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutEmotion)) + slot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_over.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_down.sub") + + for slotIdx, datadict in emotion.EMOTION_DICT.items(): + emotionIdx = slotIdx + + slot = self.soloEmotionSlot + if slotIdx > 50: + slot = self.dualEmotionSlot + + slot.SetEmotionSlot(slotIdx, emotionIdx) + slot.SetCoverButton(slotIdx) + + def __SelectEmotion(self, slotIndex): + if not slotIndex in emotion.EMOTION_DICT: + return + + if app.IsPressed(app.DIK_LCONTROL): + player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_EMOTION, slotIndex) + return + + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EMOTION, slotIndex, slotIndex) + + def __ClickEmotionSlot(self, slotIndex): + print "click emotion" + if not slotIndex in emotion.EMOTION_DICT: + return + + print "check acting" + if player.IsActingEmotion(): + return + + command = emotion.EMOTION_DICT[slotIndex]["command"] + print "command", command + + if slotIndex > 50: + vid = player.GetTargetVID() + + if 0 == vid or vid == player.GetMainCharacterIndex() or chr.IsNPC(vid) or chr.IsEnemy(vid): + import chat + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.EMOTION_CHOOSE_ONE) + return + + command += " " + chr.GetNameByVID(vid) + + print "send_command", command + net.SendChatPacket(command) + + def ActEmotion(self, emotionIndex): + self.__ClickEmotionSlot(emotionIndex) + + def __OverInEmotion(self, slotIndex): + if self.emotionToolTip: + + if not slotIndex in emotion.EMOTION_DICT: + return + + self.emotionToolTip.ClearToolTip() + self.emotionToolTip.SetTitle(emotion.EMOTION_DICT[slotIndex]["name"]) + self.emotionToolTip.AlignHorizonalCenter() + self.emotionToolTip.ShowToolTip() + + def __OverOutEmotion(self): + if self.emotionToolTip: + self.emotionToolTip.HideToolTip() + + def __BindEvent(self): + for i in xrange(len(self.skillGroupButton)): + self.skillGroupButton[i].SetEvent(lambda arg=i: self.__SelectSkillGroup(arg)) + + self.RefreshQuest() + self.__HideJobToolTip() + + for (tabKey, tabButton) in self.tabButtonDict.items(): + tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey) + + for (statusPlusKey, statusPlusButton) in self.statusPlusButtonDict.items(): + statusPlusButton.SAFE_SetEvent(self.__OnClickStatusPlusButton, statusPlusKey) + statusPlusButton.ShowToolTip = lambda arg=statusPlusKey: self.__OverInStatButton(arg) + statusPlusButton.HideToolTip = lambda arg=statusPlusKey: self.__OverOutStatButton() + + for (statusMinusKey, statusMinusButton) in self.statusMinusButtonDict.items(): + statusMinusButton.SAFE_SetEvent(self.__OnClickStatusMinusButton, statusMinusKey) + statusMinusButton.ShowToolTip = lambda arg=statusMinusKey: self.__OverInStatMinusButton(arg) + statusMinusButton.HideToolTip = lambda arg=statusMinusKey: self.__OverOutStatMinusButton() + + for titleBarValue in self.titleBarDict.itervalues(): + titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide)) + + self.questSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectQuest)) + + def __LoadWindow(self): + if self.isLoaded == 1: + return + + self.isLoaded = 1 + + try: + if localeInfo.IsARABIC() or localeInfo.IsVIETNAM() or localeInfo.IsJAPAN(): + self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "CharacterWindow.py") + else: + self.__LoadScript("UIScript/CharacterWindow.py") + + self.__BindObject() + self.__BindEvent() + except: + import exception + exception.Abort("CharacterWindow.__LoadWindow") + + #self.tabButtonDict["EMOTICON"].Disable() + self.SetState("STATUS") + + def Destroy(self): + self.ClearDictionary() + + self.__Initialize() + + def Close(self): + if 0 != self.toolTipSkill: + self.toolTipSkill.Hide() + + self.Hide() + + def SetSkillToolTip(self, toolTipSkill): + self.toolTipSkill = toolTipSkill + + def __OnClickStatusPlusButton(self, statusKey): + try: + statusPlusCommand=self.statusPlusCommandDict[statusKey] + net.SendChatPacket(statusPlusCommand) + except KeyError, msg: + dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg) + + def __OnClickStatusMinusButton(self, statusKey): + try: + statusMinusCommand=self.statusMinusCommandDict[statusKey] + net.SendChatPacket(statusMinusCommand) + except KeyError, msg: + dbg.TraceError("CharacterWindow.__OnClickStatusMinusButton KeyError: %s", msg) + + + def __OnClickTabButton(self, stateKey): + self.SetState(stateKey) + + def SetState(self, stateKey): + + self.state = stateKey + + for (tabKey, tabButton) in self.tabButtonDict.items(): + if stateKey!=tabKey: + tabButton.SetUp() + + for tabValue in self.tabDict.itervalues(): + tabValue.Hide() + + for pageValue in self.pageDict.itervalues(): + pageValue.Hide() + + for titleBarValue in self.titleBarDict.itervalues(): + titleBarValue.Hide() + + self.titleBarDict[stateKey].Show() + self.tabDict[stateKey].Show() + self.pageDict[stateKey].Show() + + + def GetState(self): + return self.state + + def __GetTotalAtkText(self): + minAtk=player.GetStatus(player.ATT_MIN) + maxAtk=player.GetStatus(player.ATT_MAX) + atkBonus=player.GetStatus(player.ATT_BONUS) + attackerBonus=player.GetStatus(player.ATTACKER_BONUS) + + if minAtk==maxAtk: + return "%d" % (minAtk+atkBonus+attackerBonus) + else: + return "%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus) + + def __GetTotalMagAtkText(self): + minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP) + maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP) + + if minMagAtk==maxMagAtk: + return "%d" % (minMagAtk) + else: + return "%d-%d" % (minMagAtk, maxMagAtk) + + def __GetTotalDefText(self): + defValue=player.GetStatus(player.DEF_GRADE) + if constInfo.ADD_DEF_BONUS_ENABLE: + defValue+=player.GetStatus(player.DEF_BONUS) + return "%d" % (defValue) + + def RefreshStatus(self): + if self.isLoaded==0: + return + + try: + self.GetChild("Level_Value").SetText(str(player.GetStatus(player.LEVEL))) + self.GetChild("Exp_Value").SetText(str(unsigned32(player.GetEXP()))) + self.GetChild("RestExp_Value").SetText(str(unsigned32(player.GetStatus(player.NEXT_EXP)) - unsigned32(player.GetStatus(player.EXP)))) + self.GetChild("HP_Value").SetText(str(player.GetStatus(player.HP)) + '/' + str(player.GetStatus(player.MAX_HP))) + self.GetChild("SP_Value").SetText(str(player.GetStatus(player.SP)) + '/' + str(player.GetStatus(player.MAX_SP))) + + self.GetChild("STR_Value").SetText(str(player.GetStatus(player.ST))) + self.GetChild("DEX_Value").SetText(str(player.GetStatus(player.DX))) + self.GetChild("HTH_Value").SetText(str(player.GetStatus(player.HT))) + self.GetChild("INT_Value").SetText(str(player.GetStatus(player.IQ))) + + self.GetChild("ATT_Value").SetText(self.__GetTotalAtkText()) + self.GetChild("DEF_Value").SetText(self.__GetTotalDefText()) + + self.GetChild("MATT_Value").SetText(self.__GetTotalMagAtkText()) + #self.GetChild("MATT_Value").SetText(str(player.GetStatus(player.MAG_ATT))) + + self.GetChild("MDEF_Value").SetText(str(player.GetStatus(player.MAG_DEF))) + self.GetChild("ASPD_Value").SetText(str(player.GetStatus(player.ATT_SPEED))) + self.GetChild("MSPD_Value").SetText(str(player.GetStatus(player.MOVING_SPEED))) + self.GetChild("CSPD_Value").SetText(str(player.GetStatus(player.CASTING_SPEED))) + self.GetChild("ER_Value").SetText(str(player.GetStatus(player.EVADE_RATE))) + + except: + #import exception + #exception.Abort("CharacterWindow.RefreshStatus.BindObject") + ## 霸烙捞 屁败 滚覆 + pass + + self.__RefreshStatusPlusButtonList() + self.__RefreshStatusMinusButtonList() + self.RefreshAlignment() + + if self.refreshToolTip: + self.refreshToolTip() + + def __RefreshStatusPlusButtonList(self): + if self.isLoaded==0: + return + + statusPlusPoint=player.GetStatus(player.STAT) + + if statusPlusPoint>0: + self.statusPlusValue.SetText(str(statusPlusPoint)) + self.statusPlusLabel.Show() + self.ShowStatusPlusButtonList() + else: + self.statusPlusValue.SetText(str(0)) + self.statusPlusLabel.Hide() + self.HideStatusPlusButtonList() + + def __RefreshStatusMinusButtonList(self): + if self.isLoaded==0: + return + + statusMinusPoint=self.__GetStatMinusPoint() + + if statusMinusPoint>0: + self.__ShowStatusMinusButtonList() + else: + self.__HideStatusMinusButtonList() + + def RefreshAlignment(self): + point, grade = player.GetAlignmentData() + + import colorInfo + COLOR_DICT = { 0 : colorInfo.TITLE_RGB_GOOD_4, + 1 : colorInfo.TITLE_RGB_GOOD_3, + 2 : colorInfo.TITLE_RGB_GOOD_2, + 3 : colorInfo.TITLE_RGB_GOOD_1, + 4 : colorInfo.TITLE_RGB_NORMAL, + 5 : colorInfo.TITLE_RGB_EVIL_1, + 6 : colorInfo.TITLE_RGB_EVIL_2, + 7 : colorInfo.TITLE_RGB_EVIL_3, + 8 : colorInfo.TITLE_RGB_EVIL_4, } + colorList = COLOR_DICT.get(grade, colorInfo.TITLE_RGB_NORMAL) + gradeColor = ui.GenerateColor(colorList[0], colorList[1], colorList[2]) + + self.toolTipAlignment.ClearToolTip() + self.toolTipAlignment.AutoAppendTextLine(localeInfo.TITLE_NAME_LIST[grade], gradeColor) + self.toolTipAlignment.AutoAppendTextLine(localeInfo.ALIGNMENT_NAME + str(point)) + self.toolTipAlignment.AlignHorizonalCenter() + + def __ShowStatusMinusButtonList(self): + for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items(): + statusMinusButton.Show() + + def __HideStatusMinusButtonList(self): + for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items(): + statusMinusButton.Hide() + + def ShowStatusPlusButtonList(self): + for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items(): + statusPlusButton.Show() + + def HideStatusPlusButtonList(self): + for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items(): + statusPlusButton.Hide() + + def SelectSkill(self, skillSlotIndex): + + mouseController = mouseModule.mouseController + + if False == mouseController.isAttached(): + + srcSlotIndex = self.__RealSkillSlotToSourceSlot(skillSlotIndex) + selectedSkillIndex = player.GetSkillIndex(srcSlotIndex) + + if skill.CanUseSkill(selectedSkillIndex): + + if app.IsPressed(app.DIK_LCONTROL): + + player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, srcSlotIndex) + return + + mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, srcSlotIndex, selectedSkillIndex) + + else: + + mouseController.DeattachObject() + + def SelectEmptySlot(self, SlotIndex): + mouseModule.mouseController.DeattachObject() + + ## ToolTip + def OverInItem(self, slotNumber): + + if mouseModule.mouseController.isAttached(): + return + + if 0 == self.toolTipSkill: + return + + srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber) + skillIndex = player.GetSkillIndex(srcSlotIndex) + skillLevel = player.GetSkillLevel(srcSlotIndex) + skillGrade = player.GetSkillGrade(srcSlotIndex) + skillType = skill.GetSkillType(skillIndex) + + ## ACTIVE + if skill.SKILL_TYPE_ACTIVE == skillType: + overInSkillGrade = self.__GetSkillGradeFromSlot(slotNumber) + + if overInSkillGrade == skill.SKILL_GRADE_COUNT-1 and skillGrade == skill.SKILL_GRADE_COUNT: + self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel) + elif overInSkillGrade == skillGrade: + self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, overInSkillGrade, skillLevel) + else: + self.toolTipSkill.SetSkillOnlyName(srcSlotIndex, skillIndex, overInSkillGrade) + + else: + self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel) + + def OverOutItem(self): + if 0 != self.toolTipSkill: + self.toolTipSkill.HideToolTip() + + ## Quest + def __SelectQuest(self, slotIndex): + questIndex = quest.GetQuestIndex(self.questShowingStartIndex+slotIndex) + + import event + event.QuestButtonClick(-2147483648 + questIndex) + + def RefreshQuest(self): + + if self.isLoaded==0: + return + + questCount = quest.GetQuestCount() + questRange = range(quest.QUEST_MAX_NUM) + + if questCount > quest.QUEST_MAX_NUM: + self.questScrollBar.Show() + else: + self.questScrollBar.Hide() + + for i in questRange[:questCount]: + (questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i) + + self.questNameList[i].SetText(questName) + self.questNameList[i].Show() + self.questLastCountList[i].Show() + self.questLastTimeList[i].Show() + + if len(questCounterName) > 0: + self.questLastCountList[i].SetText("%s : %d" % (questCounterName, questCounterValue)) + else: + self.questLastCountList[i].SetText("") + + ## Icon + self.questSlot.SetSlot(i, i, 1, 1, questIcon) + + for i in questRange[questCount:]: + self.questNameList[i].Hide() + self.questLastTimeList[i].Hide() + self.questLastCountList[i].Hide() + self.questSlot.ClearSlot(i) + self.questSlot.HideSlotBaseImage(i) + + self.__UpdateQuestClock() + + def __UpdateQuestClock(self): + if "QUEST" == self.state: + # QUEST_LIMIT_COUNT_BUG_FIX + for i in xrange(min(quest.GetQuestCount(), quest.QUEST_MAX_NUM)): + # END_OF_QUEST_LIMIT_COUNT_BUG_FIX + (lastName, lastTime) = quest.GetQuestLastTime(i) + + clockText = localeInfo.QUEST_UNLIMITED_TIME + if len(lastName) > 0: + + if lastTime <= 0: + clockText = localeInfo.QUEST_TIMEOVER + + else: + questLastMinute = lastTime / 60 + questLastSecond = lastTime % 60 + + clockText = lastName + " : " + + if questLastMinute > 0: + clockText += str(questLastMinute) + localeInfo.QUEST_MIN + if questLastSecond > 0: + clockText += " " + + if questLastSecond > 0: + clockText += str(questLastSecond) + localeInfo.QUEST_SEC + + self.questLastTimeList[i].SetText(clockText) + + def __GetStatMinusPoint(self): + POINT_STAT_RESET_COUNT = 112 + return player.GetStatus(POINT_STAT_RESET_COUNT) + + def __OverInStatMinusButton(self, stat): + try: + self.__ShowStatToolTip(self.STAT_MINUS_DESCRIPTION[stat] % self.__GetStatMinusPoint()) + except KeyError: + pass + + self.refreshToolTip = lambda arg=stat: self.__OverInStatMinusButton(arg) + + def __OverOutStatMinusButton(self): + self.__HideStatToolTip() + self.refreshToolTip = 0 + + def __OverInStatButton(self, stat): + try: + self.__ShowStatToolTip(self.STAT_DESCRIPTION[stat]) + except KeyError: + pass + + def __OverOutStatButton(self): + self.__HideStatToolTip() + + def __ShowStatToolTip(self, statDesc): + self.toolTip.ClearToolTip() + self.toolTip.AppendTextLine(statDesc) + self.toolTip.Show() + + def __HideStatToolTip(self): + self.toolTip.Hide() + + def OnPressEscapeKey(self): + self.Close() + return True + + def OnUpdate(self): + self.__UpdateQuestClock() + + ## Skill Process + def __RefreshSkillPage(self, name, slotCount): + global SHOW_LIMIT_SUPPORT_SKILL_LIST + + skillPage = self.skillPageDict[name] + + startSlotIndex = skillPage.GetStartIndex() + if "ACTIVE" == name: + if self.PAGE_HORSE == self.curSelectedSkillGroup: + startSlotIndex += slotCount + + getSkillType=skill.GetSkillType + getSkillIndex=player.GetSkillIndex + getSkillGrade=player.GetSkillGrade + getSkillLevel=player.GetSkillLevel + getSkillLevelUpPoint=skill.GetSkillLevelUpPoint + getSkillMaxLevel=skill.GetSkillMaxLevel + for i in xrange(slotCount+1): + + slotIndex = i + startSlotIndex + skillIndex = getSkillIndex(slotIndex) + + for j in xrange(skill.SKILL_GRADE_COUNT): + skillPage.ClearSlot(self.__GetRealSkillSlot(j, i)) + + if 0 == skillIndex: + continue + + skillGrade = getSkillGrade(slotIndex) + skillLevel = getSkillLevel(slotIndex) + skillType = getSkillType(skillIndex) + + ## 铰付 胶懦 抗寇 贸府 + if player.SKILL_INDEX_RIDING == skillIndex: + if 1 == skillGrade: + skillLevel += 19 + elif 2 == skillGrade: + skillLevel += 29 + elif 3 == skillGrade: + skillLevel = 40 + + skillPage.SetSkillSlotNew(slotIndex, skillIndex, max(skillLevel-1, 0), skillLevel) + skillPage.SetSlotCount(slotIndex, skillLevel) + + ## ACTIVE + elif skill.SKILL_TYPE_ACTIVE == skillType: + for j in xrange(skill.SKILL_GRADE_COUNT): + realSlotIndex = self.__GetRealSkillSlot(j, slotIndex) + skillPage.SetSkillSlotNew(realSlotIndex, skillIndex, j, skillLevel) + skillPage.SetCoverButton(realSlotIndex) + + if (skillGrade == skill.SKILL_GRADE_COUNT) and j == (skill.SKILL_GRADE_COUNT-1): + skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) + elif (not self.__CanUseSkillNow()) or (skillGrade != j): + skillPage.SetSlotCount(realSlotIndex, 0) + skillPage.DisableCoverButton(realSlotIndex) + else: + skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) + + ## 弊寇 + else: + if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST: + realSlotIndex = self.__GetETCSkillRealSlotIndex(slotIndex) + skillPage.SetSkillSlot(realSlotIndex, skillIndex, skillLevel) + skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) + + if skill.CanUseSkill(skillIndex): + skillPage.SetCoverButton(realSlotIndex) + + skillPage.RefreshSlot() + + + def RefreshSkill(self): + + if self.isLoaded==0: + return + + if self.__IsChangedHorseRidingSkillLevel(): + self.RefreshCharacter() + return + + + global SHOW_ONLY_ACTIVE_SKILL + if SHOW_ONLY_ACTIVE_SKILL: + self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT) + else: + self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT) + self.__RefreshSkillPage("SUPPORT", self.SUPPORT_PAGE_SLOT_COUNT) + + self.RefreshSkillPlusButtonList() + + def CanShowPlusButton(self, skillIndex, skillLevel, curStatPoint): + + ## 胶懦捞 乐栏搁 + if 0 == skillIndex: + return False + + ## 饭骇诀 炼扒阑 父练茄促搁 + if not skill.CanLevelUpSkill(skillIndex, skillLevel): + return False + + return True + + def __RefreshSkillPlusButton(self, name): + global HIDE_SUPPORT_SKILL_POINT + if HIDE_SUPPORT_SKILL_POINT and "SUPPORT" == name: + return + + slotWindow = self.skillPageDict[name] + slotWindow.HideAllSlotButton() + + slotStatType = self.skillPageStatDict[name] + if 0 == slotStatType: + return + + statPoint = player.GetStatus(slotStatType) + startSlotIndex = slotWindow.GetStartIndex() + if "HORSE" == name: + startSlotIndex += self.ACTIVE_PAGE_SLOT_COUNT + + if statPoint > 0: + for i in xrange(self.PAGE_SLOT_COUNT): + slotIndex = i + startSlotIndex + skillIndex = player.GetSkillIndex(slotIndex) + skillGrade = player.GetSkillGrade(slotIndex) + skillLevel = player.GetSkillLevel(slotIndex) + + if skillIndex == 0: + continue + if skillGrade != 0: + continue + + if name == "HORSE": + if player.GetStatus(player.LEVEL) >= skill.GetSkillLevelLimit(skillIndex): + if skillLevel < 20: + slotWindow.ShowSlotButton(self.__GetETCSkillRealSlotIndex(slotIndex)) + + else: + if "SUPPORT" == name: + if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST: + if self.CanShowPlusButton(skillIndex, skillLevel, statPoint): + slotWindow.ShowSlotButton(slotIndex) + else: + if self.CanShowPlusButton(skillIndex, skillLevel, statPoint): + slotWindow.ShowSlotButton(slotIndex) + + + def RefreshSkillPlusButtonList(self): + + if self.isLoaded==0: + return + + self.RefreshSkillPlusPointLabel() + + if not self.__CanUseSkillNow(): + return + + try: + if self.PAGE_HORSE == self.curSelectedSkillGroup: + self.__RefreshSkillPlusButton("HORSE") + else: + self.__RefreshSkillPlusButton("ACTIVE") + + self.__RefreshSkillPlusButton("SUPPORT") + + except: + import exception + exception.Abort("CharacterWindow.RefreshSkillPlusButtonList.BindObject") + + def RefreshSkillPlusPointLabel(self): + if self.isLoaded==0: + return + + if self.PAGE_HORSE == self.curSelectedSkillGroup: + activeStatPoint = player.GetStatus(player.SKILL_HORSE) + self.activeSkillPointValue.SetText(str(activeStatPoint)) + + else: + activeStatPoint = player.GetStatus(player.SKILL_ACTIVE) + self.activeSkillPointValue.SetText(str(activeStatPoint)) + + supportStatPoint = max(0, player.GetStatus(player.SKILL_SUPPORT)) + self.supportSkillPointValue.SetText(str(supportStatPoint)) + + ## Skill Level Up Button + def OnPressedSlotButton(self, slotNumber): + srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber) + + skillIndex = player.GetSkillIndex(srcSlotIndex) + curLevel = player.GetSkillLevel(srcSlotIndex) + maxLevel = skill.GetSkillMaxLevel(skillIndex) + + net.SendChatPacket("/skillup " + str(skillIndex)) + + ## Use Skill + def ClickSkillSlot(self, slotIndex): + + srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotIndex) + skillIndex = player.GetSkillIndex(srcSlotIndex) + skillType = skill.GetSkillType(skillIndex) + + if not self.__CanUseSkillNow(): + if skill.SKILL_TYPE_ACTIVE == skillType: + return + + for slotWindow in self.skillPageDict.values(): + if slotWindow.HasSlot(slotIndex): + if skill.CanUseSkill(skillIndex): + player.ClickSkillSlot(srcSlotIndex) + return + + mouseModule.mouseController.DeattachObject() + + ## FIXME : 胶懦阑 荤侩沁阑锭 浇吩 锅龋甫 啊瘤绊 秦寸 浇吩阑 茫酒辑 诀单捞飘 茄促. + ## 概快 阂钦府. 备炼 磊眉甫 俺急秦具 且淀. + def OnUseSkill(self, slotIndex, coolTime): + + skillIndex = player.GetSkillIndex(slotIndex) + skillType = skill.GetSkillType(skillIndex) + + ## ACTIVE + if skill.SKILL_TYPE_ACTIVE == skillType: + skillGrade = player.GetSkillGrade(slotIndex) + slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) + ## ETC + else: + slotIndex = self.__GetETCSkillRealSlotIndex(slotIndex) + + for slotWindow in self.skillPageDict.values(): + if slotWindow.HasSlot(slotIndex): + slotWindow.SetSlotCoolTime(slotIndex, coolTime) + return + + def OnActivateSkill(self, slotIndex): + + skillGrade = player.GetSkillGrade(slotIndex) + slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) + + for slotWindow in self.skillPageDict.values(): + if slotWindow.HasSlot(slotIndex): + slotWindow.ActivateSlot(slotIndex) + return + + def OnDeactivateSkill(self, slotIndex): + + skillGrade = player.GetSkillGrade(slotIndex) + slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) + + for slotWindow in self.skillPageDict.values(): + if slotWindow.HasSlot(slotIndex): + slotWindow.DeactivateSlot(slotIndex) + return + + def __ShowJobToolTip(self): + self.toolTipJob.ShowToolTip() + + def __HideJobToolTip(self): + self.toolTipJob.HideToolTip() + + def __SetJobText(self, mainJob, subJob): + if player.GetStatus(player.LEVEL)<5: + subJob=0 + + if 949 == app.GetDefaultCodePage(): + self.toolTipJob.ClearToolTip() + + try: + jobInfoTitle=localeInfo.JOBINFO_TITLE[mainJob][subJob] + jobInfoData=localeInfo.JOBINFO_DATA_LIST[mainJob][subJob] + except IndexError: + print "uiCharacter.CharacterWindow.__SetJobText(mainJob=%d, subJob=%d)" % (mainJob, subJob) + return + + self.toolTipJob.AutoAppendTextLine(jobInfoTitle) + self.toolTipJob.AppendSpace(5) + + for jobInfoDataLine in jobInfoData: + self.toolTipJob.AutoAppendTextLine(jobInfoDataLine) + + self.toolTipJob.AlignHorizonalCenter() + + def __ShowAlignmentToolTip(self): + self.toolTipAlignment.ShowToolTip() + + def __HideAlignmentToolTip(self): + self.toolTipAlignment.HideToolTip() + + def RefreshCharacter(self): + + if self.isLoaded==0: + return + + ## Name + try: + characterName = player.GetName() + guildName = player.GetGuildName() + self.characterNameValue.SetText(characterName) + self.guildNameValue.SetText(guildName) + if not guildName: + if localeInfo.IsARABIC(): + self.characterNameSlot.SetPosition(190, 34) + else: + self.characterNameSlot.SetPosition(109, 34) + + self.guildNameSlot.Hide() + else: + if localeInfo.IsJAPAN(): + self.characterNameSlot.SetPosition(143, 34) + else: + self.characterNameSlot.SetPosition(153, 34) + self.guildNameSlot.Show() + except: + import exception + exception.Abort("CharacterWindow.RefreshCharacter.BindObject") + + race = net.GetMainActorRace() + group = net.GetMainActorSkillGroup() + empire = net.GetMainActorEmpire() + + ## Job Text + job = chr.RaceToJob(race) + self.__SetJobText(job, group) + + ## FaceImage + try: + faceImageName = FACE_IMAGE_DICT[race] + + try: + self.faceImage.LoadImage(faceImageName) + except: + print "CharacterWindow.RefreshCharacter(race=%d, faceImageName=%s)" % (race, faceImageName) + self.faceImage.Hide() + + except KeyError: + self.faceImage.Hide() + + ## GroupName + self.__SetSkillGroupName(race, group) + + ## Skill + if 0 == group: + self.__SelectSkillGroup(0) + + else: + self.__SetSkillSlotData(race, group, empire) + + if self.__CanUseHorseSkill(): + self.__SelectSkillGroup(0) + + def __SetSkillGroupName(self, race, group): + + job = chr.RaceToJob(race) + + if not self.SKILL_GROUP_NAME_DICT.has_key(job): + return + + nameList = self.SKILL_GROUP_NAME_DICT[job] + + if 0 == group: + self.skillGroupButton1.SetText(nameList[1]) + self.skillGroupButton2.SetText(nameList[2]) + self.skillGroupButton1.Show() + self.skillGroupButton2.Show() + self.activeSkillGroupName.Hide() + + else: + + if self.__CanUseHorseSkill(): + self.activeSkillGroupName.Hide() + self.skillGroupButton1.SetText(nameList.get(group, "Noname")) + self.skillGroupButton2.SetText(localeInfo.SKILL_GROUP_HORSE) + self.skillGroupButton1.Show() + self.skillGroupButton2.Show() + + else: + self.activeSkillGroupName.SetText(nameList.get(group, "Noname")) + self.activeSkillGroupName.Show() + self.skillGroupButton1.Hide() + self.skillGroupButton2.Hide() + + def __SetSkillSlotData(self, race, group, empire=0): + + ## SkillIndex + playerSettingModule.RegisterSkill(race, group, empire) + + ## Event + self.__SetSkillSlotEvent() + + ## Refresh + self.RefreshSkill() + + def __SelectSkillGroup(self, index): + for btn in self.skillGroupButton: + btn.SetUp() + self.skillGroupButton[index].Down() + + if self.__CanUseHorseSkill(): + if 0 == index: + index = net.GetMainActorSkillGroup()-1 + elif 1 == index: + index = self.PAGE_HORSE + + self.curSelectedSkillGroup = index + self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire()) + + def __CanUseSkillNow(self): + if 0 == net.GetMainActorSkillGroup(): + return False + + return True + + def __CanUseHorseSkill(self): + + slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_RIDING) + + if not slotIndex: + return False + + grade = player.GetSkillGrade(slotIndex) + level = player.GetSkillLevel(slotIndex) + if level < 0: + level *= -1 + if grade >= 1 and level >= 1: + return True + + return False + + def __IsChangedHorseRidingSkillLevel(self): + ret = False + + if -1 == self.canUseHorseSkill: + self.canUseHorseSkill = self.__CanUseHorseSkill() + + if self.canUseHorseSkill != self.__CanUseHorseSkill(): + ret = True + + self.canUseHorseSkill = self.__CanUseHorseSkill() + return ret + + def __GetRealSkillSlot(self, skillGrade, skillSlot): + return skillSlot + min(skill.SKILL_GRADE_COUNT-1, skillGrade)*skill.SKILL_GRADE_STEP_COUNT + + def __GetETCSkillRealSlotIndex(self, skillSlot): + if skillSlot > 100: + return skillSlot + return skillSlot % self.ACTIVE_PAGE_SLOT_COUNT + + def __RealSkillSlotToSourceSlot(self, realSkillSlot): + if realSkillSlot > 100: + return realSkillSlot + if self.PAGE_HORSE == self.curSelectedSkillGroup: + return realSkillSlot + self.ACTIVE_PAGE_SLOT_COUNT + return realSkillSlot % skill.SKILL_GRADE_STEP_COUNT + + def __GetSkillGradeFromSlot(self, skillSlot): + return int(skillSlot / skill.SKILL_GRADE_STEP_COUNT) + + def SelectSkillGroup(self, index): + self.__SelectSkillGroup(index) + + def OnQuestScroll(self): + questCount = quest.GetQuestCount() + scrollLineCount = max(0, questCount - quest.QUEST_MAX_NUM) + startIndex = int(scrollLineCount * self.questScrollBar.GetPos()) + + if startIndex != self.questShowingStartIndex: + self.questShowingStartIndex = startIndex + self.RefreshQuest() diff --git a/root/uichat.py b/root/uichat.py new file mode 100644 index 0000000..7520826 --- /dev/null +++ b/root/uichat.py @@ -0,0 +1,1169 @@ +import ui +import grp +import chat +import wndMgr +import net +import app +import ime +import localeInfo +import colorInfo +import constInfo +import systemSetting + +ENABLE_CHAT_COMMAND = True +ENABLE_LAST_SENTENCE_STACK = True +ENABLE_INSULT_CHECK = True + +if localeInfo.IsHONGKONG(): + ENABLE_LAST_SENTENCE_STACK = True + +if localeInfo.IsEUROPE(): + ENABLE_CHAT_COMMAND = False + +if localeInfo.IsCANADA(): + ENABLE_LAST_SENTENCE_STACK = False + +chatInputSetList = [] +def InsertChatInputSetWindow(wnd): + global chatInputSetList + chatInputSetList.append(wnd) +def RefreshChatMode(): + global chatInputSetList + map(lambda wnd:wnd.OnRefreshChatMode(), chatInputSetList) +def DestroyChatInputSetWindow(): + global chatInputSetList + chatInputSetList = [] + +## ChatModeButton +class ChatModeButton(ui.Window): + + OUTLINE_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 1.0) + OVER_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 0.3) + BUTTON_STATE_UP = 0 + BUTTON_STATE_OVER = 1 + BUTTON_STATE_DOWN = 2 + + def __init__(self): + ui.Window.__init__(self) + self.state = None + self.buttonText = None + self.event = None + self.SetWindowName("ChatModeButton") + + net.EnableChatInsultFilter(ENABLE_INSULT_CHECK) + + def __del__(self): + ui.Window.__del__(self) + + def SAFE_SetEvent(self, event): + self.event=ui.__mem_func__(event) + + def SetText(self, text): + if None == self.buttonText: + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetWindowHorizontalAlignCenter() + textLine.SetWindowVerticalAlignCenter() + textLine.SetVerticalAlignCenter() + textLine.SetHorizontalAlignCenter() + textLine.SetPackedFontColor(self.OUTLINE_COLOR) + textLine.Show() + self.buttonText = textLine + + self.buttonText.SetText(text) + + def SetSize(self, width, height): + self.width = width + self.height = height + ui.Window.SetSize(self, width, height) + + def OnMouseOverIn(self): + self.state = self.BUTTON_STATE_OVER + + def OnMouseOverOut(self): + self.state = self.BUTTON_STATE_UP + + def OnMouseLeftButtonDown(self): + self.state = self.BUTTON_STATE_DOWN + + def OnMouseLeftButtonUp(self): + self.state = self.BUTTON_STATE_UP + if self.IsIn(): + self.state = self.BUTTON_STATE_OVER + + if None != self.event: + self.event() + + def OnRender(self): + + (x, y) = self.GetGlobalPosition() + + grp.SetColor(self.OUTLINE_COLOR) + grp.RenderRoundBox(x, y, self.width, self.height) + + if self.state >= self.BUTTON_STATE_OVER: + grp.RenderRoundBox(x+1, y, self.width-2, self.height) + grp.RenderRoundBox(x, y+1, self.width, self.height-2) + + if self.BUTTON_STATE_DOWN == self.state: + grp.SetColor(self.OVER_COLOR) + grp.RenderBar(x+1, y+1, self.width-2, self.height-2) + +## ChatLine +class ChatLine(ui.EditLine): + + CHAT_MODE_NAME = { chat.CHAT_TYPE_TALKING : localeInfo.CHAT_NORMAL, + chat.CHAT_TYPE_PARTY : localeInfo.CHAT_PARTY, + chat.CHAT_TYPE_GUILD : localeInfo.CHAT_GUILD, + chat.CHAT_TYPE_SHOUT : localeInfo.CHAT_SHOUT, } + + def __init__(self): + ui.EditLine.__init__(self) + self.SetWindowName("Chat Line") + self.lastShoutTime = 0 + self.eventEscape = lambda *arg: None + self.eventReturn = lambda *arg: None + self.eventTab = None + self.chatMode = chat.CHAT_TYPE_TALKING + self.bCodePage = True + + self.overTextLine = ui.TextLine() + self.overTextLine.SetParent(self) + self.overTextLine.SetPosition(-1, 0) + self.overTextLine.SetFontColor(1.0, 1.0, 0.0) + self.overTextLine.SetOutline() + self.overTextLine.Hide() + + self.lastSentenceStack = [] + self.lastSentencePos = 0 + + def SetChatMode(self, mode): + self.chatMode = mode + + def GetChatMode(self): + return self.chatMode + + def ChangeChatMode(self): + if chat.CHAT_TYPE_TALKING == self.GetChatMode(): + self.SetChatMode(chat.CHAT_TYPE_PARTY) + self.SetText("#") + self.SetEndPosition() + + elif chat.CHAT_TYPE_PARTY == self.GetChatMode(): + self.SetChatMode(chat.CHAT_TYPE_GUILD) + self.SetText("%") + self.SetEndPosition() + + elif chat.CHAT_TYPE_GUILD == self.GetChatMode(): + self.SetChatMode(chat.CHAT_TYPE_SHOUT) + self.SetText("!") + self.SetEndPosition() + + elif chat.CHAT_TYPE_SHOUT == self.GetChatMode(): + self.SetChatMode(chat.CHAT_TYPE_TALKING) + self.SetText("") + + self.__CheckChatMark() + + def GetCurrentChatModeName(self): + try: + return self.CHAT_MODE_NAME[self.chatMode] + except: + import exception + exception.Abort("ChatLine.GetCurrentChatModeName") + + def SAFE_SetEscapeEvent(self, event): + self.eventReturn = ui.__mem_func__(event) + + def SAFE_SetReturnEvent(self, event): + self.eventEscape = ui.__mem_func__(event) + + def SAFE_SetTabEvent(self, event): + self.eventTab = ui.__mem_func__(event) + + def SetTabEvent(self, event): + self.eventTab = event + + def OpenChat(self): + self.SetFocus() + self.__ResetChat() + + def __ClearChat(self): + self.SetText("") + self.lastSentencePos = 0 + + def __ResetChat(self): + if chat.CHAT_TYPE_PARTY == self.GetChatMode(): + self.SetText("#") + self.SetEndPosition() + elif chat.CHAT_TYPE_GUILD == self.GetChatMode(): + self.SetText("%") + self.SetEndPosition() + elif chat.CHAT_TYPE_SHOUT == self.GetChatMode(): + self.SetText("!") + self.SetEndPosition() + else: + self.__ClearChat() + + self.__CheckChatMark() + + + def __SendChatPacket(self, text, type): +# if text[0] == '/': +# if ENABLE_CHAT_COMMAND or constInfo.CONSOLE_ENABLE: +# pass +# else: +# return + + if net.IsChatInsultIn(text): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING) + else: + net.SendChatPacket(text, type) + + def __SendPartyChatPacket(self, text): + + if 1 == len(text): + self.RunCloseEvent() + return + + self.__SendChatPacket(text[1:], chat.CHAT_TYPE_PARTY) + self.__ResetChat() + + def __SendGuildChatPacket(self, text): + + if 1 == len(text): + self.RunCloseEvent() + return + + self.__SendChatPacket(text[1:], chat.CHAT_TYPE_GUILD) + self.__ResetChat() + + def __SendShoutChatPacket(self, text): + + if 1 == len(text): + self.RunCloseEvent() + return + + if app.GetTime() < self.lastShoutTime + 15: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_SHOUT_LIMIT) + self.__ResetChat() + return + + self.__SendChatPacket(text[1:], chat.CHAT_TYPE_SHOUT) + self.__ResetChat() + + self.lastShoutTime = app.GetTime() + + def __SendTalkingChatPacket(self, text): + self.__SendChatPacket(text, chat.CHAT_TYPE_TALKING) + self.__ResetChat() + + def OnIMETab(self): + #if None != self.eventTab: + # self.eventTab() + #return True + return False + + def OnIMEUpdate(self): + ui.EditLine.OnIMEUpdate(self) + self.__CheckChatMark() + + def __CheckChatMark(self): + + self.overTextLine.Hide() + + text = self.GetText() + if len(text) > 0: + if '#' == text[0]: + self.overTextLine.SetText("#") + self.overTextLine.Show() + elif '%' == text[0]: + self.overTextLine.SetText("%") + self.overTextLine.Show() + elif '!' == text[0]: + self.overTextLine.SetText("!") + self.overTextLine.Show() + + def OnIMEKeyDown(self, key): + # LAST_SENTENCE_STACK + if app.VK_UP == key: + self.__PrevLastSentenceStack() + return True + + if app.VK_DOWN == key: + self.__NextLastSentenceStack() + return True + # END_OF_LAST_SENTENCE_STACK + + ui.EditLine.OnIMEKeyDown(self, key) + + # LAST_SENTENCE_STACK + def __PrevLastSentenceStack(self): + global ENABLE_LAST_SENTENCE_STACK + if not ENABLE_LAST_SENTENCE_STACK: + return + + if self.lastSentenceStack and self.lastSentencePos < len(self.lastSentenceStack): + self.lastSentencePos += 1 + lastSentence = self.lastSentenceStack[-self.lastSentencePos] + self.SetText(lastSentence) + self.SetEndPosition() + + def __NextLastSentenceStack(self): + global ENABLE_LAST_SENTENCE_STACK + if not ENABLE_LAST_SENTENCE_STACK: + return + + if self.lastSentenceStack and self.lastSentencePos > 1: + self.lastSentencePos -= 1 + lastSentence = self.lastSentenceStack[-self.lastSentencePos] + self.SetText(lastSentence) + self.SetEndPosition() + + def __PushLastSentenceStack(self, text): + global ENABLE_LAST_SENTENCE_STACK + if not ENABLE_LAST_SENTENCE_STACK: + return + + if len(text) <= 0: + return + + LAST_SENTENCE_STACK_SIZE = 32 + if len(self.lastSentenceStack) > LAST_SENTENCE_STACK_SIZE: + self.lastSentenceStack.pop(0) + + self.lastSentenceStack.append(text) + # END_OF_LAST_SENTENCE_STACK + + def OnIMEReturn(self): + text = self.GetText() + textLen=len(text) + + # LAST_SENTENCE_STACK + self.__PushLastSentenceStack(text) + # END_OF_LAST_SENTENCE_STACK + + textSpaceCount=text.count(' ') + + if (textLen > 0) and (textLen != textSpaceCount): + if '#' == text[0]: + self.__SendPartyChatPacket(text) + elif '%' == text[0]: + self.__SendGuildChatPacket(text) + elif '!' == text[0]: + self.__SendShoutChatPacket(text) + else: + self.__SendTalkingChatPacket(text) + else: + self.__ClearChat() + self.eventReturn() + + return True + + def OnPressEscapeKey(self): + self.__ClearChat() + self.eventEscape() + return True + + def RunCloseEvent(self): + self.eventEscape() + + 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) + else: + ui.EditLine.OnMouseLeftButtonDown(self) + +class ChatInputSet(ui.Window): + + CHAT_OUTLINE_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 1.0) + + def __init__(self): + ui.Window.__init__(self) + self.SetWindowName("ChatInputSet") + + InsertChatInputSetWindow(self) + self.__Create() + + def __del__(self): + ui.Window.__del__(self) + + def __Create(self): + chatModeButton = ChatModeButton() + chatModeButton.SetParent(self) + chatModeButton.SetSize(40, 17) + chatModeButton.SetText(localeInfo.CHAT_NORMAL) + chatModeButton.SetPosition(7, 2) + chatModeButton.SAFE_SetEvent(self.OnChangeChatMode) + self.chatModeButton = chatModeButton + + chatLine = ChatLine() + chatLine.SetParent(self) + chatLine.SetMax(512) + chatLine.SetUserMax(76) + chatLine.SetText("") + chatLine.SAFE_SetTabEvent(self.OnChangeChatMode) + chatLine.x = 0 + chatLine.y = 0 + chatLine.width = 0 + chatLine.height = 0 + self.chatLine = chatLine + + btnSend = ui.Button() + btnSend.SetParent(self) + btnSend.SetUpVisual("d:/ymir work/ui/game/taskbar/Send_Chat_Button_01.sub") + btnSend.SetOverVisual("d:/ymir work/ui/game/taskbar/Send_Chat_Button_02.sub") + btnSend.SetDownVisual("d:/ymir work/ui/game/taskbar/Send_Chat_Button_03.sub") + btnSend.SetToolTipText(localeInfo.CHAT_SEND_CHAT) + btnSend.SAFE_SetEvent(self.chatLine.OnIMEReturn) + self.btnSend = btnSend + + def Destroy(self): + self.chatModeButton = None + self.chatLine = None + self.btnSend = None + + def Open(self): + self.chatLine.Show() + self.chatLine.SetPosition(57, 5) + self.chatLine.SetFocus() + self.chatLine.OpenChat() + + self.chatModeButton.SetPosition(7, 2) + self.chatModeButton.Show() + + self.btnSend.Show() + self.Show() + + self.RefreshPosition() + return True + + def Close(self): + self.chatLine.KillFocus() + self.chatLine.Hide() + self.chatModeButton.Hide() + self.btnSend.Hide() + self.Hide() + return True + + def SetEscapeEvent(self, event): + self.chatLine.SetEscapeEvent(event) + + def SetReturnEvent(self, event): + self.chatLine.SetReturnEvent(event) + + def OnChangeChatMode(self): + RefreshChatMode() + + def OnRefreshChatMode(self): + self.chatLine.ChangeChatMode() + self.chatModeButton.SetText(self.chatLine.GetCurrentChatModeName()) + + def SetChatFocus(self): + self.chatLine.SetFocus() + + def KillChatFocus(self): + self.chatLine.KillFocus() + + def SetChatMax(self, max): + self.chatLine.SetUserMax(max) + + def RefreshPosition(self): + if localeInfo.IsARABIC(): + self.chatLine.SetSize(self.GetWidth() - 93, 18) + else: + self.chatLine.SetSize(self.GetWidth() - 93, 13) + + self.btnSend.SetPosition(self.GetWidth() - 25, 2) + + (self.chatLine.x, self.chatLine.y, self.chatLine.width, self.chatLine.height) = self.chatLine.GetRect() + + def BindInterface(self, interface): + self.chatLine.BindInterface(interface) + + def OnRender(self): + (x, y, width, height) = self.chatLine.GetRect() + ui.RenderRoundBox(x-4, y-3, width+7, height+4, self.CHAT_OUTLINE_COLOR) + +## ChatWindow +class ChatWindow(ui.Window): + + BOARD_START_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.0) + BOARD_END_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.8) + BOARD_MIDDLE_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.5) + CHAT_OUTLINE_COLOR = grp.GenerateColor(1.0, 1.0, 1.0, 1.0) + + EDIT_LINE_HEIGHT = 25 + CHAT_WINDOW_WIDTH = 600 + + class ChatBackBoard(ui.Window): + def __init__(self): + ui.Window.__init__(self) + def __del__(self): + ui.Window.__del__(self) + + class ChatButton(ui.DragButton): + + def __init__(self): + ui.DragButton.__init__(self) + self.AddFlag("float") + self.AddFlag("movable") + self.AddFlag("restrict_x") + self.topFlag = False + self.SetWindowName("ChatWindow:ChatButton") + + + def __del__(self): + ui.DragButton.__del__(self) + + def SetOwner(self, owner): + self.owner = owner + + def OnMouseOverIn(self): + app.SetCursor(app.VSIZE) + + def OnMouseOverOut(self): + app.SetCursor(app.NORMAL) + + def OnTop(self): + if True == self.topFlag: + return + + self.topFlag = True + self.owner.SetTop() + self.topFlag = False + + def __init__(self): + ui.Window.__init__(self) + self.AddFlag("float") + + self.SetWindowName("ChatWindow") + self.__RegisterChatColorDict() + + self.boardState = chat.BOARD_STATE_VIEW + self.chatID = chat.CreateChatSet(chat.CHAT_SET_CHAT_WINDOW) + chat.SetBoardState(self.chatID, chat.BOARD_STATE_VIEW) + + self.xBar = 0 + self.yBar = 0 + self.widthBar = 0 + self.heightBar = 0 + self.curHeightBar = 0 + self.visibleLineCount = 0 + self.scrollBarPos = 1.0 + self.scrollLock = False + + chatInputSet = ChatInputSet() + chatInputSet.SetParent(self) + chatInputSet.SetEscapeEvent(ui.__mem_func__(self.CloseChat)) + chatInputSet.SetReturnEvent(ui.__mem_func__(self.CloseChat)) + chatInputSet.SetSize(550, 25) + self.chatInputSet = chatInputSet + + btnSendWhisper = ui.Button() + btnSendWhisper.SetParent(self) + btnSendWhisper.SetUpVisual("d:/ymir work/ui/game/taskbar/Send_Whisper_Button_01.sub") + btnSendWhisper.SetOverVisual("d:/ymir work/ui/game/taskbar/Send_Whisper_Button_02.sub") + btnSendWhisper.SetDownVisual("d:/ymir work/ui/game/taskbar/Send_Whisper_Button_03.sub") + btnSendWhisper.SetToolTipText(localeInfo.CHAT_SEND_MEMO) + btnSendWhisper.Hide() + self.btnSendWhisper = btnSendWhisper + + btnChatLog = ui.Button() + btnChatLog.SetParent(self) + btnChatLog.SetUpVisual("d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_01.sub") + btnChatLog.SetOverVisual("d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_02.sub") + btnChatLog.SetDownVisual("d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_03.sub") + btnChatLog.SetToolTipText(localeInfo.CHAT_LOG) + btnChatLog.Hide() + self.btnChatLog = btnChatLog + + btnChatSizing = self.ChatButton() + btnChatSizing.SetOwner(self) + btnChatSizing.SetMoveEvent(ui.__mem_func__(self.Refresh)) + btnChatSizing.Hide() + self.btnChatSizing = btnChatSizing + + imgChatBarLeft = ui.ImageBox() + imgChatBarLeft.SetParent(self.btnChatSizing) + imgChatBarLeft.AddFlag("not_pick") + imgChatBarLeft.LoadImage("d:/ymir work/ui/pattern/chat_bar_left.tga") + imgChatBarLeft.Show() + self.imgChatBarLeft = imgChatBarLeft + imgChatBarRight = ui.ImageBox() + imgChatBarRight.SetParent(self.btnChatSizing) + imgChatBarRight.AddFlag("not_pick") + imgChatBarRight.LoadImage("d:/ymir work/ui/pattern/chat_bar_right.tga") + imgChatBarRight.Show() + self.imgChatBarRight = imgChatBarRight + imgChatBarMiddle = ui.ExpandedImageBox() + imgChatBarMiddle.SetParent(self.btnChatSizing) + imgChatBarMiddle.AddFlag("not_pick") + imgChatBarMiddle.LoadImage("d:/ymir work/ui/pattern/chat_bar_middle.tga") + imgChatBarMiddle.Show() + self.imgChatBarMiddle = imgChatBarMiddle + + scrollBar = ui.ScrollBar() + scrollBar.AddFlag("float") + scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll)) + self.scrollBar = scrollBar + + self.Refresh() + self.chatInputSet.RefreshPosition() # RTL 矫 困摹甫 力措肺 棱栏妨搁 困摹 盎脚捞 鞘夸窍促 + + def __del__(self): + ui.Window.__del__(self) + + def __RegisterChatColorDict(self): + CHAT_COLOR_DICT = { + chat.CHAT_TYPE_TALKING : colorInfo.CHAT_RGB_TALK, + chat.CHAT_TYPE_INFO : colorInfo.CHAT_RGB_INFO, + chat.CHAT_TYPE_NOTICE : colorInfo.CHAT_RGB_NOTICE, + chat.CHAT_TYPE_PARTY : colorInfo.CHAT_RGB_PARTY, + chat.CHAT_TYPE_GUILD : colorInfo.CHAT_RGB_GUILD, + chat.CHAT_TYPE_COMMAND : colorInfo.CHAT_RGB_COMMAND, + chat.CHAT_TYPE_SHOUT : colorInfo.CHAT_RGB_SHOUT, + chat.CHAT_TYPE_WHISPER : colorInfo.CHAT_RGB_WHISPER, + } + + for colorItem in CHAT_COLOR_DICT.items(): + type=colorItem[0] + rgb=colorItem[1] + chat.SetChatColor(type, rgb[0], rgb[1], rgb[2]) + + def Destroy(self): + self.chatInputSet.Destroy() + self.chatInputSet = None + + self.btnSendWhisper = 0 + self.btnChatLog = 0 + self.btnChatSizing = 0 + + ################ + ## Open & Close + def OpenChat(self): + self.SetSize(self.CHAT_WINDOW_WIDTH, 25) + chat.SetBoardState(self.chatID, chat.BOARD_STATE_EDIT) + self.boardState = chat.BOARD_STATE_EDIT + + (x, y, width, height) = self.GetRect() + (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() + + if localeInfo.IsARABIC(): + chat.SetPosition(self.chatID, x + width - 10, y) + else: + chat.SetPosition(self.chatID, x + 10, y) + + chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100) + + if self.IsShow(): + self.btnChatSizing.Show() + + self.Refresh() + + self.btnSendWhisper.SetPosition(self.GetWidth() - 50, 2) + self.btnSendWhisper.Show() + + self.btnChatLog.SetPosition(self.GetWidth() - 25, 2) + self.btnChatLog.Show() + + self.chatInputSet.Open() + self.chatInputSet.SetTop() + self.SetTop() + + def CloseChat(self): + chat.SetBoardState(self.chatID, chat.BOARD_STATE_VIEW) + self.boardState = chat.BOARD_STATE_VIEW + + (x, y, width, height) = self.GetRect() + + if localeInfo.IsARABIC(): + chat.SetPosition(self.chatID, x + width - 10, y + self.EDIT_LINE_HEIGHT) + else: + chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT) + + self.SetSize(self.CHAT_WINDOW_WIDTH, 0) + + self.chatInputSet.Close() + self.btnSendWhisper.Hide() + self.btnChatLog.Hide() + self.btnChatSizing.Hide() + + self.Refresh() + + def SetSendWhisperEvent(self, event): + self.btnSendWhisper.SetEvent(event) + + def SetOpenChatLogEvent(self, event): + self.btnChatLog.SetEvent(event) + + def IsEditMode(self): + if chat.BOARD_STATE_EDIT == self.boardState: + return True + + return False + + def __RefreshSizingBar(self): + (x, y, width, height) = self.GetRect() + gxChat, gyChat = self.btnChatSizing.GetGlobalPosition() + self.btnChatSizing.SetPosition(x, gyChat) + self.btnChatSizing.SetSize(width, 22) + self.imgChatBarLeft.SetPosition(0, 0) + self.imgChatBarRight.SetPosition(width - 64, 0) + self.imgChatBarMiddle.SetPosition(64, 0) + self.imgChatBarMiddle.SetRenderingRect(0.0, 0.0, float(width - 128) / 64.0 - 1.0, 0.0) + + def SetPosition(self, x, y): + ui.Window.SetPosition(self, x, y) + self.__RefreshSizingBar() + + def SetSize(self, width, height): + ui.Window.SetSize(self, width, height) + self.__RefreshSizingBar() + + def SetHeight(self, height): + gxChat, gyChat = self.btnChatSizing.GetGlobalPosition() + self.btnChatSizing.SetPosition(gxChat, wndMgr.GetScreenHeight() - height) + + ########### + ## Refresh + def Refresh(self): + if self.boardState == chat.BOARD_STATE_EDIT: + self.RefreshBoardEditState() + elif self.boardState == chat.BOARD_STATE_VIEW: + self.RefreshBoardViewState() + + def RefreshBoardEditState(self): + + (x, y, width, height) = self.GetRect() + (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() + + self.xBar = x + self.yBar = btnY + self.widthBar = width + self.heightBar = y - btnY + self.EDIT_LINE_HEIGHT + self.curHeightBar = self.heightBar + + if localeInfo.IsARABIC(): + chat.SetPosition(self.chatID, x + width - 10, y) + else: + chat.SetPosition(self.chatID, x + 10, y) + + chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT) + chat.ArrangeShowingChat(self.chatID) + + if btnY > y: + self.btnChatSizing.SetPosition(btnX, y) + self.heightBar = self.EDIT_LINE_HEIGHT + + def RefreshBoardViewState(self): + (x, y, width, height) = self.GetRect() + (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() + textAreaHeight = self.visibleLineCount * chat.GetLineStep(self.chatID) + + if localeInfo.IsARABIC(): + chat.SetPosition(self.chatID, x + width - 10, y + self.EDIT_LINE_HEIGHT) + else: + chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT) + + chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100) + + if self.boardState == chat.BOARD_STATE_EDIT: + textAreaHeight += 45 + elif self.visibleLineCount != 0: + textAreaHeight += 10 + 10 + + self.xBar = x + self.yBar = y + self.EDIT_LINE_HEIGHT - textAreaHeight + self.widthBar = width + self.heightBar = textAreaHeight + + self.scrollBar.Hide() + + ########## + ## Render + def OnUpdate(self): + if self.boardState == chat.BOARD_STATE_EDIT: + chat.Update(self.chatID) + elif self.boardState == chat.BOARD_STATE_VIEW: + if systemSetting.IsViewChat(): + chat.Update(self.chatID) + + def OnRender(self): + if chat.GetVisibleLineCount(self.chatID) != self.visibleLineCount: + self.visibleLineCount = chat.GetVisibleLineCount(self.chatID) + self.Refresh() + + if self.curHeightBar != self.heightBar: + self.curHeightBar += (self.heightBar - self.curHeightBar) / 10 + + if self.boardState == chat.BOARD_STATE_EDIT: + grp.SetColor(self.BOARD_MIDDLE_COLOR) + grp.RenderBar(self.xBar, self.yBar + (self.heightBar - self.curHeightBar) + 10, self.widthBar, self.curHeightBar) + chat.Render(self.chatID) + elif self.boardState == chat.BOARD_STATE_VIEW: + if systemSetting.IsViewChat(): + grp.RenderGradationBar(self.xBar, self.yBar + (self.heightBar - self.curHeightBar), self.widthBar, self.curHeightBar, self.BOARD_START_COLOR, self.BOARD_END_COLOR) + chat.Render(self.chatID) + + ########## + ## Event + def OnTop(self): + self.btnChatSizing.SetTop() + self.scrollBar.SetTop() + + def OnScroll(self): + if not self.scrollLock: + self.scrollBarPos = self.scrollBar.GetPos() + + lineCount = chat.GetLineCount(self.chatID) + visibleLineCount = chat.GetVisibleLineCount(self.chatID) + endLine = visibleLineCount + int(float(lineCount - visibleLineCount) * self.scrollBarPos) + + chat.SetEndPos(self.chatID, self.scrollBarPos) + + def OnChangeChatMode(self): + self.chatInputSet.OnChangeChatMode() + + def SetChatFocus(self): + self.chatInputSet.SetChatFocus() + + def BindInterface(self, interface): + self.chatInputSet.BindInterface(interface) + +## ChatLogWindow +class ChatLogWindow(ui.Window): + + BLOCK_WIDTH = 32 + CHAT_MODE_NAME = ( localeInfo.CHAT_NORMAL, localeInfo.CHAT_PARTY, localeInfo.CHAT_GUILD, localeInfo.CHAT_SHOUT, localeInfo.CHAT_INFORMATION, localeInfo.CHAT_NOTICE, ) + CHAT_MODE_INDEX = ( chat.CHAT_TYPE_TALKING, + chat.CHAT_TYPE_PARTY, + chat.CHAT_TYPE_GUILD, + chat.CHAT_TYPE_SHOUT, + chat.CHAT_TYPE_INFO, + chat.CHAT_TYPE_NOTICE, ) + + CHAT_LOG_WINDOW_MINIMUM_WIDTH = 450 + CHAT_LOG_WINDOW_MINIMUM_HEIGHT = 120 + + 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): + + self.allChatMode = True + self.chatInputSet = None + + ui.Window.__init__(self) + self.AddFlag("float") + self.AddFlag("movable") + self.SetWindowName("ChatLogWindow") + self.__CreateChatInputSet() + self.__CreateWindow() + self.__CreateButton() + self.__CreateScrollBar() + + self.chatID = chat.CreateChatSet(chat.CHAT_SET_LOG_WINDOW) + chat.SetBoardState(self.chatID, chat.BOARD_STATE_LOG) + for i in self.CHAT_MODE_INDEX: + chat.EnableChatMode(self.chatID, i) + + self.SetPosition(20, 20) + self.SetSize(self.CHAT_LOG_WINDOW_MINIMUM_WIDTH, self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT) + self.btnSizing.SetPosition(self.CHAT_LOG_WINDOW_MINIMUM_WIDTH-self.btnSizing.GetWidth(), self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT-self.btnSizing.GetHeight()+2) + + self.OnResize() + + def __CreateChatInputSet(self): + chatInputSet = ChatInputSet() + chatInputSet.SetParent(self) + chatInputSet.SetEscapeEvent(ui.__mem_func__(self.Close)) + chatInputSet.SetWindowVerticalAlignBottom() + chatInputSet.Open() + self.chatInputSet = chatInputSet + + def __CreateWindow(self): + imgLeft = ui.ImageBox() + imgLeft.AddFlag("not_pick") + imgLeft.SetParent(self) + + imgCenter = ui.ExpandedImageBox() + imgCenter.AddFlag("not_pick") + imgCenter.SetParent(self) + + imgRight = ui.ImageBox() + imgRight.AddFlag("not_pick") + imgRight.SetParent(self) + + if localeInfo.IsARABIC(): + imgLeft.LoadImage("locale/ae/ui/pattern/titlebar_left.tga") + imgCenter.LoadImage("locale/ae/ui/pattern/titlebar_center.tga") + imgRight.LoadImage("locale/ae/ui/pattern/titlebar_right.tga") + else: + imgLeft.LoadImage("d:/ymir work/ui/pattern/chatlogwindow_titlebar_left.tga") + imgCenter.LoadImage("d:/ymir work/ui/pattern/chatlogwindow_titlebar_middle.tga") + imgRight.LoadImage("d:/ymir work/ui/pattern/chatlogwindow_titlebar_right.tga") + + imgLeft.Show() + imgCenter.Show() + imgRight.Show() + + btnClose = ui.Button() + btnClose.SetParent(self) + btnClose.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub") + btnClose.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub") + btnClose.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub") + btnClose.SetToolTipText(localeInfo.UI_CLOSE, 0, -23) + btnClose.SetEvent(ui.__mem_func__(self.Close)) + btnClose.Show() + + btnSizing = self.ResizeButton() + btnSizing.SetParent(self) + btnSizing.SetMoveEvent(ui.__mem_func__(self.OnResize)) + btnSizing.SetSize(16, 16) + btnSizing.Show() + + titleName = ui.TextLine() + titleName.SetParent(self) + + if localeInfo.IsARABIC(): + titleName.SetPosition(self.GetWidth()-20, 6) + else: + titleName.SetPosition(20, 6) + + titleName.SetText(localeInfo.CHAT_LOG_TITLE) + titleName.Show() + + self.imgLeft = imgLeft + self.imgCenter = imgCenter + self.imgRight = imgRight + self.btnClose = btnClose + self.btnSizing = btnSizing + self.titleName = titleName + + def __CreateButton(self): + + if localeInfo.IsARABIC(): + bx = 20 + else: + bx = 13 + + btnAll = ui.RadioButton() + btnAll.SetParent(self) + btnAll.SetPosition(bx, 24) + btnAll.SetUpVisual("d:/ymir work/ui/public/xsmall_button_01.sub") + btnAll.SetOverVisual("d:/ymir work/ui/public/xsmall_button_02.sub") + btnAll.SetDownVisual("d:/ymir work/ui/public/xsmall_button_03.sub") + btnAll.SetText(localeInfo.CHAT_ALL) + btnAll.SetEvent(ui.__mem_func__(self.ToggleAllChatMode)) + btnAll.Down() + btnAll.Show() + self.btnAll = btnAll + + x = bx + 48 + i = 0 + self.modeButtonList = [] + for name in self.CHAT_MODE_NAME: + btn = ui.ToggleButton() + btn.SetParent(self) + btn.SetPosition(x, 24) + btn.SetUpVisual("d:/ymir work/ui/public/xsmall_button_01.sub") + btn.SetOverVisual("d:/ymir work/ui/public/xsmall_button_02.sub") + btn.SetDownVisual("d:/ymir work/ui/public/xsmall_button_03.sub") + btn.SetText(name) + btn.Show() + + mode = self.CHAT_MODE_INDEX[i] + btn.SetToggleUpEvent(lambda arg=mode: self.ToggleChatMode(arg)) + btn.SetToggleDownEvent(lambda arg=mode: self.ToggleChatMode(arg)) + self.modeButtonList.append(btn) + + x += 48 + i += 1 + + def __CreateScrollBar(self): + scrollBar = ui.SmallThinScrollBar() + scrollBar.SetParent(self) + scrollBar.Show() + scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll)) + self.scrollBar = scrollBar + self.scrollBarPos = 1.0 + + def __del__(self): + ui.Window.__del__(self) + + def Destroy(self): + self.imgLeft = None + self.imgCenter = None + self.imgRight = None + self.btnClose = None + self.btnSizing = None + self.modeButtonList = [] + self.scrollBar = None + self.chatInputSet = None + + def ToggleAllChatMode(self): + if self.allChatMode: + return + + self.allChatMode = True + + for i in self.CHAT_MODE_INDEX: + chat.EnableChatMode(self.chatID, i) + for btn in self.modeButtonList: + btn.SetUp() + + def ToggleChatMode(self, mode): + if self.allChatMode: + self.allChatMode = False + for i in self.CHAT_MODE_INDEX: + chat.DisableChatMode(self.chatID, i) + chat.EnableChatMode(self.chatID, mode) + self.btnAll.SetUp() + + else: + chat.ToggleChatMode(self.chatID, mode) + + def SetSize(self, width, height): + self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2) - self.BLOCK_WIDTH) / self.BLOCK_WIDTH, 0.0) + self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0) + self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0) + + if localeInfo.IsARABIC(): + self.titleName.SetPosition(self.GetWidth()-20, 3) + self.btnClose.SetPosition(3, 3) + self.scrollBar.SetPosition(1, 45) + else: + self.btnClose.SetPosition(width - self.btnClose.GetWidth() - 5, 5) + self.scrollBar.SetPosition(width - 15, 45) + + self.scrollBar.SetScrollBarSize(height - 45 - 12) + self.scrollBar.SetPos(self.scrollBarPos) + ui.Window.SetSize(self, width, height) + + def Open(self): + self.OnResize() + self.chatInputSet.SetChatFocus() + self.Show() + + def Close(self): + if self.chatInputSet: + self.chatInputSet.KillChatFocus() + self.Hide() + + def OnResize(self): + x, y = self.btnSizing.GetLocalPosition() + width = self.btnSizing.GetWidth() + height = self.btnSizing.GetHeight() + + if x < self.CHAT_LOG_WINDOW_MINIMUM_WIDTH - width: + self.btnSizing.SetPosition(self.CHAT_LOG_WINDOW_MINIMUM_WIDTH - width, y) + return + if y < self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height: + self.btnSizing.SetPosition(x, self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height) + return + + self.scrollBar.LockScroll() + self.SetSize(x + width, y + height) + self.scrollBar.UnlockScroll() + + if localeInfo.IsARABIC(): + self.chatInputSet.SetPosition(20, 25) + else: + self.chatInputSet.SetPosition(0, 25) + + self.chatInputSet.SetSize(self.GetWidth() - 20, 20) + self.chatInputSet.RefreshPosition() + self.chatInputSet.SetChatMax(self.GetWidth() / 8) + + def OnScroll(self): + self.scrollBarPos = self.scrollBar.GetPos() + + lineCount = chat.GetLineCount(self.chatID) + visibleLineCount = chat.GetVisibleLineCount(self.chatID) + endLine = visibleLineCount + int(float(lineCount - visibleLineCount) * self.scrollBarPos) + + chat.SetEndPos(self.chatID, self.scrollBarPos) + + def OnRender(self): + (x, y, width, height) = self.GetRect() + + if localeInfo.IsARABIC(): + grp.SetColor(0x77000000) + grp.RenderBar(x+2, y+45, 13, height-45) + + grp.SetColor(0x77000000) + grp.RenderBar(x, y, width, height) + grp.SetColor(0x77000000) + grp.RenderBox(x, y, width-2, height) + grp.SetColor(0x77000000) + grp.RenderBox(x+1, y+1, width-2, height) + + grp.SetColor(0xff989898) + grp.RenderLine(x+width-13, y+height-1, 11, -11) + grp.RenderLine(x+width-9, y+height-1, 7, -7) + grp.RenderLine(x+width-5, y+height-1, 3, -3) + else: + grp.SetColor(0x77000000) + grp.RenderBar(x+width-15, y+45, 13, height-45) + + grp.SetColor(0x77000000) + grp.RenderBar(x, y, width, height) + grp.SetColor(0x77000000) + grp.RenderBox(x, y, width-2, height) + grp.SetColor(0x77000000) + grp.RenderBox(x+1, y+1, width-2, height) + + grp.SetColor(0xff989898) + grp.RenderLine(x+width-13, y+height-1, 11, -11) + grp.RenderLine(x+width-9, y+height-1, 7, -7) + grp.RenderLine(x+width-5, y+height-1, 3, -3) + + ##### + + chat.ArrangeShowingChat(self.chatID) + + if localeInfo.IsARABIC(): + chat.SetPosition(self.chatID, x + width - 10, y + height - 25) + else: + chat.SetPosition(self.chatID, x + 10, y + height - 25) + + chat.SetHeight(self.chatID, height - 45 - 25) + chat.Update(self.chatID) + chat.Render(self.chatID) + + def OnPressEscapeKey(self): + self.Close() + return True + + 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) + diff --git a/root/uicommon.py b/root/uicommon.py new file mode 100644 index 0000000..04b2568 --- /dev/null +++ b/root/uicommon.py @@ -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)) diff --git a/root/uicube.py b/root/uicube.py new file mode 100644 index 0000000..9ad7182 --- /dev/null +++ b/root/uicube.py @@ -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() diff --git a/root/uidragonsoul.py b/root/uidragonsoul.py new file mode 100644 index 0000000..c90668d --- /dev/null +++ b/root/uidragonsoul.py @@ -0,0 +1,1386 @@ +import ui +import player +import mouseModule +import net +import app +import snd +import item +import chat +import grp +import uiScriptLocale +import uiRefine +import uiAttachMetin +import uiPickMoney +import uiCommon +import uiPrivateShopBuilder +import localeInfo +import constInfo +import ime +import uiInventory +import sys +ITEM_FLAG_APPLICABLE = 1 << 14 + +# 侩去籍 Vnum俊 措茄 comment +# ITEM VNUM阑 10父 磊府何磐, FEDCBA扼绊 茄促搁 +# FE : 侩去籍 辆幅. D : 殿鞭 +# C : 窜拌 B : 碍拳 +# A : 咯国狼 锅龋甸... + +class DragonSoulWindow(ui.ScriptWindow): + KIND_TAP_TITLES = [uiScriptLocale.DRAGONSOUL_TAP_TITLE_1, uiScriptLocale.DRAGONSOUL_TAP_TITLE_2, + uiScriptLocale.DRAGONSOUL_TAP_TITLE_3, uiScriptLocale.DRAGONSOUL_TAP_TITLE_4, uiScriptLocale.DRAGONSOUL_TAP_TITLE_5, uiScriptLocale.DRAGONSOUL_TAP_TITLE_6] + def __init__(self): + ui.ScriptWindow.__init__(self) + self.questionDialog = None + self.tooltipItem = None + self.sellingSlotNumber = -1 + self.isLoaded = 0 + self.isActivated = False + self.DSKindIndex = 0 + self.tabDict = None + self.tabButtonDict = None + self.deckPageIndex = 0 + self.inventoryPageIndex = 0 + self.SetWindowName("DragonSoulWindow") + self.__LoadWindow() + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def Show(self): + self.__LoadWindow() + + ui.ScriptWindow.Show(self) + def __LoadWindow(self): + if self.isLoaded == 1: + return + self.isLoaded = 1 + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "dragonsoulwindow.py") + + except: + import exception + exception.Abort("dragonsoulwindow.LoadWindow.LoadObject") + try: + if localeInfo.IsARABIC(): + self.board = self.GetChild("Equipment_Base") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_01") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_02") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_03") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_04") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_05") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + self.board = self.GetChild("Tab_06") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + + wndItem = self.GetChild("ItemSlot") + wndEquip = self.GetChild("EquipmentSlot") + self.activateButton = self.GetChild("activate") + self.deckTab = [] + self.deckTab.append(self.GetChild("deck1")) + self.deckTab.append(self.GetChild("deck2")) + self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close)) + self.inventoryTab = [] + self.inventoryTab.append(self.GetChild("Inventory_Tab_01")) + self.inventoryTab.append(self.GetChild("Inventory_Tab_02")) + self.inventoryTab.append(self.GetChild("Inventory_Tab_03")) + self.inventoryTab.append(self.GetChild("Inventory_Tab_04")) + self.inventoryTab.append(self.GetChild("Inventory_Tab_05")) + self.tabDict = { + 0 : self.GetChild("Tab_01"), + 1 : self.GetChild("Tab_02"), + 2 : self.GetChild("Tab_03"), + 3 : self.GetChild("Tab_04"), + 4 : self.GetChild("Tab_05"), + 5 : self.GetChild("Tab_06"), + } + self.tabButtonDict = { + 0 : self.GetChild("Tab_Button_01"), + 1 : self.GetChild("Tab_Button_02"), + 2 : self.GetChild("Tab_Button_03"), + 3 : self.GetChild("Tab_Button_04"), + 4 : self.GetChild("Tab_Button_05"), + 5 : self.GetChild("Tab_Button_06"), + } + self.tabText = self.GetChild("tab_text_area") + except: + import exception + exception.Abort("InventoryWindow.LoadWindow.BindObject") + ## DragonSoul Kind Tap + for (tabKey, tabButton) in self.tabButtonDict.items(): + tabButton.SetEvent(ui.__mem_func__(self.SetDSKindIndex), tabKey) + ## Item + wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) + wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot)) + wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot)) + wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot)) + wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot)) + + ## Equipment + wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptyEquipSlot)) + wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectEquipItemSlot)) + wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseEquipItemSlot)) + wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseEquipItemSlot)) + wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInEquipItem)) + wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutEquipItem)) + + ## Deck + self.deckTab[0].SetToggleDownEvent(lambda arg=0: self.SetDeckPage(arg)) + self.deckTab[1].SetToggleDownEvent(lambda arg=1: self.SetDeckPage(arg)) + self.deckTab[0].SetToggleUpEvent(lambda arg=0: self.__DeckButtonDown(arg)) + self.deckTab[1].SetToggleUpEvent(lambda arg=1: self.__DeckButtonDown(arg)) + self.deckTab[0].Down() + ## Grade button + self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg)) + self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg)) + self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg)) + self.inventoryTab[3].SetEvent(lambda arg=3: self.SetInventoryPage(arg)) + self.inventoryTab[4].SetEvent(lambda arg=4: self.SetInventoryPage(arg)) + self.inventoryTab[0].Down() + ## Etc + self.wndItem = wndItem + self.wndEquip = wndEquip + + self.dlgQuestion = uiCommon.QuestionDialog2() + self.dlgQuestion.Close() + + self.activateButton.SetToggleDownEvent(ui.__mem_func__(self.ActivateButtonClick)) + self.activateButton.SetToggleUpEvent(ui.__mem_func__(self.ActivateButtonClick)) + self.wndPopupDialog = uiCommon.PopupDialog() + + ## + self.listHighlightedSlot = [] + + ## Refresh + self.SetInventoryPage(0) + self.RefreshItemSlot() + self.RefreshEquipSlotWindow() + self.RefreshBagSlotWindow() + self.SetDSKindIndex(0) + self.activateButton.Enable() + self.deckTab[self.deckPageIndex].Down() + self.activateButton.SetUp() + + def Destroy(self): + self.ClearDictionary() + self.tooltipItem = None + self.wndItem = 0 + self.wndEquip = 0 + self.activateButton = 0 + self.questionDialog = None + self.mallButton = None + self.inventoryTab = [] + self.deckTab = [] + self.equipmentTab = [] + self.tabDict = None + self.tabButtonDict = None + + def Close(self): + if None != self.tooltipItem: + self.tooltipItem.HideToolTip() + self.Hide() + + def __DeckButtonDown(self, deck): + self.deckTab[deck].Down() + + def SetInventoryPage(self, page): + if self.inventoryPageIndex != page: + self.__HighlightSlot_ClearCurrentPage() + self.inventoryPageIndex = page + self.inventoryTab[(page+1)%5].SetUp() + self.inventoryTab[(page+2)%5].SetUp() + self.inventoryTab[(page+3)%5].SetUp() + self.inventoryTab[(page+4)%5].SetUp() + self.RefreshBagSlotWindow() + + def SetItemToolTip(self, tooltipItem): + self.tooltipItem = tooltipItem + + def RefreshItemSlot(self): + self.RefreshBagSlotWindow() + self.RefreshEquipSlotWindow() + + def RefreshEquipSlotWindow(self): + for i in xrange(6): + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i) + itemVnum = player.GetItemIndex(slotNumber) + self.wndEquip.SetItemSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i, itemVnum, 0) + self.wndEquip.EnableSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i) + + if itemVnum != 0: + item.SelectItem(itemVnum) + for j in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(j) + + # 关俊辑 remain_time捞 0捞窍牢瘤 眉农 窍扁 锭巩俊 烙狼狼 剧荐肺 檬扁拳 + remain_time = 999 + # 老窜 泅犁 鸥捞赣绰 捞 技俺 挥捞促. + if item.LIMIT_REAL_TIME == limitType: + remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp() + elif item.LIMIT_REAL_TIME_START_FIRST_USE == limitType: + remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp() + elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType: + remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) + + if remain_time <= 0: + self.wndEquip.DisableSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i) + break + + self.wndEquip.RefreshSlot() + + def RefreshStatus(self): + self.RefreshItemSlot() + + def __InventoryLocalSlotPosToGlobalSlotPos(self, window_type, local_slot_pos): + if player.INVENTORY == window_type: + return self.deckPageIndex * player.DRAGON_SOUL_EQUIPMENT_FIRST_SIZE + local_slot_pos + + return (self.DSKindIndex * 5 * player.DRAGON_SOUL_PAGE_SIZE) + self.inventoryPageIndex * player.DRAGON_SOUL_PAGE_SIZE + local_slot_pos + + def RefreshBagSlotWindow(self): + getItemVNum=player.GetItemIndex + getItemCount=player.GetItemCount + setItemVnum=self.wndItem.SetItemSlot + for i in xrange(player.DRAGON_SOUL_PAGE_SIZE): + self.wndItem.EnableSlot(i) + #<- dragon soul kind + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, i) + + itemCount = getItemCount(player.DRAGON_SOUL_INVENTORY, slotNumber) + if 0 == itemCount: + self.wndItem.ClearSlot(i) + continue + elif 1 == itemCount: + itemCount = 0 + itemVnum = getItemVNum(player.DRAGON_SOUL_INVENTORY, slotNumber) + + setItemVnum(i, itemVnum, itemCount) + + if itemVnum != 0: + item.SelectItem(itemVnum) + for j in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(j) + + # 关俊辑 remain_time捞 澜荐牢瘤 眉农 窍扁 锭巩俊 烙狼狼 剧荐肺 檬扁拳 + remain_time = 999 + if item.LIMIT_REAL_TIME == limitType: + remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0) + elif item.LIMIT_REAL_TIME_START_FIRST_USE == limitType: + remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0) + elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType: + remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0) + + if remain_time <= 0: + self.wndItem.DisableSlot(i) + break + + self.__HighlightSlot_RefreshCurrentPage() + self.wndItem.RefreshSlot() + + def ShowToolTip(self, window_type, slotIndex): + if None != self.tooltipItem: + if player.INVENTORY == window_type: + self.tooltipItem.SetInventoryItem(slotIndex) + else: + self.tooltipItem.SetInventoryItem(slotIndex, player.DRAGON_SOUL_INVENTORY) + + def OnPressEscapeKey(self): + self.Close() + return True + + def OnTop(self): + if None != self.tooltipItem: + self.tooltipItem.SetTop() + + # item slot 包访 窃荐 + def OverOutItem(self): + self.wndItem.SetUsableItem(False) + if None != self.tooltipItem: + self.tooltipItem.HideToolTip() + + def OverInItem(self, overSlotPos): + self.wndItem.DeactivateSlot(overSlotPos) + overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, overSlotPos) + try: + self.listHighlightedSlot.remove(overSlotPos) + except: + pass + + self.wndItem.SetUsableItem(False) + self.ShowToolTip(player.DRAGON_SOUL_INVENTORY, overSlotPos) + + def __UseItem(self, slotIndex): + ItemVNum = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, slotIndex) + if 0 == player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotIndex, 0): + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_EXPIRED) + self.wndPopupDialog.Open() + return + + self.__EquipItem(slotIndex) + + def __EquipItem(self, slotIndex): + ItemVNum = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, slotIndex) + item.SelectItem(ItemVNum) + subType = item.GetItemSubType() + equipSlotPos = player.DRAGON_SOUL_EQUIPMENT_SLOT_START + self.deckPageIndex * player.DRAGON_SOUL_EQUIPMENT_FIRST_SIZE + subType + srcItemPos = (player.DRAGON_SOUL_INVENTORY, slotIndex) + dstItemPos = (player.INVENTORY, equipSlotPos) + self.__OpenQuestionDialog(True, srcItemPos, dstItemPos) + + def SelectItemSlot(self, itemSlotIndex): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, itemSlotIndex) + + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex() + + attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) + if player.RESERVED_WINDOW != attachedInvenType: + net.SendItemUseToItemPacket(attachedInvenType, attachedSlotPos, player.DRAGON_SOUL_INVENTORY, itemSlotIndex) + + mouseModule.mouseController.DeattachObject() + + else: + ## 惑痢俊辑 迫档废 眠啊 + ## 20140220 + curCursorNum = app.GetCursor() + + if app.SELL == curCursorNum: + self.__SellItem(itemSlotIndex) + elif app.BUY == curCursorNum: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO) + elif app.IsPressed(app.DIK_LALT): + link = player.GetItemLink(player.DRAGON_SOUL_INVENTORY, itemSlotIndex) + ime.PasteString(link) + else: + selectedItemVNum = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, itemSlotIndex) + itemCount = player.GetItemCount(player.DRAGON_SOUL_INVENTORY, itemSlotIndex) + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_DRAGON_SOUL_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount) + self.wndItem.SetUseMode(False) + snd.PlaySound("sound/ui/pick.wav") + + ## 惑痢俊 迫扁 + ## 2014.02.20 眠啊 + def __SellItem(self, itemSlotPos): + if not player.IsDSEquipmentSlot(player.DRAGON_SOUL_INVENTORY, itemSlotPos): + self.sellingSlotNumber = itemSlotPos + itemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, itemSlotPos) + itemCount = player.GetItemCount(player.DRAGON_SOUL_INVENTORY, itemSlotPos) + + 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 + + itemPrice = item.GetISellItemPrice() + + if item.Is1GoldItem(): + itemPrice = itemCount / itemPrice / 5 + else: + itemPrice = itemPrice * itemCount / 5 + + item.GetItemName(itemIndex) + itemName = item.GetItemName() + + self.questionDialog = uiCommon.QuestionDialog() + self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice)) + self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem)) + self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog)) + self.questionDialog.Open() + self.questionDialog.count = itemCount + + ## 惑痢俊 迫扁 + def SellItem(self): + + net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.DRAGON_SOUL_INVENTORY) + snd.PlaySound("sound/ui/money.wav") + self.OnCloseQuestionDialog() + + ## 惑痢俊 迫扁 + def OnCloseQuestionDialog(self): + if self.questionDialog: + self.questionDialog.Close() + + self.questionDialog = None + + ## 惑痢俊 迫扁 + def __OnClosePopupDialog(self): + self.pop = None + + def SelectEmptySlot(self, selectedSlotPos): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, selectedSlotPos) + if mouseModule.mouseController.isAttached(): + + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + + attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) + if player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType: + mouseModule.mouseController.RunCallBack("INVENTORY") + + elif player.SLOT_TYPE_SHOP == attachedSlotType: + net.SendShopBuyPacket(attachedSlotPos) + + elif player.SLOT_TYPE_SAFEBOX == attachedSlotType: + if player.ITEM_MONEY == attachedItemIndex: + net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount()) + snd.PlaySound("sound/ui/money.wav") + + else: + net.SendSafeboxCheckoutPacket(attachedSlotPos, player.DRAGON_SOUL_INVENTORY, selectedSlotPos) + + elif player.SLOT_TYPE_MALL == attachedSlotType: + net.SendMallCheckoutPacket(attachedSlotPos, player.DRAGON_SOUL_INVENTORY, selectedSlotPos) + + elif player.RESERVED_WINDOW != attachedInvenType: + if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos): + srcItemPos = (attachedInvenType, attachedSlotPos) + dstItemPos = (player.DRAGON_SOUL_INVENTORY, selectedSlotPos) + self.__OpenQuestionDialog(False, srcItemPos, dstItemPos) + else: + itemCount = player.GetItemCount(attachedInvenType, attachedSlotPos) + attachedCount = mouseModule.mouseController.GetAttachedItemCount() + + self.__SendMoveItemPacket(attachedInvenType, attachedSlotPos, player.DRAGON_SOUL_INVENTORY, selectedSlotPos, attachedCount) + + mouseModule.mouseController.DeattachObject() + + def UseItemSlot(self, slotIndex): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): + return + slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, slotIndex) + try: + # 侩去籍 碍拳芒捞 凯妨乐栏搁, 酒捞袍 快努腐 矫 磊悼栏肺 碍拳芒栏肺 甸绢皑. + if self.wndDragonSoulRefine.IsShow(): + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP) + return + self.wndDragonSoulRefine.AutoSetItem((player.DRAGON_SOUL_INVENTORY, slotIndex), 1) + return + except: + pass + + self.__UseItem(slotIndex) + + mouseModule.mouseController.DeattachObject() + self.OverOutItem() + + def __SendMoveItemPacket(self, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, srcItemCount): + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP) + return + + net.SendItemMovePacket(srcSlotWindow , srcSlotPos, dstSlotWindow, dstSlotPos, srcItemCount) + + # equip 浇吩 包访 窃荐甸. + def OverOutEquipItem(self): + self.OverOutItem() + + def OverInEquipItem(self, overSlotPos): + overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, overSlotPos) + self.wndItem.SetUsableItem(False) + self.ShowToolTip(player.INVENTORY, overSlotPos) + + def UseEquipItemSlot(self, slotIndex): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): + return + + slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, slotIndex) + + self.__UseEquipItem(slotIndex) + mouseModule.mouseController.DeattachObject() + self.OverOutEquipItem() + + def __UseEquipItem(self, slotIndex): + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP) + return + + self.__OpenQuestionDialog(False, (player.INVENTORY, slotIndex), (1, 1)) + + + def SelectEquipItemSlot(self, itemSlotIndex): + + ## 付快胶 滚瓢捞 sell buy 眉农 秦辑 return + curCursorNum = app.GetCursor() + if app.SELL == curCursorNum: + return + elif app.BUY == curCursorNum: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO) + return + + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, itemSlotIndex) + + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + # 磊扁 磊脚阑 磊扁 磊脚俊霸 靛贰弊窍绰 版快 + if player.SLOT_TYPE_INVENTORY == attachedSlotType and itemSlotIndex == attachedSlotPos: + return + + attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex() + + attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) + if player.RESERVED_WINDOW != attachedInvenType: + net.SendItemUseToItemPacket(attachedInvenType, attachedSlotPos, player.INVENTORY, itemSlotIndex) + + mouseModule.mouseController.DeattachObject() + else: + selectedItemVNum = player.GetItemIndex(player.INVENTORY, itemSlotIndex) + itemCount = player.GetItemCount(player.INVENTORY, itemSlotIndex) + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount) + self.wndItem.SetUseMode(False) + snd.PlaySound("sound/ui/pick.wav") + + def SelectEmptyEquipSlot(self, selectedSlot): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, selectedSlot) + + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + + if player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType: + if 0 == player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, attachedSlotPos, 0): + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_EXPIRED) + self.wndPopupDialog.Open() + return + + item.SelectItem(attachedItemIndex) + subType = item.GetItemSubType() + if subType != (selectedSlot - player.DRAGON_SOUL_EQUIPMENT_SLOT_START): + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNMATCHED_SLOT) + self.wndPopupDialog.Open() + else: + srcItemPos = (player.DRAGON_SOUL_INVENTORY, attachedSlotPos) + dstItemPos = (player.INVENTORY, selectedSlotPos) + self.__OpenQuestionDialog(True, srcItemPos, dstItemPos) + + mouseModule.mouseController.DeattachObject() + # equip 浇吩 包访 窃荐甸 场. + + # 版绊芒 包访 + def __OpenQuestionDialog(self, Equip, srcItemPos, dstItemPos): + self.srcItemPos = srcItemPos + self.dstItemPos = dstItemPos + + self.dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.__Accept)) + self.dlgQuestion.SetCancelEvent(ui.__mem_func__(self.__Cancel)) + + if Equip: + self.dlgQuestion.SetText1(localeInfo.DRAGON_SOUL_EQUIP_WARNING1) + self.dlgQuestion.SetText2(localeInfo.DRAGON_SOUL_EQUIP_WARNING2) + else: + self.dlgQuestion.SetText1(localeInfo.DRAGON_SOUL_UNEQUIP_WARNING1) + self.dlgQuestion.SetText2(localeInfo.DRAGON_SOUL_UNEQUIP_WARNING2) + + self.dlgQuestion.Open() + + def __Accept(self): + if (-1, -1) == self.dstItemPos: + net.SendItemUsePacket(*self.srcItemPos) + else: + self.__SendMoveItemPacket(*(self.srcItemPos + self.dstItemPos + (0,))) + self.dlgQuestion.Close() + + def __Cancel(self): + self.srcItemPos = (0, 0) + self.dstItemPos = (0, 0) + self.dlgQuestion.Close() + + # 版绊芒 包访 场 + + def SetDSKindIndex(self, kindIndex): + if self.DSKindIndex != kindIndex: + self.__HighlightSlot_ClearCurrentPage() + + self.DSKindIndex = kindIndex + + for (tabKey, tabButton) in self.tabButtonDict.items(): + if kindIndex!=tabKey: + tabButton.SetUp() + + for tabValue in self.tabDict.itervalues(): + tabValue.Hide() + + self.tabDict[kindIndex].Show() + self.tabText.SetText(DragonSoulWindow.KIND_TAP_TITLES[kindIndex]) + + self.RefreshBagSlotWindow() + + def SetDeckPage(self, page): + if page == self.deckPageIndex: + return + + if self.isActivated: + self.DeactivateDragonSoul() + net.SendChatPacket("/dragon_soul deactivate") + self.deckPageIndex = page + self.deckTab[page].Down() + self.deckTab[(page+1)%2].SetUp() + + self.RefreshEquipSlotWindow() + + # 侩去籍 劝己拳 包访 + def ActivateDragonSoulByExtern(self, deck): + self.isActivated = True + self.activateButton.Down() + self.deckPageIndex = deck + self.deckTab[deck].Down() + self.deckTab[(deck+1)%2].SetUp() + self.RefreshEquipSlotWindow() + + def DeactivateDragonSoul(self): + self.isActivated = False + self.activateButton.SetUp() + + def ActivateButtonClick(self): + self.isActivated = self.isActivated ^ True + if self.isActivated: + if self.__CanActivateDeck(): + net.SendChatPacket("/dragon_soul activate " + str(self.deckPageIndex)) + else: + self.isActivated = False + self.activateButton.SetUp() + else: + net.SendChatPacket("/dragon_soul deactivate") + + def __CanActivateDeck(self): + canActiveNum = 0 + for i in xrange(6): + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i) + itemVnum = player.GetItemIndex(slotNumber) + + if itemVnum != 0: + item.SelectItem(itemVnum) + isNoLimit = True + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + # LIMIT_TIMER_BASED_ON_WEAR绰 家南0俊 巢篮 矫埃阑 冠绰促. + # LIMIT_REAL_TIME篮 矫埃 促 登搁 酒捞袍捞 荤扼瘤骨肺 且 鞘夸啊 绝促. + # LIMIT_REAL_TIME_START_FIRST_USE绰 辑滚俊 力措肺 沥狼登瘤 臼酒 老窜 忱敌促. + if item.LIMIT_TIMER_BASED_ON_WEAR == limitType: + isNoLimit = False + remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) + if 0 != remain_time: + canActiveNum += 1 + break + # 鸥捞赣啊 绝促搁 Activate且 荐 乐绰 侩去籍. + if isNoLimit: + canActiveNum += 1 + + return canActiveNum > 0 + + # 劝己拳 包访 场 + + # 浇吩 highlight 包访 + def __HighlightSlot_ClearCurrentPage(self): + for i in xrange(self.wndItem.GetSlotCount()): + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, i) + if slotNumber in self.listHighlightedSlot: + self.wndItem.DeactivateSlot(i) + self.listHighlightedSlot.remove(slotNumber) + + def __HighlightSlot_RefreshCurrentPage(self): + for i in xrange(self.wndItem.GetSlotCount()): + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, i) + if slotNumber in self.listHighlightedSlot: + self.wndItem.ActivateSlot(i) + + def HighlightSlot(self, slot): + if not slot in self.listHighlightedSlot: + self.listHighlightedSlot.append (slot) + # 浇吩 highlight 包访 场 + + def SetDragonSoulRefineWindow(self, wndDragonSoulRefine): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + from _weakref import proxy + self.wndDragonSoulRefine = proxy(wndDragonSoulRefine) + +## 碍拳且 荐 绝绰 版快 朝府绰 抗寇 +#class DragonSoulRefineException(Exception): + #pass + +class DragonSoulRefineWindow(ui.ScriptWindow): + REFINE_TYPE_GRADE, REFINE_TYPE_STEP, REFINE_TYPE_STRENGTH = xrange(3) + DS_SUB_HEADER_DIC = { + REFINE_TYPE_GRADE : player.DS_SUB_HEADER_DO_UPGRADE, + REFINE_TYPE_STEP : player.DS_SUB_HEADER_DO_IMPROVEMENT, + REFINE_TYPE_STRENGTH : player.DS_SUB_HEADER_DO_REFINE + } + REFINE_STONE_SLOT, DRAGON_SOUL_SLOT = xrange(2) + + INVALID_DRAGON_SOUL_INFO = -1 + + def __init__(self): + ui.ScriptWindow.__init__(self) + self.tooltipItem = None + self.sellingSlotNumber = -1 + self.isLoaded = 0 + self.refineChoiceButtonDict = None + self.doRefineButton = None + self.wndMoney = None + self.SetWindowName("DragonSoulRefineWindow") + self.__LoadWindow() + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def Show(self): + self.__LoadWindow() + ui.ScriptWindow.Show(self) + + def __LoadWindow(self): + if self.isLoaded == 1: + return + self.isLoaded = 1 + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "dragonsoulrefinewindow.py") + + except: + import exception + exception.Abort("dragonsoulrefinewindow.LoadWindow.LoadObject") + try: + if localeInfo.IsARABIC(): + self.board = self.GetChild("DragonSoulRefineWindowBaseImage") + self.board.SetScale(-1.0, 1.0) + self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0) + + wndRefineSlot = self.GetChild("RefineSlot") + wndResultSlot = self.GetChild("ResultSlot") + self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close)) + self.refineChoiceButtonDict = { + self.REFINE_TYPE_GRADE : self.GetChild("GradeButton"), + self.REFINE_TYPE_STEP: self.GetChild("StepButton"), + self.REFINE_TYPE_STRENGTH : self.GetChild("StrengthButton"), + } + self.doRefineButton = self.GetChild("DoRefineButton") + self.wndMoney = self.GetChild("Money_Slot") + + except: + import exception + exception.Abort("DragonSoulRefineWindow.LoadWindow.BindObject") + + + ## Item Slots + wndRefineSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInRefineItem)) + wndRefineSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem)) + wndRefineSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.__SelectRefineEmptySlot)) + wndRefineSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot)) + wndRefineSlot.SetUseSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot)) + wndRefineSlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot)) + + wndResultSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInResultItem)) + wndResultSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem)) + self.wndRefineSlot = wndRefineSlot + self.wndResultSlot = wndResultSlot + + ## Button + self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleDownEvent(self.__ToggleDownGradeButton) + self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleDownEvent(self.__ToggleDownStepButton) + self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleDownEvent(self.__ToggleDownStrengthButton) + self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_GRADE)) + self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STEP)) + self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STRENGTH)) + self.doRefineButton.SetEvent(self.__PressDoRefineButton) + + ## Dialog + self.wndPopupDialog = uiCommon.PopupDialog() + + self.currentRefineType = self.REFINE_TYPE_GRADE + self.refineItemInfo = {} + self.resultItemInfo = {} + self.currentRecipe = {} + + self.wndMoney.SetText(localeInfo.NumberToMoneyString(0)) + self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down() + + self.__Initialize() + + def Destroy(self): + self.ClearDictionary() + self.tooltipItem = None + self.wndItem = 0 + self.wndEquip = 0 + self.activateButton = 0 + self.questionDialog = None + self.mallButton = None + self.inventoryTab = [] + self.deckTab = [] + self.equipmentTab = [] + self.tabDict = None + self.tabButtonDict = None + + def Close(self): + if None != self.tooltipItem: + self.tooltipItem.HideToolTip() + + self.__FlushRefineItemSlot() + player.SendDragonSoulRefine(player.DRAGON_SOUL_REFINE_CLOSE) + self.Hide() + + def Show(self): + self.currentRefineType = self.REFINE_TYPE_GRADE + self.wndMoney.SetText(localeInfo.NumberToMoneyString(0)) + self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down() + self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetUp() + self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetUp() + + self.Refresh() + + ui.ScriptWindow.Show(self) + + def SetItemToolTip(self, tooltipItem): + self.tooltipItem = tooltipItem + + # 滚瓢 喘妨 乐绰 惑怕甫 力寇茄 葛电 碍拳芒 包访 函荐甸阑 檬扁拳. + def __Initialize(self): + self.currentRecipe = {} + self.refineItemInfo = {} + self.resultItemInfo = {} + + if self.REFINE_TYPE_STRENGTH == self.currentRefineType: + self.refineSlotLockStartIndex = 2 + else: + self.refineSlotLockStartIndex = 1 + + for i in xrange(self.refineSlotLockStartIndex): + self.wndRefineSlot.HideSlotBaseImage(i) + + self.wndMoney.SetText(localeInfo.NumberToMoneyString(0)) + + def __FlushRefineItemSlot(self): + ## Item slot settings + # 盔贰 牢亥狼 酒捞袍 墨款飘 雀汗 + for invenType, invenPos, itemCount in self.refineItemInfo.values(): + remainCount = player.GetItemCount(invenType, invenPos) + player.SetItemCount(invenType, invenPos, remainCount + itemCount) + self.__Initialize() + + def __ToggleUpButton(self, idx): + #if self.REFINE_TYPE_GRADE == self.currentRefineType: + self.refineChoiceButtonDict[idx].Down() + + def __ToggleDownGradeButton(self): + if self.REFINE_TYPE_GRADE == self.currentRefineType: + return + self.refineChoiceButtonDict[self.currentRefineType].SetUp() + self.currentRefineType = self.REFINE_TYPE_GRADE + self.__FlushRefineItemSlot() + self.Refresh() + + def __ToggleDownStepButton(self): + if self.REFINE_TYPE_STEP == self.currentRefineType: + return + self.refineChoiceButtonDict[self.currentRefineType].SetUp() + self.currentRefineType = self.REFINE_TYPE_STEP + self.__FlushRefineItemSlot() + self.Refresh() + + def __ToggleDownStrengthButton(self): + if self.REFINE_TYPE_STRENGTH == self.currentRefineType: + return + self.refineChoiceButtonDict[self.currentRefineType].SetUp() + self.currentRefineType = self.REFINE_TYPE_STRENGTH + self.__FlushRefineItemSlot() + self.Refresh() + + def __PopUp(self, message): + self.wndPopupDialog.SetText(message) + self.wndPopupDialog.Open() + + def __SetItem(self, inven, dstSlotIndex, itemCount): + invenType, invenPos = inven + + if dstSlotIndex >= self.refineSlotLockStartIndex: + return False + + itemVnum = player.GetItemIndex(invenType, invenPos) + maxCount = player.GetItemCount(invenType, invenPos) + + if itemCount > maxCount: + raise Exception, ("Invalid attachedItemCount(%d). (base pos (%d, %d), base itemCount(%d))" % (itemCount, invenType, invenPos, maxCount)) + #return False + + # strength 碍拳老 版快, 0锅浚 碍拳籍, 1锅浚 侩去籍阑 初档废 碍力窃. + if DragonSoulRefineWindow.REFINE_TYPE_STRENGTH == self.currentRefineType: + if self.__IsDragonSoul(itemVnum): + dstSlotIndex = 1 + else: + dstSlotIndex = 0 + + # 后 浇吩捞绢具窃. + if dstSlotIndex in self.refineItemInfo: + return False + + # 碍拳芒俊 棵副 荐 乐绰 酒捞袍牢瘤 八荤. + if False == self.__CheckCanRefine(itemVnum): + return False + + # 缠绢促 初篮 酒捞袍 墨款飘父怒 盔贰 磊府狼 酒捞袍 墨款飘 皑家 + player.SetItemCount(invenType, invenPos, maxCount - itemCount) + self.refineItemInfo[dstSlotIndex] = (invenType, invenPos, itemCount) + self.Refresh() + + return True + + # 碍拳 啊瓷茄 酒捞袍牢瘤 眉农 + # 侩去籍 碍拳绰 碍拳 饭矫乔甫 沥秦初绊 矫累窍绰 巴捞 酒聪扼, + # 贸澜俊 碍拳芒俊 棵赴 侩去籍俊 狼秦 碍拳 饭矫乔啊 搬沥等促. + # 弊贰辑 __CanRefineGrade, __CanRefineStep, __CanRefineStrength 窃荐俊辑 + # 碍拳 饭矫乔啊 绝促搁(贸澜 棵府绰 酒捞袍捞扼搁), 碍拳 饭矫乔甫 汲沥秦林绰 开且档 茄促. + def __CheckCanRefine(self, vnum): + if self.REFINE_TYPE_GRADE == self.currentRefineType: + return self.__CanRefineGrade(vnum) + + elif self.REFINE_TYPE_STEP == self.currentRefineType: + return self.__CanRefineStep(vnum) + + elif self.REFINE_TYPE_STRENGTH == self.currentRefineType: + return self.__CanRefineStrength(vnum) + + else: + return False + + def __CanRefineGrade (self, vnum): + ds_info = self.__GetDragonSoulTypeInfo(vnum) + + if DragonSoulRefineWindow.INVALID_DRAGON_SOUL_INFO == ds_info: + self.__PopUp(localeInfo.DRAGON_SOUL_IS_NOT_DRAGON_SOUL) + return False + + if self.currentRecipe: + ds_type, grade, step, strength = ds_info + cur_refine_ds_type, cur_refine_grade, cur_refine_step, cur_refine_strength = self.currentRecipe["ds_info"] + if not (cur_refine_ds_type == ds_type and cur_refine_grade == grade): + self.__PopUp(localeInfo.DRAGON_SOUL_INVALID_DRAGON_SOUL) + return False + # 碍拳 芒俊 贸澜 酒捞袍阑 棵府绰 版快, 碍拳 犁丰俊 包茄 沥焊啊 绝促. + # 侩去籍 碍拳啊, 饭矫乔甫 啊瘤绊 矫累窍绰 巴捞 酒聪扼, 碍拳芒俊 贸澜 棵府绰 酒捞袍捞 公均捞衬俊 蝶扼, + # 公均阑 碍拳窍绊, 犁丰啊 公均牢瘤(捞窍 饭矫乔)啊 沥秦柳促. + # 饭矫乔啊 绝促搁, 贸澜 棵赴 酒捞袍捞扼 积阿窍绊, vnum阑 官帕栏肺 饭矫乔甫 悸泼. + else: + self.currentRecipe = self.__GetRefineGradeRecipe(vnum) + + if self.currentRecipe: + self.refineSlotLockStartIndex = self.currentRecipe["need_count"] + self.wndMoney.SetText(localeInfo.NumberToMoneyString(self.currentRecipe["fee"])) + return True + else: + # 碍拳 沥焊 悸泼俊 角菩窍搁 棵副 荐 绝绰 酒捞袍栏肺 魄窜. + self.__PopUp(localeInfo.DRAGON_SOUL_CANNOT_REFINE) + return False + + def __CanRefineStep (self, vnum): + ds_info = self.__GetDragonSoulTypeInfo(vnum) + + if DragonSoulRefineWindow.INVALID_DRAGON_SOUL_INFO == ds_info: + self.__PopUp(localeInfo.DRAGON_SOUL_IS_NOT_DRAGON_SOUL) + return False + + if self.currentRecipe: + ds_type, grade, step, strength = ds_info + cur_refine_ds_type, cur_refine_grade, cur_refine_step, cur_refine_strength = self.currentRecipe["ds_info"] + if not (cur_refine_ds_type == ds_type and cur_refine_grade == grade and cur_refine_step == step): + self.__PopUp(localeInfo.DRAGON_SOUL_INVALID_DRAGON_SOUL) + return False + # 碍拳 芒俊 贸澜 酒捞袍阑 棵府绰 版快, 犁丰俊 包茄 沥焊啊 绝促. + # 侩去籍 碍拳啊, 饭矫乔甫 啊瘤绊 矫累窍绰 巴捞 酒聪扼, 碍拳芒俊 贸澜 棵府绰 酒捞袍捞 公均捞衬俊 蝶扼, + # 公均阑 碍拳窍绊, 犁丰啊 公均牢瘤(捞窍 饭矫乔)啊 沥秦柳促. + # 饭矫乔啊 绝促搁, 贸澜 棵赴 酒捞袍捞扼 积阿窍绊, vnum阑 官帕栏肺 饭矫乔甫 悸泼. + else: + self.currentRecipe = self.__GetRefineStepRecipe(vnum) + + if self.currentRecipe: + self.refineSlotLockStartIndex = self.currentRecipe["need_count"] + self.wndMoney.SetText(localeInfo.NumberToMoneyString(self.currentRecipe["fee"])) + return True + + else: + # 碍拳 沥焊 悸泼俊 角菩窍搁 棵副 荐 绝绰 酒捞袍栏肺 魄窜. + self.__PopUp(localeInfo.DRAGON_SOUL_CANNOT_REFINE) + return False + + def __CanRefineStrength (self, vnum): + # 侩去籍牢 版快, 歹 捞惑 strength 碍拳甫 且 荐 绝绰瘤 眉农秦具窃. + if self.__IsDragonSoul(vnum): + ds_type, grade, step, strength = self.__GetDragonSoulTypeInfo(vnum) + + import dragon_soul_refine_settings + if strength >= dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["strength_max_table"][grade][step]: + self.__PopUp(localeInfo.DRAGON_SOUL_CANNOT_REFINE_MORE) + return False + + else: + return True + + # strength 碍拳狼 版快, refine_recipe啊 侩去籍狼 辆幅啊 酒囱, 碍拳籍狼 辆幅俊 蝶扼 崔扼柳促. + # 蝶扼辑 侩去籍捞 酒聪扼搁, + # 捞固 饭矫乔啊 乐绰 版快绰, 碍拳籍捞 碍拳芒俊 乐促绰 巴捞骨肺, return False + # 饭矫乔啊 绝绰 版快绰, 碍拳籍牢瘤 犬牢窍绊, 饭矫乔甫 悸泼茄促. + else: + if self.currentRecipe: + self.__PopUp(localeInfo.DRAGON_SOUL_IS_NOT_DRAGON_SOUL) + return False + else: + refineRecipe = self.__GetRefineStrengthInfo(vnum) + if refineRecipe: + self.currentRecipe = refineRecipe + self.wndMoney.SetText(localeInfo.NumberToMoneyString(self.currentRecipe["fee"])) + return True + else: + # 饭矫乔甫 悸泼且 荐 绝绰 版快 + self.__PopUp(localeInfo.DRAGON_SOUL_NOT_DRAGON_SOUL_REFINE_STONE) + return False + + def __GetRefineGradeRecipe (self, vnum): + ds_type, grade, step, strength = self.__GetDragonSoulTypeInfo(vnum) + try: + import dragon_soul_refine_settings + + return { + "ds_info" : (ds_type, grade, step, strength), + "need_count" : dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["grade_need_count"][grade], + "fee" : dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["grade_fee"][grade] + } + except: + return None + + def __GetRefineStepRecipe (self, vnum): + ds_type, grade, step, strength = self.__GetDragonSoulTypeInfo(vnum) + try: + import dragon_soul_refine_settings + + return { + "ds_info" : (ds_type, grade, step, strength), + "need_count" : dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["step_need_count"][step], + "fee" : dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["step_fee"][step] + } + except: + return None + + # strength 碍拳狼 版快, refineInfo绰 碍拳籍俊 蝶扼 崔扼柳促. + def __GetRefineStrengthInfo (self, itemVnum): + try: + # 捞仇狼 困摹甫 绢骂窍瘤.... + # 碍拳籍捞 酒聪搁 救凳. + item.SelectItem(itemVnum) + if not (item.ITEM_TYPE_MATERIAL == item.GetItemType() \ + and (item.MATERIAL_DS_REFINE_NORMAL <= item.GetItemSubType() and item.GetItemSubType() <= item.MATERIAL_DS_REFINE_HOLLY)): + return None + + import dragon_soul_refine_settings + return { "fee" : dragon_soul_refine_settings.strength_fee[item.GetItemSubType()] } + except: + return None + + def __IsDragonSoul(self, vnum): + item.SelectItem(vnum) + return item.GetItemType() == item.ITEM_TYPE_DS + + # 侩去籍 Vnum俊 措茄 comment + # ITEM VNUM阑 10父 磊府何磐, FEDCBA扼绊 茄促搁 + # FE : 侩去籍 辆幅. D : 殿鞭 + # C : 窜拌 B : 碍拳 + # A : 咯国狼 锅龋甸... + def __GetDragonSoulTypeInfo(self, vnum): + if not self.__IsDragonSoul(vnum): + return DragonSoulRefineWindow.INVALID_DRAGON_SOUL_INFO + ds_type = vnum / 10000 + grade = vnum % 10000 /1000 + step = vnum % 1000 / 100 + strength = vnum % 100 / 10 + + return (ds_type, grade, step, strength) + + def __MakeDragonSoulVnum(self, ds_type, grade, step, strength): + return ds_type * 10000 + grade * 1000 + step * 100 + strength * 10 + + ## 后 浇吩 急琶 Event + def __SelectRefineEmptySlot(self, selectedSlotPos): + try: + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + if selectedSlotPos >= self.refineSlotLockStartIndex: + return + + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + mouseModule.mouseController.DeattachObject() + + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP) + return + + attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) + + if player.INVENTORY == attachedInvenType and player.IsEquipmentSlot(attachedSlotPos): + return + + if player.INVENTORY != attachedInvenType and player.DRAGON_SOUL_INVENTORY != attachedInvenType: + return + + if True == self.__SetItem((attachedInvenType, attachedSlotPos), selectedSlotPos, attachedItemCount): + self.Refresh() + + except Exception, e: + import dbg + dbg.TraceError("Exception : __SelectRefineEmptySlot, %s" % e) + + # 努腐栏肺 浇吩俊辑 昏力. + def __SelectRefineItemSlot(self, selectedSlotPos): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + try: + if not selectedSlotPos in self.refineItemInfo: + # 货肺款 酒捞袍阑 碍拳芒俊 棵府绰 累诀. + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + mouseModule.mouseController.DeattachObject() + + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP) + return + + attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) + + if player.INVENTORY == attachedInvenType and player.IsEquipmentSlot(attachedSlotPos): + return + + if player.INVENTORY != attachedInvenType and player.DRAGON_SOUL_INVENTORY != attachedInvenType: + return + + self.AutoSetItem((attachedInvenType, attachedSlotPos), 1) + return + elif mouseModule.mouseController.isAttached(): + return + + attachedInvenType, attachedSlotPos, attachedItemCount = self.refineItemInfo[selectedSlotPos] + selectedItemVnum = player.GetItemIndex(attachedInvenType, attachedSlotPos) + + # 碍拳芒俊辑 昏力 棺 盔贰 牢亥狼 酒捞袍 墨款飘 雀汗 + invenType, invenPos, itemCount = self.refineItemInfo[selectedSlotPos] + remainCount = player.GetItemCount(invenType, invenPos) + player.SetItemCount(invenType, invenPos, remainCount + itemCount) + del self.refineItemInfo[selectedSlotPos] + + # 碍拳芒捞 厚菌促搁, 檬扁拳 + if not self.refineItemInfo: + self.__Initialize() + else: + item.SelectItem(selectedItemVnum) + # 绝矩 酒捞袍捞 碍拳籍捞菌促搁 碍拳 饭乔矫 檬扁拳 + if (item.ITEM_TYPE_MATERIAL == item.GetItemType() \ + and (item.MATERIAL_DS_REFINE_NORMAL <= item.GetItemSubType() and item.GetItemSubType() <= item.MATERIAL_DS_REFINE_HOLLY)): + self.currentRecipe = {} + self.wndMoney.SetText(localeInfo.NumberToMoneyString(0)) + # 侩去籍捞菌促搁, + # strength碍拳啊 酒囱 版快, 碍拳芒俊 促弗 侩去籍捞 巢酒乐栏骨肺, 饭矫乔甫 檬扁拳窍搁 救凳. + # strength碍拳狼 版快, 碍拳 饭矫乔绰 碍拳籍俊 辆加等 巴捞骨肺 促弗 贸府且 鞘夸啊 绝澜. + else: + pass + + except Exception, e: + import dbg + dbg.TraceError("Exception : __SelectRefineItemSlot, %s" % e) + + self.Refresh() + + def __OverInRefineItem(self, slotIndex): + if self.refineItemInfo.has_key(slotIndex): + inven_type, inven_pos, item_count = self.refineItemInfo[slotIndex] + self.tooltipItem.SetInventoryItem(inven_pos, inven_type) + + def __OverInResultItem(self, slotIndex): + if self.resultItemInfo.has_key(slotIndex): + inven_type, inven_pos, item_count = self.resultItemInfo[slotIndex] + self.tooltipItem.SetInventoryItem(inven_pos, inven_type) + + def __OverOutItem(self): + if self.tooltipItem: + self.tooltipItem.HideToolTip() + + def __PressDoRefineButton(self): + for i in xrange(self.refineSlotLockStartIndex): + if not i in self.refineItemInfo: + self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_NOT_ENOUGH_MATERIAL) + self.wndPopupDialog.Open() + + return + + player.SendDragonSoulRefine(DragonSoulRefineWindow.DS_SUB_HEADER_DIC[self.currentRefineType], self.refineItemInfo) + + def OnPressEscapeKey(self): + self.Close() + return True + + def Refresh(self): + self.__RefreshRefineItemSlot() + self.__ClearResultItemSlot() + + def __RefreshRefineItemSlot(self): + try: + for slotPos in xrange(self.wndRefineSlot.GetSlotCount()): + self.wndRefineSlot.ClearSlot(slotPos) + if slotPos < self.refineSlotLockStartIndex: + # self.refineItemInfo[slotPos]狼 沥焊犬牢 + # (角力肺 酒捞袍捞 粮犁窍绰瘤 犬牢) + # 粮犁 -> 酒捞袍 酒捞能阑 浇吩俊 悸泼. + # 厚粮犁 -> 酒捞袍捞 绝栏骨肺 碍拳芒俊辑 昏力. + if slotPos in self.refineItemInfo: + invenType, invenPos, itemCount = self.refineItemInfo[slotPos] + itemVnum = player.GetItemIndex(invenType, invenPos) + + # if itemVnum: + if itemVnum: + self.wndRefineSlot.SetItemSlot(slotPos, player.GetItemIndex(invenType, invenPos), itemCount) + else: + del self.refineItemInfo[slotPos] + + # 后 浇吩俊 reference 酒捞能阑 alpha 0.5肺 悸泼. + if not slotPos in self.refineItemInfo: + try: + reference_vnum = 0 + # strength 碍拳老 锭绰, + # 0锅 浇吩俊 碍拳籍阑, 1锅 浇吩俊 侩去籍阑 初绰促. + if DragonSoulRefineWindow.REFINE_TYPE_STRENGTH == self.currentRefineType: + if DragonSoulRefineWindow.REFINE_STONE_SLOT == slotPos: + reference_vnum = 100300 + else: + reference_vnum = self.__MakeDragonSoulVnum(*self.currentRecipe["ds_info"]) + if 0 != reference_vnum: + item.SelectItem(reference_vnum) + itemIcon = item.GetIconImage() + (width, height) = item.GetItemSize() + self.wndRefineSlot.SetSlot(slotPos, 0, width, height, itemIcon, (1.0, 1.0, 1.0, 0.5)) + # slot 快螟 窍窜俊 箭磊 哆搁 救 抗惠... + self.wndRefineSlot.SetSlotCount(slotPos, 0) + except: + pass + # refineSlotLockStartIndex 焊促 累篮 浇吩篮 摧腮 捞固瘤甫 焊咯林搁 救凳. + self.wndRefineSlot.HideSlotBaseImage(slotPos) + # slotPos >= self.refineSlotLockStartIndex: + else: + # 沥惑利牢 版快扼搁 捞 if巩俊 甸绢哎 老篮 绝摆瘤父, + # (局檬俊 牢郸胶啊 refineSlotLockStartIndex 捞惑牢 浇吩俊绰 酒捞袍阑 持瘤 给窍霸 沁扁 锭巩) + # 趣矫 葛甫 俊矾俊 措厚窃. + if slotPos in self.refineItemInfo: + invenType, invenPos, itemCount = self.refineItemInfo[slotPos] + remainCount = player.GetItemCount(invenType, invenPos) + player.SetItemCount(invenType, invenPos, remainCount + itemCount) + del self.refineItemInfo[slotPos] + # refineSlotLockStartIndex 捞惑牢 浇吩篮 摧腮 捞固瘤甫 焊咯拎具窃. + self.wndRefineSlot.ShowSlotBaseImage(slotPos) + + # 碍拳芒俊 酒公繁 酒捞袍捞 绝促搁, 檬扁拳秦淋. + # 困俊辑 吝埃 吝埃俊 "del self.refineItemInfo[slotPos]"甫 沁扁 锭巩俊, + # 咯扁辑 茄锅 眉农秦拎具窃. + if not self.refineItemInfo: + self.__Initialize() + + self.wndRefineSlot.RefreshSlot() + except Exception, e: + import dbg + dbg.TraceError("Exception : __RefreshRefineItemSlot, %s" % e) + + def __GetEmptySlot(self, itemVnum = 0): + # STRENGTH 碍拳狼 版快, 侩去籍 浇吩苞 碍拳籍 浇吩捞 备盒登绢乐扁 嫐巩俊 + # vnum阑 舅酒具 茄促. + if DragonSoulRefineWindow.REFINE_TYPE_STRENGTH == self.currentRefineType: + if 0 == itemVnum: + return -1 + + if self.__IsDragonSoul(itemVnum): + if not DragonSoulRefineWindow.DRAGON_SOUL_SLOT in self.refineItemInfo: + return DragonSoulRefineWindow.DRAGON_SOUL_SLOT + else: + if not DragonSoulRefineWindow.REFINE_STONE_SLOT in self.refineItemInfo: + return DragonSoulRefineWindow.REFINE_STONE_SLOT + else: + for slotPos in xrange(self.wndRefineSlot.GetSlotCount()): + if not slotPos in self.refineItemInfo: + return slotPos + + return -1 + + def AutoSetItem(self, inven, itemCount): + invenType, invenPos = inven + itemVnum = player.GetItemIndex(invenType, invenPos) + emptySlot = self.__GetEmptySlot(itemVnum) + if -1 == emptySlot: + return + + self.__SetItem((invenType, invenPos), emptySlot, itemCount) + + def __ClearResultItemSlot(self): + self.wndResultSlot.ClearSlot(0) + self.resultItemInfo = {} + + def RefineSucceed(self, inven_type, inven_pos): + self.__Initialize() + self.Refresh() + + itemCount = player.GetItemCount(inven_type, inven_pos) + if itemCount > 0: + self.resultItemInfo[0] = (inven_type, inven_pos, itemCount) + self.wndResultSlot.SetItemSlot(0, player.GetItemIndex(inven_type, inven_pos), itemCount) + + def RefineFail(self, reason, inven_type, inven_pos): + if net.DS_SUB_HEADER_REFINE_FAIL == reason: + self.__Initialize() + self.Refresh() + itemCount = player.GetItemCount(inven_type, inven_pos) + if itemCount > 0: + self.resultItemInfo[0] = (inven_type, inven_pos, itemCount) + self.wndResultSlot.SetItemSlot(0, player.GetItemIndex(inven_type, inven_pos), itemCount) + else: + self.Refresh() + + def SetInventoryWindows(self, wndInventory, wndDragonSoul): + self.wndInventory = wndInventory + self.wndDragonSoul = wndDragonSoul diff --git a/root/uiequipmentdialog.py b/root/uiequipmentdialog.py new file mode 100644 index 0000000..8ff04df --- /dev/null +++ b/root/uiequipmentdialog.py @@ -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 diff --git a/root/uiex.py b/root/uiex.py new file mode 100644 index 0000000..1ca247a --- /dev/null +++ b/root/uiex.py @@ -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() diff --git a/root/uiexchange.py b/root/uiexchange.py new file mode 100644 index 0000000..66885a4 --- /dev/null +++ b/root/uiexchange.py @@ -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() diff --git a/root/uigamebutton.py b/root/uigamebutton.py new file mode 100644 index 0000000..655f1ce --- /dev/null +++ b/root/uigamebutton.py @@ -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() diff --git a/root/uigameoption.py b/root/uigameoption.py new file mode 100644 index 0000000..83d1607 --- /dev/null +++ b/root/uigameoption.py @@ -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) self.TEXT_LIMIT: + limitText = grpText.GetSplitingTextLine(text, self.TEXT_LIMIT-3, 0) + self.slotSimpleText.SetText(limitText + "...") + self.bar.SetSize(self.len * 6 + 5, 17) + + else: + self.slotSimpleText.SetText(text) + + self.slotFullText.SetText(text) + self.slotFullText.SetPosition(2, 0) + self.slotFullText.Hide() + + def OnMouseOverIn(self): + if self.len > self.TEXT_LIMIT: + self.bar.Show() + self.slotFullText.Show() + + def OnMouseOverOut(self): + if self.len > self.TEXT_LIMIT: + self.bar.Hide() + self.slotFullText.Hide() + +class GuildWindow(ui.ScriptWindow): + + JOB_NAME = { 0 : localeInfo.JOB_WARRIOR, + 1 : localeInfo.JOB_ASSASSIN, + 2 : localeInfo.JOB_SURA, + 3 : localeInfo.JOB_SHAMAN, } + + GUILD_SKILL_PASSIVE_SLOT = 0 + GUILD_SKILL_ACTIVE_SLOT = 1 + GUILD_SKILL_AFFECT_SLOT = 2 + + GRADE_SLOT_NAME = 0 + GRADE_ADD_MEMBER_AUTHORITY = 1 + GRADE_REMOVE_MEMBER_AUTHORITY = 2 + GRADE_NOTICE_AUTHORITY = 3 + GRADE_SKILL_AUTHORITY = 4 + + MEMBER_LINE_COUNT = 13 + + 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.isLoaded=0 + + self.__Initialize() + + def __del__(self): + ui.ScriptWindow.__del__(self) + print " ==================================== DESTROIED GUILD WINDOW" + + def __Initialize(self): + + self.board = None + self.pageName = None + self.tabDict = None + self.tabButtonDict = None + self.pickDialog = None + self.questionDialog = None + self.offerDialog = None + self.popupDialog = None + self.moneyDialog = None + self.changeGradeNameDialog = None + self.popup = None + + self.popupMessage = None + self.commentSlot = None + + self.pageWindow = None + self.tooltipSkill = None + + self.memberLinePos = 0 + + self.enemyGuildNameList = [] + + def Open(self): + self.Show() + self.SetTop() + + guildID = net.GetGuildID() + self.largeMarkBox.SetIndex(guildID) + self.largeMarkBox.SetScale(3) + + def Close(self): + self.__CloseAllGuildMemberPageGradeComboBox() + self.offerDialog.Close() + self.popupDialog.Hide() + self.changeGradeNameDialog.Hide() + self.tooltipSkill.Hide() + self.Hide() + + self.pickDialog = None + self.questionDialog = None + self.popup = None + + def Destroy(self): + self.ClearDictionary() + + if self.offerDialog: + self.offerDialog.Destroy() + + if self.popupDialog: + self.popupDialog.ClearDictionary() + + if self.changeGradeNameDialog: + self.changeGradeNameDialog.ClearDictionary() + + if self.pageWindow: + for window in self.pageWindow.values(): + window.ClearDictionary() + + self.__Initialize() + + def Show(self): + if self.isLoaded==0: + self.isLoaded=1 + + self.__LoadWindow() + + self.RefreshGuildInfoPage() + self.RefreshGuildBoardPage() + self.RefreshGuildMemberPage() + self.RefreshGuildSkillPage() + self.RefreshGuildGradePage() + + ui.ScriptWindow.Show(self) + + def __LoadWindow(self): + global DISABLE_GUILD_SKILL + try: + pyScrLoader = ui.PythonScriptLoader() + + if localeInfo.IsARABIC() : + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow.py") + else: + pyScrLoader.LoadScriptFile(self, "uiscript/guildwindow.py") + + self.popupDialog = ui.ScriptWindow() + pyScrLoader.LoadScriptFile(self.popupDialog, "UIScript/PopupDialog.py") + + self.changeGradeNameDialog = ChangeGradeNameDialog() + pyScrLoader.LoadScriptFile(self.changeGradeNameDialog, "uiscript/changegradenamedialog.py") + + if localeInfo.IsARABIC(): + self.pageWindow = { + "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"), + "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"), + "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"), + "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"), + "SKILL" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"), + "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"), + } + elif localeInfo.IsJAPAN() : + self.pageWindow = { + "GUILD_INFO" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildinfopage.py"), + "BOARD" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_boardpage.py"), + "MEMBER" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_memberpage.py"), + "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"), + "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"), + "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"), + } + elif localeInfo.IsVIETNAM() : # 促钎矫 + self.pageWindow = { + "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"), + "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"), + "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"), + "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"), + "SKILL" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"), + "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"), + } + elif localeInfo.IsEUROPE() and not app.GetLocalePath() == "locale/ca" : + self.pageWindow = { + "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"), + "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"), + "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"), + "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"), + "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"), + "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"), + } + else: + self.pageWindow = { + "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage.py"), + "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"), + "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"), + "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"), + "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"), + "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"), + } + + for window in self.pageWindow.values(): + pyScrLoader.LoadScriptFile(window, window.GetScriptFileName()) + + except: + import exception + exception.Abort("GuildWindow.__LoadWindow.LoadScript") + + try: + getObject = self.GetChild + + self.board = getObject("Board") + self.pageName = { + "GUILD_INFO" : localeInfo.GUILD_TILE_INFO, + "BOARD" : localeInfo.GUILD_TILE_BOARD, + "MEMBER" : localeInfo.GUILD_TILE_MEMBER, + "BASE_INFO" : localeInfo.GUILD_TILE_BASEINFO, + "SKILL" : localeInfo.GUILD_TILE_SKILL, + "GRADE" : localeInfo.GUILD_TILE_GRADE, + } + + self.tabDict = { + "GUILD_INFO" : getObject("Tab_01"), + "BOARD" : getObject("Tab_02"), + "MEMBER" : getObject("Tab_03"), + "BASE_INFO" : getObject("Tab_04"), + "SKILL" : getObject("Tab_05"), + "GRADE" : getObject("Tab_06"), + } + self.tabButtonDict = { + "GUILD_INFO" : getObject("Tab_Button_01"), + "BOARD" : getObject("Tab_Button_02"), + "MEMBER" : getObject("Tab_Button_03"), + "BASE_INFO" : getObject("Tab_Button_04"), + "SKILL" : getObject("Tab_Button_05"), + "GRADE" : getObject("Tab_Button_06"), + } + + ## QuestionDialog + self.popupMessage = self.popupDialog.GetChild("message") + self.popupDialog.GetChild("accept").SetEvent(ui.__mem_func__(self.popupDialog.Hide)) + + ## ChangeGradeName + self.changeGradeNameDialog.GetChild("AcceptButton").SetEvent(ui.__mem_func__(self.OnChangeGradeName)) + self.changeGradeNameDialog.GetChild("CancelButton").SetEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide)) + self.changeGradeNameDialog.GetChild("Board").SetCloseEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide)) + self.changeGradeNameDialog.gradeNameSlot = self.changeGradeNameDialog.GetChild("GradeNameValue") + self.changeGradeNameDialog.gradeNameSlot.OnIMEReturn = ui.__mem_func__(self.OnChangeGradeName) + self.changeGradeNameDialog.gradeNameSlot.OnPressEscapeKey = ui.__mem_func__(self.changeGradeNameDialog.Close) + + ## Comment + self.commentSlot = self.pageWindow["BOARD"].GetChild("CommentValue") + self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment) + #self.commentSlot.OnKeyDown = ui.__mem_func__(self.OnKeyDownInBoardPage) + self.commentSlot.OnKeyDown = lambda key, argSelf=self: argSelf.OnKeyDownInBoardPage(key) + + ## RefreshButton + self.pageWindow["BOARD"].GetChild("RefreshButton").SetEvent(ui.__mem_func__(self.OnRefreshComments)) + + ## ScrollBar + scrollBar = self.pageWindow["MEMBER"].GetChild("ScrollBar") + scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScrollMemberLine)) + self.pageWindow["MEMBER"].scrollBar = scrollBar + + except: + import exception + exception.Abort("GuildWindow.__LoadWindow.BindObject") + + self.__MakeInfoPage() + self.__MakeBoardPage() + self.__MakeMemberPage() + self.__MakeBaseInfoPage() + self.__MakeSkillPage() + self.__MakeGradePage() + + for page in self.pageWindow.values(): + page.UpdateRect() + + for key, btn in self.tabButtonDict.items(): + btn.SetEvent(self.SelectPage, key) + + self.tabButtonDict["BASE_INFO"].Disable() + + if DISABLE_GUILD_SKILL: + self.tabButtonDict["SKILL"].Disable() + + self.board.SetCloseEvent(ui.__mem_func__(self.Close)) + self.board.SetTitleColor(0xffffffff) + self.SelectPage("GUILD_INFO") + + self.offerDialog = uiPickMoney.PickMoneyDialog() + self.offerDialog.LoadDialog() + self.offerDialog.SetMax(9) + self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP) + self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer)) + + def __MakeInfoPage(self): + page = self.pageWindow["GUILD_INFO"] + + try: + page.nameSlot = page.GetChild("GuildNameValue") + page.masterNameSlot = page.GetChild("GuildMasterNameValue") + page.guildLevelSlot = page.GetChild("GuildLevelValue") + page.curExpSlot = page.GetChild("CurrentExperienceValue") + page.lastExpSlot = page.GetChild("LastExperienceValue") + page.memberCountSlot = page.GetChild("GuildMemberCountValue") + page.levelAverageSlot = page.GetChild("GuildMemberLevelAverageValue") + page.uploadMarkButton = page.GetChild("UploadGuildMarkButton") + page.uploadSymbolButton = page.GetChild("UploadGuildSymbolButton") + page.declareWarButton = page.GetChild("DeclareWarButton") + + try: + page.guildMoneySlot = page.GetChild("GuildMoneyValue") + except KeyError: + page.guildMoneySlot = None + + try: + page.GetChild("DepositButton").SetEvent(ui.__mem_func__(self.__OnClickDepositButton)) + page.GetChild("WithdrawButton").SetEvent(ui.__mem_func__(self.__OnClickWithdrawButton)) + except KeyError: + pass + + page.uploadMarkButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildMarkButton)) + page.uploadSymbolButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildSymbolButton)) + page.declareWarButton.SetEvent(ui.__mem_func__(self.__OnClickDeclareWarButton)) + page.GetChild("OfferButton").SetEvent(ui.__mem_func__(self.__OnClickOfferButton)) + page.GetChild("EnemyGuildCancel1").Hide() + page.GetChild("EnemyGuildCancel2").Hide() + page.GetChild("EnemyGuildCancel3").Hide() + page.GetChild("EnemyGuildCancel4").Hide() + page.GetChild("EnemyGuildCancel5").Hide() + page.GetChild("EnemyGuildCancel6").Hide() + + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName1")) + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName2")) + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName3")) + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName4")) + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName5")) + self.enemyGuildNameList.append(page.GetChild("EnemyGuildName6")) + + self.largeMarkBox = page.GetChild("LargeGuildMark") + except: + import exception + exception.Abort("GuildWindow.__MakeInfoPage") + + self.largeMarkBox.AddFlag("not_pick") + + self.markSelectDialog=uiUploadMark.MarkSelectDialog() + self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark) + + self.symbolSelectDialog=uiUploadMark.SymbolSelectDialog() + self.symbolSelectDialog.SAFE_SetSelectEvent(self.__OnSelectSymbol) + + + def __MakeBoardPage(self): + + i = 0 + lineStep = 20 + page = self.pageWindow["BOARD"] + + page.boardDict = {} + + for i in xrange(12): + + yPos = 25 + i * lineStep + + ## NoticeMark + if localeInfo.IsJAPAN(): + noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 15, yPos+3) + else: + noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 5, yPos+3) + noticeMarkImage.Hide() + page.Children.append(noticeMarkImage) + + ## Name + ## 13.12.02 酒而荐沥 + if localeInfo.IsJAPAN(): + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 9, yPos) + elif localeInfo.IsARABIC(): + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 255, yPos) + else: + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 15, yPos) + nameSlot = ui.MakeTextLine(nameSlotImage) + page.Children.append(nameSlotImage) + page.Children.append(nameSlot) + + ## Delete Button + if localeInfo.IsARABIC(): + deleteButton = ui.MakeButton(page, 3, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub") + else: + deleteButton = ui.MakeButton(page, 340, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub") + deleteButton.SetEvent(ui.__mem_func__(self.OnDeleteComment), i) + page.Children.append(deleteButton) + + ## Comment + ## 13.12.02 酒而荐沥 + commentSlot = CommentSlot() + commentSlot.SetParent(page) + if localeInfo.IsARABIC(): + commentSlot.SetPosition(25, yPos) + else: + commentSlot.SetPosition(114, yPos) + commentSlot.Show() + page.Children.append(commentSlot) + + boardSlotList = [] + boardSlotList.append(noticeMarkImage) + boardSlotList.append(nameSlot) + boardSlotList.append(commentSlot) + page.boardDict[i] = boardSlotList + + ## PostComment - Have to make this here for that fit tooltip's position. + ## 13.12.02 酒而荐沥 + if localeInfo.IsARABIC(): + postCommentButton = ui.MakeButton(page, 3, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub") + else: + postCommentButton = ui.MakeButton(page, 337, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub") + postCommentButton.SetEvent(ui.__mem_func__(self.OnPostComment)) + page.Children.append(postCommentButton) + + def __MakeMemberPage(self): + + page = self.pageWindow["MEMBER"] + + lineStep = 20 + page.memberDict = {} + + for i in xrange(self.MEMBER_LINE_COUNT): + + inverseLineIndex = self.MEMBER_LINE_COUNT - i - 1 + yPos = 28 + inverseLineIndex*lineStep + ## 13.12.02 酒而 荐沥 + ## Name + if localeInfo.IsJAPAN(): + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 15, yPos) + elif localeInfo.IsARABIC(): + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 255, yPos) + else: + nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 10, yPos) + nameSlot = ui.MakeTextLine(nameSlotImage) + page.Children.append(nameSlotImage) + page.Children.append(nameSlot) + + ## Grade + gradeSlot = ui.ComboBox() + gradeSlot.SetParent(page) + if localeInfo.IsJAPAN(): + gradeSlot.SetPosition(117, yPos-1) + elif localeInfo.IsARABIC(): + gradeSlot.SetPosition(192, yPos-1) + else: + gradeSlot.SetPosition(101, yPos-1) + gradeSlot.SetSize(61, 18) + gradeSlot.SetEvent(lambda gradeNumber, lineIndex=inverseLineIndex, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber)) + gradeSlot.Show() + page.Children.append(gradeSlot) + + ## Job + if localeInfo.IsJAPAN(): + jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 181, yPos) + elif localeInfo.IsARABIC(): + jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 145, yPos) + else: + jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 170, yPos) + jobSlot = ui.MakeTextLine(jobSlotImage) + page.Children.append(jobSlotImage) + page.Children.append(jobSlot) + + ## Level + if localeInfo.IsJAPAN(): + levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 221, yPos) + elif localeInfo.IsARABIC(): + levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 106, yPos) + else: + levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 210, yPos) + levelSlot = ui.MakeTextLine(levelSlotImage) + page.Children.append(levelSlotImage) + page.Children.append(levelSlot) + + ## Offer + if localeInfo.IsJAPAN(): + offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 261, yPos) + elif localeInfo.IsARABIC(): + offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 66, yPos) + else: + offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 250, yPos) + offerSlot = ui.MakeTextLine(offerSlotImage) + page.Children.append(offerSlotImage) + page.Children.append(offerSlot) + + ## General Enable + event = lambda argSelf=proxy(self), argIndex=inverseLineIndex: apply(argSelf.OnEnableGeneral, (argIndex,)) + if localeInfo.IsJAPAN(): + generalEnableCheckBox = CheckBox(page, 307, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub") + elif localeInfo.IsARABIC(): + generalEnableCheckBox = CheckBox(page, 22, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub") + else: + generalEnableCheckBox = CheckBox(page, 297, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub") + page.Children.append(generalEnableCheckBox) + + memberSlotList = [] + memberSlotList.append(nameSlot) + memberSlotList.append(gradeSlot) + memberSlotList.append(jobSlot) + memberSlotList.append(levelSlot) + memberSlotList.append(offerSlot) + memberSlotList.append(generalEnableCheckBox) + page.memberDict[inverseLineIndex] = memberSlotList + + def __MakeBaseInfoPage(self): + + page = self.pageWindow["BASE_INFO"] + + page.buildingDataDict = {} + + lineStep = 20 + GUILD_BUILDING_MAX_NUM = 7 + + yPos = 95 + 35 + + for i in xrange(GUILD_BUILDING_MAX_NUM): + + nameSlotImage = ui.MakeSlotBar(page, 15, yPos, 78, 17) + nameSlot = ui.MakeTextLine(nameSlotImage) + page.Children.append(nameSlotImage) + page.Children.append(nameSlot) + nameSlot.SetText(localeInfo.GUILD_BUILDING_NAME) + + gradeSlotImage = ui.MakeSlotBar(page, 99, yPos, 26, 17) + gradeSlot = ui.MakeTextLine(gradeSlotImage) + page.Children.append(gradeSlotImage) + page.Children.append(gradeSlot) + gradeSlot.SetText(localeInfo.GUILD_BUILDING_GRADE) + + RESOURCE_MAX_NUM = 6 + for j in xrange(RESOURCE_MAX_NUM): + resourceSlotImage = ui.MakeSlotBar(page, 131 + 29*j, yPos, 26, 17) + resourceSlot = ui.MakeTextLine(resourceSlotImage) + page.Children.append(resourceSlotImage) + page.Children.append(resourceSlot) + resourceSlot.SetText(localeInfo.GUILD_GEM) + + event = lambda *arg: None + powerSlot = CheckBox(page, 308, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub") + page.Children.append(powerSlot) + + yPos += lineStep + + def __MakeSkillPage(self): + + page = self.pageWindow["SKILL"] + + page.skillPoint = page.GetChild("Skill_Plus_Value") + page.passiveSlot = page.GetChild("Passive_Skill_Slot_Table") + page.activeSlot = page.GetChild("Active_Skill_Slot_Table") + page.affectSlot = page.GetChild("Affect_Slot_Table") + page.gpGauge = page.GetChild("Dragon_God_Power_Gauge") + page.gpValue = page.GetChild("Dragon_God_Power_Value") + page.btnHealGSP = page.GetChild("Heal_GSP_Button") + + page.activeSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + page.activeSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type)) + page.activeSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + page.activeSlot.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type)) + page.activeSlot.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type)) + page.activeSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type)) + page.activeSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_over.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_down.sub") + page.passiveSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + page.passiveSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OverInItem(slotNumber, type)) + page.passiveSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + page.passiveSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OnUpGuildSkill(slotNumber, type)) + page.passiveSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_over.sub",\ + "d:/ymir work/ui/game/windows/btn_plus_down.sub") + page.affectSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + page.affectSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_AFFECT_SLOT: self.OverInItem(slotNumber, type)) + page.affectSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + page.btnHealGSP.SetEvent(ui.__mem_func__(self.__OnOpenHealGSPBoard)) + + ## Passive + """ + for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)): + + slotIndex = page.passiveSlot.GetStartIndex()+i + skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST[i] + + page.passiveSlot.SetSkillSlot(slotIndex, skillIndex, 0) + page.passiveSlot.RefreshSlot() + guild.SetSkillIndex(slotIndex, i) + """ + + ## Active + for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)): + + slotIndex = page.activeSlot.GetStartIndex()+i + skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i] + + page.activeSlot.SetSkillSlot(slotIndex, skillIndex, 0) + page.activeSlot.SetCoverButton(slotIndex) + page.activeSlot.RefreshSlot() + guild.SetSkillIndex(slotIndex, len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)+i) + + def __MakeGradePage(self): + + lineStep = 18 + page = self.pageWindow["GRADE"] + + page.gradeDict = {} + + for i in xrange(15): + + yPos = 22 + i*lineStep + index = i+1 + ## 13.12.02 酒而 荐沥 + ## GradeNumber + if localeInfo.IsARABIC(): + gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 310, yPos) + else: + gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 14, yPos) + gradeNumberSlot = ui.MakeTextLine(gradeNumberSlotImage) + gradeNumberSlot.SetText(str(i+1)) + page.Children.append(gradeNumberSlotImage) + page.Children.append(gradeNumberSlot) + + ## GradeName + if localeInfo.IsARABIC(): + gradeNameSlot = EditableTextSlot(page, 242, yPos) + else: + gradeNameSlot = EditableTextSlot(page, 58, yPos) + gradeNameSlot.SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), index) + page.Children.append(gradeNameSlot) + + ## Invite Authority + event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) + if localeInfo.IsARABIC(): + inviteAuthorityCheckBox = CheckBox(page, 185, yPos, event) + else: + inviteAuthorityCheckBox = CheckBox(page, 124, yPos, event) + page.Children.append(inviteAuthorityCheckBox) + + ## DriveOut Authority + event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) + if localeInfo.IsARABIC(): + driveoutAuthorityCheckBox = CheckBox(page, 128, yPos, event) + else: + driveoutAuthorityCheckBox = CheckBox(page, 181, yPos, event) + page.Children.append(driveoutAuthorityCheckBox) + + ## Notice Authority + event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) + if localeInfo.IsARABIC(): + noticeAuthorityCheckBox = CheckBox(page, 71, yPos, event) + else: + noticeAuthorityCheckBox = CheckBox(page, 238, yPos, event) + page.Children.append(noticeAuthorityCheckBox) + + ## Skill Authority + event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) + if localeInfo.IsARABIC(): + skillAuthorityCheckBox = CheckBox(page, 14, yPos, event) + else: + skillAuthorityCheckBox = CheckBox(page, 295, yPos, event) + page.Children.append(skillAuthorityCheckBox) + + gradeSlotList = [] + gradeSlotList.append(gradeNameSlot) + gradeSlotList.append(inviteAuthorityCheckBox) + gradeSlotList.append(driveoutAuthorityCheckBox) + gradeSlotList.append(noticeAuthorityCheckBox) + gradeSlotList.append(skillAuthorityCheckBox) + page.gradeDict[index] = gradeSlotList + + masterSlotList = page.gradeDict[1] + for slot in masterSlotList: + slot.Disable() + + def CanOpen(self): + return guild.IsGuildEnable() + + def Open(self): + self.Show() + self.SetTop() + + guildID = net.GetGuildID() + self.largeMarkBox.SetIndex(guildID) + self.largeMarkBox.SetScale(3) + ## 13.12.02 酒而荐沥 + if localeInfo.IsARABIC(): + self.largeMarkBox.SetPosition(self.largeMarkBox.GetWidth()+32,1) + + def Close(self): + self.__CloseAllGuildMemberPageGradeComboBox() + self.offerDialog.Close() + self.popupDialog.Hide() + self.changeGradeNameDialog.Hide() + self.Hide() + + if self.tooltipSkill: + self.tooltipSkill.Hide() + + self.pickDialog = None + self.questionDialog = None + self.moneyDialog = None + + def Destroy(self): + self.ClearDictionary() + self.board = None + self.pageName = None + self.tabDict = None + self.tabButtonDict = None + self.pickDialog = None + self.questionDialog = None + self.markSelectDialog = None + self.symbolSelectDialog = None + + if self.offerDialog: + self.offerDialog.Destroy() + self.offerDialog = None + + if self.popupDialog: + self.popupDialog.ClearDictionary() + self.popupDialog = None + + if self.changeGradeNameDialog: + self.changeGradeNameDialog.ClearDictionary() + self.changeGradeNameDialog = None + + self.popupMessage = None + self.commentSlot = None + + if self.pageWindow: + for window in self.pageWindow.values(): + window.ClearDictionary() + + self.pageWindow = None + self.tooltipSkill = None + self.moneyDialog = None + + self.enemyGuildNameList = [] + + def DeleteGuild(self): + self.RefreshGuildInfoPage() + self.RefreshGuildBoardPage() + self.RefreshGuildMemberPage() + self.RefreshGuildSkillPage() + self.RefreshGuildGradePage() + self.Hide() + + def SetSkillToolTip(self, tooltipSkill): + self.tooltipSkill = tooltipSkill + + def SelectPage(self, arg): + + if "BOARD" == arg: + self.OnRefreshComments() + + 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]) + self.__CloseAllGuildMemberPageGradeComboBox() + + def __CloseAllGuildMemberPageGradeComboBox(self): + + page = self.pageWindow["MEMBER"] + for key, slotList in page.memberDict.items(): + slotList[1].CloseListBox() + + def RefreshGuildInfoPage(self): + + if self.isLoaded==0: + return + + global DISABLE_DECLARE_WAR + page = self.pageWindow["GUILD_INFO"] + page.nameSlot.SetText(guild.GetGuildName()) + page.masterNameSlot.SetText(guild.GetGuildMasterName()) + page.guildLevelSlot.SetText(str(guild.GetGuildLevel())) + if page.guildMoneySlot: + page.guildMoneySlot.SetText(str(guild.GetGuildMoney())) + + curExp, lastExp = guild.GetGuildExperience() + curExp *= 100 + lastExp *= 100 + page.curExpSlot.SetText(str(curExp)) + page.lastExpSlot.SetText(str(lastExp)) + + curMemberCount, maxMemberCount = guild.GetGuildMemberCount() + if maxMemberCount== 0xffff: + page.memberCountSlot.SetText("%d / %s " % (curMemberCount, localeInfo.GUILD_MEMBER_COUNT_INFINITY)) + else: + page.memberCountSlot.SetText("%d / %d" % (curMemberCount, maxMemberCount)) + + page.levelAverageSlot.SetText(str(guild.GetGuildMemberLevelAverage())) + + ## 辨靛厘父 辨靛 付农客 辨靛傈 脚没 滚瓢阑 杭 荐 乐澜 + mainCharacterName = player.GetMainCharacterName() + masterName = guild.GetGuildMasterName() + + if mainCharacterName == masterName: + page.uploadMarkButton.Show() + + if DISABLE_DECLARE_WAR: + page.declareWarButton.Hide() + else: + page.declareWarButton.Show() + + if guild.HasGuildLand(): + page.uploadSymbolButton.Show() + else: + page.uploadSymbolButton.Hide() + else: + page.uploadMarkButton.Hide() + page.declareWarButton.Hide() + page.uploadSymbolButton.Hide() + + ## Refresh 矫俊 辨靛傈 沥焊 诀单捞飘 + for i in xrange(guild.ENEMY_GUILD_SLOT_MAX_COUNT): + name = guild.GetEnemyGuildName(i) + nameTextLine = self.enemyGuildNameList[i] + if name: + nameTextLine.SetText(name) + else: + nameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY) + + def __GetGuildBoardCommentData(self, index): + commentID, chrName, comment = guild.GetGuildBoardCommentData(index) + if 0==commentID: + if ""==chrName: + chrName=localeInfo.UI_NONAME + if ""==comment: + comment=localeInfo.UI_NOCONTENTS + + return commentID, chrName, comment + + def RefreshGuildBoardPage(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["BOARD"] + + self.BOARD_LINE_MAX_NUM = 12 + lineIndex = 0 + + commentCount = guild.GetGuildBoardCommentCount() + for i in xrange(commentCount): + + commentID, chrName, comment = self.__GetGuildBoardCommentData(i) + + if not comment: + continue + + slotList = page.boardDict[lineIndex] + + if "!" == comment[0]: + slotList[0].Show() + slotList[1].SetText(chrName) + slotList[2].SetText(comment[1:]) + + else: + slotList[0].Hide() + slotList[1].SetText(chrName) + slotList[2].SetText(comment) + + lineIndex += 1 + + for i in xrange(self.BOARD_LINE_MAX_NUM - lineIndex): + slotList = page.boardDict[lineIndex+i] + slotList[0].Hide() + slotList[1].SetText("") + slotList[2].SetText("") + + def RefreshGuildMemberPage(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["MEMBER"] + + ## ScrollBar + count = guild.GetMemberCount() + if count > self.MEMBER_LINE_COUNT: + page.scrollBar.SetMiddleBarSize(float(self.MEMBER_LINE_COUNT) / float(count)) + page.scrollBar.Show() + else: + page.scrollBar.Hide() + self.RefreshGuildMemberPageGradeComboBox() + self.RefreshGuildMemberPageMemberList() + + def RefreshGuildMemberPageMemberList(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["MEMBER"] + + for line, slotList in page.memberDict.items(): + + gradeComboBox = slotList[1] + gradeComboBox.Disable() + + if not guild.IsMember(line): + slotList[0].SetText("") + slotList[2].SetText("") + slotList[3].SetText("") + slotList[4].SetText("") + slotList[5].SetCheck(False) + continue + + pid, name, grade, race, level, offer, general = self.GetMemberData(line) + if pid < 0: + continue + + job = chr.RaceToJob(race) + + guildExperienceSummary = guild.GetGuildExperienceSummary() + + offerPercentage = 0 + if guildExperienceSummary > 0: + offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0) + + slotList[0].SetText(name) + slotList[2].SetText(self.JOB_NAME.get(job, "?")) + slotList[3].SetText(str(level)) + slotList[4].SetText(str(offerPercentage) + "%") + slotList[5].SetCheck(general) + gradeComboBox.SetCurrentItem(guild.GetGradeName(grade)) + if 1 != grade: + gradeComboBox.Enable() + + def RefreshGuildMemberPageGradeComboBox(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["MEMBER"] + + self.CAN_CHANGE_GRADE_COUNT = 15 - 1 + for key, slotList in page.memberDict.items(): + + gradeComboBox = slotList[1] + gradeComboBox.Disable() + + if not guild.IsMember(key): + continue + + pid, name, grade, job, level, offer, general = self.GetMemberData(key) + if pid < 0: + continue + + gradeComboBox.ClearItem() + for i in xrange(self.CAN_CHANGE_GRADE_COUNT): + gradeComboBox.InsertItem(i+2, guild.GetGradeName(i+2)) + gradeComboBox.SetCurrentItem(guild.GetGradeName(grade)) + if 1 != grade: + gradeComboBox.Enable() + + def RefreshGuildSkillPage(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["SKILL"] + + curPoint, maxPoint = guild.GetDragonPowerPoint() + maxPoint = max(maxPoint, 1) + page.gpValue.SetText(str(curPoint) + " / " + str(maxPoint)) + + percentage = (float(curPoint) / float(maxPoint) * 100) * (float(173) / float(95)) + page.gpGauge.SetPercentage(int(percentage), 100) + + skillPoint = guild.GetGuildSkillPoint() + page.skillPoint.SetText(str(skillPoint)) + + page.passiveSlot.HideAllSlotButton() + page.activeSlot.HideAllSlotButton() + + ## Passive + """ + for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)): + + slotIndex = page.passiveSlot.GetStartIndex()+i + skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST[i] + skillLevel = guild.GetSkillLevel(slotIndex) + skillMaxLevel = skill.GetSkillMaxLevel(skillIndex) + + page.passiveSlot.SetSlotCount(slotIndex, skillLevel) + if skillPoint > 0: + if skillLevel < skillMaxLevel: + page.passiveSlot.ShowSlotButton(slotIndex) + """ + + ## Active + for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)): + + slotIndex = page.activeSlot.GetStartIndex()+i + skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i] + skillLevel = guild.GetSkillLevel(slotIndex) + skillMaxLevel = skill.GetSkillMaxLevel(skillIndex) + + page.activeSlot.SetSlotCount(slotIndex, skillLevel) + + if skillLevel <= 0: + page.activeSlot.DisableCoverButton(slotIndex) + else: + page.activeSlot.EnableCoverButton(slotIndex) + + if skillPoint > 0: + if skillLevel < skillMaxLevel: + page.activeSlot.ShowSlotButton(slotIndex) + + def RefreshGuildGradePage(self): + + if self.isLoaded==0: + return + + page = self.pageWindow["GRADE"] + + for key, slotList in page.gradeDict.items(): + name, authority = guild.GetGradeData(int(key)) + + slotList[self.GRADE_SLOT_NAME].SetText(name) + slotList[self.GRADE_ADD_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_ADD_MEMBER) + slotList[self.GRADE_REMOVE_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_REMOVE_MEMBER) + slotList[self.GRADE_NOTICE_AUTHORITY].SetCheck(authority & guild.AUTH_NOTICE) + slotList[self.GRADE_SKILL_AUTHORITY].SetCheck(authority & guild.AUTH_SKILL) + + ## GuildInfo + + def __PopupMessage(self, msg): + self.popupMessage.SetText(msg) + self.popupDialog.SetTop() + self.popupDialog.Show() + + def __OnClickSelectGuildMarkButton(self): + if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL): + self.__PopupMessage(localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL) + elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE): + self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION) + else: + self.markSelectDialog.Open() + + def __OnClickSelectGuildSymbolButton(self): + if guild.MainPlayerHasAuthority(guild.AUTH_NOTICE): + self.symbolSelectDialog.Open() + else: + self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION) + + def __OnClickDeclareWarButton(self): + inputDialog = DeclareGuildWarDialog() + inputDialog.Open() + self.inputDialog = inputDialog + + def __OnSelectMark(self, markFileName): + ret = net.UploadMark("upload/"+markFileName) + + # MARK_BUG_FIX + if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret: + self.__PopupMessage(localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT); + + return ret + # END_OF_MARK_BUG_FIX + + def __OnSelectSymbol(self, symbolFileName): + net.UploadSymbol("upload/"+symbolFileName) + + def __OnClickOfferButton(self): + + curEXP = unsigned32(player.GetStatus(player.EXP)) + + if curEXP <= 100: + self.__PopupMessage(localeInfo.GUILD_SHORT_EXP); + return + + self.offerDialog.Open(curEXP, 100) + + def __OnClickDepositButton(self): + moneyDialog = uiPickMoney.PickMoneyDialog() + moneyDialog.LoadDialog() + moneyDialog.SetMax(6) + moneyDialog.SetTitleName(localeInfo.GUILD_DEPOSIT) + moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeposit)) + moneyDialog.Open(player.GetMoney()) + self.moneyDialog = moneyDialog + + def __OnClickWithdrawButton(self): + moneyDialog = uiPickMoney.PickMoneyDialog() + moneyDialog.LoadDialog() + moneyDialog.SetMax(6) + moneyDialog.SetTitleName(localeInfo.GUILD_WITHDRAW) + moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnWithdraw)) + moneyDialog.Open(guild.GetGuildMoney()) + self.moneyDialog = moneyDialog + + def __OnBlock(self): + popup = uiCommon.PopupDialog() + popup.SetText(localeInfo.NOT_YET_SUPPORT) + popup.SetAcceptEvent(self.__OnClosePopupDialog) + popup.Open() + self.popup = popup + + def __OnClosePopupDialog(self): + self.popup = None + + def OnDeposit(self, money): + net.SendGuildDepositMoneyPacket(money) + + def OnWithdraw(self, money): + net.SendGuildWithdrawMoneyPacket(money) + + def OnOffer(self, exp): + net.SendGuildOfferPacket(exp) + + ## Board + def OnPostComment(self): + + text = self.commentSlot.GetText() + if not text: + return False + + net.SendGuildPostCommentPacket(text[:50]) + self.commentSlot.SetText("") + return True + + def OnDeleteComment(self, index): + + commentID, chrName, comment = self.__GetGuildBoardCommentData(index) + net.SendGuildDeleteCommentPacket(commentID) + + def OnRefreshComments(self): + net.SendGuildRefreshCommentsPacket(0) + + def OnKeyDownInBoardPage(self, key): + if key == 63: + self.OnRefreshComments() + return True + + ## Member + ## OnEnableGeneral + def OnChangeMemberGrade(self, lineIndex, gradeNumber): + PID = guild.MemberIndexToPID(lineIndex + self.memberLinePos) + net.SendGuildChangeMemberGradePacket(PID, gradeNumber) + + def OnEnableGeneral(self, lineIndex): + if not guild.IsMember(lineIndex): + return + + pid, name, grade, job, level, offer, general = self.GetMemberData(lineIndex) + if pid < 0: + return + + net.SendGuildChangeMemberGeneralPacket(pid, 1 - general) + + ## Grade + def OnOpenChangeGradeName(self, arg): + self.changeGradeNameDialog.SetGradeNumber(arg) + self.changeGradeNameDialog.Open() + + def OnChangeGradeName(self): + self.changeGradeNameDialog.Hide() + gradeNumber = self.changeGradeNameDialog.GetGradeNumber() + gradeName = self.changeGradeNameDialog.GetGradeName() + + if len(gradeName) == 0: + gradeName = localeInfo.GUILD_DEFAULT_GRADE + + net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName) + return True + + def OnCheckAuthority(self, argIndex, argAuthority): + name, authority = guild.GetGradeData(argIndex) + net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority) + + def OnScrollMemberLine(self): + scrollBar = self.pageWindow["MEMBER"].scrollBar + pos = scrollBar.GetPos() + + count = guild.GetMemberCount() + newLinePos = int(float(count - self.MEMBER_LINE_COUNT) * pos) + + if newLinePos != self.memberLinePos: + self.memberLinePos = newLinePos + self.RefreshGuildMemberPageMemberList() + self.__CloseAllGuildMemberPageGradeComboBox() + + def GetMemberData(self, localPos): + return guild.GetMemberData(localPos + self.memberLinePos) + + ## Guild Skill + def __OnOpenHealGSPBoard(self): + + curPoint, maxPoint = guild.GetDragonPowerPoint() + + if maxPoint - curPoint <= 0: + self.__PopupMessage(localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE) + return + + pickDialog = uiPickMoney.PickMoneyDialog() + pickDialog.LoadDialog() + pickDialog.SetMax(9) + pickDialog.SetTitleName(localeInfo.GUILD_HEAL_GSP) + pickDialog.SetAcceptEvent(ui.__mem_func__(self.__OnOpenHealGSPQuestionDialog)) + pickDialog.Open(maxPoint - curPoint, 1) + self.pickDialog = pickDialog + + def __OnOpenHealGSPQuestionDialog(self, healGSP): + + money = healGSP * constInfo.GUILD_MONEY_PER_GSP + + questionDialog = uiCommon.QuestionDialog() + questionDialog.SetText(localeInfo.GUILD_DO_YOU_HEAL_GSP % (money, healGSP)) + questionDialog.SetAcceptEvent(ui.__mem_func__(self.__OnHealGSP)) + questionDialog.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog)) + questionDialog.SetWidth(400) + questionDialog.Open() + questionDialog.healGSP = healGSP + self.questionDialog = questionDialog + + def __OnHealGSP(self): + net.SendGuildChargeGSPPacket(self.questionDialog.healGSP) + self.__OnCloseQuestionDialog() + + def __OnCloseQuestionDialog(self): + if self.questionDialog: + self.questionDialog.Close() + self.questionDialog = None + + def OnPickUpGuildSkill(self, skillSlotIndex, type): + + mouseController = mouseModule.mouseController + + if False == mouseController.isAttached(): + + skillIndex = player.GetSkillIndex(skillSlotIndex) + skillLevel = guild.GetSkillLevel(skillSlotIndex) + + if skill.CanUseSkill(skillIndex) and skillLevel > 0: + + if app.IsPressed(app.DIK_LCONTROL): + + player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, skillSlotIndex) + return + + mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, skillSlotIndex, skillIndex) + + else: + mouseController.DeattachObject() + + def OnUseGuildSkill(self, slotNumber, type): + skillIndex = player.GetSkillIndex(slotNumber) + skillLevel = guild.GetSkillLevel(slotNumber) + + if skillLevel <= 0: + return + + player.UseGuildSkill(slotNumber) + + def OnUpGuildSkill(self, slotNumber, type): + skillIndex = player.GetSkillIndex(slotNumber) + net.SendChatPacket("/gskillup " + str(skillIndex)) + + def OnUseSkill(self, slotNumber, coolTime): + + if self.isLoaded==0: + return + + page = self.pageWindow["SKILL"] + + if page.activeSlot.HasSlot(slotNumber): + page.activeSlot.SetSlotCoolTime(slotNumber, coolTime) + + def OnStartGuildWar(self, guildSelf, guildOpp): + + if self.isLoaded==0: + return + + if guild.GetGuildID() != guildSelf: + return + + guildName = guild.GetGuildName(guildOpp) + for guildNameTextLine in self.enemyGuildNameList: + if localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY == guildNameTextLine.GetText(): + guildNameTextLine.SetText(guildName) + return + + def OnEndGuildWar(self, guildSelf, guildOpp): + + if self.isLoaded==0: + return + + if guild.GetGuildID() != guildSelf: + return + + guildName = guild.GetGuildName(guildOpp) + for guildNameTextLine in self.enemyGuildNameList: + if guildName == guildNameTextLine.GetText(): + guildNameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY) + return + + ## ToolTip + def OverInItem(self, slotNumber, type): + + if mouseModule.mouseController.isAttached(): + return + + if None != self.tooltipSkill: + skillIndex = player.GetSkillIndex(slotNumber) + skillLevel = guild.GetSkillLevel(slotNumber) + + self.tooltipSkill.SetSkill(skillIndex, skillLevel) + + def OverOutItem(self): + if None != self.tooltipSkill: + self.tooltipSkill.HideToolTip() + + def OnPressEscapeKey(self): + self.Close() + return True + + +class BuildGuildBuildingWindow(ui.ScriptWindow): + + if localeInfo.IsJAPAN(): + GUILD_CATEGORY_LIST = ( + ("HEADQUARTER", "婎慴寶抸暔"), + ("FACILITY", "奼挘寶抸暔"), + ("OBJECT", "偦偺懠"), + ) + elif localeInfo.IsYMIR() or localeInfo.IsWE_KOREA(): + GUILD_CATEGORY_LIST = ( + ("HEADQUARTER", "夯扒拱"), + ("FACILITY", "扁瓷扒拱"), + ("OBJECT", "炼版拱"), + ) + elif localeInfo.IsEUROPE() or localeInfo.IsHONGKONG(): + GUILD_CATEGORY_LIST = ( + ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER), + ("FACILITY", localeInfo.GUILD_FACILITY), + ("OBJECT", localeInfo.GUILD_OBJECT), + ) + else: + try : + GUILD_CATEGORY_LIST = ( + ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER), + ("FACILITY", localeInfo.GUILD_FACILITY), + ("OBJECT", localeInfo.GUILD_OBJECT), + ) + except: + GUILD_CATEGORY_LIST = ( + ("HEADQUARTER", "Main Building"), + ("FACILITY", "Facility"), + ("OBJECT", "Object"), + ) + + MODE_VIEW = 0 + MODE_POSITIONING = 1 + MODE_PREVIEW = 2 + + BUILDING_ALPHA = 0.55 + + ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) + DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0) + + START_INSTANCE_INDEX = 123450 + #WALL_SET_INSTANCE = 14105 + + def __init__(self): + ui.ScriptWindow.__init__(self) + self.__LoadWindow() + + self.closeEvent = None + self.popup = None + self.mode = self.MODE_VIEW + self.race = 0 + self.type = None + self.x = 0 + self.y = 0 + self.z = 0 + self.rot_x = 0 + self.rot_y = 0 + self.rot_z = 0 + self.rot_x_limit = 0 + self.rot_y_limit = 0 + self.rot_z_limit = 0 + self.needMoney = 0 + self.needStoneCount = 0 + self.needLogCount = 0 + self.needPlywoodCount = 0 + + #self.index = 0 + self.indexList = [] + self.raceList = [] + self.posList = [] + self.rotList = [] + + index = 0 + for category in self.GUILD_CATEGORY_LIST: + self.categoryList.InsertItem(index, category[1]) + index += 1 + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def __LoadWindow(self): + + try: + pyScrLoader = ui.PythonScriptLoader() + if localeInfo.IsARABIC(): + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "buildguildbuildingwindow.py") + elif localeInfo.IsVIETNAM(): + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "buildguildbuildingwindow.py") + else: + pyScrLoader.LoadScriptFile(self, "uiscript/buildguildbuildingwindow.py") + except: + import exception + exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript") + + try: + getObject = self.GetChild + self.board = getObject("Board") + self.categoryList = getObject("CategoryList") + self.buildingList = getObject("BuildingList") + self.listScrollBar = getObject("ListScrollBar") + self.positionButton = getObject("PositionButton") + self.previewButton = getObject("PreviewButton") + self.posValueX = getObject("BuildingPositionXValue") + self.posValueY = getObject("BuildingPositionYValue") + self.ctrlRotationX = getObject("BuildingRotationX") + self.ctrlRotationY = getObject("BuildingRotationY") + self.ctrlRotationZ = getObject("BuildingRotationZ") + self.buildingPriceValue = getObject("BuildingPriceValue") + self.buildingMaterialStoneValue = getObject("BuildingMaterialStoneValue") + self.buildingMaterialLogValue = getObject("BuildingMaterialLogValue") + self.buildingMaterialPlywoodValue = getObject("BuildingMaterialPlywoodValue") + + self.positionButton.SetEvent(ui.__mem_func__(self.__OnSelectPositioningMode)) + self.previewButton.SetToggleDownEvent(ui.__mem_func__(self.__OnEnterPreviewMode)) + self.previewButton.SetToggleUpEvent(ui.__mem_func__(self.__OnLeavePreviewMode)) + self.ctrlRotationX.SetEvent(ui.__mem_func__(self.__OnChangeRotation)) + self.ctrlRotationY.SetEvent(ui.__mem_func__(self.__OnChangeRotation)) + self.ctrlRotationZ.SetEvent(ui.__mem_func__(self.__OnChangeRotation)) + self.listScrollBar.SetScrollEvent(ui.__mem_func__(self.__OnScrollBuildingList)) + + getObject("CategoryList").SetEvent(ui.__mem_func__(self.__OnSelectCategory)) + getObject("BuildingList").SetEvent(ui.__mem_func__(self.__OnSelectBuilding)) + getObject("AcceptButton").SetEvent(ui.__mem_func__(self.Build)) + getObject("CancelButton").SetEvent(ui.__mem_func__(self.Close)) + self.board.SetCloseEvent(ui.__mem_func__(self.Close)) + + except: + import exception + exception.Abort("BuildGuildBuildingWindow.__LoadWindow - BindObject") + + def __CreateWallBlock(self, race, x, y, rot=0.0 ): + idx = self.START_INSTANCE_INDEX + len(self.indexList) + self.indexList.append(idx) + self.raceList.append(race) + self.posList.append((x, y)) + self.rotList.append(rot) + chr.CreateInstance(idx) + chr.SelectInstance(idx) + chr.SetVirtualID(idx) + chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT) + + chr.SetRace(race) + chr.SetArmor(0) + chr.Refresh() + chr.SetLoopMotion(chr.MOTION_WAIT) + chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA) + chr.SetRotationAll(0.0, 0.0, rot) + + self.ctrlRotationX.SetSliderPos(0.5) + self.ctrlRotationY.SetSliderPos(0.5) + self.ctrlRotationZ.SetSliderPos(0.5) + + def __GetObjectSize(self, race): + idx = self.START_INSTANCE_INDEX + 1000 + chr.CreateInstance(idx) + chr.SelectInstance(idx) + chr.SetVirtualID(idx) + chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT) + + chr.SetRace(race) + chr.SetArmor(0) + chr.Refresh() + chr.SetLoopMotion(chr.MOTION_WAIT) + sx, sy, ex, ey = chr.GetBoundBoxOnlyXY(idx) + chr.DeleteInstance(idx) + return sx, sy, ex, ey + + def __GetBuildInPosition(self): + + zList = [] + zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.syPos) ) + zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.eyPos) ) + zList.append( background.GetHeight(self.x+self.exPos, self.y+self.syPos) ) + zList.append( background.GetHeight(self.x+self.exPos, self.y+self.eyPos) ) + zList.append( background.GetHeight(self.x+(self.exPos+self.sxPos)/2, self.y+(self.eyPos+self.syPos)/2) ) + zList.sort() + return zList[3] + + def __CreateBuildInInstance(self,race): + + self.__DeleteInstance() + + object_base = race - race%10 + + door_minX, door_minY, door_maxX, door_maxY = self.__GetObjectSize(object_base+4) + corner_minX, corner_minY, corner_maxX, corner_maxY = self.__GetObjectSize(object_base+1) + line_minX, line_minY, line_maxX, line_maxY = self.__GetObjectSize(object_base+2) + line_width = line_maxX - line_minX + line_width_half = line_width / 2 + + X_SIZE_STEP = 2 * 2 ## 2狼 窜困肺父 刘啊秦具 窃 + Y_SIZE_STEP = 8 + sxPos = door_maxX - corner_minX + (line_width_half*X_SIZE_STEP) + exPos = -sxPos + syPos = 0 + eyPos = -(corner_maxY*2 + line_width*Y_SIZE_STEP) + + self.sxPos = sxPos + self.syPos = syPos + self.exPos = exPos + self.eyPos = eyPos + + z = self.__GetBuildInPosition() + + ## Door + self.__CreateWallBlock(object_base+4, 0.0, syPos) + + ## Corner + self.__CreateWallBlock(object_base+1, sxPos, syPos) + self.__CreateWallBlock(object_base+1, exPos, syPos, 270.0) + self.__CreateWallBlock(object_base+1, sxPos, eyPos, 90.0) + self.__CreateWallBlock(object_base+1, exPos, eyPos,180.0 ) + + ## Line + lineBlock = object_base+2 + line_startX = -door_maxX - line_minX - (line_width_half*X_SIZE_STEP) + self.__CreateWallBlock(lineBlock, line_startX, eyPos) + self.__CreateWallBlock(lineBlock, line_startX+line_width*1, eyPos) + self.__CreateWallBlock(lineBlock, line_startX+line_width*2, eyPos) + self.__CreateWallBlock(lineBlock, line_startX+line_width*3, eyPos) + for i in xrange(X_SIZE_STEP): + self.__CreateWallBlock(lineBlock, line_startX+line_width*(3+i+1), eyPos) + for i in xrange(X_SIZE_STEP/2): + self.__CreateWallBlock(lineBlock, door_minX - line_maxX - line_width*i, syPos) + self.__CreateWallBlock(lineBlock, door_maxX - line_minX + line_width*i, syPos) + for i in xrange(Y_SIZE_STEP): + self.__CreateWallBlock(lineBlock, sxPos, line_minX + corner_minX - line_width*i, 90.0) + self.__CreateWallBlock(lineBlock, exPos, line_minX + corner_minX - line_width*i, 90.0) + + self.SetBuildingPosition(int(self.x), int(self.y), self.__GetBuildInPosition()) + + def __DeleteInstance(self): + if not self.indexList: + return + + for index in self.indexList: + chr.DeleteInstance(index) + + self.indexList = [] + self.raceList = [] + self.posList = [] + self.rotList = [] + + def __CreateInstance(self, race): + + self.__DeleteInstance() + + self.race = race + + idx = self.START_INSTANCE_INDEX + self.indexList.append(idx) + self.posList.append((0, 0)) + self.rotList.append(0) + + chr.CreateInstance(idx) + chr.SelectInstance(idx) + chr.SetVirtualID(idx) + chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT) + + chr.SetRace(race) + chr.SetArmor(0) + chr.Refresh() + chr.SetLoopMotion(chr.MOTION_WAIT) + chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA) + + self.SetBuildingPosition(int(self.x), int(self.y), 0) + self.ctrlRotationX.SetSliderPos(0.5) + self.ctrlRotationY.SetSliderPos(0.5) + self.ctrlRotationZ.SetSliderPos(0.5) + + def Build(self): + + if not self.__IsEnoughMoney(): + self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MONEY) + return + if not self.__IsEnoughMaterialStone(): + self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL) + return + if not self.__IsEnoughMaterialLog(): + self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL) + return + if not self.__IsEnoughMaterialPlywood(): + self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL) + return + + ## /build c vnum x y x_rot y_rot z_rot + ## /build d vnum + if "BUILDIN" == self.type: + for i in xrange(len(self.raceList)): + race = self.raceList[i] + xPos, yPos = self.posList[i] + rot = self.rotList[i] + net.SendChatPacket("/build c %d %d %d %d %d %d" % (race, int(self.x+xPos), int(self.y+yPos), self.rot_x, self.rot_y, rot)) + else: + net.SendChatPacket("/build c %d %d %d %d %d %d" % (self.race, int(self.x), int(self.y), self.rot_x, self.rot_y, self.rot_z)) + + self.Close() + + def Open(self): + x, y, z = player.GetMainCharacterPosition() + app.SetCameraSetting(int(x), int(-y), int(z), 3000, 0, 30) + + background.VisibleGuildArea() + + self.x = x + self.y = y + self.z = z + self.categoryList.SelectItem(0) + self.buildingList.SelectItem(0) + self.SetTop() + self.Show() + self.__DisablePCBlocker() + + import debugInfo + if debugInfo.IsDebugMode(): + self.categoryList.SelectItem(2) + self.buildingList.SelectItem(0) + + def Close(self): + + self.__DeleteInstance() + + background.DisableGuildArea() + + self.Hide() + self.__OnClosePopupDialog() + self.__EnablePCBlocker() + self.__UnlockCameraMoving() + if self.closeEvent: + self.closeEvent() + + def Destory(self): + self.Close() + + self.ClearDictionary() + self.board = None + self.categoryList = None + self.buildingList = None + self.listScrollBar = None + self.positionButton = None + self.previewButton = None + self.posValueX = None + self.posValueY = None + self.ctrlRotationX = None + self.ctrlRotationY = None + self.ctrlRotationZ = None + self.buildingPriceValue = None + self.buildingMaterialStoneValue = None + self.buildingMaterialLogValue = None + self.buildingMaterialPlywoodValue = None + self.closeEvent = None + + def SetCloseEvent(self, event): + self.closeEvent = event + + def __PopupDialog(self, text): + popup = uiCommon.PopupDialog() + popup.SetText(text) + popup.SetAcceptEvent(self.__OnClosePopupDialog) + popup.Open() + self.popup = popup + + def __OnClosePopupDialog(self): + self.popup = None + + def __EnablePCBlocker(self): + ## PC Blocker 贸府甫 囊促. (捧疙秦咙) + chr.SetInstanceType(chr.INSTANCE_TYPE_BUILDING) + + for idx in self.indexList: + chr.SetBlendRenderMode(idx, 1.0) + + def __DisablePCBlocker(self): + ## PC Blocker 贸府甫 馋促. (救捧疙秦咙) + chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT) + + for idx in self.indexList: + chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA) + + def __OnSelectPositioningMode(self): + if self.MODE_PREVIEW == self.mode: + self.positionButton.SetUp() + return + + self.mode = self.MODE_POSITIONING + self.Hide() + + def __OnEnterPreviewMode(self): + + if self.MODE_POSITIONING == self.mode: + self.previewButton.SetUp() + return + + self.mode = self.MODE_PREVIEW + self.positionButton.SetUp() + self.__UnlockCameraMoving() + self.__EnablePCBlocker() + + def __OnLeavePreviewMode(self): + self.__RestoreViewMode() + + def __RestoreViewMode(self): + self.__DisablePCBlocker() + self.__LockCameraMoving() + self.mode = self.MODE_VIEW + self.positionButton.SetUp() + self.previewButton.SetUp() + + def __IsEnoughMoney(self): + + if app.IsEnableTestServerFlag(): + return True + + curMoney = player.GetMoney() + if curMoney < self.needMoney: + return False + return True + + def __IsEnoughMaterialStone(self): + + if app.IsEnableTestServerFlag(): + return True + + curStoneCount = player.GetItemCountByVnum(MATERIAL_STONE_ID) + if curStoneCount < self.needStoneCount: + return False + return True + + def __IsEnoughMaterialLog(self): + + if app.IsEnableTestServerFlag(): + return True + + curLogCount = player.GetItemCountByVnum(MATERIAL_LOG_ID) + if curLogCount < self.needLogCount: + return False + return True + + def __IsEnoughMaterialPlywood(self): + + if app.IsEnableTestServerFlag(): + return True + + curPlywoodCount = player.GetItemCountByVnum(MATERIAL_PLYWOOD_ID) + if curPlywoodCount < self.needPlywoodCount: + return False + return True + + def __OnSelectCategory(self): + self.listScrollBar.SetPos(0.0) + self.__RefreshItem() + + def __SetBuildingData(self, data): + self.buildingPriceValue.SetText(NumberToMoneyString(data["PRICE"])) + + self.needMoney = int(data["PRICE"]) + + materialList = data["MATERIAL"] + self.needStoneCount = int(materialList[MATERIAL_STONE_INDEX]) + self.needLogCount = int(materialList[MATERIAL_LOG_INDEX]) + self.needPlywoodCount = int(materialList[MATERIAL_PLYWOOD_INDEX]) + + if (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"): + self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX]) + self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] ) + self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX]) + else: + self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX] + localeInfo.THING_COUNT) + self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] + localeInfo.THING_COUNT) + self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX] + localeInfo.THING_COUNT) + if self.__IsEnoughMoney(): + self.buildingPriceValue.SetPackedFontColor(self.ENABLE_COLOR) + else: + self.buildingPriceValue.SetPackedFontColor(self.DISABLE_COLOR) + + if self.__IsEnoughMaterialStone(): + self.buildingMaterialStoneValue.SetPackedFontColor(self.ENABLE_COLOR) + else: + self.buildingMaterialStoneValue.SetPackedFontColor(self.DISABLE_COLOR) + + if self.__IsEnoughMaterialLog(): + self.buildingMaterialLogValue.SetPackedFontColor(self.ENABLE_COLOR) + else: + self.buildingMaterialLogValue.SetPackedFontColor(self.DISABLE_COLOR) + + if self.__IsEnoughMaterialPlywood(): + self.buildingMaterialPlywoodValue.SetPackedFontColor(self.ENABLE_COLOR) + else: + self.buildingMaterialPlywoodValue.SetPackedFontColor(self.DISABLE_COLOR) + + self.rot_x_limit = data["X_ROT_LIMIT"] + self.rot_y_limit = data["Y_ROT_LIMIT"] + self.rot_z_limit = data["Z_ROT_LIMIT"] + self.ctrlRotationX.Enable() + self.ctrlRotationY.Enable() + self.ctrlRotationZ.Enable() + if 0 == self.rot_x_limit: + self.ctrlRotationX.Disable() + if 0 == self.rot_y_limit: + self.ctrlRotationY.Disable() + if 0 == self.rot_z_limit: + self.ctrlRotationZ.Disable() + + def __OnSelectBuilding(self): + buildingIndex = self.buildingList.GetSelectedItem() + if buildingIndex >= len(BUILDING_DATA_LIST): + return + + categoryIndex = self.categoryList.GetSelectedItem() + if categoryIndex >= len(self.GUILD_CATEGORY_LIST): + return + selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0] + + index = 0 + for data in BUILDING_DATA_LIST: + type = data["TYPE"] + vnum = data["VNUM"] + if selectedType != type: + continue + + if index == buildingIndex: + self.type = type + if "BUILDIN" == self.type: + self.__CreateBuildInInstance(vnum) + else: + self.__CreateInstance(vnum) + + self.__SetBuildingData(data) + + index += 1 + + def __OnScrollBuildingList(self): + viewItemCount = self.buildingList.GetViewItemCount() + itemCount = self.buildingList.GetItemCount() + pos = self.listScrollBar.GetPos() * (itemCount-viewItemCount) + self.buildingList.SetBasePos(int(pos)) + + def __OnChangeRotation(self): + self.rot_x = self.ctrlRotationX.GetSliderPos() * self.rot_x_limit - self.rot_x_limit/2 + self.rot_y = self.ctrlRotationY.GetSliderPos() * self.rot_y_limit - self.rot_y_limit/2 + self.rot_z = (self.ctrlRotationZ.GetSliderPos() * 360 + 180) % 360 + if "BUILDIN" == self.type: + chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z) + else: + chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z) + + def __LockCameraMoving(self): + app.SetCameraSetting(int(self.x), int(-self.y), int(self.z), 3000, 0, 30) + + def __UnlockCameraMoving(self): + app.SetDefaultCamera() + + def __RefreshItem(self): + + self.buildingList.ClearItem() + + categoryIndex = self.categoryList.GetSelectedItem() + if categoryIndex >= len(self.GUILD_CATEGORY_LIST): + return + selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0] + + index = 0 + for data in BUILDING_DATA_LIST: + if selectedType != data["TYPE"]: + continue + + if data["SHOW"]: + self.buildingList.InsertItem(index, data["LOCAL_NAME"]) + + index += 1 + + self.buildingList.SelectItem(0) + + if self.buildingList.GetItemCount() < self.buildingList.GetViewItemCount(): + self.buildingList.SetSize(120, self.buildingList.GetHeight()) + self.buildingList.LocateItem() + self.listScrollBar.Hide() + else: + self.buildingList.SetSize(105, self.buildingList.GetHeight()) + self.buildingList.LocateItem() + self.listScrollBar.Show() + + def SettleCurrentPosition(self): + guildID = miniMap.GetGuildAreaID(self.x, self.y) + + import debugInfo + if debugInfo.IsDebugMode(): + guildID = player.GetGuildID() + + if guildID != player.GetGuildID(): + return + + self.__RestoreViewMode() + self.__LockCameraMoving() + self.Show() + + def SetBuildingPosition(self, x, y, z): + self.x = x + self.y = y + self.posValueX.SetText(str(int(x))) + self.posValueY.SetText(str(int(y))) + + for i in xrange(len(self.indexList)): + idx = self.indexList[i] + xPos, yPos = self.posList[i] + + chr.SelectInstance(idx) + if 0 != z: + self.z = z + chr.SetPixelPosition(int(x+xPos), int(y+yPos), int(z)) + else: + chr.SetPixelPosition(int(x+xPos), int(y+yPos)) + + def IsPositioningMode(self): + if self.MODE_POSITIONING == self.mode: + return True + return False + + def IsPreviewMode(self): + if self.MODE_PREVIEW == self.mode: + return True + return False + + def OnPressEscapeKey(self): + self.Close() + return True + +""" +- 橇肺配妮 + +霸烙倒涝矫: + RecvLandPacket: + CPythonMiniMap::RegisterGuildArea + +霸烙捞悼吝: + PythonPlayer::Update() + CPythonPlayer::__Update_NotifyGuildAreaEvent() + game.py.BINARY_Guild_EnterGuildArea + uigameButton.GameButtonWindow.ShowBuildButton() + game.py.BINARY_Guild_ExitGuildArea + uigameButton.GameButtonWindow.HideBuildButton() + +BuildButton: +!辨靛厘牢瘤 贸府 绝澜 +!扒拱捞 乐绢档 窿扁 滚瓢篮 乐澜 + +!扒拱捞 烙矫肺 荤侩窍绰 VID 绰 辑滚啊 焊郴林绰 巴苞 去悼瞪 堪妨啊 乐澜 +!扒拱 VNUM 篮 BuildGuildBuildingWindow.BUILDING_VNUM_LIST 甫 捞侩秦 函券 + +!扒拱 瘤阑锭绰 /build c(reate) +!扒拱 何贱锭绰 /build d(estroy) +!rotation 狼 窜困绰 degree + + interfaceModule.interface.__OnClickBuildButton: + interfaceModule.interface.BUILD_OpenWindow: + +AcceptButton: + BuildGuildBuildingWindow.Build: + net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot") + +PreviewButton: + __OnPreviewMode: + __RestoreViewMode: + +扒拱 何荐扁: + uiTarget.TargetBoard.__OnDestroyBuilding + net.SendChatPacket("/build d vid") +""" + +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() + + import chrmgr + chrmgr.CreateRace(0) + chrmgr.SelectRace(0) + chrmgr.SetPathName("d:/ymir Work/pc/warrior/") + chrmgr.LoadRaceData("warrior.msm") + chrmgr.SetPathName("d:/ymir work/pc/warrior/general/") + chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa") + chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, "run.msa") + + def LoadGuildBuildingList(filename): + handle = app.OpenTextFile(filename) + count = app.GetTextFileLineCount(handle) + for i in xrange(count): + line = app.GetTextFileLine(handle, i) + tokens = line.split("\t") + + TOKEN_VNUM = 0 + TOKEN_TYPE = 1 + TOKEN_NAME = 2 + TOKEN_LOCAL_NAME = 3 + NO_USE_TOKEN_SIZE_1 = 4 + NO_USE_TOKEN_SIZE_2 = 5 + NO_USE_TOKEN_SIZE_3 = 6 + NO_USE_TOKEN_SIZE_4 = 7 + TOKEN_X_ROT_LIMIT = 8 + TOKEN_Y_ROT_LIMIT = 9 + TOKEN_Z_ROT_LIMIT = 10 + TOKEN_PRICE = 11 + TOKEN_MATERIAL = 12 + TOKEN_NPC = 13 + TOKEN_GROUP = 14 + TOKEN_DEPEND_GROUP = 15 + TOKEN_ENABLE_FLAG = 16 + LIMIT_TOKEN_COUNT = 17 + + if not tokens[TOKEN_VNUM].isdigit(): + continue + + if not int(tokens[TOKEN_ENABLE_FLAG]): + continue + + if len(tokens) < LIMIT_TOKEN_COUNT: + import dbg + dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line)) + continue + + ENABLE_FLAG_TYPE_NOT_USE = False + ENABLE_FLAG_TYPE_USE = True + ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2 + + if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]): + continue + + vnum = int(tokens[TOKEN_VNUM]) + type = tokens[TOKEN_TYPE] + name = tokens[TOKEN_NAME] + localName = tokens[TOKEN_LOCAL_NAME] + xRotLimit = int(tokens[TOKEN_X_ROT_LIMIT]) + yRotLimit = int(tokens[TOKEN_Y_ROT_LIMIT]) + zRotLimit = int(tokens[TOKEN_Z_ROT_LIMIT]) + price = tokens[TOKEN_PRICE] + material = tokens[TOKEN_MATERIAL] + + folderName = "" + if "HEADQUARTER" == type: + folderName = "headquarter" + elif "FACILITY" == type: + folderName = "facility" + elif "OBJECT" == type: + folderName = "object" + ##"BuildIn" Is made by exist instance. + + materialList = ["0", "0", "0"] + if material[0] == "\"": + material = material[1:] + if material[-1] == "\"": + material = material[:-1] + for one in material.split("/"): + data = one.split(",") + if 2 != len(data): + continue + itemID = int(data[0]) + count = data[1] + + if itemID == MATERIAL_STONE_ID: + materialList[MATERIAL_STONE_INDEX] = count + elif itemID == MATERIAL_LOG_ID: + materialList[MATERIAL_LOG_INDEX] = count + elif itemID == MATERIAL_PLYWOOD_ID: + materialList[MATERIAL_PLYWOOD_INDEX] = count + + import chrmgr + chrmgr.RegisterRaceSrcName(name, folderName) + chrmgr.RegisterRaceName(vnum, name) + + appendingData = { "VNUM":vnum, + "TYPE":type, + "NAME":name, + "LOCAL_NAME":localName, + "X_ROT_LIMIT":xRotLimit, + "Y_ROT_LIMIT":yRotLimit, + "Z_ROT_LIMIT":zRotLimit, + "PRICE":price, + "MATERIAL":materialList, + "SHOW" : True } + + if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]): + appendingData["SHOW"] = False + + BUILDING_DATA_LIST.append(appendingData) + + app.CloseTextFile(handle) + + LoadGuildBuildingList(app.GetLocalePath()+"/GuildBuildingList.txt") + + class TestGame(ui.Window): + def __init__(self): + ui.Window.__init__(self) + + x = 30000 + y = 40000 + + self.wndGuildBuilding = None + self.onClickKeyDict = {} + self.onClickKeyDict[app.DIK_SPACE] = lambda: self.OpenBuildGuildBuildingWindow() + + background.Initialize() + background.LoadMap("metin2_map_a1", x, y, 0) + background.SetShadowLevel(background.SHADOW_ALL) + + self.MakeCharacter(1, 0, x, y) + player.SetMainCharacterIndex(1) + chr.SelectInstance(1) + + def __del__(self): + ui.Window.__del__(self) + + def MakeCharacter(self, index, race, x, y): + chr.CreateInstance(index) + chr.SelectInstance(index) + chr.SetVirtualID(index) + chr.SetInstanceType(chr.INSTANCE_TYPE_PLAYER) + + chr.SetRace(race) + chr.SetArmor(0) + chr.SetHair(0) + chr.Refresh() + chr.SetMotionMode(chr.MOTION_MODE_GENERAL) + chr.SetLoopMotion(chr.MOTION_WAIT) + + chr.SetPixelPosition(x, y) + chr.SetDirection(chr.DIR_NORTH) + + def OpenBuildGuildBuildingWindow(self): + self.wndGuildBuilding = BuildGuildBuildingWindow() + self.wndGuildBuilding.Open() + self.wndGuildBuilding.SetParent(self) + self.wndGuildBuilding.SetTop() + + def OnKeyUp(self, key): + if key in self.onClickKeyDict: + self.onClickKeyDict[key]() + return True + + def OnMouseLeftButtonDown(self): + if self.wndGuildBuilding: + if self.wndGuildBuilding.IsPositioningMode(): + self.wndGuildBuilding.SettleCurrentPosition() + return + + player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS); + return True + + def OnMouseLeftButtonUp(self): + if self.wndGuildBuilding: + return + + player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK) + return True + + def OnMouseRightButtonDown(self): + player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS); + return True + + def OnMouseRightButtonUp(self): + player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK); + return True + + def OnMouseMiddleButtonDown(self): + player.SetMouseMiddleButtonState(player.MBS_PRESS) + + def OnMouseMiddleButtonUp(self): + player.SetMouseMiddleButtonState(player.MBS_CLICK) + + def OnUpdate(self): + app.UpdateGame() + + if self.wndGuildBuilding: + if self.wndGuildBuilding.IsPositioningMode(): + x, y, z = background.GetPickingPoint() + self.wndGuildBuilding.SetBuildingPosition(x, y, z) + + def OnRender(self): + app.RenderGame() + grp.PopState() + grp.SetInterfaceRenderState() + + game = TestGame() + game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight()) + game.Show() + + wndGuildBuilding = BuildGuildBuildingWindow() + wndGuildBuilding.Open() + wndGuildBuilding.SetTop() + + app.Loop() + + """ + - 橇肺配妮 + +霸烙倒涝矫: + RecvLandPacket: + CPythonMiniMap::RegisterGuildArea + +霸烙捞悼吝: + PythonPlayer::Update() + CPythonPlayer::__Update_NotifyGuildAreaEvent() + game.py.BINARY_Guild_EnterGuildArea + uigameButton.GameButtonWindow.ShowBuildButton() + game.py.BINARY_Guild_ExitGuildArea + uigameButton.GameButtonWindow.HideBuildButton() + +BuildButton: +!辨靛厘牢瘤 贸府 绝澜 +!扒拱捞 乐绢档 窿扁 滚瓢篮 乐澜 + +!扒拱捞 烙矫肺 荤侩窍绰 VID 绰 辑滚啊 焊郴林绰 巴苞 去悼瞪 堪妨啊 乐澜 +!扒拱 VNUM 篮 BuildGuildBuildingWindow.BUILDING_VNUM_LIST 甫 捞侩秦 函券 + +!扒拱 瘤阑锭绰 /build c(reate) +!扒拱 何贱锭绰 /build d(estroy) +!rotation 狼 窜困绰 degree + + interfaceModule.interface.__OnClickBuildButton: + interfaceModule.interface.BUILD_OpenWindow: + +AcceptButton: + BuildGuildBuildingWindow.Build: + net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot") + + x_rot, y_rot 绰 AffectContainer俊 历厘 + +PreviewButton: + __OnPreviewMode: + __RestoreViewMode: + +扒拱 何荐扁: + uiTarget.TargetBoard.__OnDestroyBuilding + net.SendChatPacket("/build d vid") + """ + diff --git a/root/uihelp.py b/root/uihelp.py new file mode 100644 index 0000000..5e5bd5d --- /dev/null +++ b/root/uihelp.py @@ -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 + diff --git a/root/uiinventory.py b/root/uiinventory.py new file mode 100644 index 0000000..c12312a --- /dev/null +++ b/root/uiinventory.py @@ -0,0 +1,1205 @@ +import ui +import player +import mouseModule +import net +import app +import snd +import item +import player +import chat +import grp +import uiScriptLocale +import uiRefine +import uiAttachMetin +import uiPickMoney +import uiCommon +import uiPrivateShopBuilder # 锟斤拷锟轿伙拷锟斤拷 锟斤拷锟斤拷锟斤拷 ItemMove 锟斤拷锟斤拷 +import localeInfo +import constInfo +import ime +import wndMgr + +ITEM_MALL_BUTTON_ENABLE = True + + + +ITEM_FLAG_APPLICABLE = 1 << 14 + +class CostumeWindow(ui.ScriptWindow): + + def __init__(self, wndInventory): + import exception + + if not app.ENABLE_COSTUME_SYSTEM: + exception.Abort("What do you do?") + return + + if not wndInventory: + exception.Abort("wndInventory parameter must be set to InventoryWindow") + return + + ui.ScriptWindow.__init__(self) + + self.isLoaded = 0 + self.wndInventory = wndInventory; + + self.__LoadWindow() + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def Show(self): + self.__LoadWindow() + self.RefreshCostumeSlot() + + ui.ScriptWindow.Show(self) + + def Close(self): + self.Hide() + + def __LoadWindow(self): + if self.isLoaded == 1: + return + + self.isLoaded = 1 + + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, "UIScript/CostumeWindow.py") + except: + import exception + exception.Abort("CostumeWindow.LoadWindow.LoadObject") + + try: + wndEquip = self.GetChild("CostumeSlot") + self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close)) + + except: + import exception + exception.Abort("CostumeWindow.LoadWindow.BindObject") + + ## Equipment + wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem)) + wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem)) + wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot)) + wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot)) + wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot)) + wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot)) + + self.wndEquip = wndEquip + + def RefreshCostumeSlot(self): + getItemVNum=player.GetItemIndex + + for i in xrange(item.COSTUME_SLOT_COUNT): + slotNumber = item.COSTUME_SLOT_START + i + self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0) + + self.wndEquip.RefreshSlot() + +class BeltInventoryWindow(ui.ScriptWindow): + + def __init__(self, wndInventory): + import exception + + if not app.ENABLE_NEW_EQUIPMENT_SYSTEM: + exception.Abort("What do you do?") + return + + if not wndInventory: + exception.Abort("wndInventory parameter must be set to InventoryWindow") + return + + ui.ScriptWindow.__init__(self) + + self.isLoaded = 0 + self.wndInventory = wndInventory; + + self.wndBeltInventoryLayer = None + self.wndBeltInventorySlot = None + self.expandBtn = None + self.minBtn = None + + self.__LoadWindow() + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def Show(self, openBeltSlot = FALSE): + self.__LoadWindow() + self.RefreshSlot() + + ui.ScriptWindow.Show(self) + + if openBeltSlot: + self.OpenInventory() + else: + self.CloseInventory() + + def Close(self): + self.Hide() + + def IsOpeningInventory(self): + return self.wndBeltInventoryLayer.IsShow() + + def OpenInventory(self): + self.wndBeltInventoryLayer.Show() + self.expandBtn.Hide() + + if localeInfo.IsARABIC() == 0: + self.AdjustPositionAndSize() + + def CloseInventory(self): + self.wndBeltInventoryLayer.Hide() + self.expandBtn.Show() + + if localeInfo.IsARABIC() == 0: + self.AdjustPositionAndSize() + + ## 锟斤拷锟斤拷 锟轿猴拷锟戒府 锟斤拷摹锟斤拷 锟斤拷锟斤拷锟斤拷锟斤拷 BASE 锟斤拷摹锟斤拷 锟斤拷锟, 锟斤拷锟斤拷.. 锟斤拷锟斤拷 锟较碉拷锟节碉拷锟较憋拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷锟 锟斤拷锟斤拷.. + def GetBasePosition(self): + x, y = self.wndInventory.GetGlobalPosition() + return x - 148, y + 241 + + def AdjustPositionAndSize(self): + bx, by = self.GetBasePosition() + + if self.IsOpeningInventory(): + self.SetPosition(bx, by) + self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight()) + + else: + self.SetPosition(bx + 138, by); + self.SetSize(10, self.GetHeight()) + + def __LoadWindow(self): + if self.isLoaded == 1: + return + + self.isLoaded = 1 + + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py") + except: + import exception + exception.Abort("CostumeWindow.LoadWindow.LoadObject") + + try: + self.ORIGINAL_WIDTH = self.GetWidth() + wndBeltInventorySlot = self.GetChild("BeltInventorySlot") + self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer") + self.expandBtn = self.GetChild("ExpandBtn") + self.minBtn = self.GetChild("MinimizeBtn") + + self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory)) + self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory)) + + if localeInfo.IsARABIC() : + self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15) + self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0) + self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15) + + for i in xrange(item.BELT_INVENTORY_SLOT_COUNT): + slotNumber = item.BELT_INVENTORY_SLOT_START + i + wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\ + "d:/ymir work/ui/game/quest/slot_button_01.sub",\ + "d:/ymir work/ui/game/quest/slot_button_01.sub",\ + "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", FALSE, FALSE) + + except: + import exception + exception.Abort("CostumeWindow.LoadWindow.BindObject") + + ## Equipment + wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem)) + wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem)) + wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot)) + wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot)) + wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot)) + wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot)) + + self.wndBeltInventorySlot = wndBeltInventorySlot + + def RefreshSlot(self): + getItemVNum=player.GetItemIndex + + for i in xrange(item.BELT_INVENTORY_SLOT_COUNT): + slotNumber = item.BELT_INVENTORY_SLOT_START + i + self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber)) + self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, TRUE) + + avail = "0" + + if player.IsAvailableBeltInventoryCell(slotNumber): + self.wndBeltInventorySlot.EnableCoverButton(slotNumber) + else: + self.wndBeltInventorySlot.DisableCoverButton(slotNumber) + + self.wndBeltInventorySlot.RefreshSlot() + + +class InventoryWindow(ui.ScriptWindow): + + USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET") + + questionDialog = None + tooltipItem = None + wndCostume = None + wndBelt = None + dlgPickMoney = None + + sellingSlotNumber = -1 + isLoaded = 0 + isOpenedCostumeWindowWhenClosingInventory = 0 # 锟轿猴拷锟戒府 锟斤拷锟斤拷 锟斤拷 锟节斤拷锟斤拷锟斤拷 锟斤拷锟斤拷锟街撅拷锟斤拷锟斤拷 锟斤拷锟斤拷-_-; 锟斤拷锟教癸拷 锟斤拷锟斤拷 + isOpenedBeltWindowWhenClosingInventory = 0 # 锟轿猴拷锟戒府 锟斤拷锟斤拷 锟斤拷 锟斤拷飘 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷锟街撅拷锟斤拷锟斤拷 锟斤拷锟斤拷-_-; 锟斤拷锟教癸拷 锟斤拷锟斤拷 + + def __init__(self): + ui.ScriptWindow.__init__(self) + + self.isOpenedBeltWindowWhenClosingInventory = 0 # 锟轿猴拷锟戒府 锟斤拷锟斤拷 锟斤拷 锟斤拷飘 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷锟街撅拷锟斤拷锟斤拷 锟斤拷锟斤拷-_-; 锟斤拷锟教癸拷 锟斤拷锟斤拷 + + self.__LoadWindow() + + def __del__(self): + ui.ScriptWindow.__del__(self) + + def Show(self): + self.__LoadWindow() + + ui.ScriptWindow.Show(self) + + # 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷 锟斤拷 锟节斤拷锟斤拷锟斤拷 锟斤拷锟斤拷锟街撅拷锟劫革拷 锟轿猴拷锟戒府锟斤拷 锟斤拷 锟斤拷 锟节斤拷锟斤拷锟斤拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷. + if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume: + self.wndCostume.Show() + + # 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷 锟斤拷 锟斤拷飘 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷锟街撅拷锟劫革拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷. + if self.wndBelt: + self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory) + + def BindInterfaceClass(self, interface): + self.interface = interface + + def __LoadWindow(self): + if self.isLoaded == 1: + return + + self.isLoaded = 1 + + try: + pyScrLoader = ui.PythonScriptLoader() + + if ITEM_MALL_BUTTON_ENABLE: + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py") + else: + pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py") + except: + import exception + exception.Abort("InventoryWindow.LoadWindow.LoadObject") + + try: + wndItem = self.GetChild("ItemSlot") + wndEquip = self.GetChild("EquipmentSlot") + self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close)) + self.wndMoney = self.GetChild("Money") + self.wndMoneySlot = self.GetChild("Money_Slot") + self.mallButton = self.GetChild2("MallButton") + self.DSSButton = self.GetChild2("DSSButton") + self.costumeButton = self.GetChild2("CostumeButton") + + self.inventoryTab = [] + self.inventoryTab.append(self.GetChild("Inventory_Tab_01")) + self.inventoryTab.append(self.GetChild("Inventory_Tab_02")) + + self.equipmentTab = [] + self.equipmentTab.append(self.GetChild("Equipment_Tab_01")) + self.equipmentTab.append(self.GetChild("Equipment_Tab_02")) + + if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM: + self.costumeButton.Hide() + self.costumeButton.Destroy() + self.costumeButton = 0 + + # Belt Inventory Window + self.wndBelt = None + + if app.ENABLE_NEW_EQUIPMENT_SYSTEM: + self.wndBelt = BeltInventoryWindow(self) + + except: + import exception + exception.Abort("InventoryWindow.LoadWindow.BindObject") + + ## Item + 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)) + + ## Equipment + wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot)) + wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot)) + wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot)) + wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot)) + wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) + wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + + ## PickMoneyDialog + dlgPickMoney = uiPickMoney.PickMoneyDialog() + dlgPickMoney.LoadDialog() + dlgPickMoney.Hide() + + ## RefineDialog + self.refineDialog = uiRefine.RefineDialog() + self.refineDialog.Hide() + + ## AttachMetinDialog + self.attachMetinDialog = uiAttachMetin.AttachMetinDialog() + self.attachMetinDialog.Hide() + + ## MoneySlot + self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog)) + + self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg)) + self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg)) + self.inventoryTab[0].Down() + + self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg)) + self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg)) + self.equipmentTab[0].Down() + self.equipmentTab[0].Hide() + self.equipmentTab[1].Hide() + + self.wndItem = wndItem + self.wndEquip = wndEquip + self.dlgPickMoney = dlgPickMoney + + # MallButton + if self.mallButton: + self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton)) + + if self.DSSButton: + self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton)) + + # Costume Button + if self.costumeButton: + self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton)) + + self.wndCostume = None + + ##### + + ## Refresh + self.SetInventoryPage(0) + self.SetEquipmentPage(0) + self.RefreshItemSlot() + self.RefreshStatus() + + def Destroy(self): + self.ClearDictionary() + + self.dlgPickMoney.Destroy() + self.dlgPickMoney = 0 + + self.refineDialog.Destroy() + self.refineDialog = 0 + + self.attachMetinDialog.Destroy() + self.attachMetinDialog = 0 + + self.tooltipItem = None + self.wndItem = 0 + self.wndEquip = 0 + self.dlgPickMoney = 0 + self.wndMoney = 0 + self.wndMoneySlot = 0 + self.questionDialog = None + self.mallButton = None + self.DSSButton = None + self.interface = None + + if self.wndCostume: + self.wndCostume.Destroy() + self.wndCostume = 0 + + if self.wndBelt: + self.wndBelt.Destroy() + self.wndBelt = None + + self.inventoryTab = [] + self.equipmentTab = [] + + def Hide(self): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): + self.OnCloseQuestionDialog() + return + if None != self.tooltipItem: + self.tooltipItem.HideToolTip() + + if self.wndCostume: + self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # 锟轿猴拷锟戒府 芒锟斤拷 锟斤拷锟斤拷 锟斤拷 锟节斤拷锟斤拷锟斤拷 锟斤拷锟斤拷 锟街撅拷锟铰帮拷? + self.wndCostume.Close() + + if self.wndBelt: + self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # 锟轿猴拷锟戒府 芒锟斤拷 锟斤拷锟斤拷 锟斤拷 锟斤拷飘 锟轿猴拷锟戒府锟斤拷 锟斤拷锟斤拷 锟街撅拷锟铰帮拷? + print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory + self.wndBelt.Close() + + if self.dlgPickMoney: + self.dlgPickMoney.Close() + + wndMgr.Hide(self.hWnd) + + + def Close(self): + self.Hide() + + def SetInventoryPage(self, page): + self.inventoryPageIndex = page + self.inventoryTab[1-page].SetUp() + self.RefreshBagSlotWindow() + + def SetEquipmentPage(self, page): + self.equipmentPageIndex = page + self.equipmentTab[1-page].SetUp() + self.RefreshEquipSlotWindow() + + def ClickMallButton(self): + print "click_mall_button" + net.SendChatPacket("/click_mall") + + # DSSButton + def ClickDSSButton(self): + print "click_dss_button" + self.interface.ToggleDragonSoulWindow() + + def ClickCostumeButton(self): + print "Click Costume Button" + if self.wndCostume: + if self.wndCostume.IsShow(): + self.wndCostume.Hide() + else: + self.wndCostume.Show() + else: + self.wndCostume = CostumeWindow(self) + self.wndCostume.Show() + + def OpenPickMoneyDialog(self): + + if mouseModule.mouseController.isAttached(): + + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType(): + + if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex(): + net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount()) + snd.PlaySound("sound/ui/money.wav") + + mouseModule.mouseController.DeattachObject() + + else: + curMoney = player.GetElk() + + if curMoney <= 0: + return + + self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE) + self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney)) + self.dlgPickMoney.Open(curMoney) + self.dlgPickMoney.SetMax(7) # 锟轿猴拷锟戒府 990000 锟斤拷锟斤拷 锟斤拷锟斤拷 锟斤拷锟斤拷 + + def OnPickMoney(self, money): + mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money) + + def OnPickItem(self, count): + itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex + selectedItemVNum = player.GetItemIndex(itemSlotIndex) + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count) + + def __InventoryLocalSlotPosToGlobalSlotPos(self, local): + if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)): + return local + + return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local + + def RefreshBagSlotWindow(self): + getItemVNum=player.GetItemIndex + getItemCount=player.GetItemCount + setItemVNum=self.wndItem.SetItemSlot + + for i in xrange(player.INVENTORY_PAGE_SIZE): + slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i) + + itemCount = getItemCount(slotNumber) + # itemCount == 0锟教革拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷. + if 0 == itemCount: + self.wndItem.ClearSlot(i) + continue + elif 1 == itemCount: + itemCount = 0 + + itemVnum = getItemVNum(slotNumber) + setItemVNum(i, itemVnum, itemCount) + + ## 锟节碉拷锟斤拷锟斤拷 (HP: #72723 ~ #72726, SP: #72727 ~ #72730) 漂锟斤拷贸锟斤拷 - 锟斤拷锟斤拷锟斤拷锟轿碉拷锟斤拷 锟斤拷锟皆匡拷 劝锟斤拷拳/锟斤拷劝锟斤拷拳 钎锟矫革拷 锟斤拷锟斤拷 锟桔撅拷锟斤拷 - [hyo] + if constInfo.IS_AUTO_POTION(itemVnum): + # metinSocket - [0] : 劝锟斤拷拳 锟斤拷锟斤拷, [1] : 锟斤拷锟斤拷锟 锟斤拷, [2] : 锟街达拷 锟诫樊 + metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] + + if slotNumber >= player.INVENTORY_PAGE_SIZE: + slotNumber -= player.INVENTORY_PAGE_SIZE + + isActivated = 0 != metinSocket[0] + + if isActivated: + self.wndItem.ActivateSlot(slotNumber) + potionType = 0; + if constInfo.IS_AUTO_POTION_HP(itemVnum): + potionType = player.AUTO_POTION_TYPE_HP + elif constInfo.IS_AUTO_POTION_SP(itemVnum): + potionType = player.AUTO_POTION_TYPE_SP + + usedAmount = int(metinSocket[1]) + totalAmount = int(metinSocket[2]) + player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i)) + + else: + self.wndItem.DeactivateSlot(slotNumber) + + ## Allgemein aktivierbare Items (z.B. Reit-Siegel) - Rahmen ueber metinSocket[0], ohne Auto-Potion-Logik + elif constInfo.IS_ACTIVATABLE_ITEM(itemVnum): + isActivated = 0 != player.GetItemMetinSocket(slotNumber, 0) + + if slotNumber >= player.INVENTORY_PAGE_SIZE: + slotNumber -= player.INVENTORY_PAGE_SIZE + + if isActivated: + self.wndItem.ActivateSlot(slotNumber) + else: + self.wndItem.DeactivateSlot(slotNumber) + + self.wndItem.RefreshSlot() + + if self.wndBelt: + self.wndBelt.RefreshSlot() + + def RefreshEquipSlotWindow(self): + getItemVNum=player.GetItemIndex + getItemCount=player.GetItemCount + setItemVNum=self.wndEquip.SetItemSlot + for i in xrange(player.EQUIPMENT_PAGE_COUNT): + slotNumber = player.EQUIPMENT_SLOT_START + i + itemCount = getItemCount(slotNumber) + if itemCount <= 1: + itemCount = 0 + setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount) + + if app.ENABLE_NEW_EQUIPMENT_SYSTEM: + for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT): + slotNumber = player.NEW_EQUIPMENT_SLOT_START + i + itemCount = getItemCount(slotNumber) + if itemCount <= 1: + itemCount = 0 + setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount) + print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber) + + + + self.wndEquip.RefreshSlot() + + if self.wndCostume: + self.wndCostume.RefreshCostumeSlot() + + def RefreshItemSlot(self): + self.RefreshBagSlotWindow() + self.RefreshEquipSlotWindow() + + def RefreshStatus(self): + money = player.GetElk() + self.wndMoney.SetText(localeInfo.NumberToMoneyString(money)) + + def SetItemToolTip(self, tooltipItem): + self.tooltipItem = tooltipItem + + def SellItem(self): + if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber): + if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber): + ## 锟斤拷去锟斤拷锟斤拷 锟饺革拷锟斤拷 锟较达拷 锟斤拷锟 锟竭帮拷锟较搁辑 锟斤拷锟斤拷 type 锟竭帮拷 + net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY) + snd.PlaySound("sound/ui/money.wav") + self.OnCloseQuestionDialog() + + def OnDetachMetinFromItem(self): + if None == self.questionDialog: + return + + #net.SendItemUseToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos) + self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos) + self.OnCloseQuestionDialog() + + def OnCloseQuestionDialog(self): + if not self.questionDialog: + return + + self.questionDialog.Close() + self.questionDialog = None + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) + + ## Slot Event + def SelectEmptySlot(self, selectedSlotPos): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos) + + if mouseModule.mouseController.isAttached(): + + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() + attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + + if player.SLOT_TYPE_INVENTORY == attachedSlotType: + itemCount = player.GetItemCount(attachedSlotPos) + attachedCount = mouseModule.mouseController.GetAttachedItemCount() + self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount) + + if item.IsRefineScroll(attachedItemIndex): + self.wndItem.SetUseMode(False) + + elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType: + mouseModule.mouseController.RunCallBack("INVENTORY") + + elif player.SLOT_TYPE_SHOP == attachedSlotType: + net.SendShopBuyPacket(attachedSlotPos) + + elif player.SLOT_TYPE_SAFEBOX == attachedSlotType: + + if player.ITEM_MONEY == attachedItemIndex: + net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount()) + snd.PlaySound("sound/ui/money.wav") + + else: + net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos) + + elif player.SLOT_TYPE_MALL == attachedSlotType: + net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos) + + mouseModule.mouseController.DeattachObject() + + def SelectItemSlot(self, itemSlotIndex): + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: + return + + itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex) + + if mouseModule.mouseController.isAttached(): + attachedSlotType = mouseModule.mouseController.GetAttachedType() + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex() + + if player.SLOT_TYPE_INVENTORY == attachedSlotType: + self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex) + + mouseModule.mouseController.DeattachObject() + + else: + + curCursorNum = app.GetCursor() + if app.SELL == curCursorNum: + self.__SellItem(itemSlotIndex) + + elif app.BUY == curCursorNum: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO) + + elif app.IsPressed(app.DIK_LALT): + link = player.GetItemLink(itemSlotIndex) + ime.PasteString(link) + + elif app.IsPressed(app.DIK_LSHIFT): + itemCount = player.GetItemCount(itemSlotIndex) + + if itemCount > 1: + self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE) + self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem)) + self.dlgPickMoney.Open(itemCount) + self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex + #else: + #selectedItemVNum = player.GetItemIndex(itemSlotIndex) + #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum) + + elif app.IsPressed(app.DIK_LCONTROL): + itemIndex = player.GetItemIndex(itemSlotIndex) + + if True == item.CanAddToQuickSlotItem(itemIndex): + player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex) + else: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM) + + else: + selectedItemVNum = player.GetItemIndex(itemSlotIndex) + itemCount = player.GetItemCount(itemSlotIndex) + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount) + + if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex): + self.wndItem.SetUseMode(True) + else: + self.wndItem.SetUseMode(False) + + snd.PlaySound("sound/ui/pick.wav") + + def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos): + if srcItemSlotPos == dstItemSlotPos: + return + + elif item.IsRefineScroll(srcItemVID): + self.RefineItem(srcItemSlotPos, dstItemSlotPos) + self.wndItem.SetUseMode(False) + + elif item.IsMetin(srcItemVID): + self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos) + + elif item.IsDetachScroll(srcItemVID): + self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos) + + elif item.IsKey(srcItemVID): + self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) + + elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: + self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) + + elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE: + self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) + + else: + #snd.PlaySound("sound/ui/drop.wav") + + ## 锟教碉拷锟斤拷挪 锟斤拷锟斤拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟 锟斤拷锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷丶锟 锟斤拷锟斤拷 锟斤拷挪锟斤拷 - [levites] + if player.IsEquipmentSlot(dstItemSlotPos): + + ## 锟斤拷锟 锟街达拷 锟斤拷锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷隙锟斤拷锟 + if item.IsEquipmentVID(srcItemVID): + self.__UseItem(srcItemSlotPos) + + else: + self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0) + #net.SendItemMovePacket(srcItemSlotPos, dstItemSlotPos, 0) + + def __SellItem(self, itemSlotPos): + if not player.IsEquipmentSlot(itemSlotPos): + self.sellingSlotNumber = itemSlotPos + itemIndex = player.GetItemIndex(itemSlotPos) + itemCount = player.GetItemCount(itemSlotPos) + + + self.sellingSlotitemIndex = itemIndex + self.sellingSlotitemCount = itemCount + + item.SelectItem(itemIndex) + ## 锟斤拷萍 锟矫凤拷锟斤拷 锟剿伙拷 锟斤拷锟斤拷锟斤拷 锟竭帮拷 + ## 20140220 + 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 + + itemPrice = item.GetISellItemPrice() + + if item.Is1GoldItem(): + itemPrice = itemCount / itemPrice / 5 + else: + itemPrice = itemPrice * itemCount / 5 + + item.GetItemName(itemIndex) + itemName = item.GetItemName() + + self.questionDialog = uiCommon.QuestionDialog() + self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice)) + self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem)) + self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog)) + self.questionDialog.Open() + self.questionDialog.count = itemCount + + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) + + def __OnClosePopupDialog(self): + self.pop = None + + def RefineItem(self, scrollSlotPos, targetSlotPos): + + scrollIndex = player.GetItemIndex(scrollSlotPos) + targetIndex = player.GetItemIndex(targetSlotPos) + + if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos): + return + + ########################################################### + self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos) + #net.SendItemUseToItemPacket(scrollSlotPos, targetSlotPos) + return + ########################################################### + + ########################################################### + #net.SendRequestRefineInfoPacket(targetSlotPos) + #return + ########################################################### + + result = player.CanRefine(scrollIndex, targetSlotPos) + + if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result: + #snd.PlaySound("sound/ui/jaeryun_fail.wav") + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET) + + elif player.REFINE_NEED_MORE_GOOD_SCROLL == result: + #snd.PlaySound("sound/ui/jaeryun_fail.wav") + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL) + + elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result: + #snd.PlaySound("sound/ui/jaeryun_fail.wav") + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM) + + elif player.REFINE_NOT_NEXT_GRADE_ITEM == result: + #snd.PlaySound("sound/ui/jaeryun_fail.wav") + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM) + + elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM) + + if player.REFINE_OK != result: + return + + self.refineDialog.Open(scrollSlotPos, targetSlotPos) + + def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos): + scrollIndex = player.GetItemIndex(scrollSlotPos) + targetIndex = player.GetItemIndex(targetSlotPos) + + if not player.CanDetach(scrollIndex, targetSlotPos): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM) + return + + self.questionDialog = uiCommon.QuestionDialog() + self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN) + self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem)) + self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog)) + self.questionDialog.Open() + self.questionDialog.sourcePos = scrollSlotPos + self.questionDialog.targetPos = targetSlotPos + + def AttachMetinToItem(self, metinSlotPos, targetSlotPos): + metinIndex = player.GetItemIndex(metinSlotPos) + targetIndex = player.GetItemIndex(targetSlotPos) + + item.SelectItem(metinIndex) + itemName = item.GetItemName() + + result = player.CanAttachMetin(metinIndex, targetSlotPos) + + if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName)) + + if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName)) + + elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName)) + + elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result: + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM) + + if player.ATTACH_METIN_OK != result: + return + + self.attachMetinDialog.Open(metinSlotPos, targetSlotPos) + + + + def OverOutItem(self): + self.wndItem.SetUsableItem(False) + if None != self.tooltipItem: + self.tooltipItem.HideToolTip() + + def OverInItem(self, overSlotPos): + overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos) + self.wndItem.SetUsableItem(False) + + if mouseModule.mouseController.isAttached(): + attachedItemType = mouseModule.mouseController.GetAttachedType() + if player.SLOT_TYPE_INVENTORY == attachedItemType: + + attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() + attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex() + + if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): + self.wndItem.SetUsableItem(True) + self.ShowToolTip(overSlotPos) + return + + self.ShowToolTip(overSlotPos) + + + def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos): + "锟劫革拷 锟斤拷锟斤拷锟桔匡拷 锟斤拷锟斤拷锟 锟斤拷 锟街达拷 锟斤拷锟斤拷锟斤拷锟轿帮拷?" + + if item.IsRefineScroll(srcItemVNum): + return True + elif item.IsMetin(srcItemVNum): + return True + elif item.IsDetachScroll(srcItemVNum): + return True + elif item.IsKey(srcItemVNum): + return True + elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: + return True + else: + if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE: + return True + + return False + + def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos): + "锟斤拷锟 锟斤拷锟斤拷锟桔匡拷 锟斤拷锟斤拷锟 锟斤拷 锟街绰帮拷?" + + if srcSlotPos == dstSlotPos: + return False + + if item.IsRefineScroll(srcItemVNum): + if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos): + return True + elif item.IsMetin(srcItemVNum): + if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos): + return True + elif item.IsDetachScroll(srcItemVNum): + if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos): + return True + elif item.IsKey(srcItemVNum): + if player.CanUnlock(srcItemVNum, dstSlotPos): + return True + + elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: + return True + + else: + useType=item.GetUseType(srcItemVNum) + + if "USE_CLEAN_SOCKET" == useType: + if self.__CanCleanBrokenMetinStone(dstSlotPos): + return True + elif "USE_CHANGE_ATTRIBUTE" == useType: + if self.__CanChangeItemAttrList(dstSlotPos): + return True + elif "USE_ADD_ATTRIBUTE" == useType: + if self.__CanAddItemAttr(dstSlotPos): + return True + elif "USE_ADD_ATTRIBUTE2" == useType: + if self.__CanAddItemAttr(dstSlotPos): + return True + elif "USE_ADD_ACCESSORY_SOCKET" == useType: + if self.__CanAddAccessorySocket(dstSlotPos): + return True + elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType: + if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum): + return TRUE; + elif "USE_PUT_INTO_BELT_SOCKET" == useType: + dstItemVNum = player.GetItemIndex(dstSlotPos) + print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum + + item.SelectItem(dstItemVNum) + + if item.ITEM_TYPE_BELT == item.GetItemType(): + return True + + return False + + def __CanCleanBrokenMetinStone(self, dstSlotPos): + dstItemVNum = player.GetItemIndex(dstSlotPos) + if dstItemVNum == 0: + return False + + item.SelectItem(dstItemVNum) + + if item.ITEM_TYPE_WEAPON != item.GetItemType(): + return False + + for i in xrange(player.METIN_SOCKET_MAX_NUM): + if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE: + return True + + return False + + def __CanChangeItemAttrList(self, dstSlotPos): + dstItemVNum = player.GetItemIndex(dstSlotPos) + if dstItemVNum == 0: + return False + + item.SelectItem(dstItemVNum) + + if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR): + return False + + for i in xrange(player.METIN_SOCKET_MAX_NUM): + if player.GetItemAttribute(dstSlotPos, i) != 0: + return True + + return False + + def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum): + dstItemVNum = player.GetItemIndex(dstSlotPos) + if dstItemVNum == 0: + return False + + item.SelectItem(dstItemVNum) + + if item.GetItemType() != item.ITEM_TYPE_ARMOR: + return False + + if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR): + return False + + curCount = player.GetItemMetinSocket(dstSlotPos, 0) + maxCount = player.GetItemMetinSocket(dstSlotPos, 1) + + if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()): + return False + + if curCount>=maxCount: + return False + + return True + + def __CanAddAccessorySocket(self, dstSlotPos): + dstItemVNum = player.GetItemIndex(dstSlotPos) + if dstItemVNum == 0: + return False + + item.SelectItem(dstItemVNum) + + if item.GetItemType() != item.ITEM_TYPE_ARMOR: + return False + + if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR): + return False + + curCount = player.GetItemMetinSocket(dstSlotPos, 0) + maxCount = player.GetItemMetinSocket(dstSlotPos, 1) + + ACCESSORY_SOCKET_MAX_SIZE = 3 + if maxCount >= ACCESSORY_SOCKET_MAX_SIZE: + return False + + return True + + def __CanAddItemAttr(self, dstSlotPos): + dstItemVNum = player.GetItemIndex(dstSlotPos) + if dstItemVNum == 0: + return False + + item.SelectItem(dstItemVNum) + + if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR): + return False + + attrCount = 0 + for i in xrange(player.METIN_SOCKET_MAX_NUM): + if player.GetItemAttribute(dstSlotPos, i) != 0: + attrCount += 1 + + if attrCount<4: + return True + + return False + + def ShowToolTip(self, slotIndex): + if None != self.tooltipItem: + self.tooltipItem.SetInventoryItem(slotIndex) + + def OnTop(self): + if None != self.tooltipItem: + self.tooltipItem.SetTop() + + def OnPressEscapeKey(self): + self.Close() + return True + + def UseItemSlot(self, slotIndex): + curCursorNum = app.GetCursor() + if app.SELL == curCursorNum: + return + + if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): + return + + slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex) + + if app.ENABLE_DRAGON_SOUL_SYSTEM: + if self.wndDragonSoulRefine.IsShow(): + self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1) + return + + self.__UseItem(slotIndex) + mouseModule.mouseController.DeattachObject() + self.OverOutItem() + + def __UseItem(self, slotIndex): + ItemVNum = player.GetItemIndex(slotIndex) + item.SelectItem(ItemVNum) + if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE): + self.questionDialog = uiCommon.QuestionDialog() + self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM) + self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept)) + self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel)) + self.questionDialog.Open() + self.questionDialog.slotIndex = slotIndex + + constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) + + else: + self.__SendUseItemPacket(slotIndex) + #net.SendItemUsePacket(slotIndex) + + def __UseItemQuestionDialog_OnCancel(self): + self.OnCloseQuestionDialog() + + def __UseItemQuestionDialog_OnAccept(self): + self.__SendUseItemPacket(self.questionDialog.slotIndex) + self.OnCloseQuestionDialog() + + def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos): + # 锟斤拷锟轿伙拷锟斤拷 锟斤拷锟斤拷 锟街达拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟 锟斤拷锟斤拷 + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP) + return + + net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos) + + def __SendUseItemPacket(self, slotPos): + # 锟斤拷锟轿伙拷锟斤拷 锟斤拷锟斤拷 锟街达拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟 锟斤拷锟斤拷 + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP) + return + + net.SendItemUsePacket(slotPos) + + def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount): + # 锟斤拷锟轿伙拷锟斤拷 锟斤拷锟斤拷 锟街达拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷 锟斤拷锟 锟斤拷锟斤拷 + if uiPrivateShopBuilder.IsBuildingPrivateShop(): + chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP) + return + + net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount) + + def SetDragonSoulRefineWindow(self, wndDragonSoulRefine): + if app.ENABLE_DRAGON_SOUL_SYSTEM: + self.wndDragonSoulRefine = wndDragonSoulRefine + + def OnMoveWindow(self, x, y): +# print "Inventory Global Pos : ", self.GetGlobalPosition() + if self.wndBelt: +# print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition() + self.wndBelt.AdjustPositionAndSize() + diff --git a/root/uimapnameshower.py b/root/uimapnameshower.py new file mode 100644 index 0000000..fdbd1e1 --- /dev/null +++ b/root/uimapnameshower.py @@ -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 diff --git a/root/uimessenger.py b/root/uimessenger.py new file mode 100644 index 0000000..dd7cea9 --- /dev/null +++ b/root/uimessenger.py @@ -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() diff --git a/root/uiminimap.py b/root/uiminimap.py new file mode 100644 index 0000000..b51e742 --- /dev/null +++ b/root/uiminimap.py @@ -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() diff --git a/root/uioption.py b/root/uioption.py new file mode 100644 index 0000000..2a5dfdf --- /dev/null +++ b/root/uioption.py @@ -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)= 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() diff --git a/root/uiphasecurtain.py b/root/uiphasecurtain.py new file mode 100644 index 0000000..107420a --- /dev/null +++ b/root/uiphasecurtain.py @@ -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) diff --git a/root/uipickmoney.py b/root/uipickmoney.py new file mode 100644 index 0000000..f1535b8 --- /dev/null +++ b/root/uipickmoney.py @@ -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() diff --git a/root/uiplayergauge.py b/root/uiplayergauge.py new file mode 100644 index 0000000..40068de --- /dev/null +++ b/root/uiplayergauge.py @@ -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() diff --git a/root/uipointreset.py b/root/uipointreset.py new file mode 100644 index 0000000..6ab160a --- /dev/null +++ b/root/uipointreset.py @@ -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 diff --git a/root/uiprivateshopbuilder.py b/root/uiprivateshopbuilder.py new file mode 100644 index 0000000..3e8f782 --- /dev/null +++ b/root/uiprivateshopbuilder.py @@ -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() diff --git a/root/uiquest.py b/root/uiquest.py new file mode 100644 index 0000000..4c52973 --- /dev/null +++ b/root/uiquest.py @@ -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() diff --git a/root/uirefine.py b/root/uirefine.py new file mode 100644 index 0000000..6ff9916 --- /dev/null +++ b/root/uirefine.py @@ -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 diff --git a/root/uirestart.py b/root/uirestart.py new file mode 100644 index 0000000..da65808 --- /dev/null +++ b/root/uirestart.py @@ -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 diff --git a/root/uisafebox.py b/root/uisafebox.py new file mode 100644 index 0000000..e527322 --- /dev/null +++ b/root/uisafebox.py @@ -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() diff --git a/root/uiscriptlocale.py b/root/uiscriptlocale.py new file mode 100644 index 0000000..e4a82f3 --- /dev/null +++ b/root/uiscriptlocale.py @@ -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()) + diff --git a/root/uiselectitem.py b/root/uiselectitem.py new file mode 100644 index 0000000..cfebb62 --- /dev/null +++ b/root/uiselectitem.py @@ -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) + diff --git a/root/uiselectmusic.py b/root/uiselectmusic.py new file mode 100644 index 0000000..cf1880d --- /dev/null +++ b/root/uiselectmusic.py @@ -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)) + + diff --git a/root/uishop.py b/root/uishop.py new file mode 100644 index 0000000..d7a91f0 --- /dev/null +++ b/root/uishop.py @@ -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 diff --git a/root/uisystem.py b/root/uisystem.py new file mode 100644 index 0000000..ae2feca --- /dev/null +++ b/root/uisystem.py @@ -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() + diff --git a/root/uisystemoption.py b/root/uisystemoption.py new file mode 100644 index 0000000..9ef1d4a --- /dev/null +++ b/root/uisystemoption.py @@ -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) + diff --git a/root/uitarget.py b/root/uitarget.py new file mode 100644 index 0000000..dbe38dc --- /dev/null +++ b/root/uitarget.py @@ -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() diff --git a/root/uitaskbar.py b/root/uitaskbar.py new file mode 100644 index 0000000..c146323 --- /dev/null +++ b/root/uitaskbar.py @@ -0,0 +1,1139 @@ +import ui +import net +import item +import skill +import localeInfo +import wndMgr +import player +import constInfo +import mouseModule +import uiScriptLocale +import app + +MOUSE_SETTINGS = [0, 0] + +def InitMouseButtonSettings(left, right): + global MOUSE_SETTINGS + MOUSE_SETTINGS = [left, right] + +def SetMouseButtonSetting(dir, event): + global MOUSE_SETTINGS + MOUSE_SETTINGS[dir] = event + +def GetMouseButtonSettings(): + global MOUSE_SETTINGS + return MOUSE_SETTINGS + +def SaveMouseButtonSettings(): + global MOUSE_SETTINGS + open("mouse.cfg", "w").write("%s\t%s" % tuple(MOUSE_SETTINGS)) + +def LoadMouseButtonSettings(): + global MOUSE_SETTINGS + tokens = open("mouse.cfg", "r").read().split() + + if len(tokens) != 2: + raise RuntimeError, "MOUSE_SETTINGS_FILE_ERROR" + + MOUSE_SETTINGS[0] = int(tokens[0]) + MOUSE_SETTINGS[1] = int(tokens[1]) + +def unsigned32(n): + return n & 0xFFFFFFFFL + +#-------------------Giftbox Begin------------------------------ + +class GiftBox(ui.ScriptWindow): + class TextToolTip(ui.Window): + def __init__(self): + ui.Window.__init__(self, "TOP_MOST") + self.SetWindowName("GiftBox") + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetHorizontalAlignCenter() + textLine.SetOutline() + textLine.Show() + self.textLine = textLine + + def __del__(self): + ui.Window.__del__(self) + + def SetText(self, text): + self.textLine.SetText(text) + + def OnRender(self): + (mouseX, mouseY) = wndMgr.GetMousePosition() + self.textLine.SetPosition(mouseX, mouseY - 15) + + def __init__(self): + #print "NEW TASKBAR ----------------------------------------------------------------------------" + ui.ScriptWindow.__init__(self) + self.tooltipGift = self.TextToolTip() + self.tooltipGift.Show() + + def __del__(self): + #print "---------------------------------------------------------------------------- DELETE TASKBAR" + ui.ScriptWindow.__del__(self) + + def LoadWindow(self): + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "giftbox.py") + except: + import exception + exception.Abort("GiftBox.LoadWindow.LoadObject") + + self.giftBoxIcon = self.GetChild("GiftBox_Icon") + self.giftBoxToolTip = self.GetChild("GiftBox_ToolTip") + + def Destroy(self): + self.giftBoxIcon = 0 + self.giftBoxToolTip = 0 + +#-------------------Giftbox End------------------------------ + +class EnergyBar(ui.ScriptWindow): + class TextToolTip(ui.Window): + def __init__(self): + ui.Window.__init__(self, "TOP_MOST") + self.SetWindowName("EnergyBar") + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetHorizontalAlignCenter() + textLine.SetOutline() + textLine.Show() + self.textLine = textLine + + def __del__(self): + ui.Window.__del__(self) + + def SetText(self, text): + self.textLine.SetText(text) + + def OnRender(self): + (mouseX, mouseY) = wndMgr.GetMousePosition() + self.textLine.SetPosition(mouseX, mouseY - 15) + + def __init__(self): + #print "NEW TASKBAR ----------------------------------------------------------------------------" + ui.ScriptWindow.__init__(self) + self.tooltipEnergy = self.TextToolTip() + self.tooltipEnergy.Show() + + def __del__(self): + #print "---------------------------------------------------------------------------- DELETE TASKBAR" + ui.ScriptWindow.__del__(self) + + def LoadWindow(self): + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "EnergyBar.py") + except: + import exception + exception.Abort("EnergyBar.LoadWindow.LoadObject") + + self.energyEmpty = self.GetChild("EnergyGauge_Empty") + self.energyHungry = self.GetChild("EnergyGauge_Hungry") + self.energyFull = self.GetChild("EnergyGauge_Full") + + self.energyGaugeBoard = self.GetChild("EnergyGauge_Board") + self.energyGaugeToolTip = self.GetChild("EnergyGauge_ToolTip") + + + def Destroy(self): + self.energyEmpty = None + self.energyHungry = None + self.energyFull = None + self.energyGaugeBoard = 0 + self.energyGaugeToolTip = 0 + self.tooltipEnergy = 0 + + ## Gauge + def RefreshStatus(self): + pointEnergy = player.GetStatus (player.ENERGY) + leftTimeEnergy = player.GetStatus (player.ENERGY_END_TIME) - app.GetGlobalTimeStamp() + # 面扁券 瘤加 矫埃 = 2矫埃. + self.SetEnergy (pointEnergy, leftTimeEnergy, 7200) + + def SetEnergy (self, point, leftTime, maxTime): + leftTime = max (leftTime, 0) + maxTime = max (maxTime, 0) + + self.energyEmpty.Hide() + self.energyHungry.Hide() + self.energyFull.Hide() + + if leftTime == 0: + self.energyEmpty.Show() + elif ((leftTime * 100) / maxTime) < 15: + self.energyHungry.Show() + else: + self.energyFull.Show() + + self.tooltipEnergy.SetText("%s" % (localeInfo.TOOLTIP_ENERGY(point))) + + def OnUpdate(self): + if True == self.energyGaugeToolTip.IsIn(): + self.RefreshStatus() + self.tooltipEnergy.Show() + else: + self.tooltipEnergy.Hide() + +class ExpandedTaskBar(ui.ScriptWindow): + BUTTON_DRAGON_SOUL = 0 + def __init__(self): + ui.Window.__init__(self) + self.SetWindowName("ExpandedTaskBar") + + def LoadWindow(self): + try: + pyScrLoader = ui.PythonScriptLoader() + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "ExpandedTaskBar.py") + except: + import exception + exception.Abort("ExpandedTaskBar.LoadWindow.LoadObject") + + self.expandedTaskBarBoard = self.GetChild("ExpanedTaskBar_Board") + + self.toggleButtonDict = {} + self.toggleButtonDict[ExpandedTaskBar.BUTTON_DRAGON_SOUL] = self.GetChild("DragonSoulButton") + self.toggleButtonDict[ExpandedTaskBar.BUTTON_DRAGON_SOUL].SetParent(self) + + def SetTop(self): + super(ExpandedTaskBar, self).SetTop() + for button in self.toggleButtonDict.values(): + button.SetTop() + + def Show(self): + ui.ScriptWindow.Show(self) + + def Close(self): + self.Hide() + + def SetToolTipText(self, eButton, text): + self.toggleButtonDict[eButton].SetToolTipText(text) + + def SetToggleButtonEvent(self, eButton, kEventFunc): + self.toggleButtonDict[eButton].SetEvent(kEventFunc) + + def OnPressEscapeKey(self): + self.Close() + return True + +class TaskBar(ui.ScriptWindow): + + BUTTON_CHARACTER = 0 + BUTTON_INVENTORY = 1 + BUTTON_MESSENGER = 2 + BUTTON_SYSTEM = 3 + BUTTON_CHAT = 4 + BUTTON_EXPAND = 4 + IS_EXPANDED = False + + MOUSE_BUTTON_LEFT = 0 + MOUSE_BUTTON_RIGHT = 1 + NONE = 255 + + EVENT_MOVE = 0 + EVENT_ATTACK = 1 + EVENT_MOVE_AND_ATTACK = 2 + EVENT_CAMERA = 3 + EVENT_SKILL = 4 + EVENT_AUTO = 5 + + GAUGE_WIDTH = 95 + GAUGE_HEIGHT = 13 + + QUICKPAGE_NUMBER_FILENAME = [ + "d:/ymir work/ui/game/taskbar/1.sub", + "d:/ymir work/ui/game/taskbar/2.sub", + "d:/ymir work/ui/game/taskbar/3.sub", + "d:/ymir work/ui/game/taskbar/4.sub", + ] + + #gift icon show and hide + def ShowGift(self): + if not localeInfo.IsBRAZIL(): + self.wndGiftBox.Show() + + def HideGift(self): + self.wndGiftBox.Hide() + + class TextToolTip(ui.Window): + def __init__(self): + ui.Window.__init__(self, "TOP_MOST") + + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetHorizontalAlignCenter() + textLine.SetOutline() + textLine.Show() + self.textLine = textLine + + def __del__(self): + ui.Window.__del__(self) + + def SetText(self, text): + self.textLine.SetText(text) + + def OnRender(self): + (mouseX, mouseY) = wndMgr.GetMousePosition() + self.textLine.SetPosition(mouseX, mouseY - 15) + + class SkillButton(ui.SlotWindow): + + def __init__(self): + ui.SlotWindow.__init__(self) + + self.event = 0 + self.arg = 0 + + self.slotIndex = 0 + self.skillIndex = 0 + + slotIndex = 0 + wndMgr.SetSlotBaseImage(self.hWnd, "d:/ymir work/ui/public/slot_base.sub", 1.0, 1.0, 1.0, 1.0) + wndMgr.AppendSlot(self.hWnd, slotIndex, 0, 0, 32, 32) + self.SetCoverButton(slotIndex, "d:/ymir work/ui/public/slot_cover_button_01.sub",\ + "d:/ymir work/ui/public/slot_cover_button_02.sub",\ + "d:/ymir work/ui/public/slot_cover_button_03.sub",\ + "d:/ymir work/ui/public/slot_cover_button_04.sub", True, False) + self.SetSize(32, 32) + + def __del__(self): + ui.SlotWindow.__del__(self) + + def Destroy(self): + if 0 != self.tooltipSkill: + self.tooltipSkill.HideToolTip() + + def RefreshSkill(self): + if 0 != self.slotIndex: + self.SetSkill(self.slotIndex) + + def SetSkillToolTip(self, tooltip): + self.tooltipSkill = tooltip + + def SetSkill(self, skillSlotNumber): + slotNumber = 0 + skillIndex = player.GetSkillIndex(skillSlotNumber) + skillGrade = player.GetSkillGrade(skillSlotNumber) + skillLevel = player.GetSkillLevel(skillSlotNumber) + skillType = skill.GetSkillType(skillIndex) + + self.skillIndex = skillIndex + if 0 == self.skillIndex: + self.ClearSlot(slotNumber) + return + + self.slotIndex = skillSlotNumber + + self.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel) + self.SetSlotCountNew(slotNumber, skillGrade, skillLevel) + + ## NOTE : CoolTime 眉农 + if player.IsSkillCoolTime(skillSlotNumber): + (coolTime, elapsedTime) = player.GetSkillCoolTime(skillSlotNumber) + self.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) + + ## NOTE : Activate 登绢 乐促搁 酒捞能档 诀单捞飘 + if player.IsSkillActive(skillSlotNumber): + self.ActivateSlot(slotNumber) + + def SetSkillEvent(self, event, arg=0): + self.event = event + self.arg = arg + + def GetSkillIndex(self): + return self.skillIndex + + def GetSlotIndex(self): + return self.slotIndex + + def Activate(self, coolTime): + self.SetSlotCoolTime(0, coolTime) + + if skill.IsToggleSkill(self.skillIndex): + self.ActivateSlot(0) + + def Deactivate(self): + if skill.IsToggleSkill(self.skillIndex): + self.DeactivateSlot(0) + + def OnOverInItem(self, dummy): + self.tooltipSkill.SetSkill(self.skillIndex) + + def OnOverOutItem(self): + self.tooltipSkill.HideToolTip() + + def OnSelectItemSlot(self, dummy): + if 0 != self.event: + if 0 != self.arg: + self.event(self.arg) + else: + self.event() + + def __init__(self): + #print "NEW TASKBAR ----------------------------------------------------------------------------" + + ui.ScriptWindow.__init__(self, "TOP_MOST") + + self.quickPageNumImageBox = None + self.tooltipItem = 0 + self.tooltipSkill = 0 + self.mouseModeButtonList = [ ui.ScriptWindow("TOP_MOST"), ui.ScriptWindow("TOP_MOST") ] + + self.tooltipHP = self.TextToolTip() + self.tooltipHP.Show() + self.tooltipSP = self.TextToolTip() + self.tooltipSP.Show() + self.tooltipST = self.TextToolTip() + self.tooltipST.Show() + self.tooltipEXP = self.TextToolTip() + self.tooltipEXP.Show() + + self.skillCategoryNameList = [ "ACTIVE_1", "ACTIVE_2", "ACTIVE_3" ] + self.skillPageStartSlotIndexDict = { + "ACTIVE_1" : 1, + "ACTIVE_2" : 21, + "ACTIVE_3" : 41, + } + + self.selectSkillButtonList = [] + + self.lastUpdateQuickSlot = 0 + self.SetWindowName("TaskBar") + + def __del__(self): + #print "---------------------------------------------------------------------------- DELETE TASKBAR" + ui.ScriptWindow.__del__(self) + + def LoadWindow(self): + try: + pyScrLoader = ui.PythonScriptLoader() + + if constInfo.IN_GAME_SHOP_ENABLE: + pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "TaskBar.py") + else: + pyScrLoader.LoadScriptFile(self, "UIScript/TaskBar.py") + pyScrLoader.LoadScriptFile(self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT], "UIScript/MouseButtonWindow.py") + pyScrLoader.LoadScriptFile(self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT], "UIScript/RightMouseButtonWindow.py") + except: + import exception + exception.Abort("TaskBar.LoadWindow.LoadObject") + + self.quickslot = [] + self.quickslot.append(self.GetChild("quick_slot_1")) + self.quickslot.append(self.GetChild("quick_slot_2")) + for slot in self.quickslot: + slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) + slot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptyQuickSlot)) + slot.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemQuickSlot)) + slot.SetUnselectItemSlotEvent(ui.__mem_func__(self.UnselectItemQuickSlot)) + slot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) + slot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) + + toggleButtonDict = {} + toggleButtonDict[TaskBar.BUTTON_CHARACTER]=self.GetChild("CharacterButton") + toggleButtonDict[TaskBar.BUTTON_INVENTORY]=self.GetChild("InventoryButton") + toggleButtonDict[TaskBar.BUTTON_MESSENGER]=self.GetChild("MessengerButton") + toggleButtonDict[TaskBar.BUTTON_SYSTEM]=self.GetChild("SystemButton") + + # ChatButton, ExpandButton 笛 吝 窍唱绰 馆靛矫 粮犁茄促. + try: + toggleButtonDict[TaskBar.BUTTON_CHAT]=self.GetChild("ChatButton") + except: + toggleButtonDict[TaskBar.BUTTON_EXPAND]=self.GetChild("ExpandButton") + TaskBar.IS_EXPANDED = True + + + if localeInfo.IsARABIC(): + systemButton = toggleButtonDict[TaskBar.BUTTON_SYSTEM] + if systemButton.ToolTipText: + tx, ty = systemButton.ToolTipText.GetLocalPosition() + tw = systemButton.ToolTipText.GetWidth() + systemButton.ToolTipText.SetPosition(-tw/2, ty) + + + expGauge = [] + expGauge.append(self.GetChild("EXPGauge_01")) + expGauge.append(self.GetChild("EXPGauge_02")) + expGauge.append(self.GetChild("EXPGauge_03")) + expGauge.append(self.GetChild("EXPGauge_04")) + + for exp in expGauge: + exp.SetSize(0, 0) + + + self.quickPageNumImageBox=self.GetChild("QuickPageNumber") + + self.GetChild("QuickPageUpButton").SetEvent(ui.__mem_func__(self.__OnClickQuickPageUpButton)) + self.GetChild("QuickPageDownButton").SetEvent(ui.__mem_func__(self.__OnClickQuickPageDownButton)) + + mouseLeftButtonModeButton = self.GetChild("LeftMouseButton") + mouseRightButtonModeButton = self.GetChild("RightMouseButton") + mouseLeftButtonModeButton.SetEvent(ui.__mem_func__(self.ToggleLeftMouseButtonModeWindow)) + mouseRightButtonModeButton.SetEvent(ui.__mem_func__(self.ToggleRightMouseButtonModeWindow)) + self.curMouseModeButton = [ mouseLeftButtonModeButton, mouseRightButtonModeButton ] + + (xLocalRight, yLocalRight) = mouseRightButtonModeButton.GetLocalPosition() + self.curSkillButton = self.SkillButton() + self.curSkillButton.SetParent(self) + self.curSkillButton.SetPosition(xLocalRight, 3) + self.curSkillButton.SetSkillEvent(ui.__mem_func__(self.ToggleRightMouseButtonModeWindow)) + self.curSkillButton.Hide() + + (xLeft, yLeft) = mouseLeftButtonModeButton.GetGlobalPosition() + (xRight, yRight) = mouseRightButtonModeButton.GetGlobalPosition() + leftModeButtonList = self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT] + leftModeButtonList.SetPosition(xLeft, yLeft - leftModeButtonList.GetHeight()-5) + rightModeButtonList = self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT] + rightModeButtonList.SetPosition(xRight - rightModeButtonList.GetWidth() + 32, yRight - rightModeButtonList.GetHeight()-5) + rightModeButtonList.GetChild("button_skill").SetEvent(lambda adir=self.MOUSE_BUTTON_RIGHT, aevent=self.EVENT_SKILL: self.SelectMouseButtonEvent(adir, aevent)) + rightModeButtonList.GetChild("button_skill").Hide() + + mouseImage = ui.ImageBox("TOP_MOST") + mouseImage.AddFlag("float") + mouseImage.LoadImage("d:/ymir work/ui/game/taskbar/mouse_button_camera_01.sub") + mouseImage.SetPosition(xRight, wndMgr.GetScreenHeight() - 34) + mouseImage.Hide() + self.mouseImage = mouseImage + + dir = self.MOUSE_BUTTON_LEFT + wnd = self.mouseModeButtonList[dir] + wnd.GetChild("button_move_and_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_MOVE_AND_ATTACK: self.SelectMouseButtonEvent(adir, aevent)) + wnd.GetChild("button_auto_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_AUTO: self.SelectMouseButtonEvent(adir, aevent)) + wnd.GetChild("button_camera").SetEvent(lambda adir=dir, aevent=self.EVENT_CAMERA: self.SelectMouseButtonEvent(adir, aevent)) + + dir = self.MOUSE_BUTTON_RIGHT + wnd = self.mouseModeButtonList[dir] + wnd.GetChild("button_move_and_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_MOVE_AND_ATTACK: self.SelectMouseButtonEvent(adir, aevent)) + wnd.GetChild("button_camera").SetEvent(lambda adir=dir, aevent=self.EVENT_CAMERA: self.SelectMouseButtonEvent(adir, aevent)) + + self.toggleButtonDict = toggleButtonDict + self.expGauge = expGauge + + if constInfo.IN_GAME_SHOP_ENABLE: + self.rampageGauge1 = self.GetChild("RampageGauge") + self.rampageGauge1.OnMouseOverIn = ui.__mem_func__(self.__RampageGauge_OverIn) + self.rampageGauge2 = self.GetChild("RampageGauge2") + self.rampageGauge2.OnMouseOverOut = ui.__mem_func__(self.__RampageGauge_OverOut) + self.rampageGauge2.OnMouseLeftButtonUp = ui.__mem_func__(self.__RampageGauge_Click) + print "[DEBUG]: constInfo.IN_GAME_SHOP_ENABLE / self.rampageGauge1",constInfo.IN_GAME_SHOP_ENABLE, self.rampageGauge1 + self.__RampageGauge_OverOut() + + self.hpGauge = self.GetChild("HPGauge") + self.mpGauge = self.GetChild("SPGauge") + self.stGauge = self.GetChild("STGauge") + self.hpRecoveryGaugeBar = self.GetChild("HPRecoveryGaugeBar") + self.spRecoveryGaugeBar = self.GetChild("SPRecoveryGaugeBar") + + self.hpGaugeBoard=self.GetChild("HPGauge_Board") + self.mpGaugeBoard=self.GetChild("SPGauge_Board") + self.stGaugeBoard=self.GetChild("STGauge_Board") + self.expGaugeBoard=self.GetChild("EXP_Gauge_Board") + + #giftbox object + wndGiftBox = GiftBox() + wndGiftBox.LoadWindow() + self.wndGiftBox = wndGiftBox + + self.__LoadMouseSettings() + self.RefreshStatus() + self.RefreshQuickSlot() + + def __RampageGauge_OverIn(self): + print "rampage_over_in" + self.rampageGauge2.Show() + self.rampageGauge1.Hide() + + def __RampageGauge_OverOut(self): + print "rampage_over_out" + self.rampageGauge2.Hide() + self.rampageGauge1.Show() + + def __RampageGauge_Click(self): + print "rampage_up" + net.SendChatPacket("/in_game_mall") + # gift icon hide when click mall icon + self.wndGiftBox.Hide() + + def __LoadMouseSettings(self): + try: + LoadMouseButtonSettings() + (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings() + if not self.__IsInSafeMouseButtonSettingRange(mouseLeftButtonEvent) or not self.__IsInSafeMouseButtonSettingRange(mouseRightButtonEvent): + raise RuntimeError, "INVALID_MOUSE_BUTTON_SETTINGS" + except: + InitMouseButtonSettings(self.EVENT_MOVE_AND_ATTACK, self.EVENT_CAMERA) + (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings() + + try: + self.SelectMouseButtonEvent(self.MOUSE_BUTTON_LEFT, mouseLeftButtonEvent) + self.SelectMouseButtonEvent(self.MOUSE_BUTTON_RIGHT, mouseRightButtonEvent) + except: + InitMouseButtonSettings(self.EVENT_MOVE_AND_ATTACK, self.EVENT_CAMERA) + (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings() + + self.SelectMouseButtonEvent(self.MOUSE_BUTTON_LEFT, mouseLeftButtonEvent) + self.SelectMouseButtonEvent(self.MOUSE_BUTTON_RIGHT, mouseRightButtonEvent) + + + + def __IsInSafeMouseButtonSettingRange(self, arg): + return arg >= self.EVENT_MOVE and arg <= self.EVENT_AUTO + + def Destroy(self): + SaveMouseButtonSettings() + + self.ClearDictionary() + self.mouseModeButtonList[0].ClearDictionary() + self.mouseModeButtonList[1].ClearDictionary() + self.mouseModeButtonList = 0 + self.curMouseModeButton = 0 + self.curSkillButton = 0 + self.selectSkillButtonList = 0 + + + self.expGauge = None + self.hpGauge = None + self.mpGauge = None + self.stGauge = None + self.hpRecoveryGaugeBar = None + self.spRecoveryGaugeBar = None + + self.tooltipItem = 0 + self.tooltipSkill = 0 + self.quickslot = 0 + self.toggleButtonDict = 0 + + self.hpGaugeBoard = 0 + self.mpGaugeBoard = 0 + self.stGaugeBoard = 0 + + self.expGaugeBoard = 0 + + self.tooltipHP = 0 + self.tooltipSP = 0 + self.tooltipST = 0 + self.tooltipEXP = 0 + + self.mouseImage = None + + def __OnClickQuickPageUpButton(self): + player.SetQuickPage(player.GetQuickPage()-1) + + def __OnClickQuickPageDownButton(self): + player.SetQuickPage(player.GetQuickPage()+1) + + def SetToggleButtonEvent(self, eButton, kEventFunc): + self.toggleButtonDict[eButton].SetEvent(kEventFunc) + + def SetItemToolTip(self, tooltipItem): + self.tooltipItem = tooltipItem + + def SetSkillToolTip(self, tooltipSkill): + self.tooltipSkill = tooltipSkill + self.curSkillButton.SetSkillToolTip(self.tooltipSkill) + + ## Mouse Image + def ShowMouseImage(self): + self.mouseImage.SetTop() + self.mouseImage.Show() + + def HideMouseImage(self): + player.SetQuickCameraMode(False) + self.mouseImage.Hide() + + ## Gauge + def RefreshStatus(self): + curHP = player.GetStatus(player.HP) + maxHP = player.GetStatus(player.MAX_HP) + curSP = player.GetStatus(player.SP) + maxSP = player.GetStatus(player.MAX_SP) + curEXP = unsigned32(player.GetStatus(player.EXP)) + nextEXP = unsigned32(player.GetStatus(player.NEXT_EXP)) + recoveryHP = player.GetStatus(player.HP_RECOVERY) + recoverySP = player.GetStatus(player.SP_RECOVERY) + + self.RefreshStamina() + + self.SetHP(curHP, recoveryHP, maxHP) + self.SetSP(curSP, recoverySP, maxSP) + self.SetExperience(curEXP, nextEXP) + + def RefreshStamina(self): + curST = player.GetStatus(player.STAMINA) + maxST = player.GetStatus(player.MAX_STAMINA) + self.SetST(curST, maxST) + + def RefreshSkill(self): + self.curSkillButton.RefreshSkill() + for button in self.selectSkillButtonList: + button.RefreshSkill() + + def SetHP(self, curPoint, recoveryPoint, maxPoint): + curPoint = min(curPoint, maxPoint) + if maxPoint > 0: + self.hpGauge.SetPercentage(curPoint, maxPoint) + self.tooltipHP.SetText("%s : %d / %d" % (localeInfo.TASKBAR_HP, curPoint, maxPoint)) + + if 0 == recoveryPoint: + self.hpRecoveryGaugeBar.Hide() + else: + destPoint = min(maxPoint, curPoint + recoveryPoint) + newWidth = int(self.GAUGE_WIDTH * (float(destPoint) / float(maxPoint))) + self.hpRecoveryGaugeBar.SetSize(newWidth, self.GAUGE_HEIGHT) + self.hpRecoveryGaugeBar.Show() + + def SetSP(self, curPoint, recoveryPoint, maxPoint): + curPoint = min(curPoint, maxPoint) + if maxPoint > 0: + self.mpGauge.SetPercentage(curPoint, maxPoint) + self.tooltipSP.SetText("%s : %d / %d" % (localeInfo.TASKBAR_SP, curPoint, maxPoint)) + + if 0 == recoveryPoint: + self.spRecoveryGaugeBar.Hide() + else: + destPoint = min(maxPoint, curPoint + recoveryPoint) + newWidth = int(self.GAUGE_WIDTH * (float(destPoint) / float(maxPoint))) + self.spRecoveryGaugeBar.SetSize(newWidth, self.GAUGE_HEIGHT) + self.spRecoveryGaugeBar.Show() + + def SetST(self, curPoint, maxPoint): + curPoint = min(curPoint, maxPoint) + if maxPoint > 0: + self.stGauge.SetPercentage(curPoint, maxPoint) + self.tooltipST.SetText("%s : %d / %d" % (localeInfo.TASKBAR_ST, curPoint, maxPoint)) + + def SetExperience(self, curPoint, maxPoint): + + curPoint = min(curPoint, maxPoint) + curPoint = max(curPoint, 0) + maxPoint = max(maxPoint, 0) + + quarterPoint = maxPoint / 4 + FullCount = 0 + + if 0 != quarterPoint: + FullCount = min(4, curPoint / quarterPoint) + + for i in xrange(4): + self.expGauge[i].Hide() + + for i in xrange(FullCount): + self.expGauge[i].SetRenderingRect(0.0, 0.0, 0.0, 0.0) + self.expGauge[i].Show() + + if 0 != quarterPoint: + if FullCount < 4: + Percentage = float(curPoint % quarterPoint) / quarterPoint - 1.0 + self.expGauge[FullCount].SetRenderingRect(0.0, Percentage, 0.0, 0.0) + self.expGauge[FullCount].Show() + + ##### + self.tooltipEXP.SetText("%s : %.2f%%" % (localeInfo.TASKBAR_EXP, float(curPoint) / max(1, float(maxPoint)) * 100)) + + + ## QuickSlot + def RefreshQuickSlot(self): + + pageNum = player.GetQuickPage() + + try: + self.quickPageNumImageBox.LoadImage(TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum]) + except: + pass + + startNumber = 0 + for slot in self.quickslot: + + for i in xrange(4): + + slotNumber = i+startNumber + + (Type, Position) = player.GetLocalQuickSlot(slotNumber) + + if player.SLOT_TYPE_NONE == Type: + slot.ClearSlot(slotNumber) + continue + + if player.SLOT_TYPE_INVENTORY == Type: + + itemIndex = player.GetItemIndex(Position) + itemCount = player.GetItemCount(Position) + if itemCount <= 1: + itemCount = 0 + + ## 磊悼拱距 (#72723, #72724) 漂荐贸府 - 酒捞袍牢单档 浇吩俊 劝己拳/厚劝己拳 钎矫甫 困茄 累诀烙 - [hyo] + if constInfo.IS_AUTO_POTION(itemIndex): + # metinSocket - [0] : 劝己拳 咯何, [1] : 荤侩茄 剧, [2] : 弥措 侩樊 + metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] + + if 0 != int(metinSocket[0]): + slot.ActivateSlot(slotNumber) + else: + slot.DeactivateSlot(slotNumber) + + slot.SetItemSlot(slotNumber, itemIndex, itemCount) + + elif player.SLOT_TYPE_SKILL == Type: + + skillIndex = player.GetSkillIndex(Position) + if 0 == skillIndex: + slot.ClearSlot(slotNumber) + continue + + skillType = skill.GetSkillType(skillIndex) + if skill.SKILL_TYPE_GUILD == skillType: + import guild + skillGrade = 0 + skillLevel = guild.GetSkillLevel(Position) + + else: + skillGrade = player.GetSkillGrade(Position) + skillLevel = player.GetSkillLevel(Position) + + slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel) + slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel) + slot.SetCoverButton(slotNumber) + + ## NOTE : CoolTime 眉农 + if player.IsSkillCoolTime(Position): + (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) + slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) + + ## NOTE : Activate 登绢 乐促搁 酒捞能档 诀单捞飘 + if player.IsSkillActive(Position): + slot.ActivateSlot(slotNumber) + + elif player.SLOT_TYPE_EMOTION == Type: + + emotionIndex = Position + slot.SetEmotionSlot(slotNumber, emotionIndex) + slot.SetCoverButton(slotNumber) + slot.SetSlotCount(slotNumber, 0) + + slot.RefreshSlot() + startNumber += 4 + + def canAddQuickSlot(self, Type, slotNumber): + + if player.SLOT_TYPE_INVENTORY == Type: + + itemIndex = player.GetItemIndex(slotNumber) + return item.CanAddToQuickSlotItem(itemIndex) + + return True + + def AddQuickSlot(self, localSlotIndex): + AttachedSlotType = mouseModule.mouseController.GetAttachedType() + AttachedSlotNumber = mouseModule.mouseController.GetAttachedSlotNumber() + AttachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() + + if player.SLOT_TYPE_QUICK_SLOT == AttachedSlotType: + player.RequestMoveGlobalQuickSlotToLocalQuickSlot(AttachedSlotNumber, localSlotIndex) + + elif player.SLOT_TYPE_EMOTION == AttachedSlotType: + + player.RequestAddLocalQuickSlot(localSlotIndex, AttachedSlotType, AttachedItemIndex) + + elif True == self.canAddQuickSlot(AttachedSlotType, AttachedSlotNumber): + + ## Online Code + player.RequestAddLocalQuickSlot(localSlotIndex, AttachedSlotType, AttachedSlotNumber) + + mouseModule.mouseController.DeattachObject() + self.RefreshQuickSlot() + + def SelectEmptyQuickSlot(self, slotIndex): + + if True == mouseModule.mouseController.isAttached(): + self.AddQuickSlot(slotIndex) + + def SelectItemQuickSlot(self, localQuickSlotIndex): + + if True == mouseModule.mouseController.isAttached(): + self.AddQuickSlot(localQuickSlotIndex) + + else: + globalQuickSlotIndex=player.LocalQuickSlotIndexToGlobalQuickSlotIndex(localQuickSlotIndex) + mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_QUICK_SLOT, globalQuickSlotIndex, globalQuickSlotIndex) + + def UnselectItemQuickSlot(self, localSlotIndex): + + if False == mouseModule.mouseController.isAttached(): + player.RequestUseLocalQuickSlot(localSlotIndex) + return + + elif mouseModule.mouseController.isAttached(): + mouseModule.mouseController.DeattachObject() + return + + + def OnUseSkill(self, usedSlotIndex, coolTime): + + QUICK_SLOT_SLOT_COUNT = 4 + slotIndex = 0 + + ## Current Skill Button + if usedSlotIndex == self.curSkillButton.GetSlotIndex(): + self.curSkillButton.Activate(coolTime) + + ## Quick Slot + for slotWindow in self.quickslot: + + for i in xrange(QUICK_SLOT_SLOT_COUNT): + + (Type, Position) = player.GetLocalQuickSlot(slotIndex) + + if Type == player.SLOT_TYPE_SKILL: + if usedSlotIndex == Position: + slotWindow.SetSlotCoolTime(slotIndex, coolTime) + return + + slotIndex += 1 + + def OnActivateSkill(self, usedSlotIndex): + slotIndex = 0 + + ## Current Skill Button + if usedSlotIndex == self.curSkillButton.GetSlotIndex(): + self.curSkillButton.Deactivate() + + ## Quick Slot + for slotWindow in self.quickslot: + + for i in xrange(4): + + (Type, Position) = player.GetLocalQuickSlot(slotIndex) + + if Type == player.SLOT_TYPE_SKILL: + if usedSlotIndex == Position: + slotWindow.ActivateSlot(slotIndex) + return + + slotIndex += 1 + + def OnDeactivateSkill(self, usedSlotIndex): + slotIndex = 0 + + ## Current Skill Button + if usedSlotIndex == self.curSkillButton.GetSlotIndex(): + self.curSkillButton.Deactivate() + + ## Quick Slot + for slotWindow in self.quickslot: + + for i in xrange(4): + + (Type, Position) = player.GetLocalQuickSlot(slotIndex) + + if Type == player.SLOT_TYPE_SKILL: + if usedSlotIndex == Position: + slotWindow.DeactivateSlot(slotIndex) + return + + slotIndex += 1 + + ## ToolTip + def OverInItem(self, slotNumber): + if mouseModule.mouseController.isAttached(): + return + + (Type, Position) = player.GetLocalQuickSlot(slotNumber) + + if player.SLOT_TYPE_INVENTORY == Type: + self.tooltipItem.SetInventoryItem(Position) + self.tooltipSkill.HideToolTip() + + elif player.SLOT_TYPE_SKILL == Type: + + skillIndex = player.GetSkillIndex(Position) + skillType = skill.GetSkillType(skillIndex) + + if skill.SKILL_TYPE_GUILD == skillType: + import guild + skillGrade = 0 + skillLevel = guild.GetSkillLevel(Position) + + else: + skillGrade = player.GetSkillGrade(Position) + skillLevel = player.GetSkillLevel(Position) + + self.tooltipSkill.SetSkillNew(Position, skillIndex, skillGrade, skillLevel) + self.tooltipItem.HideToolTip() + + def OverOutItem(self): + if 0 != self.tooltipItem: + self.tooltipItem.HideToolTip() + if 0 != self.tooltipSkill: + self.tooltipSkill.HideToolTip() + + def OnUpdate(self): + if app.GetGlobalTime() - self.lastUpdateQuickSlot > 500: + self.lastUpdateQuickSlot = app.GetGlobalTime() + self.RefreshQuickSlot() + + if True == self.hpGaugeBoard.IsIn(): + self.tooltipHP.Show() + else: + self.tooltipHP.Hide() + + if True == self.mpGaugeBoard.IsIn(): + self.tooltipSP.Show() + else: + self.tooltipSP.Hide() + + if True == self.stGaugeBoard.IsIn(): + self.tooltipST.Show() + else: + self.tooltipST.Hide() + + if True == self.expGaugeBoard.IsIn(): + self.tooltipEXP.Show() + else: + self.tooltipEXP.Hide() + + ## Skill + def ToggleLeftMouseButtonModeWindow(self): + + wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT] + + if True == wndMouseButtonMode.IsShow(): + + wndMouseButtonMode.Hide() + + else: + wndMouseButtonMode.Show() + + def ToggleRightMouseButtonModeWindow(self): + + wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT] + + if True == wndMouseButtonMode.IsShow(): + + wndMouseButtonMode.Hide() + self.CloseSelectSkill() + + else: + wndMouseButtonMode.Show() + self.OpenSelectSkill() + + def OpenSelectSkill(self): + + PAGE_SLOT_COUNT = 6 + + (xSkillButton, y) = self.curSkillButton.GetGlobalPosition() + y -= (37 + 32 + 1) + + for key in self.skillCategoryNameList: + + appendCount = 0 + startNumber = self.skillPageStartSlotIndexDict[key] + x = xSkillButton + + getSkillIndex=player.GetSkillIndex + getSkillLevel=player.GetSkillLevel + for i in xrange(PAGE_SLOT_COUNT): + + skillIndex = getSkillIndex(startNumber+i) + skillLevel = getSkillLevel(startNumber+i) + + if 0 == skillIndex: + continue + if 0 == skillLevel: + continue + if skill.IsStandingSkill(skillIndex): + continue + + ## FIXME : 胶懦 窍唱寸 浇吩 窍唱究 且寸窍绰扒 酒公府 毫档 何窍啊 农促. + ## 捞 何盒篮 矫埃阑 唱搁 绊摹档废. - [levites] + skillButton = self.SkillButton() + skillButton.SetSkill(startNumber+i) + skillButton.SetPosition(x, y) + skillButton.SetSkillEvent(ui.__mem_func__(self.CloseSelectSkill), startNumber+i+1) + skillButton.SetSkillToolTip(self.tooltipSkill) + skillButton.SetTop() + skillButton.Show() + self.selectSkillButtonList.append(skillButton) + + appendCount += 1 + x -= 32 + + if appendCount > 0: + y -= 32 + + def CloseSelectSkill(self, slotIndex=-1): + + self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT].Hide() + for button in self.selectSkillButtonList: + button.Destroy() + + self.selectSkillButtonList = [] + + if -1 != slotIndex: + self.curSkillButton.Show() + self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide() + player.SetMouseFunc(player.MBT_RIGHT, player.MBF_SKILL) + player.ChangeCurrentSkillNumberOnly(slotIndex-1) + else: + self.curSkillButton.Hide() + self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Show() + + def SelectMouseButtonEvent(self, dir, event): + SetMouseButtonSetting(dir, event) + + self.CloseSelectSkill() + self.mouseModeButtonList[dir].Hide() + + btn = 0 + type = self.NONE + func = self.NONE + tooltip_text = "" + + if self.MOUSE_BUTTON_LEFT == dir: + type = player.MBT_LEFT + + elif self.MOUSE_BUTTON_RIGHT == dir: + type = player.MBT_RIGHT + + if self.EVENT_MOVE == event: + btn = self.mouseModeButtonList[dir].GetChild("button_move") + func = player.MBF_MOVE + tooltip_text = localeInfo.TASKBAR_MOVE + elif self.EVENT_ATTACK == event: + btn = self.mouseModeButtonList[dir].GetChild("button_attack") + func = player.MBF_ATTACK + tooltip_text = localeInfo.TASKBAR_ATTACK + elif self.EVENT_AUTO == event: + btn = self.mouseModeButtonList[dir].GetChild("button_auto_attack") + func = player.MBF_AUTO + tooltip_text = localeInfo.TASKBAR_AUTO + elif self.EVENT_MOVE_AND_ATTACK == event: + btn = self.mouseModeButtonList[dir].GetChild("button_move_and_attack") + func = player.MBF_SMART + tooltip_text = localeInfo.TASKBAR_ATTACK + elif self.EVENT_CAMERA == event: + btn = self.mouseModeButtonList[dir].GetChild("button_camera") + func = player.MBF_CAMERA + tooltip_text = localeInfo.TASKBAR_CAMERA + elif self.EVENT_SKILL == event: + btn = self.mouseModeButtonList[dir].GetChild("button_skill") + func = player.MBF_SKILL + tooltip_text = localeInfo.TASKBAR_SKILL + + if 0 != btn: + self.curMouseModeButton[dir].SetToolTipText(tooltip_text, 0, -18) + self.curMouseModeButton[dir].SetUpVisual(btn.GetUpVisualFileName()) + self.curMouseModeButton[dir].SetOverVisual(btn.GetOverVisualFileName()) + self.curMouseModeButton[dir].SetDownVisual(btn.GetDownVisualFileName()) + self.curMouseModeButton[dir].Show() + + player.SetMouseFunc(type, func) + + def OnChangeCurrentSkill(self, skillSlotNumber): + self.curSkillButton.SetSkill(skillSlotNumber) + self.curSkillButton.Show() + self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide() + diff --git a/root/uitip.py b/root/uitip.py new file mode 100644 index 0000000..e0aea0f --- /dev/null +++ b/root/uitip.py @@ -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() + diff --git a/root/uitooltip.py b/root/uitooltip.py new file mode 100644 index 0000000..11c5b13 --- /dev/null +++ b/root/uitooltip.py @@ -0,0 +1,2344 @@ +import dbg +import player +import item +import grp +import wndMgr +import skill +import shop +import exchange +import grpText +import safebox +import localeInfo +import app +import background +import nonplayer +import chr + +import ui +import mouseModule +import constInfo + +WARP_SCROLLS = [22011, 22000, 22010] + +DESC_DEFAULT_MAX_COLS = 26 +DESC_WESTERN_MAX_COLS = 35 +DESC_WESTERN_MAX_WIDTH = 220 + +def chop(n): + return round(n - 0.5, 1) + +def SplitDescription(desc, limit): + total_tokens = desc.split() + line_tokens = [] + line_len = 0 + lines = [] + for token in total_tokens: + if "|" in token: + sep_pos = token.find("|") + line_tokens.append(token[:sep_pos]) + + lines.append(" ".join(line_tokens)) + line_len = len(token) - (sep_pos + 1) + line_tokens = [token[sep_pos+1:]] + else: + line_len += len(token) + if len(line_tokens) + line_len > limit: + lines.append(" ".join(line_tokens)) + line_len = len(token) + line_tokens = [token] + else: + line_tokens.append(token) + + if line_tokens: + lines.append(" ".join(line_tokens)) + + return lines + +################################################################################################### +## ToolTip +## +## NOTE : 泅犁绰 Item苞 Skill阑 惑加栏肺 漂拳 矫难滴菌澜 +## 窍瘤父 弊促瘤 狼固啊 绝绢 焊烙 +## +class ToolTip(ui.ThinBoard): + + TOOL_TIP_WIDTH = 190 + TOOL_TIP_HEIGHT = 10 + + TEXT_LINE_HEIGHT = 17 + + TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0) + SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0) + NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) + FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) + PRICE_COLOR = 0xffFFB96D + + HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR + MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0) + LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0) + + ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) + DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0) + + NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0) + POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0) + SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0) + SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0) + + CONDITION_COLOR = 0xffBEB47D + CAN_LEVEL_UP_COLOR = 0xff8EC292 + CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR + NEED_SKILL_POINT_COLOR = 0xff9A9CDB + + def __init__(self, width = TOOL_TIP_WIDTH, isPickable=False): + ui.ThinBoard.__init__(self, "TOP_MOST") + + if isPickable: + pass + else: + self.AddFlag("not_pick") + + self.AddFlag("float") + + self.followFlag = True + self.toolTipWidth = width + + self.xPos = -1 + self.yPos = -1 + + self.defFontName = localeInfo.UI_DEF_FONT + self.ClearToolTip() + + def __del__(self): + ui.ThinBoard.__del__(self) + + def ClearToolTip(self): + self.toolTipHeight = 12 + self.childrenList = [] + + def SetFollow(self, flag): + self.followFlag = flag + + def SetDefaultFontName(self, fontName): + self.defFontName = fontName + + def AppendSpace(self, size): + self.toolTipHeight += size + self.ResizeToolTip() + + def AppendHorizontalLine(self): + + for i in xrange(2): + horizontalLine = ui.Line() + horizontalLine.SetParent(self) + horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i) + horizontalLine.SetWindowHorizontalAlignCenter() + horizontalLine.SetSize(150, 0) + horizontalLine.Show() + + if 0 == i: + horizontalLine.SetColor(0xff555555) + else: + horizontalLine.SetColor(0xff000000) + + self.childrenList.append(horizontalLine) + + self.toolTipHeight += 11 + self.ResizeToolTip() + + def AlignHorizonalCenter(self): + for child in self.childrenList: + (x, y)=child.GetLocalPosition() + child.SetPosition(self.toolTipWidth/2, y) + + self.ResizeToolTip() + + def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetFontName(self.defFontName) + textLine.SetPackedFontColor(color) + textLine.SetText(text) + textLine.SetOutline() + textLine.SetFeather(False) + textLine.Show() + + if centerAlign: + textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight) + textLine.SetHorizontalAlignCenter() + + else: + textLine.SetPosition(10, self.toolTipHeight) + + self.childrenList.append(textLine) + + (textWidth, textHeight)=textLine.GetTextSize() + + textWidth += 40 + textHeight += 5 + + if self.toolTipWidth < textWidth: + self.toolTipWidth = textWidth + + self.toolTipHeight += textHeight + + return textLine + + def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetFontName(self.defFontName) + textLine.SetPackedFontColor(color) + textLine.SetText(text) + textLine.SetOutline() + textLine.SetFeather(False) + textLine.Show() + + if centerAlign: + textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight) + textLine.SetHorizontalAlignCenter() + + else: + textLine.SetPosition(10, self.toolTipHeight) + + self.childrenList.append(textLine) + + self.toolTipHeight += self.TEXT_LINE_HEIGHT + self.ResizeToolTip() + + return textLine + + def AppendDescription(self, desc, limit, color = FONT_COLOR): + if localeInfo.IsEUROPE(): + self.__AppendDescription_WesternLanguage(desc, color) + else: + self.__AppendDescription_EasternLanguage(desc, limit, color) + + def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR): + length = len(description) + if 0 == length: + return + + lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation) + for i in xrange(lineCount): + if 0 == i: + self.AppendSpace(5) + self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color) + + def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR): + lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS) + if not lines: + return + + self.AppendSpace(5) + for line in lines: + self.AppendTextLine(line, color) + + + def ResizeToolTip(self): + self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight) + + def SetTitle(self, name): + self.AppendTextLine(name, self.TITLE_COLOR) + + def GetLimitTextLineColor(self, curValue, limitValue): + if curValue < limitValue: + return self.DISABLE_COLOR + + return self.ENABLE_COLOR + + def GetChangeTextLineColor(self, value, isSpecial=False): + if value > 0: + if isSpecial: + return self.SPECIAL_POSITIVE_COLOR + else: + return self.POSITIVE_COLOR + + if 0 == value: + return self.NORMAL_COLOR + + return self.NEGATIVE_COLOR + + def SetToolTipPosition(self, x = -1, y = -1): + self.xPos = x + self.yPos = y + + def ShowToolTip(self): + self.SetTop() + self.Show() + + self.OnUpdate() + + def HideToolTip(self): + self.Hide() + + def OnUpdate(self): + + if not self.followFlag: + return + + x = 0 + y = 0 + width = self.GetWidth() + height = self.toolTipHeight + + if -1 == self.xPos and -1 == self.yPos: + + (mouseX, mouseY) = wndMgr.GetMousePosition() + + if mouseY < wndMgr.GetScreenHeight() - 300: + y = mouseY + 40 + else: + y = mouseY - height - 30 + + x = mouseX - width/2 + + else: + + x = self.xPos - width/2 + y = self.yPos - height + + x = max(x, 0) + y = max(y, 0) + x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2 + y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight() + + parentWindow = self.GetParentProxy() + if parentWindow: + (gx, gy) = parentWindow.GetGlobalPosition() + x -= gx + y -= gy + + self.SetPosition(x, y) + +class ItemToolTip(ToolTip): + + CHARACTER_NAMES = ( + localeInfo.TOOLTIP_WARRIOR, + localeInfo.TOOLTIP_ASSASSIN, + localeInfo.TOOLTIP_SURA, + localeInfo.TOOLTIP_SHAMAN + ) + + CHARACTER_COUNT = len(CHARACTER_NAMES) + WEAR_NAMES = ( + localeInfo.TOOLTIP_ARMOR, + localeInfo.TOOLTIP_HELMET, + localeInfo.TOOLTIP_SHOES, + localeInfo.TOOLTIP_WRISTLET, + localeInfo.TOOLTIP_WEAPON, + localeInfo.TOOLTIP_NECK, + localeInfo.TOOLTIP_EAR, + localeInfo.TOOLTIP_UNIQUE, + localeInfo.TOOLTIP_SHIELD, + localeInfo.TOOLTIP_ARROW, + ) + WEAR_COUNT = len(WEAR_NAMES) + + AFFECT_DICT = { + item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP, + item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP, + item.APPLY_CON : localeInfo.TOOLTIP_CON, + item.APPLY_INT : localeInfo.TOOLTIP_INT, + item.APPLY_STR : localeInfo.TOOLTIP_STR, + item.APPLY_DEX : localeInfo.TOOLTIP_DEX, + item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED, + item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED, + item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED, + item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN, + item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN, + item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT, + item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT, + item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT, + item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT, + item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, + + item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR, + item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN, + item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA, + item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN, + item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER, + + item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN, + item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL, + item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC, + item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO, + item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD, + item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL, + item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP, + item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP, + item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT, + item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER, + item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK, + item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE, + item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD, + item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND, + item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER, + item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL, + item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN, + item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW, + item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE, + item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC, + item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC, + item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND, + item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE, + item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE, + item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE, + item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER, + item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS, + item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS, + item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS, + item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS, + item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER, + item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN, + item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW, + item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL, + item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE, + item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE, + item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE, + item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE, + item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE, + item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA, + item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS, + item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS, + item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS, + item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS, + item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS, + item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS, + item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS, + item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS, + item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS, + item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC, + item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC, + item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR, + item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN, + item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA, + item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN, + item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT, + item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT, + item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY, + item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS, + + item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER, + item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER, + item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE, + item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH, + item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK, + item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT, + item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT, + } + + ATTRIBUTE_NEED_WIDTH = { + 23 : 230, + 24 : 230, + 25 : 230, + 26 : 220, + 27 : 210, + + 35 : 210, + 36 : 210, + 37 : 210, + 38 : 210, + 39 : 210, + 40 : 210, + 41 : 210, + + 42 : 220, + 43 : 230, + 45 : 230, + } + + ANTI_FLAG_DICT = { + 0 : item.ITEM_ANTIFLAG_WARRIOR, + 1 : item.ITEM_ANTIFLAG_ASSASSIN, + 2 : item.ITEM_ANTIFLAG_SURA, + 3 : item.ITEM_ANTIFLAG_SHAMAN, + } + + FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) + + def __init__(self, *args, **kwargs): + ToolTip.__init__(self, *args, **kwargs) + self.itemVnum = 0 + self.isShopItem = False + + # 酒捞袍 砒屏阑 钎矫且 锭 泅犁 某腐磐啊 馒侩且 荐 绝绰 酒捞袍捞扼搁 碍力肺 Disable Color肺 汲沥 (捞固 弊犯霸 累悼窍绊 乐栏唱 波具 且 鞘夸啊 乐绢辑) + self.bCannotUseItemForceSetDisableColor = True + + def __del__(self): + ToolTip.__del__(self) + + def SetCannotUseItemForceSetDisableColor(self, enable): + self.bCannotUseItemForceSetDisableColor = enable + + def CanEquip(self): + if not item.IsEquipmentVID(self.itemVnum): + return True + + race = player.GetRace() + job = chr.RaceToJob(race) + if not self.ANTI_FLAG_DICT.has_key(job): + return False + + if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]): + return False + + sex = chr.RaceToSex(race) + + MALE = 1 + FEMALE = 0 + + if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE: + return False + + if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE: + return False + + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_LEVEL == limitType: + if player.GetStatus(player.LEVEL) < limitValue: + return False + """ + elif item.LIMIT_STR == limitType: + if player.GetStatus(player.ST) < limitValue: + return False + elif item.LIMIT_DEX == limitType: + if player.GetStatus(player.DX) < limitValue: + return False + elif item.LIMIT_INT == limitType: + if player.GetStatus(player.IQ) < limitValue: + return False + elif item.LIMIT_CON == limitType: + if player.GetStatus(player.HT) < limitValue: + return False + """ + + return True + + def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): + if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor: + color = self.DISABLE_COLOR + + return ToolTip.AppendTextLine(self, text, color, centerAlign) + + def ClearToolTip(self): + self.isShopItem = False + self.toolTipWidth = self.TOOL_TIP_WIDTH + ToolTip.ClearToolTip(self) + + def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY): + itemVnum = player.GetItemIndex(window_type, slotIndex) + if 0 == itemVnum: + return + + self.ClearToolTip() + if shop.IsOpen(): + if not shop.IsPrivateShop(): + item.SelectItem(itemVnum) + self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex)) + + metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)] + attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)] + + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def SetShopItem(self, slotIndex): + itemVnum = shop.GetItemID(slotIndex) + if 0 == itemVnum: + return + + price = shop.GetItemPrice(slotIndex) + self.ClearToolTip() + self.isShopItem = True + + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(shop.GetItemMetinSocket(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(shop.GetItemAttribute(slotIndex, i)) + + self.AddItemData(itemVnum, metinSlot, attrSlot) + self.AppendPrice(price) + + def SetShopItemBySecondaryCoin(self, slotIndex): + itemVnum = shop.GetItemID(slotIndex) + if 0 == itemVnum: + return + + price = shop.GetItemPrice(slotIndex) + self.ClearToolTip() + self.isShopItem = True + + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(shop.GetItemMetinSocket(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(shop.GetItemAttribute(slotIndex, i)) + + self.AddItemData(itemVnum, metinSlot, attrSlot) + self.AppendPriceBySecondaryCoin(price) + + def SetExchangeOwnerItem(self, slotIndex): + itemVnum = exchange.GetItemVnumFromSelf(slotIndex) + if 0 == itemVnum: + return + + self.ClearToolTip() + + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i)) + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def SetExchangeTargetItem(self, slotIndex): + itemVnum = exchange.GetItemVnumFromTarget(slotIndex) + if 0 == itemVnum: + return + + self.ClearToolTip() + + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i)) + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex): + itemVnum = player.GetItemIndex(invenType, invenPos) + if 0 == itemVnum: + return + + item.SelectItem(itemVnum) + self.ClearToolTip() + self.AppendSellingPrice(shop.GetPrivateShopItemPrice(invenType, invenPos)) + + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(player.GetItemMetinSocket(invenPos, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(player.GetItemAttribute(invenPos, i)) + + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def SetSafeBoxItem(self, slotIndex): + itemVnum = safebox.GetItemID(slotIndex) + if 0 == itemVnum: + return + + self.ClearToolTip() + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(safebox.GetItemAttribute(slotIndex, i)) + + self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemFlags(slotIndex)) + + def SetMallItem(self, slotIndex): + itemVnum = safebox.GetMallItemID(slotIndex) + if 0 == itemVnum: + return + + self.ClearToolTip() + metinSlot = [] + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i)) + attrSlot = [] + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i)) + + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def SetItemToolTip(self, itemVnum): + self.ClearToolTip() + 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)) + + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def __AppendAttackSpeedInfo(self, item): + atkSpd = item.GetValue(0) + + if atkSpd < 80: + stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST + elif atkSpd <= 95: + stSpd = localeInfo.TOOLTIP_ITEM_FAST + elif atkSpd <= 105: + stSpd = localeInfo.TOOLTIP_ITEM_NORMAL + elif atkSpd <= 120: + stSpd = localeInfo.TOOLTIP_ITEM_SLOW + else: + stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW + + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR) + + def __AppendAttackGradeInfo(self): + atkGrade = item.GetValue(1) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade)) + + def __AppendAttackPowerInfo(self): + minPower = item.GetValue(3) + maxPower = item.GetValue(4) + addPower = item.GetValue(5) + if maxPower > minPower: + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower), self.POSITIVE_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower), self.POSITIVE_COLOR) + + def __AppendMagicAttackInfo(self): + minMagicAttackPower = item.GetValue(1) + maxMagicAttackPower = item.GetValue(2) + addPower = item.GetValue(5) + + if minMagicAttackPower > 0 or maxMagicAttackPower > 0: + if maxMagicAttackPower > minMagicAttackPower: + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower), self.POSITIVE_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower), self.POSITIVE_COLOR) + + def __AppendMagicDefenceInfo(self): + magicDefencePower = item.GetValue(0) + + if magicDefencePower > 0: + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower)) + + def __AppendAttributeInformation(self, attrSlot): + if 0 != attrSlot: + + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + type = attrSlot[i][0] + value = attrSlot[i][1] + + if 0 == value: + continue + + affectString = self.__GetAffectString(type, value) + if affectString: + affectColor = self.__GetAttributeColor(i, value) + self.AppendTextLine(affectString, affectColor) + + def __GetAttributeColor(self, index, value): + if value > 0: + if index >= 5: + return self.SPECIAL_POSITIVE_COLOR2 + else: + return self.SPECIAL_POSITIVE_COLOR + elif value == 0: + return self.NORMAL_COLOR + else: + return self.NEGATIVE_COLOR + + def __IsPolymorphItem(self, itemVnum): + if itemVnum >= 70103 and itemVnum <= 70106: + return 1 + return 0 + + def __SetPolymorphItemTitle(self, monsterVnum): + if localeInfo.IsVIETNAM(): + itemName =item.GetItemName() + itemName+=" " + itemName+=nonplayer.GetMonsterName(monsterVnum) + else: + itemName =nonplayer.GetMonsterName(monsterVnum) + itemName+=" " + itemName+=item.GetItemName() + self.SetTitle(itemName) + + def __SetNormalItemTitle(self): + self.SetTitle(item.GetItemName()) + + def __SetSpecialItemTitle(self): + self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR) + + def __SetItemTitle(self, itemVnum, metinSlot, attrSlot): + if localeInfo.IsCANADA(): + if 72726 == itemVnum or 72730 == itemVnum: + self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)) + return + + if self.__IsPolymorphItem(itemVnum): + self.__SetPolymorphItemTitle(metinSlot[0]) + else: + if self.__IsAttr(attrSlot): + self.__SetSpecialItemTitle() + return + + self.__SetNormalItemTitle() + + def __IsAttr(self, attrSlot): + if not attrSlot: + return False + + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + type = attrSlot[i][0] + if 0 != type: + return True + + return False + + def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0): + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlotData=metinSlot[i] + if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE: + metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER + + self.AddItemData(itemVnum, metinSlot, attrSlot) + + def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot): + self.__AdjustMaxWidth(attrSlot, itemDesc) + self.__SetItemTitle(itemVnum, metinSlot, attrSlot) + + if self.__IsHair(itemVnum): + self.__AppendHairIcon(itemVnum) + + ### Description ### + self.AppendDescription(itemDesc, 26) + self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR) + + def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0): + self.itemVnum = itemVnum + item.SelectItem(itemVnum) + itemType = item.GetItemType() + itemSubType = item.GetItemSubType() + + if 50026 == itemVnum: + if 0 != metinSlot: + name = item.GetItemName() + if metinSlot[0] > 0: + name += " " + name += localeInfo.NumberToMoneyString(metinSlot[0]) + self.SetTitle(name) + + self.ShowToolTip() + return + + ### Skill Book ### + elif 50300 == itemVnum: + if 0 != metinSlot: + self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1) + + self.ShowToolTip() + return + elif 70037 == itemVnum: + if 0 != metinSlot: + self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0) + self.AppendDescription(item.GetItemDescription(), 26) + self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR) + + self.ShowToolTip() + return + elif 70055 == itemVnum: + if 0 != metinSlot: + self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0) + self.AppendDescription(item.GetItemDescription(), 26) + self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR) + + self.ShowToolTip() + return + ########################################################################################### + + + itemDesc = item.GetItemDescription() + itemSummary = item.GetItemSummary() + + isCostumeItem = 0 + isCostumeHair = 0 + isCostumeBody = 0 + + if app.ENABLE_COSTUME_SYSTEM: + if item.ITEM_TYPE_COSTUME == itemType: + isCostumeItem = 1 + isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType + isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType + + #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair)) + + self.__AdjustMaxWidth(attrSlot, itemDesc) + self.__SetItemTitle(itemVnum, metinSlot, attrSlot) + + ### Hair Preview Image ### + if self.__IsHair(itemVnum): + self.__AppendHairIcon(itemVnum) + + ### Description ### + self.AppendDescription(itemDesc, 26) + self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR) + + ### Weapon ### + if item.ITEM_TYPE_WEAPON == itemType: + + self.__AppendLimitInformation() + + self.AppendSpace(5) + + ## 何盲老 版快 付傍阑 刚历 钎矫茄促. + if item.WEAPON_FAN == itemSubType: + self.__AppendMagicAttackInfo() + self.__AppendAttackPowerInfo() + + else: + self.__AppendAttackPowerInfo() + self.__AppendMagicAttackInfo() + + self.__AppendAffectInformation() + self.__AppendAttributeInformation(attrSlot) + + self.AppendWearableInformation() + self.__AppendMetinSlotInfo(metinSlot) + + ### Armor ### + elif item.ITEM_TYPE_ARMOR == itemType: + self.__AppendLimitInformation() + + ## 规绢仿 + defGrade = item.GetValue(1) + defBonus = item.GetValue(5)*2 ## 规绢仿 钎矫 肋给 登绰 巩力甫 荐沥 + if defGrade > 0: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade)) + + self.__AppendMagicDefenceInfo() + self.__AppendAffectInformation() + self.__AppendAttributeInformation(attrSlot) + + self.AppendWearableInformation() + + if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR): + self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType)) + else: + self.__AppendMetinSlotInfo(metinSlot) + + ### Ring Slot Item (Not UNIQUE) ### + elif item.ITEM_TYPE_RING == itemType: + self.__AppendLimitInformation() + self.__AppendAffectInformation() + self.__AppendAttributeInformation(attrSlot) + + #馆瘤 家南 矫胶袍 包访秦急 酒流 扁裙 固沥 + #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001) + + + ### Belt Item ### + elif item.ITEM_TYPE_BELT == itemType: + self.__AppendLimitInformation() + self.__AppendAffectInformation() + self.__AppendAttributeInformation(attrSlot) + + self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum)) + + ## 内胶悯 酒捞袍 ## + elif 0 != isCostumeItem: + self.__AppendLimitInformation() + self.__AppendAffectInformation() + self.__AppendAttributeInformation(attrSlot) + + self.AppendWearableInformation() + + bHasRealtimeFlag = 0 + + ## 荤侩啊瓷 矫埃 力茄捞 乐绰瘤 茫酒焊绊 + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + bHasRealtimeFlag = 1 + + ## 乐促搁 包访 沥焊甫 钎矫窃. ex) 巢篮 矫埃 : 6老 6矫埃 58盒 + if 1 == bHasRealtimeFlag: + self.AppendMallItemLastTime(metinSlot[0]) + #dbg.TraceError("1) REAL_TIME flag On ") + + ## Rod ## + elif item.ITEM_TYPE_ROD == itemType: + + if 0 != metinSlot: + curLevel = item.GetValue(0) / 10 + curEXP = metinSlot[0] + maxEXP = item.GetValue(2) + self.__AppendLimitInformation() + self.__AppendRodInformation(curLevel, curEXP, maxEXP) + + ## Pick ## + elif item.ITEM_TYPE_PICK == itemType: + + if 0 != metinSlot: + curLevel = item.GetValue(0) / 10 + curEXP = metinSlot[0] + maxEXP = item.GetValue(2) + self.__AppendLimitInformation() + self.__AppendPickInformation(curLevel, curEXP, maxEXP) + + ## Lottery ## + elif item.ITEM_TYPE_LOTTERY == itemType: + if 0 != metinSlot: + + ticketNumber = int(metinSlot[0]) + stepNumber = int(metinSlot[1]) + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR); + + ### Metin ### + elif item.ITEM_TYPE_METIN == itemType: + self.AppendMetinInformation() + self.AppendMetinWearInformation() + + ### Fish ### + elif item.ITEM_TYPE_FISH == itemType: + if 0 != metinSlot: + self.__AppendFishInfo(metinSlot[0]) + + ## item.ITEM_TYPE_BLEND + elif item.ITEM_TYPE_BLEND == itemType: + self.__AppendLimitInformation() + + if metinSlot: + affectType = metinSlot[0] + affectValue = metinSlot[1] + time = metinSlot[2] + self.AppendSpace(5) + affectText = self.__GetAffectString(affectType, affectValue) + + self.AppendTextLine(affectText, self.NORMAL_COLOR) + + if time > 0: + minute = (time / 60) + second = (time % 60) + timeString = localeInfo.TOOLTIP_POTION_TIME + + if minute > 0: + timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN + if second > 0: + timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC + + self.AppendTextLine(timeString) + else: + self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME) + else: + self.AppendTextLine("BLEND_POTION_NO_INFO") + + elif item.ITEM_TYPE_UNIQUE == itemType: + if 0 != metinSlot: + bHasRealtimeFlag = 0 + + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + bHasRealtimeFlag = 1 + + if 1 == bHasRealtimeFlag: + self.AppendMallItemLastTime(metinSlot[0]) + else: + time = metinSlot[player.METIN_SOCKET_MAX_NUM-1] + + if 1 == item.GetValue(2): ## 角矫埃 捞侩 Flag / 厘馒 救秦档 霖促 + self.AppendMallItemLastTime(time) + else: + self.AppendUniqueItemLastTime(time) + + ### Use ### + elif item.ITEM_TYPE_USE == itemType: + self.__AppendLimitInformation() + + if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType: + self.__AppendPotionInformation() + + elif item.USE_ABILITY_UP == itemSubType: + self.__AppendAbilityPotionInformation() + + + ## 康籍 皑瘤扁 + if 27989 == itemVnum or 76006 == itemVnum: + if 0 != metinSlot: + useCount = int(metinSlot[0]) + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR) + + ## 捞亥飘 皑瘤扁 + elif 50004 == itemVnum: + if 0 != metinSlot: + useCount = int(metinSlot[0]) + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR) + + ## 磊悼拱距 + elif constInfo.IS_AUTO_POTION(itemVnum): + if 0 != metinSlot: + ## 0: 劝己拳, 1: 荤侩樊, 2: 醚樊 + isActivated = int(metinSlot[0]) + usedAmount = float(metinSlot[1]) + totalAmount = float(metinSlot[2]) + + if 0 == totalAmount: + totalAmount = 1 + + self.AppendSpace(5) + + if 0 != isActivated: + self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR) + self.AppendSpace(5) + + self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR) + + ## 蓖券 扁撅何 + elif itemVnum in WARP_SCROLLS: + if 0 != metinSlot: + xPos = int(metinSlot[0]) + yPos = int(metinSlot[1]) + + if xPos != 0 and yPos != 0: + (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos) + + localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "") + + self.AppendSpace(5) + + if localeMapName!="": + self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR) + dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName) + + ##### + if item.USE_SPECIAL == itemSubType: + bHasRealtimeFlag = 0 + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + bHasRealtimeFlag = 1 + + ## 乐促搁 包访 沥焊甫 钎矫窃. ex) 巢篮 矫埃 : 6老 6矫埃 58盒 + if 1 == bHasRealtimeFlag: + self.AppendMallItemLastTime(metinSlot[0]) + else: + # ... 捞芭... 辑滚俊绰 捞繁 矫埃 眉农 救登绢 乐绰单... + # 恐 捞繁霸 乐绰瘤 舅瘤绰 给窍唱 弊成 滴磊... + if 0 != metinSlot: + time = metinSlot[player.METIN_SOCKET_MAX_NUM-1] + + ## 角矫埃 捞侩 Flag + if 1 == item.GetValue(2): + self.AppendMallItemLastTime(time) + + elif item.USE_TIME_CHARGE_PER == itemSubType: + bHasRealtimeFlag = 0 + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + bHasRealtimeFlag = 1 + if metinSlot[2]: + self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2])) + else: + self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0))) + + ## 乐促搁 包访 沥焊甫 钎矫窃. ex) 巢篮 矫埃 : 6老 6矫埃 58盒 + if 1 == bHasRealtimeFlag: + self.AppendMallItemLastTime(metinSlot[0]) + + elif item.USE_TIME_CHARGE_FIX == itemSubType: + bHasRealtimeFlag = 0 + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + bHasRealtimeFlag = 1 + if metinSlot[2]: + self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2])) + else: + self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0))) + + ## 乐促搁 包访 沥焊甫 钎矫窃. ex) 巢篮 矫埃 : 6老 6矫埃 58盒 + if 1 == bHasRealtimeFlag: + self.AppendMallItemLastTime(metinSlot[0]) + + elif item.ITEM_TYPE_QUEST == itemType: + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + + if item.LIMIT_REAL_TIME == limitType: + self.AppendMallItemLastTime(metinSlot[0]) + elif item.ITEM_TYPE_DS == itemType: + self.AppendTextLine(self.__DragonSoulInfoString(itemVnum)) + self.__AppendAttributeInformation(attrSlot) + else: + self.__AppendLimitInformation() + + for i in xrange(item.LIMIT_MAX_NUM): + (limitType, limitValue) = item.GetLimit(i) + #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue)) + + if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType: + self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i) + #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ") + + elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType: + self.AppendTimerBasedOnWearLastTime(metinSlot) + #dbg.TraceError("1) REAL_TIME flag On ") + + + + self.ShowToolTip() + + def __DragonSoulInfoString (self, dwVnum): + step = (dwVnum / 100) % 10 + refine = (dwVnum / 10) % 10 + if 0 == step: + return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine) + elif 1 == step: + return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine) + elif 2 == step: + return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine) + elif 3 == step: + return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine) + elif 4 == step: + return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine) + else: + return "" + + + ## 庆绢牢啊? + def __IsHair(self, itemVnum): + return (self.__IsOldHair(itemVnum) or + self.__IsNewHair(itemVnum) or + self.__IsNewHair2(itemVnum) or + self.__IsNewHair3(itemVnum) or + self.__IsCostumeHair(itemVnum) + ) + + def __IsOldHair(self, itemVnum): + return itemVnum > 73000 and itemVnum < 74000 + + def __IsNewHair(self, itemVnum): + return itemVnum > 74000 and itemVnum < 75000 + + def __IsNewHair2(self, itemVnum): + return itemVnum > 75000 and itemVnum < 76000 + + def __IsNewHair3(self, itemVnum): + return ((74012 < itemVnum and itemVnum < 74022) or + (74262 < itemVnum and itemVnum < 74272) or + (74512 < itemVnum and itemVnum < 74522) or + (74762 < itemVnum and itemVnum < 74772) or + (45000 < itemVnum and itemVnum < 47000)) + + def __IsCostumeHair(self, itemVnum): + return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000) + + def __AppendHairIcon(self, itemVnum): + itemImage = ui.ImageBox() + itemImage.SetParent(self) + itemImage.Show() + + if self.__IsOldHair(itemVnum): + itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga") + elif self.__IsNewHair3(itemVnum): + itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum)) + elif self.__IsNewHair(itemVnum): # 扁粮 庆绢 锅龋甫 楷搬矫难辑 荤侩茄促. 货肺款 酒捞袍篮 1000父怒 锅龋啊 疵菌促. + itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga") + elif self.__IsNewHair2(itemVnum): + itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum)) + elif self.__IsCostumeHair(itemVnum): + itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000)) + + itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight) + self.toolTipHeight += itemImage.GetHeight() + #self.toolTipWidth += itemImage.GetWidth()/2 + self.childrenList.append(itemImage) + self.ResizeToolTip() + + ## 荤捞令啊 奴 Description 老 版快 砒屏 荤捞令甫 炼沥茄促 + def __AdjustMaxWidth(self, attrSlot, desc): + newToolTipWidth = self.toolTipWidth + newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth) + newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth) + if newToolTipWidth > self.toolTipWidth: + self.toolTipWidth = newToolTipWidth + self.ResizeToolTip() + + def __AdjustAttrMaxWidth(self, attrSlot): + if 0 == attrSlot: + return self.toolTipWidth + + maxWidth = self.toolTipWidth + for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): + type = attrSlot[i][0] + value = attrSlot[i][1] + if self.ATTRIBUTE_NEED_WIDTH.has_key(type): + if value > 0: + maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth) + + # ATTR_CHANGE_TOOLTIP_WIDTH + #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth) + #self.ResizeToolTip() + # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH + + return maxWidth + + def __AdjustDescMaxWidth(self, desc): + if len(desc) < DESC_DEFAULT_MAX_COLS: + return self.toolTipWidth + + return DESC_WESTERN_MAX_WIDTH + + def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade): + skillName = skill.GetSkillName(skillIndex) + + if not skillName: + return + + if localeInfo.IsVIETNAM(): + itemName = bookName + " " + skillName + else: + itemName = skillName + " " + bookName + self.SetTitle(itemName) + + def __AppendPickInformation(self, curLevel, curEXP, maxEXP): + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR) + + if curEXP == maxEXP: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR) + + + def __AppendRodInformation(self, curLevel, curEXP, maxEXP): + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR) + + if curEXP == maxEXP: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR) + + def __AppendLimitInformation(self): + + appendSpace = False + + for i in xrange(item.LIMIT_MAX_NUM): + + (limitType, limitValue) = item.GetLimit(i) + + if limitValue > 0: + if False == appendSpace: + self.AppendSpace(5) + appendSpace = True + + else: + continue + + if item.LIMIT_LEVEL == limitType: + color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color) + """ + elif item.LIMIT_STR == limitType: + color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color) + elif item.LIMIT_DEX == limitType: + color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color) + elif item.LIMIT_INT == limitType: + color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color) + elif item.LIMIT_CON == limitType: + color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color) + """ + + + + + + + + + + + + + def __GetAffectString(self, affectType, affectValue): + if 0 == affectType: + return None + + if 0 == affectValue: + return None + + try: + return self.AFFECT_DICT[affectType](affectValue) + except TypeError: + return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue) + except KeyError: + return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue) + + def __AppendAffectInformation(self): + for i in xrange(item.ITEM_APPLY_MAX_NUM): + + (affectType, affectValue) = item.GetAffect(i) + + affectString = self.__GetAffectString(affectType, affectValue) + if affectString: + self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue)) + + def AppendWearableInformation(self): + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR) + + flagList = ( + not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR), + not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN), + not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA), + not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN)) + + characterNames = "" + for i in xrange(self.CHARACTER_COUNT): + + name = self.CHARACTER_NAMES[i] + flag = flagList[i] + + if flag: + characterNames += " " + characterNames += name + + textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True) + textLine.SetFeather() + + if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE): + textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True) + textLine.SetFeather() + + if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE): + textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True) + textLine.SetFeather() + + def __AppendPotionInformation(self): + self.AppendSpace(5) + + healHP = item.GetValue(0) + healSP = item.GetValue(1) + healStatus = item.GetValue(2) + healPercentageHP = item.GetValue(3) + healPercentageSP = item.GetValue(4) + + if healHP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP)) + if healSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP)) + if healStatus != 0: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE) + if healPercentageHP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP)) + if healPercentageSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP)) + + def __AppendAbilityPotionInformation(self): + + self.AppendSpace(5) + + abilityType = item.GetValue(0) + time = item.GetValue(1) + point = item.GetValue(2) + + if abilityType == item.APPLY_ATT_SPEED: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point)) + elif abilityType == item.APPLY_MOV_SPEED: + self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point)) + + if time > 0: + minute = (time / 60) + second = (time % 60) + timeString = localeInfo.TOOLTIP_POTION_TIME + + if minute > 0: + timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN + if second > 0: + timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC + + self.AppendTextLine(timeString) + + def GetPriceColor(self, price): + if price>=constInfo.HIGH_PRICE: + return self.HIGH_PRICE_COLOR + if price>=constInfo.MIDDLE_PRICE: + return self.MIDDLE_PRICE_COLOR + else: + return self.LOW_PRICE_COLOR + + def AppendPrice(self, price): + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price)) + + def AppendPriceBySecondaryCoin(self, price): + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price)) + + def AppendSellingPrice(self, price): + if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL): + self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR) + self.AppendSpace(5) + else: + self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price)) + self.AppendSpace(5) + + def AppendMetinInformation(self): + affectType, affectValue = item.GetAffect(0) + #affectType = item.GetValue(0) + #affectValue = item.GetValue(1) + + affectString = self.__GetAffectString(affectType, affectValue) + + if affectString: + self.AppendSpace(5) + self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue)) + + def AppendMetinWearInformation(self): + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR) + + flagList = (item.IsWearableFlag(item.WEARABLE_BODY), + item.IsWearableFlag(item.WEARABLE_HEAD), + item.IsWearableFlag(item.WEARABLE_FOOTS), + item.IsWearableFlag(item.WEARABLE_WRIST), + item.IsWearableFlag(item.WEARABLE_WEAPON), + item.IsWearableFlag(item.WEARABLE_NECK), + item.IsWearableFlag(item.WEARABLE_EAR), + item.IsWearableFlag(item.WEARABLE_UNIQUE), + item.IsWearableFlag(item.WEARABLE_SHIELD), + item.IsWearableFlag(item.WEARABLE_ARROW)) + + wearNames = "" + for i in xrange(self.WEAR_COUNT): + + name = self.WEAR_NAMES[i] + flag = flagList[i] + + if flag: + wearNames += " " + wearNames += name + + textLine = ui.TextLine() + textLine.SetParent(self) + textLine.SetFontName(self.defFontName) + textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight) + textLine.SetHorizontalAlignCenter() + textLine.SetPackedFontColor(self.NORMAL_COLOR) + textLine.SetText(wearNames) + textLine.Show() + self.childrenList.append(textLine) + + self.toolTipHeight += self.TEXT_LINE_HEIGHT + self.ResizeToolTip() + + def GetMetinSocketType(self, number): + if player.METIN_SOCKET_TYPE_NONE == number: + return player.METIN_SOCKET_TYPE_NONE + elif player.METIN_SOCKET_TYPE_SILVER == number: + return player.METIN_SOCKET_TYPE_SILVER + elif player.METIN_SOCKET_TYPE_GOLD == number: + return player.METIN_SOCKET_TYPE_GOLD + else: + item.SelectItem(number) + if item.METIN_NORMAL == item.GetItemSubType(): + return player.METIN_SOCKET_TYPE_SILVER + elif item.METIN_GOLD == item.GetItemSubType(): + return player.METIN_SOCKET_TYPE_GOLD + elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number): + return player.METIN_SOCKET_TYPE_SILVER + elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number): + return player.METIN_SOCKET_TYPE_SILVER + elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number): + return player.METIN_SOCKET_TYPE_SILVER + + return player.METIN_SOCKET_TYPE_NONE + + def GetMetinItemIndex(self, number): + if player.METIN_SOCKET_TYPE_SILVER == number: + return 0 + if player.METIN_SOCKET_TYPE_GOLD == number: + return 0 + + return number + + def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum): + ACCESSORY_SOCKET_MAX_SIZE = 3 + + cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE) + end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE) + + affectType1, affectValue1 = item.GetAffect(0) + affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)] + + affectType2, affectValue2 = item.GetAffect(1) + affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)] + + mtrlPos=0 + mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur) + for mtrl in mtrlList: + affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos]) + affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos]) + + leftTime = 0 + if cur == mtrlPos+1: + leftTime=metinSlot[2] + + self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime) + mtrlPos+=1 + + def __AppendMetinSlotInfo(self, metinSlot): + if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot): + return + + for i in xrange(player.METIN_SOCKET_MAX_NUM): + self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i]) + + def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot): + if 0 == metinSlot: + return 1 + + for i in xrange(player.METIN_SOCKET_MAX_NUM): + metinSlotData=metinSlot[i] + if 0 != self.GetMetinSocketType(metinSlotData): + if 0 != self.GetMetinItemIndex(metinSlotData): + return 0 + + return 1 + + def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0): + + slotType = self.GetMetinSocketType(metinSlotData) + itemIndex = self.GetMetinItemIndex(metinSlotData) + + if 0 == slotType: + return + + self.AppendSpace(5) + + slotImage = ui.ImageBox() + slotImage.SetParent(self) + slotImage.Show() + + ## Name + nameTextLine = ui.TextLine() + nameTextLine.SetParent(self) + nameTextLine.SetFontName(self.defFontName) + nameTextLine.SetPackedFontColor(self.NORMAL_COLOR) + nameTextLine.SetOutline() + nameTextLine.SetFeather() + nameTextLine.Show() + + self.childrenList.append(nameTextLine) + + if player.METIN_SOCKET_TYPE_SILVER == slotType: + slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub") + elif player.METIN_SOCKET_TYPE_GOLD == slotType: + slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub") + + self.childrenList.append(slotImage) + + if localeInfo.IsARABIC(): + slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1) + nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2) + else: + slotImage.SetPosition(9, self.toolTipHeight-1) + nameTextLine.SetPosition(50, self.toolTipHeight + 2) + + metinImage = ui.ImageBox() + metinImage.SetParent(self) + metinImage.Show() + self.childrenList.append(metinImage) + + if itemIndex: + + item.SelectItem(itemIndex) + + ## Image + try: + metinImage.LoadImage(item.GetIconImageFileName()) + except: + dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" % + (itemIndex, item.GetIconImageFileName()) + ) + + nameTextLine.SetText(item.GetItemName()) + + ## Affect + affectTextLine = ui.TextLine() + affectTextLine.SetParent(self) + affectTextLine.SetFontName(self.defFontName) + affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR) + affectTextLine.SetOutline() + affectTextLine.SetFeather() + affectTextLine.Show() + + if localeInfo.IsARABIC(): + metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight) + affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2) + else: + metinImage.SetPosition(10, self.toolTipHeight) + affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2) + + if custumAffectString: + affectTextLine.SetText(custumAffectString) + elif itemIndex!=constInfo.ERROR_METIN_STONE: + affectType, affectValue = item.GetAffect(0) + affectString = self.__GetAffectString(affectType, affectValue) + if affectString: + affectTextLine.SetText(affectString) + else: + affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT) + + self.childrenList.append(affectTextLine) + + if custumAffectString2: + affectTextLine = ui.TextLine() + affectTextLine.SetParent(self) + affectTextLine.SetFontName(self.defFontName) + affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR) + affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2) + affectTextLine.SetOutline() + affectTextLine.SetFeather() + affectTextLine.Show() + affectTextLine.SetText(custumAffectString2) + self.childrenList.append(affectTextLine) + self.toolTipHeight += 16 + 2 + + if 0 != leftTime: + timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime)) + + timeTextLine = ui.TextLine() + timeTextLine.SetParent(self) + timeTextLine.SetFontName(self.defFontName) + timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR) + timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2) + timeTextLine.SetOutline() + timeTextLine.SetFeather() + timeTextLine.Show() + timeTextLine.SetText(timeText) + self.childrenList.append(timeTextLine) + self.toolTipHeight += 16 + 2 + + else: + nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY) + + self.toolTipHeight += 35 + self.ResizeToolTip() + + def __AppendFishInfo(self, size): + if size > 0: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR) + + def AppendUniqueItemLastTime(self, restMin): + restSecond = restMin*60 + self.AppendSpace(5) + self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR) + + def AppendMallItemLastTime(self, endTime): + leftSec = max(0, endTime - app.GetGlobalTimeStamp()) + self.AppendSpace(5) + self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR) + + def AppendTimerBasedOnWearLastTime(self, metinSlot): + if 0 == metinSlot[0]: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR) + else: + endTime = app.GetGlobalTimeStamp() + metinSlot[0] + self.AppendMallItemLastTime(endTime) + + def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex): + useCount = metinSlot[1] + endTime = metinSlot[0] + + # 茄 锅捞扼档 荤侩沁促搁 Socket0俊 辆丰 矫埃(2012斥 3岿 1老 13矫 01盒 鞍篮..) 捞 冠囚乐澜. + # 荤侩窍瘤 臼疽促搁 Socket0俊 捞侩啊瓷矫埃(捞甫抛搁 600 鞍篮 蔼. 檬窜困)捞 甸绢乐阑 荐 乐绊, 0捞扼搁 Limit Value俊 乐绰 捞侩啊瓷矫埃阑 荤侩茄促. + if 0 == useCount: + if 0 == endTime: + (limitType, limitValue) = item.GetLimit(limitIndex) + endTime = limitValue + + endTime += app.GetGlobalTimeStamp() + + self.AppendMallItemLastTime(endTime) + +class HyperlinkItemToolTip(ItemToolTip): + def __init__(self): + ItemToolTip.__init__(self, isPickable=True) + + def SetHyperlinkItem(self, tokens): + minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM + maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM + if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount: + head, vnum, flag = tokens[:3] + itemVnum = int(vnum, 16) + metinSlot = [int(metin, 16) for metin in tokens[3:6]] + + rests = tokens[6:] + if rests: + attrSlot = [] + + rests.reverse() + while rests: + key = int(rests.pop(), 16) + if rests: + val = int(rests.pop()) + attrSlot.append((key, val)) + + attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot)) + else: + attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM + + self.ClearToolTip() + self.AddItemData(itemVnum, metinSlot, attrSlot) + + ItemToolTip.OnUpdate(self) + + def OnUpdate(self): + pass + + def OnMouseLeftButtonDown(self): + self.Hide() + +class SkillToolTip(ToolTip): + + POINT_NAME_DICT = { + player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL, + player.IQ : localeInfo.SKILL_TOOLTIP_INT, + } + + SKILL_TOOL_TIP_WIDTH = 200 + PARTY_SKILL_TOOL_TIP_WIDTH = 340 + + PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,), + ( 8, 3, 20,), + (14, 4, 30,), + (22, 5, 45,), + (28, 6, 60,), + (34, 7, 80,), + (38, 8, 100,), ) + + PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,), + (10, 3, 2, 0,), + (16, 4, 2, 1,), + (24, 5, 2, 2,), ) + + PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ), + ( 26, 1, ), + ( 32, 2, ), ) + + SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER, + player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER, + player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, } + + AFFECT_NAME_DICT = { + "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER, + "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE, + "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE, + "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED, + "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED, + "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE, + "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL, + "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE, + } + AFFECT_APPEND_TEXT_DICT = { + "DODGE" : "%", + "RESIST_NORMAL" : "%", + "REFLECT_MELEE" : "%", + } + + def __init__(self): + ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH) + def __del__(self): + ToolTip.__del__(self) + + def SetSkill(self, skillIndex, skillLevel = -1): + + if 0 == skillIndex: + return + + if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex): + + if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth: + self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH + self.ResizeToolTip() + + self.AppendDefaultData(skillIndex) + self.AppendSkillConditionData(skillIndex) + self.AppendGuildSkillData(skillIndex, skillLevel) + + else: + + if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth: + self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH + self.ResizeToolTip() + + slotIndex = player.GetSkillSlotIndex(skillIndex) + skillGrade = player.GetSkillGrade(slotIndex) + skillLevel = player.GetSkillLevel(slotIndex) + skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex) + skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex) + + self.AppendDefaultData(skillIndex) + self.AppendSkillConditionData(skillIndex) + self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage) + self.AppendSkillRequirement(skillIndex, skillLevel) + + self.ShowToolTip() + + def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel): + + if 0 == skillIndex: + return + + if player.SKILL_INDEX_TONGSOL == skillIndex: + + slotIndex = player.GetSkillSlotIndex(skillIndex) + skillLevel = player.GetSkillLevel(slotIndex) + + self.AppendDefaultData(skillIndex) + self.AppendPartySkillData(skillGrade, skillLevel) + + elif player.SKILL_INDEX_RIDING == skillIndex: + + slotIndex = player.GetSkillSlotIndex(skillIndex) + self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30) + + elif player.SKILL_INDEX_SUMMON == skillIndex: + + maxLevel = 10 + + self.ClearToolTip() + self.__SetSkillTitle(skillIndex, skillGrade) + + ## Description + description = skill.GetSkillDescription(skillIndex) + self.AppendDescription(description, 25) + + if skillLevel == 10: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR) + self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR) + + else: + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR) + self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR) + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR) + self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR) + + elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex): + + if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth: + self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH + self.ResizeToolTip() + + self.AppendDefaultData(skillIndex) + self.AppendSkillConditionData(skillIndex) + self.AppendGuildSkillData(skillIndex, skillLevel) + + else: + + if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth: + self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH + self.ResizeToolTip() + + slotIndex = player.GetSkillSlotIndex(skillIndex) + + skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex) + skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex) + + self.AppendDefaultData(skillIndex, skillGrade) + self.AppendSkillConditionData(skillIndex) + self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage) + self.AppendSkillRequirement(skillIndex, skillLevel) + + self.ShowToolTip() + + def __SetSkillTitle(self, skillIndex, skillGrade): + self.SetTitle(skill.GetSkillName(skillIndex, skillGrade)) + self.__AppendSkillGradeName(skillIndex, skillGrade) + + def __AppendSkillGradeName(self, skillIndex, skillGrade): + if self.SKILL_GRADE_NAME.has_key(skillGrade): + self.AppendSpace(5) + self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR) + + def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade): + if 0 == skillIndex: + return + + slotIndex = player.GetSkillSlotIndex(skillIndex) + + self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH + self.ResizeToolTip() + + self.ClearToolTip() + self.__SetSkillTitle(skillIndex, skillGrade) + self.AppendDefaultData(skillIndex, skillGrade) + self.AppendSkillConditionData(skillIndex) + self.ShowToolTip() + + def AppendDefaultData(self, skillIndex, skillGrade = 0): + self.ClearToolTip() + self.__SetSkillTitle(skillIndex, skillGrade) + + ## Level Limit + levelLimit = skill.GetSkillLevelLimit(skillIndex) + if levelLimit > 0: + + color = self.NORMAL_COLOR + if player.GetStatus(player.LEVEL) < levelLimit: + color = self.NEGATIVE_COLOR + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color) + + ## Description + description = skill.GetSkillDescription(skillIndex) + self.AppendDescription(description, 25) + + def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel): + self.ClearToolTip() + self.__SetSkillTitle(skillIndex, skillGrade) + + ## Description + description = skill.GetSkillDescription(skillIndex) + self.AppendDescription(description, 25) + + if 1 == skillGrade: + skillLevel += 19 + elif 2 == skillGrade: + skillLevel += 29 + elif 3 == skillGrade: + skillLevel = 40 + + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR) + + def AppendSkillConditionData(self, skillIndex): + conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex) + if conditionDataCount > 0: + self.AppendSpace(5) + for i in xrange(conditionDataCount): + self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR) + + def AppendGuildSkillData(self, skillIndex, skillLevel): + skillMaxLevel = 7 + skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel) + skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel) + ## Current Level + if skillLevel > 0: + if self.HasSkillLevelDescription(skillIndex, skillLevel): + self.AppendSpace(5) + if skillLevel == skillMaxLevel: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR) + + ##### + + for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)): + self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR) + + ## Cooltime + coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage) + if coolTime > 0: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR) + + ## SP + needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage) + if needGSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR) + + ## Next Level + if skillLevel < skillMaxLevel: + if self.HasSkillLevelDescription(skillIndex, skillLevel+1): + self.AppendSpace(5) + self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR) + + ##### + + for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)): + self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR) + + ## Cooltime + coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage) + if coolTime > 0: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR) + + ## SP + needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage) + if needGSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR) + + def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage): + + self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, } + self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, } + + skillLevelUpPoint = 1 + realSkillGrade = player.GetSkillGrade(slotIndex) + skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15) + skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20) + + ## Current Level + if skillLevel > 0: + if self.HasSkillLevelDescription(skillIndex, skillLevel): + self.AppendSpace(5) + if skillGrade == skill.SKILL_GRADE_COUNT: + pass + elif skillLevel == skillMaxLevelEnd: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR) + self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR) + + ## Next Level + if skillGrade != skill.SKILL_GRADE_COUNT: + if skillLevel < skillMaxLevelEnd: + if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint): + self.AppendSpace(5) + ## HP焊碍, 包烹雀乔 焊炼胶懦狼 版快 + if skillIndex == 141 or skillIndex == 142: + self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR) + else: + self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR) + self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR) + + def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color): + + affectDataCount = skill.GetNewAffectDataCount(skillIndex) + if affectDataCount > 0: + for i in xrange(affectDataCount): + type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage) + + if not self.AFFECT_NAME_DICT.has_key(type): + continue + + minValue = int(minValue) + maxValue = int(maxValue) + affectText = self.AFFECT_NAME_DICT[type] + + if "HP" == type: + if minValue < 0 and maxValue < 0: + minValue *= -1 + maxValue *= -1 + + else: + affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL + + affectText += str(minValue) + if minValue != maxValue: + affectText += " - " + str(maxValue) + affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "") + + #import debugInfo + #if debugInfo.IsDebugMode(): + # affectText = "!!" + affectText + + self.AppendTextLine(affectText, color) + + else: + for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)): + self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color) + + + ## Duration + duration = skill.GetDuration(skillIndex, skillPercentage) + if duration > 0: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color) + + ## Cooltime + coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage) + if coolTime > 0: + self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color) + + ## SP + needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage) + if needSP != 0: + continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage) + + if skill.IsUseHPSkill(skillIndex): + self.AppendNeedHP(needSP, continuationSP, color) + else: + self.AppendNeedSP(needSP, continuationSP, color) + + def AppendSkillRequirement(self, skillIndex, skillLevel): + + skillMaxLevel = skill.GetSkillMaxLevel(skillIndex) + + if skillLevel >= skillMaxLevel: + return + + isAppendHorizontalLine = False + + ## Requirement + if skill.IsSkillRequirement(skillIndex): + + if not isAppendHorizontalLine: + isAppendHorizontalLine = True + self.AppendHorizontalLine() + + requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex) + + color = self.CANNOT_LEVEL_UP_COLOR + if skill.CheckRequirementSueccess(skillIndex): + color = self.CAN_LEVEL_UP_COLOR + self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color) + + ## Require Stat + requireStatCount = skill.GetSkillRequireStatCount(skillIndex) + if requireStatCount > 0: + + for i in xrange(requireStatCount): + type, level = skill.GetSkillRequireStatData(skillIndex, i) + if self.POINT_NAME_DICT.has_key(type): + + if not isAppendHorizontalLine: + isAppendHorizontalLine = True + self.AppendHorizontalLine() + + name = self.POINT_NAME_DICT[type] + color = self.CANNOT_LEVEL_UP_COLOR + if player.GetStatus(type) >= level: + color = self.CAN_LEVEL_UP_COLOR + self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color) + + def HasSkillLevelDescription(self, skillIndex, skillLevel): + if skill.GetSkillAffectDescriptionCount(skillIndex) > 0: + return True + if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0: + return True + if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0: + return True + + return False + + def AppendMasterAffectDescription(self, index, desc, color): + self.AppendTextLine(desc, color) + + def AppendNextAffectDescription(self, index, desc): + self.AppendTextLine(desc, self.DISABLE_COLOR) + + def AppendNeedHP(self, needSP, continuationSP, color): + + self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color) + + if continuationSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color) + + def AppendNeedSP(self, needSP, continuationSP, color): + + if -1 == needSP: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color) + + else: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color) + + if continuationSP > 0: + self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color) + + def AppendPartySkillData(self, skillGrade, skillLevel): + + if 1 == skillGrade: + skillLevel += 19 + elif 2 == skillGrade: + skillLevel += 29 + elif 3 == skillGrade: + skillLevel = 40 + + if skillLevel <= 0: + return + + skillIndex = player.SKILL_INDEX_TONGSOL + slotIndex = player.GetSkillSlotIndex(skillIndex) + skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex) + if localeInfo.IsBRAZIL(): + k = skillPower + else: + k = player.GetSkillLevel(skillIndex) / 100.0 + self.AppendSpace(5) + self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR) + + if skillLevel>=10: + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k )) + + if skillLevel>=20: + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k)) + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k)) + + if skillLevel>=25: + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k )) + + if skillLevel>=35: + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k )) + + if skillLevel>=40: + self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k )) + + self.AlignHorizonalCenter() + + def __AppendSummonDescription(self, skillLevel, color): + if skillLevel > 1: + self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color) + elif 1 == skillLevel: + self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color) + elif 0 == skillLevel: + self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color) + + +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() + + toolTip = ItemToolTip() + toolTip.ClearToolTip() + #toolTip.AppendTextLine("Test") + desc = "Item descriptions:|increase of width of display to 35 digits per row AND installation of function that the displayed words are not broken up in two parts, but instead if one word is too long to be displayed in this row, this word will start in the next row." + summ = "" + + toolTip.AddItemData_Offline(10, desc, summ, 0, 0) + toolTip.Show() + + app.Loop() diff --git a/root/uiuploadmark.py b/root/uiuploadmark.py new file mode 100644 index 0000000..cf1a291 --- /dev/null +++ b/root/uiuploadmark.py @@ -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)) diff --git a/root/uiweb.py b/root/uiweb.py new file mode 100644 index 0000000..77022ae --- /dev/null +++ b/root/uiweb.py @@ -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() diff --git a/root/uiwhisper.py b/root/uiwhisper.py new file mode 100644 index 0000000..51ef6bb --- /dev/null +++ b/root/uiwhisper.py @@ -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() diff --git a/root/utils.py b/root/utils.py new file mode 100644 index 0000000..7906f29 --- /dev/null +++ b/root/utils.py @@ -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 + + diff --git a/root/warrior_m.msm b/root/warrior_m.msm new file mode 100644 index 0000000..52ea092 --- /dev/null +++ b/root/warrior_m.msm @@ -0,0 +1,1605 @@ +ScriptType RaceDataScript + +BaseModelFileName "d:/ymir work/pc/warrior/warrior_novice.GR2" + +Group HairData +{ + PathName "d:/ymir Work/pc/warrior/" + + HairDataCount 61 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 1001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 1002 + Model "hair/hair_2_2.gr2" + SourceSkin "hair/hair_2_2.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 1003 + Model "hair/hair_2_3.gr2" + SourceSkin "hair/hair_2_3.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 1004 + Model "hair/hair_2_4.gr2" + SourceSkin "hair/hair_2_4.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 1005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 1006 + Model "hair/hair_3_2.gr2" + SourceSkin "hair/hair_3_2.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 1007 + Model "hair/hair_3_3.gr2" + SourceSkin "hair/hair_3_3.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 1008 + Model "hair/hair_3_4.gr2" + SourceSkin "hair/hair_3_4.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 1009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 1010 + Model "hair/hair_4_2.gr2" + SourceSkin "hair/hair_4_2.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 1011 + Model "hair/hair_4_3.gr2" + SourceSkin "hair/hair_4_3.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 1012 + Model "hair/hair_4_4.gr2" + SourceSkin "hair/hair_4_4.dds" + TargetSkin "hair/hair_4_4.dds" + } + Group HairData18 + { + HairIndex 1013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 1014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 1015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 1016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + HairIndex 1017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + HairIndex 1018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + Group HairData26 + { + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + Group HairData27 + { + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + Group HairData29 + { + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData30 + { + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + Group HairData31 + { + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + Group HairData32 + { + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData33 + { + HairIndex 5028 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_3.dds" + } + Group HairData34 + { + HairIndex 5029 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_2.dds" + } + Group HairData35 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData36 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData37 + { + HairIndex 5033 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData38 + { + HairIndex 5035 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData39 + { + HairIndex 5037 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData40 + { + HairIndex 5039 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData41 + { + HairIndex 5041 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData42 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData43 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData44 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData45 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData46 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData47 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData48 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData49 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData50 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData51 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData52 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData53 + { + HairIndex 5055 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData54 + { + HairIndex 5057 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData55 + { + HairIndex 5059 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData56 + { + HairIndex 5061 + Model "hair/hair_35_1.gr2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData57 + { + HairIndex 5063 + Model "hair/hair_37_1.gr2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + + Group HairData58 + { + HairIndex 5064 + Model "hair/hair_36_1.gr2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + + Group HairData59 + { + HairIndex 5065 + Model "hair/hair_38_1.gr2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + Group HairData60 + { + HairIndex 5022 + Model "hair/hair_12_1.gr2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } + +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc/warrior/" + + ShapeDataCount 146 + Group ShapeData00 + { + ShapeIndex 0 + + Model "warrior_novice.gr2" + SourceSkin "warrior_novice_red.dds" + TargetSkin "warrior_novice_red.dds" + } + Group ShapeData01 + { + ShapeIndex 1 + Model "warrior_novice.gr2" + SourceSkin "warrior_novice_red.dds" + TargetSkin "warrior_novice_blue.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_nahan.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_giryung.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_jaho.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_saja.dds" + + } + Group ShapeData06 + { + ShapeIndex 7 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_jain.dds" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_moryong.dds" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_cheongrin.dds" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_geumrin.dds" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "warrior_yongsin.GR2" + SourceSkin "warrior_yongsin.dds" + TargetSkin "warrior_yongsin.dds" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 201 + Model "warrior_marry_01.gr2" + SourceSkin "warrior_marry_01.dds" + TargetSkin "warrior_marry_01.dds" + } + Group ShapeData16 + { + SpecialPath "d:/ymir Work/pc/warrior/" + ShapeIndex 12 + Model "warrior_4-1.GR2" + SourceSkin "warrior_4-1.dds" + TargetSkin "warrior_4-1.dds" + } + Group ShapeData17 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 24 + Model "warrior_lord.GR2" + SourceSkin "warrior_king01.dds" + TargetSkin "warrior_king01.dds" + } + + + Group ShapeData18 + { + ShapeIndex 14 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_1-1_nahan_a.dds" + } + + Group ShapeData19 + { + ShapeIndex 15 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_giryung_a.dds" + } + Group ShapeData20 + { + ShapeIndex 16 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_jaho_a.dds" + } + + Group ShapeData21 + { + ShapeIndex 17 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_saja_a.dds" + } + Group ShapeData22 + { + ShapeIndex 18 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_jain_a.dds" + } + Group ShapeData23 + { + ShapeIndex 19 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_2-3_moryong_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 20 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_3-1_cheongrin_a.dds" + } + Group ShapeData25 + { + ShapeIndex 21 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_3-2_geumrin_a.dds" + } + Group ShapeData26 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 25 + Model "warrior_lord.GR2" + SourceSkin "warrior_king01.dds" + TargetSkin "warrior_king02.dds" + } + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 26 + Model "warrior_4-1.GR2" + SourceSkin "warrior_4-1.dds" + TargetSkin "warrior_4-2.dds" + } + Group ShapeData28 + { + + ShapeIndex 27 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_blue.dds" + } + Group ShapeData31 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 30 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_costume1.dds" + } + Group ShapeData32 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40031 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1.dds" + } + Group ShapeData33 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40033 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_London.dds" + } + Group ShapeData34 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40034 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Germany.dds" + } + Group ShapeData35 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40035 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Turkey.dds" + } + Group ShapeData36 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40036 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Brazil.dds" + } + Group ShapeData37 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40037 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_London.dds" + } + Group ShapeData38 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40038 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Germany.dds" + } + Group ShapeData39 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40039 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Turkey.dds" + } + Group ShapeData40 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40040 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Brazil.dds" + } + Group ShapeData41 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40041 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_London.dds" + } + Group ShapeData42 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40042 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Germany.dds" + } + Group ShapeData43 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40043 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Turkey.dds" + } + Group ShapeData44 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40044 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Brazil.dds" + } + Group ShapeData45 + { + + ShapeIndex 40032 + Model "warrior_assasin1.GR2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assassin1.dds" + } + Group ShapeData46 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40045 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_France.dds" + } + Group ShapeData47 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40046 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Italy.dds" + } + Group ShapeData48 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40047 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Poland.dds" + } + Group ShapeData49 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40048 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Romania.dds" + } + Group ShapeData50 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40049 + Model "warrior_fencing1_Germany.GR2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Spain.dds" + } + Group ShapeData51 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40050 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_France.dds" + } + Group ShapeData52 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40051 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Italy.dds" + } + Group ShapeData53 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40052 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Poland.dds" + } + Group ShapeData54 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40053 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Romania.dds" + } + Group ShapeData55 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40054 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Spain.dds" + } + Group ShapeData56 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40055 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_France.dds" + } + Group ShapeData57 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40056 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Italy.dds" + } + Group ShapeData58 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40057 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Poland.dds" + } + Group ShapeData59 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40058 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Romaina.dds" + } + Group ShapeData60 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40059 + Model "warrior_boxing1_Germany.GR2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Spain.dds" + } + Group ShapeData61 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40065 + Model "warrior_halloween1.GR2" + SourceSkin "warrior_halloween1.dds" + TargetSkin "warrior_halloween1.dds" + } + Group ShapeData62 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 13 + Model "warrior_5_1.GR2" + SourceSkin "warrior_5_1.dds" + TargetSkin "warrior_5_1.dds" + } + Group ShapeData63 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40062 + Model "warrior_salsa1.GR2" + SourceSkin "warrior_salsa1.dds" + TargetSkin "warrior_salsa1.dds" + } + Group ShapeData64 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40063 + Model "warrior_Springwear1.GR2" + SourceSkin "warrior_Springwear1.dds" + TargetSkin "warrior_Springwear1.dds" + } + Group ShapeData65 + { + SpecialPath "d:/ymir Work/pc/warrior/" + + ShapeIndex 40061 + Model "warrior_tailcoat1.gr2" + SourceSkin "warrior_tailcoat1.dds" + TargetSkin "warrior_tailcoat1.dds" + } + Group ShapeData66 + { + SpecialPath "d:/ymir Work/pc/warrior/" + ShapeIndex 40069 + Model "warrior_deer1.gr2" + SourceSkin "warrior_deer1.dds" + TargetSkin "warrior_deer1.dds" + } + Group ShapeData67 + { + SpecialPath "d:/ymir Work/pc/warrior/" + ShapeIndex 40066 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_red.dds" + } + Group ShapeData68 + { + SpecialPath "d:/ymir Work/pc/warrior/" + ShapeIndex 40067 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_green.dds" + } + Group ShapeData69 + { + SpecialPath "d:/ymir Work/pc/warrior/" + ShapeIndex 40068 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "warrior_samurai1.GR2" + SourceSkin "warrior_samurai1.dds" + TargetSkin "warrior_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "warrior_BlackSnake1.GR2" + SourceSkin "warrior_BlackSnake1.dds" + TargetSkin "warrior_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "warrior_BlackSnake1.GR2" + SourceSkin "warrior_BlackSnake1.dds" + TargetSkin "warrior_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40112 + Model "warrior_assasin1.GR2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assasin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40114 + Model "warrior_pwahuang1.GR2" + SourceSkin "warrior_pwahuang1.dds" + TargetSkin "warrior_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40116 + Model "warrior_halloween2.GR2" + SourceSkin "warrior_halloween2.dds" + TargetSkin "warrior_halloween2.dds" + } + Group ShapeData112 + { + ShapeIndex 40118 + Model "warrior_assasin1.GR2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assassin3.dds" + } + Group ShapeData113 + { + ShapeIndex 40060 + Model "warrior_capoeira1.GR2" + SourceSkin "warrior_capoeira1.dds" + TargetSkin "warrior_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40120 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40122 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40124 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40126 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40128 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40130 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40132 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40134 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40136 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40138 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40140 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40142 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40144 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40146 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40148 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40150 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40152 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40154 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40156 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40158 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40160 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40162 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40164 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40166 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40168 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40170 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40172 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40174 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40176 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40178 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40180 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40182 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC32.dds" + } +} + +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 100.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 100.000000 + } + } +} diff --git a/root/warrior_w.msm b/root/warrior_w.msm new file mode 100644 index 0000000..10d7172 --- /dev/null +++ b/root/warrior_w.msm @@ -0,0 +1,1690 @@ +ScriptType RaceDataScript + +BaseModelFileName "d:/ymir work/pc2/warrior/warrior_novice.GR2" + +Group HairData +{ + PathName "d:/ymir Work/pc2/warrior/" + + HairDataCount 75 + Group HairData00 + { + HairIndex 0 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01.dds" + } + Group HairData01 + { + HairIndex 1 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_white.dds" + } + Group HairData02 + { + HairIndex 2 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_gold.dds" + } + Group HairData03 + { + HairIndex 3 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_red.dds" + } + Group HairData04 + { + HairIndex 4 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_brown.dds" + } + Group HairData05 + { + HairIndex 5 + Model "hair/hair_1_1.gr2" + SourceSkin "hair/hair_1_1.dds" + TargetSkin "warrior_hair_01_black.dds" + } + Group HairData06 + { + HairIndex 1001 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_1.dds" + } + Group HairData07 + { + HairIndex 1002 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_2.dds" + } + Group HairData08 + { + HairIndex 1003 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_3.dds" + } + Group HairData09 + { + HairIndex 1004 + Model "hair/hair_2_1.gr2" + SourceSkin "hair/hair_2_1.dds" + TargetSkin "hair/hair_2_4.dds" + } + Group HairData10 + { + HairIndex 1005 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_1.dds" + } + Group HairData11 + { + HairIndex 1006 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_2.dds" + } + Group HairData12 + { + HairIndex 1007 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_3.dds" + } + Group HairData13 + { + HairIndex 1008 + Model "hair/hair_3_1.gr2" + SourceSkin "hair/hair_3_1.dds" + TargetSkin "hair/hair_3_4.dds" + } + Group HairData14 + { + HairIndex 1009 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_1.dds" + } + Group HairData15 + { + HairIndex 1010 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_2.dds" + } + Group HairData16 + { + HairIndex 1011 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_3.dds" + } + Group HairData17 + { + HairIndex 1012 + Model "hair/hair_4_1.gr2" + SourceSkin "hair/hair_4_1.dds" + TargetSkin "hair/hair_4_4.dds" + } + Group HairData18 + { + HairIndex 1013 + Model "hair/hair_6_1.gr2" + SourceSkin "hair/hair_6_1.dds" + TargetSkin "hair/hair_6_1.dds" + } + Group HairData19 + { + HairIndex 1014 + Model "hair/hair_5_1.gr2" + SourceSkin "hair/hair_5_1.dds" + TargetSkin "hair/hair_5_1.dds" + } + Group HairData20 + { + HairIndex 1015 + Model "hair/hair_7_1.gr2" + SourceSkin "hair/hair_7_1.dds" + TargetSkin "hair/hair_7_1.dds" + } + Group HairData21 + { + HairIndex 1016 + Model "hair/hair_8_1.gr2" + SourceSkin "hair/hair_8_1.dds" + TargetSkin "hair/hair_8_1.dds" + } + Group HairData22 + { + HairIndex 1017 + Model "hair/hair_9_1.gr2" + SourceSkin "hair/hair_9_1.dds" + TargetSkin "hair/hair_9_1.dds" + } + Group HairData23 + { + HairIndex 1018 + Model "hair/hair_10_1.gr2" + SourceSkin "hair/hair_10_1.dds" + TargetSkin "hair/hair_10_1.dds" + } + Group HairData24 + { + HairIndex 5001 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_1.dds" + } + Group HairData25 + { + HairIndex 5002 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_1.dds" + } + Group HairData26 + { + HairIndex 5006 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_1.dds" + } + Group HairData27 + { + HairIndex 5003 + Model "hair/hair_16_1.gr2" + SourceSkin "hair/hair_16_1.dds" + TargetSkin "hair/hair_16_1.dds" + } + Group HairData28 + { + HairIndex 5014 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_1.dds" + } + + Group HairData29 + { + HairIndex 5005 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_2.dds" + } + Group HairData30 + { + HairIndex 5007 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_3.dds" + } + Group HairData31 + { + HairIndex 5008 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_4.dds" + } + Group HairData32 + { + HairIndex 5009 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_5.dds" + } + Group HairData33 + { + HairIndex 5010 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_6.dds" + } + Group HairData34 + { + HairIndex 5011 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_7.dds" + } + Group HairData35 + { + HairIndex 5012 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_8.dds" + } + Group HairData36 + { + HairIndex 5013 + Model "hair/hair_15_1.gr2" + SourceSkin "hair/hair_15_1.dds" + TargetSkin "hair/hair_15_9.dds" + } + Group HairData37 + { + HairIndex 5004 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_2.dds" + } + Group HairData38 + { + HairIndex 5015 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_3.dds" + } + Group HairData39 + { + HairIndex 5016 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_4.dds" + } + Group HairData40 + { + HairIndex 5017 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_5.dds" + } + Group HairData41 + { + HairIndex 5018 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_6.dds" + } + Group HairData42 + { + HairIndex 5019 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_7.dds" + } + Group HairData43 + { + HairIndex 5020 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_8.dds" + } + Group HairData44 + { + HairIndex 5021 + Model "hair/hair_17_1.gr2" + SourceSkin "hair/hair_17_1.dds" + TargetSkin "hair/hair_17_9.dds" + } + Group HairData45 + { + HairIndex 5027 + Model "hair/hair_20_1.gr2" + SourceSkin "hair/hair_20_1.dds" + TargetSkin "hair/hair_20_1.dds" + } + Group HairData46 + { + HairIndex 5023 + Model "hair/hair_13_1.gr2" + SourceSkin "hair/hair_13_1.dds" + TargetSkin "hair/hair_13_1.dds" + } + Group HairData47 + { + HairIndex 5024 + Model "hair/hair_18_1.gr2" + SourceSkin "hair/hair_18_1.dds" + TargetSkin "hair/hair_18_1.dds" + } + Group HairData48 + { + HairIndex 5025 + Model "hair/hair_19_1.gr2" + SourceSkin "hair/hair_19_1.dds" + TargetSkin "hair/hair_19_1.dds" + } + Group HairData49 + { + HairIndex 5030 + Model "hair/hair_22_1.gr2" + SourceSkin "hair/hair_22_1.dds" + TargetSkin "hair/hair_22_1.dds" + } + Group HairData50 + { + HairIndex 5031 + Model "hair/hair_23_1.gr2" + SourceSkin "hair/hair_23_1.dds" + TargetSkin "hair/hair_23_1.dds" + } + Group HairData51 + { + HairIndex 5034 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_1.dds" + } + Group HairData52 + { + HairIndex 5036 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_2.dds" + } + Group HairData53 + { + HairIndex 5038 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_3.dds" + } + Group HairData54 + { + HairIndex 5040 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_4.dds" + } + Group HairData55 + { + HairIndex 5042 + Model "hair/hair_24_1.gr2" + SourceSkin "hair/hair_24_1.dds" + TargetSkin "hair/hair_24_5.dds" + } + Group HairData56 + { + HairIndex 5026 + Model "hair/hair_21_1.gr2" + SourceSkin "hair/hair_21_1.dds" + TargetSkin "hair/hair_21_1.dds" + } + Group HairData57 + { + HairIndex 5045 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_2.dds" + } + Group HairData58 + { + HairIndex 5046 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_3.dds" + } + Group HairData59 + { + HairIndex 5047 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_4.dds" + } + Group HairData60 + { + HairIndex 5048 + Model "hair/hair_11_1.gr2" + SourceSkin "hair/hair_11_1.dds" + TargetSkin "hair/hair_11_5.dds" + } + Group HairData61 + { + HairIndex 5049 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData62 + { + HairIndex 5050 + Model "hair/hair_28_1.gr2" + SourceSkin "hair/hair_28_1.dds" + TargetSkin "hair/hair_28_1.dds" + } + Group HairData63 + { + HairIndex 5051 + Model "hair/hair_29_1.gr2" + SourceSkin "hair/hair_29_1.dds" + TargetSkin "hair/hair_29_1.dds" + } + Group HairData64 + { + HairIndex 5052 + Model "hair/hair_30_1.gr2" + SourceSkin "hair/hair_30_1.dds" + TargetSkin "hair/hair_30_1.dds" + } + Group HairData65 + { + HairIndex 5053 + Model "hair/hair_31_1.gr2" + SourceSkin "hair/hair_31_1.dds" + TargetSkin "hair/hair_31_1.dds" + } + Group HairData66 + { + HairIndex 5054 + Model "hair/hair_32_1.gr2" + SourceSkin "hair/hair_32_1.dds" + TargetSkin "hair/hair_32_1.dds" + } + Group HairData67 + { + HairIndex 5056 + Model "hair/hair_14_1.gr2" + SourceSkin "hair/hair_14_1.dds" + TargetSkin "hair/hair_14_2.dds" + } + Group HairData68 + { + HairIndex 5058 + Model "hair/hair_33_1.gr2" + SourceSkin "hair/hair_33_1.dds" + TargetSkin "hair/hair_33_1.dds" + } + Group HairData69 + { + HairIndex 5060 + Model "hair/hair_34_1.gr2" + SourceSkin "hair/hair_34_1.dds" + TargetSkin "hair/hair_34_1.dds" + } + Group HairData70 + { + HairIndex 5062 + Model "hair/hair_35_1.gr2" + SourceSkin "hair/hair_35_1.dds" + TargetSkin "hair/hair_35_1.dds" + } + Group HairData71 + { + HairIndex 5063 + Model "hair/hair_37_1.gr2" + SourceSkin "hair/hair_37_1.dds" + TargetSkin "hair/hair_37_1.dds" + } + + Group HairData72 + { + HairIndex 5064 + Model "hair/hair_36_1.gr2" + SourceSkin "hair/hair_36_1.dds" + TargetSkin "hair/hair_36_1.dds" + } + + Group HairData73 + { + HairIndex 5065 + Model "hair/hair_38_1.gr2" + SourceSkin "hair/hair_38_1.dds" + TargetSkin "hair/hair_38_1.dds" + } + Group HairData74 + { + HairIndex 5022 + Model "hair/hair_12_1.gr2" + SourceSkin "hair/hair_12_1.dds" + TargetSkin "hair/hair_12_1.dds" + } + +} + +Group ShapeData +{ + PathName "d:/ymir Work/pc2/warrior/" + + ShapeDataCount 146 + Group ShapeData00 + { + ShapeIndex 0 + + Model "warrior_novice.gr2" + SourceSkin "warrior_novice_red.dds" + TargetSkin "warrior_novice_red.dds" + } + Group ShapeData01 + { + ShapeIndex 1 + Model "warrior_novice.gr2" + SourceSkin "warrior_novice_red.dds" + TargetSkin "warrior_novice_blue.dds" + } + Group ShapeData02 + { + ShapeIndex 3 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_nahan.dds" + } + Group ShapeData03 + { + ShapeIndex 4 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_giryung.dds" + } + Group ShapeData04 + { + ShapeIndex 5 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_jaho.dds" + } + Group ShapeData05 + { + ShapeIndex 6 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_saja.dds" + + } + Group ShapeData06 + { + ShapeIndex 7 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_jain.dds" + } + Group ShapeData07 + { + ShapeIndex 8 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_moryong.dds" + } + Group ShapeData08 + { + ShapeIndex 9 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_cheongrin.dds" + } + Group ShapeData09 + { + ShapeIndex 10 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_geumrin.dds" + } + Group ShapeData10 + { + ShapeIndex 11 + Model "warrior_yongsin.GR2" + SourceSkin "warrior_yongsin.dds" + TargetSkin "warrior_yongsin.dds" + } + Group ShapeData11 + { + SpecialPath "d:/ymir work/monster/wolf/" + + ShapeIndex 100 + Model "wolf.gr2" + SourceSkin "wolf.dds" + } + Group ShapeData12 + { + SpecialPath "d:/ymir work/monster/wild_boar/" + + ShapeIndex 101 + Model "wild_boar.gr2" + SourceSkin "wild_boar.dds" + } + Group ShapeData13 + { + SpecialPath "d:/ymir work/monster/bear/" + + ShapeIndex 102 + Model "bear.gr2" + SourceSkin "bear.dds" + } + Group ShapeData14 + { + SpecialPath "d:/ymir work/monster/tiger/" + + ShapeIndex 103 + Model "tiger.gr2" + SourceSkin "tiger.dds" + } + Group ShapeData15 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 201 + Model "warrior_marry_01.gr2" + SourceSkin "warrior_marry_01.dds" + TargetSkin "warrior_marry_01.dds" + } + Group ShapeData16 + { + ShapeIndex 12 + Model "warrior_4-1.GR2" + SourceSkin "warrior_4-1.dds" + TargetSkin "warrior_4-1.dds" + } + Group ShapeData17 + { + ShapeIndex 24 + Model "warrior_lord.GR2" + SourceSkin "warrior_king01.dds" + TargetSkin "warrior_king01.dds" + } + + + Group ShapeData18 + { + ShapeIndex 14 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_1-1_nahan_a.dds" + } + + Group ShapeData19 + { + ShapeIndex 15 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_giryung_a.dds" + } + Group ShapeData20 + { + ShapeIndex 16 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_jaho_a.dds" + } + + Group ShapeData21 + { + ShapeIndex 17 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_saja_a.dds" + } + Group ShapeData22 + { + ShapeIndex 18 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_jain_a.dds" + } + Group ShapeData23 + { + ShapeIndex 19 + Model "warrior_saja.gr2" + SourceSkin "warrior_saja.dds" + TargetSkin "warrior_2-3_moryong_a.DDS" + } + Group ShapeData24 + { + ShapeIndex 20 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_3-1_cheongrin_a.dds" + } + Group ShapeData25 + { + ShapeIndex 21 + Model "warrior_cheongrin.gr2" + SourceSkin "warrior_cheongrin.dds" + TargetSkin "warrior_3-2_geumrin_a.dds" + } + Group ShapeData26 + { + ShapeIndex 25 + Model "warrior_lord.GR2" + SourceSkin "warrior_king01.dds" + TargetSkin "warrior_king02.dds" + } + Group ShapeData27 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 26 + Model "warrior_4-1.GR2" + SourceSkin "warrior_4-1.dds" + TargetSkin "warrior_4-2.dds" + } + Group ShapeData28 + { + + ShapeIndex 27 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_red.dds" + } + Group ShapeData29 + { + + ShapeIndex 28 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_yellow.dds" + } + Group ShapeData30 + { + + ShapeIndex 29 + Model "warrior_event1.GR2" + SourceSkin "warrior_event1_yellow.dds" + TargetSkin "warrior_event1_blue.dds" + } + Group ShapeData31 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 30 + Model "warrior_nahan.gr2" + SourceSkin "warrior_nahan.dds" + TargetSkin "warrior_costume1.dds" + } + Group ShapeData32 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40031 + Model "warrior_rabbit1.gr2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1.dds" + } + Group ShapeData33 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40033 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_London.dds" + } + Group ShapeData34 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40034 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Germany.dds" + } + Group ShapeData35 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40035 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Turkey.dds" + } + Group ShapeData36 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40036 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Brazil.dds" + } + Group ShapeData37 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40037 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_London.dds" + } + Group ShapeData38 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40038 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Germany.dds" + } + Group ShapeData39 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40039 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Turkey.dds" + } + Group ShapeData40 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40040 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Brazil.dds" + } + Group ShapeData41 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40041 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_London.dds" + } + Group ShapeData42 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40042 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Germany.dds" + } + Group ShapeData43 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40043 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Turkey.dds" + } + Group ShapeData44 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40044 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Brazil.dds" + } + Group ShapeData45 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40032 + Model "warrior_assassin1.gr2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assassin1.dds" + } + Group ShapeData46 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40045 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_France.dds" + } + Group ShapeData47 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40046 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Italy.dds" + } + Group ShapeData48 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40047 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Poland.dds" + } + Group ShapeData49 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40048 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Romania.dds" + } + Group ShapeData50 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40049 + Model "warrior_fencing1_Germany.gr2" + SourceSkin "warrior_fencing1_Germany.dds" + TargetSkin "warrior_fencing1_Spain.dds" + } + Group ShapeData51 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40050 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_France.dds" + } + Group ShapeData52 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40051 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Italy.dds" + } + Group ShapeData53 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40052 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Poland.dds" + } + Group ShapeData54 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40053 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Romania.dds" + } + Group ShapeData55 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40054 + Model "warrior_soccer1_Germany.gr2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_soccer1_Spain.dds" + } + Group ShapeData56 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40055 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_France.dds" + } + Group ShapeData57 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40056 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Italy.dds" + } + Group ShapeData58 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40057 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Poland.dds" + } + Group ShapeData59 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40058 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Romania.dds" + } + Group ShapeData60 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40059 + Model "warrior_boxing1_Germany.gr2" + SourceSkin "warrior_boxing1_Germany.dds" + TargetSkin "warrior_boxing1_Spain.dds" + } + Group ShapeData61 + { + SpecialPath "d:/ymir Work/pc2/warrior/" + + ShapeIndex 40065 + Model "warrior_halloween1.gr2" + SourceSkin "warrior_halloween1.dds" + TargetSkin "warrior_halloween1.dds" + } + + Group ShapeData62 + { + ShapeIndex 13 + Model "warrior_5_1.GR2" + SourceSkin "warrior_5_1.dds" + TargetSkin "warrior_5_1.dds" + } + Group ShapeData63 + { + ShapeIndex 40062 + Model "warrior_salsa1.GR2" + SourceSkin "warrior_salsa1.dds" + TargetSkin "warrior_salsa1.dds" + } + Group ShapeData64 + { + ShapeIndex 40063 + Model "warrior_Springwear1.GR2" + SourceSkin "warrior_Springwear1.dds" + TargetSkin "warrior_Springwear1.dds" + } + Group ShapeData65 + { + ShapeIndex 40061 + Model "warrior_tailcoat1.gr2" + SourceSkin "warrior_tailcoat1.dds" + TargetSkin "warrior_tailcoat1.dds" + } + Group ShapeData66 + { + ShapeIndex 40069 + Model "warrior_deer1.gr2" + SourceSkin "warrior_deer1.dds" + TargetSkin "warrior_deer1.dds" + } + Group ShapeData67 + { + ShapeIndex 40066 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_red.dds" + } + Group ShapeData68 + { + ShapeIndex 40067 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_green.dds" + } + Group ShapeData69 + { + ShapeIndex 40068 + Model "warrior_santa1_black.gr2" + SourceSkin "warrior_santa1_black.dds" + TargetSkin "warrior_santa1_black.dds" + } + Group ShapeData70 + { + ShapeIndex 40070 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA01.dds" + } + Group ShapeData71 + { + ShapeIndex 40071 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA02.dds" + } + Group ShapeData72 + { + ShapeIndex 40072 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA03.dds" + } + Group ShapeData73 + { + ShapeIndex 40073 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA04.dds" + } + Group ShapeData74 + { + ShapeIndex 40074 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA05.dds" + } + Group ShapeData75 + { + ShapeIndex 40075 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA06.dds" + } + Group ShapeData76 + { + ShapeIndex 40076 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA07.dds" + } + Group ShapeData77 + { + ShapeIndex 40077 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA08.dds" + } + Group ShapeData78 + { + ShapeIndex 40078 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA09.dds" + } + Group ShapeData79 + { + ShapeIndex 40079 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA10.dds" + } + Group ShapeData80 + { + ShapeIndex 40080 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA11.dds" + } + Group ShapeData81 + { + ShapeIndex 40081 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA12.dds" + } + Group ShapeData82 + { + ShapeIndex 40082 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA13.dds" + } + Group ShapeData83 + { + ShapeIndex 40083 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA14.dds" + } + Group ShapeData84 + { + ShapeIndex 40084 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA15.dds" + } + Group ShapeData85 + { + ShapeIndex 40085 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA16.dds" + } + Group ShapeData86 + { + ShapeIndex 40086 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA17.dds" + } + Group ShapeData87 + { + ShapeIndex 40087 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA18.dds" + } + Group ShapeData88 + { + ShapeIndex 40088 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA19.dds" + } + Group ShapeData89 + { + ShapeIndex 40089 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA20.dds" + } + Group ShapeData90 + { + ShapeIndex 40090 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA21.dds" + } + Group ShapeData91 + { + ShapeIndex 40091 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA22.dds" + } + Group ShapeData92 + { + ShapeIndex 40092 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA23.dds" + } + Group ShapeData93 + { + ShapeIndex 40093 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA24.dds" + } + Group ShapeData94 + { + ShapeIndex 40094 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA25.dds" + } + Group ShapeData95 + { + ShapeIndex 40095 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA26.dds" + } + Group ShapeData96 + { + ShapeIndex 40096 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA27.dds" + } + Group ShapeData97 + { + ShapeIndex 40097 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA28.dds" + } + Group ShapeData98 + { + ShapeIndex 40098 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA29.dds" + } + Group ShapeData99 + { + ShapeIndex 40099 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA30.dds" + } + Group ShapeData100 + { + ShapeIndex 40100 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA31.dds" + } + Group ShapeData101 + { + ShapeIndex 40101 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_UEFA32.dds" + } + Group ShapeData102 + { + ShapeIndex 40064 + Model "warrior_samurai1.GR2" + SourceSkin "warrior_samurai1.dds" + TargetSkin "warrior_samurai1.dds" + } + Group ShapeData103 + { + ShapeIndex 40106 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_black.dds" + } + Group ShapeData104 + { + ShapeIndex 40107 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_blue.dds" + } + Group ShapeData105 + { + ShapeIndex 40108 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_green.dds" + } + Group ShapeData106 + { + ShapeIndex 40109 + Model "warrior_rabbit1.GR2" + SourceSkin "warrior_rabbit1.dds" + TargetSkin "warrior_rabbit1_pink.dds" + } + Group ShapeData107 + { + ShapeIndex 40110 + Model "warrior_BlackSnake1.GR2" + SourceSkin "warrior_BlackSnake1.dds" + TargetSkin "warrior_BlackSnake1.dds" + } + Group ShapeData108 + { + ShapeIndex 40111 + Model "warrior_BlackSnake1.GR2" + SourceSkin "warrior_BlackSnake1.dds" + TargetSkin "warrior_BlackSnake1.dds" + } + Group ShapeData109 + { + ShapeIndex 40113 + Model "warrior_assassin1.GR2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assassin2.dds" + } + Group ShapeData110 + { + ShapeIndex 40115 + Model "warrior_pwahuang1.GR2" + SourceSkin "warrior_pwahuang1.dds" + TargetSkin "warrior_pwahuang1.dds" + } + Group ShapeData111 + { + ShapeIndex 40117 + Model "warrior_halloween2.GR2" + SourceSkin "warrior_halloween2.dds" + TargetSkin "warrior_halloween2.dds" + } + Group ShapeData112 + { + ShapeIndex 40119 + Model "warrior_assassin1.gr2" + SourceSkin "warrior_assassin1.dds" + TargetSkin "warrior_assassin3.DDS" + } + Group ShapeData113 + { + ShapeIndex 40060 + Model "warrior_capoeira1.GR2" + SourceSkin "warrior_capoeira1.dds" + TargetSkin "warrior_capoeira1.dds" + } + Group ShapeData114 + { + ShapeIndex 40121 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC01.dds" + } + Group ShapeData115 + { + ShapeIndex 40123 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC02.dds" + } + Group ShapeData116 + { + ShapeIndex 40125 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC03.dds" + } + Group ShapeData117 + { + ShapeIndex 40127 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC04.dds" + } + Group ShapeData118 + { + ShapeIndex 40129 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC05.dds" + } + Group ShapeData119 + { + ShapeIndex 40131 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC06.dds" + } + Group ShapeData120 + { + ShapeIndex 40133 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC07.dds" + } + Group ShapeData121 + { + ShapeIndex 40135 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC08.dds" + } + Group ShapeData122 + { + ShapeIndex 40137 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC09.dds" + } + Group ShapeData123 + { + ShapeIndex 40139 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC10.dds" + } + Group ShapeData124 + { + ShapeIndex 40141 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC11.dds" + } + Group ShapeData125 + { + ShapeIndex 40143 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC12.dds" + } + Group ShapeData126 + { + ShapeIndex 40145 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC13.dds" + } + Group ShapeData127 + { + ShapeIndex 40147 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC14.dds" + } + Group ShapeData128 + { + ShapeIndex 40149 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC15.dds" + } + Group ShapeData129 + { + ShapeIndex 40151 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC16.dds" + } + Group ShapeData130 + { + ShapeIndex 40153 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC17.dds" + } + Group ShapeData131 + { + ShapeIndex 40155 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC18.dds" + } + Group ShapeData132 + { + ShapeIndex 40157 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC19.dds" + } + Group ShapeData133 + { + ShapeIndex 40159 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC20.dds" + } + Group ShapeData134 + { + ShapeIndex 40161 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC21.dds" + } + Group ShapeData135 + { + ShapeIndex 40163 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC22.dds" + } + Group ShapeData136 + { + ShapeIndex 40165 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC23.dds" + } + Group ShapeData137 + { + ShapeIndex 40167 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC24.dds" + } + Group ShapeData138 + { + ShapeIndex 40169 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC25.dds" + } + Group ShapeData139 + { + ShapeIndex 40171 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC26.dds" + } + Group ShapeData140 + { + ShapeIndex 40173 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC27.dds" + } + Group ShapeData141 + { + ShapeIndex 40175 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC28.dds" + } + Group ShapeData142 + { + ShapeIndex 40177 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC29.dds" + } + Group ShapeData143 + { + ShapeIndex 40179 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC30.dds" + } + Group ShapeData144 + { + ShapeIndex 40181 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC31.dds" + } + Group ShapeData145 + { + ShapeIndex 40183 + Model "warrior_soccer1_Germany.GR2" + SourceSkin "warrior_soccer1_Germany.dds" + TargetSkin "warrior_WC32.dds" + } + +} + +Group AttachingData +{ + AttachingDataCount 2 + + Group AttachingData00 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 1 + + SphereDataCount 1 + Group SphereData00 + { + Radius 40.000000 + Position 0.000000 0.000000 100.000000 + } + } + + Group AttachingData01 + { + AttachingDataType 1 + + isAttaching 0 + AttachingModelIndex 0 + AttachingBoneName "Bip01" + + CollisionType 3 + + SphereDataCount 1 + Group SphereData00 + { + Radius 70.000000 + Position 0.000000 0.000000 100.000000 + } + } +} diff --git a/uiscript/uiscript/936_createcharacterwindow.py b/uiscript/uiscript/936_createcharacterwindow.py new file mode 100644 index 0000000..6f29cda --- /dev/null +++ b/uiscript/uiscript/936_createcharacterwindow.py @@ -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", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/936_desc_assassin.txt b/uiscript/uiscript/936_desc_assassin.txt new file mode 100644 index 0000000..2296497 --- /dev/null +++ b/uiscript/uiscript/936_desc_assassin.txt @@ -0,0 +1,10 @@ +[DELAY value;10] +刺客是以短剑和弓箭为主的专业[ENTER] +杀手。高水准的刺客要经过残酷[ENTER] +的训练过程,所以其数量不是很[ENTER] +多,但是只要具备某种特定条件[ENTER] +,他们超强的战斗能力足可以扭[ENTER] +[WAIT] +转战争的进程,为了保证敏捷和[ENTER] +速度,所以只能使用轻便的防御[ENTER] +盔甲,这是他们唯一的弱点。[ENTER] diff --git a/uiscript/uiscript/936_desc_empire_a.txt b/uiscript/uiscript/936_desc_empire_a.txt new file mode 100644 index 0000000..8d893e2 --- /dev/null +++ b/uiscript/uiscript/936_desc_empire_a.txt @@ -0,0 +1,15 @@ +[DELAY value;10] +盛唐国[ENTER] +[ENTER] +繁荣的国度,有着辉煌的经济[ENTER] +文化成就。这里人们大都贤明[ENTER] +且具有很高的智力,在一个[ENTER] +[WAIT] +崇高而神圣的目标指引下,他[ENTER] +们团结在一起,相互配合,[ENTER] +亲密无间。他们都尊崇圣人之道[ENTER] +,严以律己,从不崇尚武力,但[ENTER] +这并不表示软弱。当他们热爱的[ENTER] +[WAIT] +家园受到威胁时,也会毫不犹豫的[ENTER] +给对手以致命的一击。[ENTER] diff --git a/uiscript/uiscript/936_desc_empire_b.txt b/uiscript/uiscript/936_desc_empire_b.txt new file mode 100644 index 0000000..4f5d43b --- /dev/null +++ b/uiscript/uiscript/936_desc_empire_b.txt @@ -0,0 +1,11 @@ +[DELAY value;10] +秦皇国[ENTER] +[ENTER] +极具野心的帝国,整个国家有着[ENTER] +森严的等级制度,由于多年战乱,[ENTER] +这里的军队都经常长期的训练,纪[ENTER] +[WAIT] +律严明,作战灵活,具有非同一[ENTER] +般的忍耐力,超强的凝聚力和战[ENTER] +斗力。[ENTER] + diff --git a/uiscript/uiscript/936_desc_empire_c.txt b/uiscript/uiscript/936_desc_empire_c.txt new file mode 100644 index 0000000..5208676 --- /dev/null +++ b/uiscript/uiscript/936_desc_empire_c.txt @@ -0,0 +1,12 @@ +[DELAY value;10] +汉武国[ENTER] +[ENTER] +一个历经百年强盛的国度,有[ENTER] +横扫八荒的野心。这里的人们[ENTER] +都勇决果敢、爱憎分明,有胆识、[ENTER] +[WAIT] +有魄力,在激情背后始终保持一颗[ENTER] +充满自信的心。他们注重自己的威[ENTER] +严,虽然有时会显得刚愎自用,[ENTER] +当这并不防碍他们成为万人敬[ENTER] +仰的英雄。[ENTER] diff --git a/uiscript/uiscript/936_desc_shaman.txt b/uiscript/uiscript/936_desc_shaman.txt new file mode 100644 index 0000000..916d6fe --- /dev/null +++ b/uiscript/uiscript/936_desc_shaman.txt @@ -0,0 +1,10 @@ +[DELAY value;10] +神女是领悟到自然流逝与阴阳照[ENTER] +化的美丽化身。她们利用自然的[ENTER] +力量发挥巨大的潜能,营造出绚[ENTER] +丽的仙术世界。同时拥有渊源的[ENTER] +知识,所以很想与别人沟通,[ENTER] +[WAIT] +但却很少有人能够见到她们真正[ENTER] +的化身。精通仙术的神女将成为[ENTER] +战场上至关重要的角色。 diff --git a/uiscript/uiscript/936_desc_sura.txt b/uiscript/uiscript/936_desc_sura.txt new file mode 100644 index 0000000..6e3e32c --- /dev/null +++ b/uiscript/uiscript/936_desc_sura.txt @@ -0,0 +1,9 @@ +[DELAY value;10] +修罗将恶魔的种子寄生在自己的[ENTER] +手臂上,用来吸取魔法力量。他[ENTER] +们与别人不同,更加不会相信别[ENTER] +人,所以使得周围没有亲近的朋[ENTER] +友。他们的目标只有一个,就是[ENTER] +[WAIT] +追求大陆上最强的力量,此外的[ENTER] +事物都将视为阻碍。[ENTER] diff --git a/uiscript/uiscript/936_desc_warrior.txt b/uiscript/uiscript/936_desc_warrior.txt new file mode 100644 index 0000000..5635c93 --- /dev/null +++ b/uiscript/uiscript/936_desc_warrior.txt @@ -0,0 +1,8 @@ +[DELAY value;10] +猛将拥有一把锋利的巨剑以及厚[ENTER] +实的盔甲,从游戏一开始就成为[ENTER] +关注的焦点,没有人敢蔑视他们[ENTER] +他们追求钢铁般的肌肉和净水般[ENTER] +宁静的精神世界。整个大陆上没[ENTER] +[WAIT] +有人能抵挡他们愤怒的脚步。[ENTER] diff --git a/uiscript/uiscript/936_loginwindow.py b/uiscript/uiscript/936_loginwindow.py new file mode 100644 index 0000000..0f775cf --- /dev/null +++ b/uiscript/uiscript/936_loginwindow.py @@ -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, + }, + + ), + + }, + + ), +} diff --git a/uiscript/uiscript/936_selectcharacterwindow.py b/uiscript/uiscript/936_selectcharacterwindow.py new file mode 100644 index 0000000..6112c3a --- /dev/null +++ b/uiscript/uiscript/936_selectcharacterwindow.py @@ -0,0 +1,580 @@ +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 * (220) / 600 + +BOARD_ITEM_ADD_POSITION = -40 + +window = { + "name" : "SelectCharacterWindow", + + "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, + }, + + ## 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", + }, + + ## 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" : 363 + BOARD_ITEM_ADD_POSITION, + + "children" : + ( + + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + + { + "name" : "EmpireNameSlot", + "type" : "image", + + "x" : 100, + "y" : 12, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "EmpireName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_EMPIRE_NAME, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "GuildNameSlot", + "type" : "image", + + "x" : 100, + "y" : 33, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "GuildName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_NO_GUILD, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "character_name", + "type" : "text", + + "x" : 17, + "y" : 124 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_NAME, + + "children" : + ( + { + "name" : "character_name_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_name_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_level", + "type" : "text", + + "x" : 17, + "y" : 50 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_LEVEL, + + "children" : + ( + { + "name" : "character_level_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_level_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_play_time", + "type" : "text", + + "x" : 17, + "y" : 76 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_TITLE, + + "children" : + ( + { + "name" : "character_play_time_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_play_time_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_hth", + "type" : "text", + + "x" : 17, + "y" : 102 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_HP, + + "children" : + ( + { + "name" : "gauge_hth", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "red", + }, + { + "name" : "character_hth_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_hth_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_int", + "type" : "text", + + "x" : 17, + "y" : 128 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SP, + + "children" : + ( + { + "name" : "gauge_int", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "pink", + }, + { + "name" : "character_int_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_int_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_str", + "type" : "text", + + "x" : 17, + "y" : 154 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_ATT_GRADE, + + "children" : + ( + { + "name" : "gauge_str", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "purple", + }, + { + "name" : "character_str_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_str_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_dex", + "type" : "text", + + "x" : 17, + "y" : 180 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DEX_GRADE, + + "children" : + ( + { + "name" : "gauge_dex", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "blue", + }, + { + "name" : "character_dex_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_dex_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + + ## Buttons + { + "name" : "start_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SELECT, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "create_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_CREATE, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_EXIT, + + "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" : "delete_button", + "type" : "button", + + "x" : 14, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DELETE, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (450 - 22*3) / 800, + "y" : SCREEN_HEIGHT * (505) / 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 * (580 - 22) / 800, + "y" : SCREEN_HEIGHT * (505) / 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", + }, + + ), +} diff --git a/uiscript/uiscript/936_selectempirewindow.py b/uiscript/uiscript/936_selectempirewindow.py new file mode 100644 index 0000000..f431092 --- /dev/null +++ b/uiscript/uiscript/936_selectempirewindow.py @@ -0,0 +1,362 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +LOCALE_PATH = "d:/ymir work/ui/intro/"+uiScriptLocale.CODEPAGE+"_empire/" + +ATALS_X = SCREEN_WIDTH * (282) / 800 +ATALS_Y = SCREEN_HEIGHT * (170) / 600 + +window = { + "name" : "SelectCharacterWindow", + + "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/select/background_alpha.sub", + + "x_scale" : float(SCREEN_WIDTH) / 100.0, + "y_scale" : float(SCREEN_HEIGHT) / 69.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), + }, + + ## Title + { + "name" : "Title", + "type" : "expanded_image", + + "x" : SCREEN_WIDTH * (410 - 346/2) / 800, + "y" : SCREEN_HEIGHT * (114 - 136/2) / 600, + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + + "image" : LOCALE_PATH+"title.sub" + }, + + ## Atlas + { + "name" : "Atlas", + "type" : "image", + + "x" : ATALS_X, + "y" : ATALS_Y, + + "image" : "d:/ymir work/ui/intro/empire/atlas.sub", + + "children" : + ( + ## Empire Image + { + "name" : "EmpireArea_A", + "type" : "expanded_image", + + "x" : 43, + "y" : 201, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_a.sub" + }, + { + "name" : "EmpireArea_B", + "type" : "expanded_image", + + "x" : 17, + "y" : 16, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_b.sub" + }, + { + "name" : "EmpireArea_C", + "type" : "expanded_image", + + "x" : 314, + "y" : 33, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_c.sub" + }, + + ## Empire Flag + { + "name" : "EmpireAreaFlag_A", + "type" : "expanded_image", + + "x" : 167, + "y" : 235, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_a.sub" + }, + { + "name" : "EmpireAreaFlag_B", + "type" : "expanded_image", + + "x" : 70, + "y" : 42, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_b.sub" + }, + { + "name" : "EmpireAreaFlag_C", + "type" : "expanded_image", + + "x" : 357, + "y" : 78, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_c.sub" + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : ATALS_X + 80, + "y" : ATALS_Y + 340, + + "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" : ATALS_X + 160 + 110, + "y" : ATALS_Y + 340, + + "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", + }, + + ## Character Board + { + "name" : "empire_board", + "type" : "thinboard", + + "x" : SCREEN_WIDTH * (40) / 800, + "y" : SCREEN_HEIGHT * (211) / 600, + + "width" : 208, + "height" : 314, + + "children" : + ( + ## Bar + { + "name" : "flag_board", + "type" : "bar", + + "x" : 24, + "y" : 17, + "width" : 159, + "height" : 119, + + "children" : + ( + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + ), + + }, + { + "name" : "text_board", + "type" : "bar", + + "x" : 10, + "y" : 146, + + "width" : 189, + "height" : 122, + + "children" : + ( + { + "name" : "prev_text_button", + "type" : "button", + + "x" : 95, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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_text_button", + "type" : "button", + + "x" : 140, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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, + }, + ), + }, + + ## Buttons + { + "name" : "select_button", + "type" : "button", + + "x" : 14, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_SELECT, + + "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" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_EXIT, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/949_createcharacterwindow.py b/uiscript/uiscript/949_createcharacterwindow.py new file mode 100644 index 0000000..a7533ed --- /dev/null +++ b/uiscript/uiscript/949_createcharacterwindow.py @@ -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) / 800, + "y" : SCREEN_HEIGHT * (510) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (570) / 800, + "y" : SCREEN_HEIGHT * (510) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/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", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/949_desc_assassin.txt b/uiscript/uiscript/949_desc_assassin.txt new file mode 100644 index 0000000..c6163c2 --- /dev/null +++ b/uiscript/uiscript/949_desc_assassin.txt @@ -0,0 +1,16 @@ +[DELAY value;10] +磊按篮 窜八苞 劝阑 林公扁肺[ENTER] +窍绰 傈巩利牢 鞠混磊 涝聪促.[ENTER] +捞甸篮 老沥 荐霖俊 档崔窍扁[ENTER] +鳖瘤狼 啊趣茄 绕访苞沥 傣盒[ENTER] +俊 措氟 傈眉俊 弊府 腹瘤绰[ENTER] +[WAIT] +臼瘤父, 漂沥茄 炼扒父 爱眠绢[ENTER] +柳促搁 傈厘狼 儒抚阑 第官层[ENTER] +初阑 荐 乐阑 沥档狼 颇鲍仿阑[ENTER] +啊笼聪促. 刮酶窃苞 加档甫[ENTER] +蜡瘤窍扁 困秦 啊涵款 规绢备[ENTER] +[WAIT] +父阑 馒侩 茄促绰 巴捞 绢痘霸[ENTER] +焊搁 捞甸狼 蜡老茄 距痢[ENTER] +涝聪促. diff --git a/uiscript/uiscript/949_desc_empire_a.txt b/uiscript/uiscript/949_desc_empire_a.txt new file mode 100644 index 0000000..dcae77e --- /dev/null +++ b/uiscript/uiscript/949_desc_empire_a.txt @@ -0,0 +1,27 @@ +[DELAY value;10] +脚荐惫[ENTER] +[ENTER] +悼规苞狼 背开狼 何劝阑 捞风[ENTER] +妨绰 芭措 惑诀惫啊. 力惫狼[ENTER] +盒凯 捞饶 规摹登促矫乔 茄[ENTER] +[WAIT] +辑率狼 堡具 瘤开阑 辟夯栏肺[ENTER] +茄 惑牢甸捞 扒汲茄 惫啊捞促.[ENTER] +林肺 辑开苞狼 公开 烹肺肺[ENTER] +荤侩登带 瘤开捞瘤父 己付籍[ENTER] +(Metin Stone)狼 免泅 捞饶[ENTER] +[WAIT] +公开肺啊 瞒窜凳栏肺 牢秦 啊厘[ENTER] +弧府 己付籍狼 困蛆阑 柄崔疽带[ENTER] +捞甸捞扁档 窍促. 积诀阑 困蛆[ENTER] +寸茄 捞甸篮 弊甸捞 啊柳 葛电[ENTER] +犁魂阑 贸盒秦 备 力惫 傈眉俊辑[ENTER] +[WAIT] +傈荤甸阑 葛酒 甸咯 辑率俊辑狼[ENTER] +困蛆阑 规厚 窍妨绊 霖厚 吝俊[ENTER] +乐促. 捞甸捞 盔窍绰 巴篮[ENTER] +烹老等 窍唱狼 惫啊狼 塞栏肺[ENTER] +乐阑瘤档 葛福绰 辑开俊辑狼[ENTER] +[WAIT] +魔傍阑 阜酒郴绊 促矫 公开肺甫[ENTER] +俺么窍绰 巴捞促. diff --git a/uiscript/uiscript/949_desc_empire_b.txt b/uiscript/uiscript/949_desc_empire_b.txt new file mode 100644 index 0000000..5f88c54 --- /dev/null +++ b/uiscript/uiscript/949_desc_empire_b.txt @@ -0,0 +1,24 @@ +[DELAY value;10] +玫炼惫[ENTER] +[ENTER] +己付籍狼 儡幅荤充狼 粮犁甫[ENTER] +何福垄栏哥 捞甫 力芭窍妨绰[ENTER] +己辆背惫啊. 炔力狼 荤锰悼积[ENTER] +[WAIT] +例档荤 辣康俊 狼秦 技况柳[ENTER] +辑规狼 惫啊捞促. 林贱苞 痢俊[ENTER] +瓷茄 酒郴甫 烹秦 己付籍(Metin[ENTER] +Stone)狼 困氰阑 流立利栏肺[ENTER] +柄摧绊 弊俊 措茄 措厚氓阑[ENTER] +[WAIT] +技匡 巴阑 咯矾 瞒肥俊 吧媚[ENTER] +扒狼窍看瘤父 捞甫 公矫寸窍绊[ENTER] +老练阑 捞缠绊 力惫俊 措秦[ENTER] +馆扁甫 甸菌促. 泅犁 柳畴惫苞[ENTER] +坷罚 趋傈阑 芭奠窍绊 乐栏哥[ENTER] +[WAIT] +捞甸狼 格利篮 窜瘤 窍唱, 傈[ENTER] +措氟阑 烹老秦 辑率俊辑何磐[ENTER] +炼陛究 魔侥秦 甸绢 坷绰 己付[ENTER] +籍狼 塞阑 瞒窜 窍绰 巴捞促.[ENTER] + diff --git a/uiscript/uiscript/949_desc_empire_c.txt b/uiscript/uiscript/949_desc_empire_c.txt new file mode 100644 index 0000000..91519b2 --- /dev/null +++ b/uiscript/uiscript/949_desc_empire_c.txt @@ -0,0 +1,27 @@ +[DELAY value;10] +柳畴惫[ENTER] +[ENTER] +备 力惫狼 何劝阑 厕操哥 沥烹[ENTER] +己阑 林厘窍绰 焙荤措惫. 炔力[ENTER] +狼 利磊牢 捞涪捞 捞缠绊 乐绰[ENTER] +[WAIT] +夯惫捞促. 合规俊 困摹窍绊[ENTER] +乐扁 锭巩俊 脚荐惫俊 厚秦[ENTER] +趣刀茄 磊楷券版阑 啊瘤绊[ENTER] +乐栏哥 弊 锭巩牢瘤 惑寸洒[ENTER] +傍拜利捞绊 菩档利牢 巩拳甫[ENTER] +蜡瘤窍绊 乐促. 脚荐惫阑[ENTER] +[WAIT] +扒汲茄 辣康狼 己付籍俊 措茄[ENTER] +林厘俊 措秦辑绰 肯傈洒 公矫[ENTER] +窍绰淀茄 措寇利牢 怕档甫[ENTER] +秒窍绊 乐瘤父 捞固 炔角狼[ENTER] +泅磊甸阑 悼盔秦 弊俊 措茄[ENTER] +[WAIT] +磊技茄 炼荤俊 馒荐秦 乐绰 淀[ENTER] +窍促. 捞甸捞 钎搁利栏肺 己付[ENTER] +籍俊 措秦 公包缴茄 巴篮[ENTER] +盒凯等 力惫阑 促矫 烹老窍扁[ENTER] +困茄 捞涪狼 具噶捞 官帕俊[ENTER] +[WAIT] +彬妨乐扁 锭巩捞促.[ENTER] diff --git a/uiscript/uiscript/949_desc_shaman.txt b/uiscript/uiscript/949_desc_shaman.txt new file mode 100644 index 0000000..ebc02ee --- /dev/null +++ b/uiscript/uiscript/949_desc_shaman.txt @@ -0,0 +1,17 @@ +[DELAY value;10] +公寸篮 磊楷苞 澜剧狼 塞狼[ENTER] +儒抚苞 炼拳甫 柄崔篮 泅磊甸[ENTER] +涝聪促. 弊甸篮 捞矾茄 过蘑阑[ENTER] +漂沥茄 概俺眉甫 烹秦 备眉拳[ENTER] +矫懦 荐 乐绰 规过 肚茄 舅绊[ENTER] +[WAIT] +乐嚼聪促. 捞矾茄 弊甸父狼[ENTER] +概俺眉甫 老馆 荤恩甸篮 何利,[ENTER] +趣篮 柳过捞扼绊 何辅聪促.[ENTER] +呈公唱 规措茄 瘤侥阑 啊瘤绊[ENTER] +乐扁 锭巩俊 谗烙绝捞 促弗[ENTER] +[WAIT] +荤恩苞 措拳 窍扁甫 盔窍瘤父,[ENTER] +弊甸狼 缴坷窍绊 抄秦茄 捞具[ENTER] +扁甸绢临 荤恩甸篮 弊府 腹瘤[ENTER] +臼嚼聪促. diff --git a/uiscript/uiscript/949_desc_sura.txt b/uiscript/uiscript/949_desc_sura.txt new file mode 100644 index 0000000..69d5abd --- /dev/null +++ b/uiscript/uiscript/949_desc_sura.txt @@ -0,0 +1,17 @@ +[DELAY value;10] +荐扼绰 磊脚狼 迫俊 厩付狼[ENTER] +揪狙阑 扁积矫难 付过狼 塞阑[ENTER] +软荐茄 傈荤 涝聪促.[ENTER] +捞甸篮 促弗 磊甸苞绰 崔府 林[ENTER] +函俊 啊鳖款 牢埃包拌甫 屈己[ENTER] +[WAIT] +窍瘤 臼绰 漂隆捞 乐嚼聪促.[ENTER] +捞甸狼 格钎绰 瘤惑 弥碍狼 塞[ENTER] +阑 爱眠绰 巴捞哥, 弊 寇狼 巴[ENTER] +甸篮 窜瘤 芭眠厘胶矾款 规秦[ENTER] +拱捞扼绊 积阿 钦聪促.[ENTER] +[WAIT] +磊脚狼 塞阑 苞矫窍绰 巴 炼瞒[ENTER] +阂鞘夸窍促绊 咯辨 沥档肺 弊[ENTER] +甸篮 坷流 鉴荐茄 塞 磊眉父[ENTER] +哎噶 钦聪促. diff --git a/uiscript/uiscript/949_desc_warrior.txt b/uiscript/uiscript/949_desc_warrior.txt new file mode 100644 index 0000000..fd9b590 --- /dev/null +++ b/uiscript/uiscript/949_desc_warrior.txt @@ -0,0 +1,17 @@ +[DELAY value;10] +公荤绰 茄 磊风 八苞 瓢瓢茄[ENTER] +癌渴栏肺 公厘窍绊 贸澜何磐[ENTER] +场鳖瘤 傈厘狼 林开栏肺 劝距[ENTER] +钦聪促. 儡犁林客 荤恩阑 泅趣[ENTER] +矫虐绰 荐窜阑 版戈窍哥 坷流[ENTER] +[WAIT] +碍枚鞍捞 荐访等 磊脚狼 辟腊[ENTER] +苞 讣篮 拱贸烦 绊夸茄 沥脚[ENTER] +技拌 父阑 眠备 钦聪促.[ENTER] +盒畴茄 捞甸阑 阜阑 荐 乐绰[ENTER] +磊甸篮 措氟 傈眉俊 粮犁 窍瘤[ENTER] +[WAIT] +臼绰 促绊 积阿 窍绰 巴捞[ENTER] +壳阑 巴 涝聪促. + + diff --git a/uiscript/uiscript/949_loginwindow.py b/uiscript/uiscript/949_loginwindow.py new file mode 100644 index 0000000..86ccae0 --- /dev/null +++ b/uiscript/uiscript/949_loginwindow.py @@ -0,0 +1,363 @@ +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", + }, + + ## Logo + { + "name" : "Metin2_Logo_1", + "type" : "expanded_image", + + "x" : float(SCREEN_WIDTH) / 27, + "y" : float(SCREEN_HEIGHT) / 8, + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + + "image" : "d:/ymir work/ui/intro/login/metin2_logo_1.sub", + }, + { + "name" : "Metin2_Logo_2", + "type" : "expanded_image", + + "x" : float(SCREEN_WIDTH) / 27 + float(429 - 27) / 800 * SCREEN_WIDTH, + "y" : float(SCREEN_HEIGHT) / 8, + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + + "image" : "d:/ymir work/ui/intro/login/metin2_logo_2.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" : 15, + "y" : 0, + "vertical_align" : "center", + "text_vertical_align" : "center", + + "text" : uiScriptLocale.LOGIN_DEFAULT_SERVERADDR, + }, + { + "name" : "SelectConnectButton", + "type" : "button", + + "x" : 150, + "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, + }, + ), + }, + + ## 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, + }, + + ), + + }, + + ), +} diff --git a/uiscript/uiscript/949_selectcharacterwindow.py b/uiscript/uiscript/949_selectcharacterwindow.py new file mode 100644 index 0000000..48f7a37 --- /dev/null +++ b/uiscript/uiscript/949_selectcharacterwindow.py @@ -0,0 +1,580 @@ +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 * (220) / 600 + +BOARD_ITEM_ADD_POSITION = -40 + +window = { + "name" : "SelectCharacterWindow", + + "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, + }, + + ## 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", + }, + + ## 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" : 363 + BOARD_ITEM_ADD_POSITION, + + "children" : + ( + + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + + { + "name" : "EmpireNameSlot", + "type" : "image", + + "x" : 100, + "y" : 12, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "EmpireName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_EMPIRE_NAME, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "GuildNameSlot", + "type" : "image", + + "x" : 100, + "y" : 33, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "GuildName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_NO_GUILD, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "character_name", + "type" : "text", + + "x" : 17, + "y" : 124 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_NAME, + + "children" : + ( + { + "name" : "character_name_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_name_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_level", + "type" : "text", + + "x" : 17, + "y" : 50 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_LEVEL, + + "children" : + ( + { + "name" : "character_level_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_level_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_play_time", + "type" : "text", + + "x" : 17, + "y" : 76 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_PLAYTIME, + + "children" : + ( + { + "name" : "character_play_time_slot", + "type" : "image", + + "x" : 83, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + }, + { + "name" : "character_play_time_value", + "type" : "text", + + "x" : 83 + 91/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_hth", + "type" : "text", + + "x" : 17, + "y" : 102 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_HP, + + "children" : + ( + { + "name" : "gauge_hth", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "red", + }, + { + "name" : "character_hth_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_hth_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_int", + "type" : "text", + + "x" : 17, + "y" : 128 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SP, + + "children" : + ( + { + "name" : "gauge_int", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "pink", + }, + { + "name" : "character_int_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_int_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_str", + "type" : "text", + + "x" : 17, + "y" : 154 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_ATT_GRADE, + + "children" : + ( + { + "name" : "gauge_str", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "purple", + }, + { + "name" : "character_str_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_str_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_dex", + "type" : "text", + + "x" : 17, + "y" : 180 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DEX_GRADE, + + "children" : + ( + { + "name" : "gauge_dex", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "blue", + }, + { + "name" : "character_dex_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_dex_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + + ## Buttons + { + "name" : "start_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SELECT, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "create_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_CREATE, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_EXIT, + + "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" : "delete_button", + "type" : "button", + + "x" : 14, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DELETE, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (450) / 800, + "y" : SCREEN_HEIGHT * (505) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (580) / 800, + "y" : SCREEN_HEIGHT * (505) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/right_button_03.sub", + }, + + ), +} diff --git a/uiscript/uiscript/949_selectempirewindow.py b/uiscript/uiscript/949_selectempirewindow.py new file mode 100644 index 0000000..5daf7c3 --- /dev/null +++ b/uiscript/uiscript/949_selectempirewindow.py @@ -0,0 +1,362 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +LOCALE_PATH = "d:/ymir work/ui/intro/"+uiScriptLocale.CODEPAGE+"_empire/" + +ATALS_X = SCREEN_WIDTH * (282) / 800 +ATALS_Y = SCREEN_HEIGHT * (170) / 600 + +window = { + "name" : "SelectCharacterWindow", + + "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/select/background_alpha.sub", + + "x_scale" : float(SCREEN_WIDTH) / 100.0, + "y_scale" : float(SCREEN_HEIGHT) / 69.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), + }, + + ## Title + { + "name" : "Title", + "type" : "expanded_image", + + "x" : SCREEN_WIDTH * (410 - 346/2) / 800, + "y" : SCREEN_HEIGHT * (114 - 136/2) / 600, + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + + "image" : LOCALE_PATH+"title.sub" + }, + + ## Atlas + { + "name" : "Atlas", + "type" : "image", + + "x" : ATALS_X, + "y" : ATALS_Y, + + "image" : "d:/ymir work/ui/intro/empire/atlas.sub", + + "children" : + ( + ## Empire Image + { + "name" : "EmpireArea_A", + "type" : "expanded_image", + + "x" : 43, + "y" : 201, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_a.sub" + }, + { + "name" : "EmpireArea_B", + "type" : "expanded_image", + + "x" : 17, + "y" : 16, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_b.sub" + }, + { + "name" : "EmpireArea_C", + "type" : "expanded_image", + + "x" : 314, + "y" : 33, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_c.sub" + }, + + ## Empire Flag + { + "name" : "EmpireAreaFlag_A", + "type" : "expanded_image", + + "x" : 167, + "y" : 235, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_a.sub" + }, + { + "name" : "EmpireAreaFlag_B", + "type" : "expanded_image", + + "x" : 70, + "y" : 42, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_b.sub" + }, + { + "name" : "EmpireAreaFlag_C", + "type" : "expanded_image", + + "x" : 357, + "y" : 78, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_c.sub" + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : ATALS_X + 160, + "y" : ATALS_Y + 340, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : ATALS_X + 160 + 130, + "y" : ATALS_Y + 340, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/right_button_03.sub", + }, + + ## Character Board + { + "name" : "empire_board", + "type" : "thinboard", + + "x" : SCREEN_WIDTH * (40) / 800, + "y" : SCREEN_HEIGHT * (211) / 600, + + "width" : 208, + "height" : 314, + + "children" : + ( + ## Bar + { + "name" : "flag_board", + "type" : "bar", + + "x" : 24, + "y" : 17, + "width" : 159, + "height" : 119, + + "children" : + ( + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + ), + + }, + { + "name" : "text_board", + "type" : "bar", + + "x" : 10, + "y" : 146, + + "width" : 189, + "height" : 122, + + "children" : + ( + { + "name" : "prev_text_button", + "type" : "button", + + "x" : 95, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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_text_button", + "type" : "button", + + "x" : 140, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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, + }, + ), + }, + + ## Buttons + { + "name" : "select_button", + "type" : "button", + + "x" : 14, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_SELECT, + + "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" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_EXIT, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/acceptguildwardialog.py b/uiscript/uiscript/acceptguildwardialog.py new file mode 100644 index 0000000..7776693 --- /dev/null +++ b/uiscript/uiscript/acceptguildwardialog.py @@ -0,0 +1,144 @@ +import uiScriptLocale + +window = { + "name" : "InputDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 230, + "height" : 130, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 230, + "height" : 130, + + "title" : uiScriptLocale.GUILD_WAR_ACCEPT, + + "children" : + ( + ## Input Slot + { + "name" : "InputName", + "type" : "text", + + "x" : 15, + "y" : 40, + + "text" : uiScriptLocale.GUILD_WAR_ENEMY, + }, + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 80, + "y" : 37, + "width" : 130, + "height" : 18, + + "children" : + ( + { + "name" : "InputValue", + "type" : "text", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + }, + ), + }, + ## Input Slot + { + "name" : "GameType", "x" : 15, "y" : 65, "width" : 65+45*4, "height" : 20, + + "children" : + ( + {"name" : "GameTypeLabel", "type" : "text", "x" : 0, "y" : 3, "text" : uiScriptLocale.GUILD_WAR_BATTLE_TYPE,}, + { + "name" : "NormalButton", + "type" : "radio_button", + + "x" : 65, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_NORMAL, + + "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", + }, + { + "name" : "WarpButton", + "type" : "radio_button", + + "x" : 65+45*1, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_WARP, + + "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", + }, + { + "name" : "CTFButton", + "type" : "radio_button", + + "x" : 65+45*2, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_CTF, + + "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", + }, + ), + }, + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 95, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 95, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/atlaswindow.py b/uiscript/uiscript/atlaswindow.py new file mode 100644 index 0000000..6adef44 --- /dev/null +++ b/uiscript/uiscript/atlaswindow.py @@ -0,0 +1,31 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/minimap/" + +window = { + "name" : "AtlasWindow", + "style" : ("movable", "float",), + + "x" : SCREEN_WIDTH - 136 - 256 - 10, + "y" : 0, + + "width" : 256 + 15, + "height" : 256 + 38, + + "children" : + ( + ## BOARD + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 256 + 15, + "height" : 256 + 38, + + "title" : uiScriptLocale.ZONE_MAP, + }, + ), +} diff --git a/uiscript/uiscript/attachstonedialog.py b/uiscript/uiscript/attachstonedialog.py new file mode 100644 index 0000000..1b6d871 --- /dev/null +++ b/uiscript/uiscript/attachstonedialog.py @@ -0,0 +1,124 @@ +import uiScriptLocale + +window = { + "name" : "AttachStoneDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 0, + "height" : 0, + + "children" : + ( + { + "name" : "Board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 0, + "height" : 0, + "children" : + ( + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 0, + "color" : "red", + + "children" : + ( + { + "name" : "TitleName", + "type" : "text", + "text" : uiScriptLocale.ATTACH_METIN_TITLE, + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 3, + }, + ), + }, + { + "name" : "AttachMetinArrow", + "type" : "image", + "x" : 0, + "y" : -33, + "horizontal_align" : "center", + "vertical_align" : "center", + "image" : "d:/ymir work/ui/game/windows/attach_metin_arrow.sub", + }, + { + "name" : "MetinSlot", + "type" : "image", + "x" : 0, + "y" : 5, + "horizontal_align" : "center", + "vertical_align" : "center", + "image" : "d:/ymir work/ui/game/windows/metin_slot_silver.sub", + + "children" : + ( + { + "name" : "MetinImage", + "type" : "image", + "x" : 1, + "y" : 1, + "horizontal_align" : "center", + "image" : "d:/ymir work/ui/game/windows/metin_slot_silver.sub", + }, + ), + }, + { + "name" : "Question", + "type" : "text", + "text" : uiScriptLocale.ATTACH_METIN_INFO, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 54, + }, + { + "name" : "AcceptButton", + "type" : "button", + + "x" : -35, + "y" : 35, + + "text" : uiScriptLocale.YES, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "default_image" : "d:/ymir work/ui/public/Middle_Button_01.sub", + "over_image" : "d:/ymir work/ui/public/Middle_Button_02.sub", + "down_image" : "d:/ymir work/ui/public/Middle_Button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 35, + "y" : 35, + + "text" : uiScriptLocale.NO, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "default_image" : "d:/ymir work/ui/public/Middle_Button_01.sub", + "over_image" : "d:/ymir work/ui/public/Middle_Button_02.sub", + "down_image" : "d:/ymir work/ui/public/Middle_Button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/auctionwindow.py b/uiscript/uiscript/auctionwindow.py new file mode 100644 index 0000000..4b1d088 --- /dev/null +++ b/uiscript/uiscript/auctionwindow.py @@ -0,0 +1,117 @@ +ROOT_PATH = "d:/ymir work/ui/game/guild/" + +window = { + "name" : "AuctionWindow", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 370, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 370, + + "title" : "概概 殿废", + + "children" : + ( + ## Tab Area + { + "name" : "TabControl", + "type" : "window", + + "x" : 0, + "y" : 37, + "vertical_align" : "bottom", + + "width" : 376, + "height" : 37, + + "children" : + ( + ## Tab + { + "name" : "Tab_01", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : ROOT_PATH+"tab_1.sub", + }, + { + "name" : "Tab_02", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : ROOT_PATH+"tab_2.sub", + }, + { + "name" : "Tab_03", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : ROOT_PATH+"tab_3.sub", + }, + ## RadioButton + { + "name" : "Tab_Button_01", + "type" : "radio_button", + + "x" : 6, + "y" : 5, + + "width" : 53, + "height" : 27, + }, + { + "name" : "Tab_Button_02", + "type" : "radio_button", + + "x" : 61, + "y" : 5, + + "width" : 67, + "height" : 27, + }, + { + "name" : "Tab_Button_03", + "type" : "radio_button", + + "x" : 130, + "y" : 5, + + "width" : 60, + "height" : 27, + }, + ), + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/auctionwindow_listpage.py b/uiscript/uiscript/auctionwindow_listpage.py new file mode 100644 index 0000000..b6a638c --- /dev/null +++ b/uiscript/uiscript/auctionwindow_listpage.py @@ -0,0 +1,121 @@ +SEARCHING_AREA_X_POS = 15 +SEARCHING_AREA_Y_POS = 235 + +window = { + "name" : "AuctionWindow_RegisterPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + { + "name" : "NumberPrint", + "type" : "text", + "x" : 18, + "y" : 7, + "text" : "锅龋", + }, + { + "name" : "NamePrint", + "type" : "text", + "x" : 79, + "y" : 7, + "text" : "酒捞袍 捞抚", + }, + { + "name" : "NamePrint", + "type" : "text", + "x" : 228, + "y" : 7, + "text" : "啊拜", + }, + + { + "name" : "ItemSearchAreaBar", + "type" : "horizontalbar", + + "x" : 0, + "y" : 235, + "width" : 330, + "horizontal_align" : "center", + "children" : + ( + + { + "name" : "ItemSearchAreaBarPrint", + "type" : "text", + "x" : 0, + "y" : 0, + "text" : "酒捞袍 八祸窍扁", + "all_align" : "center", + }, + + ), + }, + + { + "name" : "SearchingNamePrint", + "type" : "text", + "x" : SEARCHING_AREA_X_POS + 5, + "y" : SEARCHING_AREA_Y_POS + 24, + "text" : "酒捞袍捞抚", + }, + { + "name" : "SearchingNameSlot", + "type" : "image", + "x" : SEARCHING_AREA_X_POS + 68, + "y" : SEARCHING_AREA_Y_POS + 22, + "image" : "d:/ymir work/ui/public/Parameter_Slot_04.sub", + }, + + { + "name" : "SearchingIDPrint", + "type" : "text", + "x" : SEARCHING_AREA_X_POS + 5, + "y" : SEARCHING_AREA_Y_POS + 44, + "text" : "锅龋肺茫扁", + }, + { + "name" : "SearchingIDSlot", + "type" : "image", + "x" : SEARCHING_AREA_X_POS + 68, + "y" : SEARCHING_AREA_Y_POS + 42, + "image" : "d:/ymir work/ui/public/Parameter_Slot_04.sub", + }, + + { + "name" : "SearchingIDPrint", + "type" : "text", + "x" : SEARCHING_AREA_X_POS + 205, + "y" : SEARCHING_AREA_Y_POS + 24, + "text" : "家南咯何", + }, + + { + "name" : "SearchingButtonByName", + "type" : "button", + "x" : SEARCHING_AREA_X_POS + 295, + "y" : SEARCHING_AREA_Y_POS + 20, + "text" : "茫扁", + "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", + }, + { + "name" : "SearchingButtonByID", + "type" : "button", + "x" : SEARCHING_AREA_X_POS + 295, + "y" : SEARCHING_AREA_Y_POS + 40, + "text" : "茫扁", + "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", + }, + + ), +} diff --git a/uiscript/uiscript/auctionwindow_registerpage.py b/uiscript/uiscript/auctionwindow_registerpage.py new file mode 100644 index 0000000..3389a7d --- /dev/null +++ b/uiscript/uiscript/auctionwindow_registerpage.py @@ -0,0 +1,134 @@ +window = { + "name" : "AuctionWindow_RegisterPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + { + "name" : "ItemSlot", + "type" : "slotbar", + "x" : 0, + "y" : 30, + "width" : 97, + "height" : 97, + "horizontal_align" : "center", + "text_horizontal_align" : "center", + + "children" : + ( + { + "name" : "TemporaryImage", + "type" : "image", + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + "image" : "d:/ymir work/ui/items/weapon/03100.sub", + }, + ), + + }, + + { + "name" : "ItemName", + "type" : "text", + "x" : 0, + "y" : 150, + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text" : "酒捞袍阑 捞镑俊 靛贰弊窍咯 持绢林技夸", + }, + + { + "name" : "LowerSellingPriceName", + "type" : "text", + "x" : 70, + "y" : 185, + "text" : "概概 弥历啊", + }, + { + "name" : "LowerSellingPriceSlot", + "type" : "image", + "x" : 150, + "y" : 185 - 3, + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + "children" : + ( + { + "name" : "LowerSellingPriceValue", + "type" : "text", + "x" : 0, + "y" : 0, + "all_align" : "center", + "text" : "123456789123456789", + }, + ), + }, + + { + "name" : "AverageSellingPriceName", + "type" : "text", + "x" : 70, + "y" : 205, + "text" : "概概 乞闭啊", + }, + { + "name" : "AverageSellingPriceSlot", + "type" : "image", + "x" : 150, + "y" : 205 - 3, + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + "children" : + ( + { + "name" : "AverageSellingPriceValue", + "type" : "text", + "x" : 0, + "y" : 0, + "all_align" : "center", + "text" : "123456789123456789", + }, + ), + }, + + { + "name" : "InputPriceSlot", + "type" : "image", + "x" : 90, + "y" : 250 - 3, + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + "children" : + ( + { + "name" : "InputPriceValue", + "type" : "text", + "x" : 0, + "y" : 1, + "all_align" : "center", + "text" : "123456789123456789", + }, + ), + }, + + { + "name" : "RegisterButton", + "type" : "button", + + "x" : 230, + "y" : 250 - 3, + + "text" : "殿废", + + "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", + }, + + ), +} diff --git a/uiscript/uiscript/auctionwindow_uniqueauctionpage.py b/uiscript/uiscript/auctionwindow_uniqueauctionpage.py new file mode 100644 index 0000000..a54fcdc --- /dev/null +++ b/uiscript/uiscript/auctionwindow_uniqueauctionpage.py @@ -0,0 +1,9 @@ +window = { + "name" : "AuctionWindow_UniqueAuctionPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, +} diff --git a/uiscript/uiscript/beltinventorywindow.py b/uiscript/uiscript/beltinventorywindow.py new file mode 100644 index 0000000..629c0c6 --- /dev/null +++ b/uiscript/uiscript/beltinventorywindow.py @@ -0,0 +1,104 @@ +import uiScriptLocale +import item + +EQUIPMENT_START_INDEX = 90 + +window = { + "name" : "BeltInventoryWindow", + + ## 600 - (width + 坷弗率栏肺 何磐 剁快扁 24 px) + "x" : SCREEN_WIDTH - 176 - 148, + "y" : SCREEN_HEIGHT - 37 - 565 + 209 + 32, +# "x" : -148, +# "y" : 241, + "width" : 148, + "height" : 139, + + "type" : "image", + "image" : "d:/ymir work/ui/game/belt_inventory/bg.tga", + + + "children" : + ( + ## Expand Buttons + { + "name" : "ExpandBtn", + "type" : "button", + + "x" : 2, + "y" : 15, + + "default_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_normal.tga", + "over_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_over.tga", + "down_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_down.tga", + "disable_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_disabled.tga", + }, + + + ## Belt Inventory Layer (include minimize button) + { + "name" : "BeltInventoryLayer", +# "type" : "board", +# "style" : ("attach", "float"), + + "x" : 5, + "y" : 0, + + "width" : 148, + "height" : 139, + + "children" : + ( + ## Minimize Button + { + "name" : "MinimizeBtn", + "type" : "button", + + "x" : 2, + "y" : 15, + + "width" : 10, + + "default_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_normal.tga", + "over_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_over.tga", + "down_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_down.tga", + "disable_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_disabled.tga", + }, + + ## Real Belt Inventory Board + { + "name" : "BeltInventoryBoard", + "type" : "board", + "style" : ("attach", "float"), + + "x" : 10, + "y" : 0, + + "width" : 138, + "height" : 139, + + "children" : + ( + ## Belt Inventory Slots + { + "name" : "BeltInventorySlot", + "type" : "grid_table", + + "x" : 5, + "y" : 5, + + "start_index" : item.BELT_INVENTORY_SLOT_START, + "x_count" : 4, + "y_count" : 4, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + ), + }, + ) + }, + + ), +} diff --git a/uiscript/uiscript/buildguildbuildingwindow.py b/uiscript/uiscript/buildguildbuildingwindow.py new file mode 100644 index 0000000..04e7957 --- /dev/null +++ b/uiscript/uiscript/buildguildbuildingwindow.py @@ -0,0 +1,343 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +SMALL_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_02.sub" +MIDDLE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_03.sub" + +TEMP_X = 110 + +window = { + "name" : "BuildGuildBuildingWindow", + "style" : ("movable", "float",), + + "x" : 10, + "y" : SCREEN_HEIGHT - 240 - 50, + + "width" : 355+TEMP_X, + "height" : 240, + + "children" : + ( + + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 355+TEMP_X, + "height" : 240, + + "title" : uiScriptLocale.GUILD_BUILDING_TITLE, + + "children" : + ( + + { + "name" : "BuildingCategoryTitle", + "type" : "text", + + "x" : 15 + 50, + "y" : 33, + "text_horizontal_align" : "center", + + "text" : uiScriptLocale.GUILD_BUILDING_CATEGORY_TITLE, + }, + { + "name" : "BuildingCategoryBar", + "type" : "slotbar", + + "x" : 15, + "y" : 50, + + "width" : 100, + "height" : 80, + + "children" : + ( + { + "name" : "CategoryList", + "type" : "listbox", + + "x" : 0, + "y" : 1, + + "width" : 100, + "height" : 80, + }, + ), + }, + + { + "name" : "BuildingPriceTitle", + "type" : "text", "x" : 30, "y" : 143, "text" : uiScriptLocale.GUILD_BUILDING_PRICE, + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingPriceSlot", + "type":"slotbar", "x":25, "y":-4, "width":60, "height":17, + "children" : + ( + { "name" : "BuildingPriceValue", "type" : "text", "x" : 0, "y" : 1, "all_align" : "center", "text" : "50000000", }, + ), + }, + ), + }, + + { + "name" : "BuildingMaterialStoneTitle", + "type" : "text", "x" : 30, "y" : 163, "text" : uiScriptLocale.GUILD_BUILDING_STONE, + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingMaterialStoneSlot", + "type":"slotbar", "x":25, "y":-4, "width":60, "height":17, + "children" : + ( + { "name" : "BuildingMaterialStoneValue", "type" : "text", "x" : 0, "y" : 1, "all_align" : "center", "text" : "50000000", }, + ), + }, + ), + }, + + { + "name" : "BuildingMaterialLogTitle", + "type" : "text", "x" : 30, "y" : 183, "text" : uiScriptLocale.GUILD_BUILDING_LOG, + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingMaterialLogSlot", + "type":"slotbar", "x":25, "y":-4, "width":60, "height":17, + "children" : + ( + { "name" : "BuildingMaterialLogValue", "type" : "text", "x" : 0, "y" : 1, "all_align" : "center", "text" : "50000000", }, + ), + }, + ), + }, + + { + "name" : "BuildingMaterialPlywoodTitle", + "type" : "text", "x" : 30, "y" : 203, "text" : uiScriptLocale.GUILD_BUILDING_PLY, + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingMaterialPlywoodSlot", + "type":"slotbar", "x":25, "y":-4, "width":60, "height":17, + "children" : + ( + { "name" : "BuildingMaterialPlywoodValue", "type" : "text", "x" : 0, "y" : 1, "all_align" : "center", "text" : "50000000", }, + ), + }, + ), + }, + + { + "name" : "temp_window", + "type" : "window", + "style" : ("not_pick",), + + "x" : TEMP_X, + "y" : 0, + "width" : 355, + "height" : 240, + + "children" : + ( + + ### START_TEMP + { + "name" : "BuildingListTitle", + "type" : "text", + + "x" : 15 + 60, + "y" : 33, + "text_horizontal_align" : "center", + + "text" : uiScriptLocale.GUILD_BUILDING_LIST_TITLE, + }, + + { + "name" : "BuildingListBar", + "type" : "slotbar", + + "x" : 15, + "y" : 50, + + "width" : 120, + "height" : 172, + + "children" : + ( + { + "name" : "BuildingList", + "type" : "listbox", + + "x" : 0, + "y" : 1, + + "width" : 105, + "height" : 172, + }, + { + "name" : "ListScrollBar", + "type" : "scrollbar", + + "x" : 15, + "y" : 2, + "size" : 172-2, + "horizontal_align" : "right", + }, + ), + }, + + { + "name" : "BuildingPositionTitle", + "type" : "text", + + "x" : 250, + "y" : 33, + "text_horizontal_align" : "center", + + "text" : uiScriptLocale.GUILD_BUILDING_POSITION, + }, + { + "name" : "PositionButton", + "type" : "radio_button", "x" : 280, "y" : 50, "text" : uiScriptLocale.GUILD_BUILDING_CHANGE, + "default_image" : ROOT_PATH + "Big_Button_01.sub", + "over_image" : ROOT_PATH + "Big_Button_02.sub", + "down_image" : ROOT_PATH + "Big_Button_03.sub", + }, + { + "name" : "BuildingPositionXTitle", + "type" : "text", "x" : 150, "y" : 53, "text" : "X", + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingPositionXSlot", + "type":"image", "x":23, "y":-3, "image":MIDDLE_VALUE_FILE, + "children" : + ( + { "name" : "BuildingPositionXValue", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "999", }, + ), + }, + ), + }, + { + "name" : "BuildingPositionY", + "type" : "text", "x" : 150, "y" : 73, "text" : "Y", + "text_horizontal_align" : "center", + "children" : + ( + { + "name":"BuildingPositionYSlot", + "type":"image", "x":23, "y":-3, "image":MIDDLE_VALUE_FILE, + "children" : + ( + { "name" : "BuildingPositionYValue", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "999", }, + ), + }, + ), + }, + + { + "name" : "BuildingRotationTitle", + "type" : "text", + + "x" : 250, + "y" : 95, + "text_horizontal_align" : "center", + + "text" : uiScriptLocale.GUILD_BUILDING_DIRECTION, + }, + { + "name" : "BuildingRotationXTitle", + "type" : "text", "x" : 150, "y" : 115, "text" : "X", + "text_horizontal_align" : "center", + }, + { + "name" : "BuildingRotationX", + "type" : "sliderbar", + "x" : 158, "y" : 115, + }, + { + "name" : "BuildingRotationYTitle", + "type" : "text", "x" : 150, "y" : 135, "text" : "Y", + "text_horizontal_align" : "center", + }, + { + "name" : "BuildingRotationY", + "type" : "sliderbar", + "x" : 158, "y" : 135, + }, + { + "name" : "BuildingRotationZTitle", + "type" : "text", "x" : 150, "y" : 155, "text" : "Z", + "text_horizontal_align" : "center", + }, + { + "name" : "BuildingRotationZ", + "type" : "sliderbar", + "x" : 158, "y" : 155, + }, + + { + "name" : "PreviewButton", + "type" : "toggle_button", + + "x" : 200, + "y" : 60, + "vertical_align" : "bottom", + + "text" : uiScriptLocale.GUILD_BUILDING_PREVIEW, + + "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" : "AcceptButton", + "type" : "button", + + "x" : 200, + "y" : 35, + + "text" : uiScriptLocale.ACCEPT, + "vertical_align" : "bottom", + + "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" : "CancelButton", + "type" : "button", + + "x" : 245, + "y" : 35, + + "text" : uiScriptLocale.CANCEL, + "vertical_align" : "bottom", + + "default_image" : ROOT_PATH + "Small_Button_01.sub", + "over_image" : ROOT_PATH + "Small_Button_02.sub", + "down_image" : ROOT_PATH + "Small_Button_03.sub", + }, + ### END_TEMP + + ), + + }, + + ), + }, + + ), +} diff --git a/uiscript/uiscript/changegradenamedialog.py b/uiscript/uiscript/changegradenamedialog.py new file mode 100644 index 0000000..1756178 --- /dev/null +++ b/uiscript/uiscript/changegradenamedialog.py @@ -0,0 +1,89 @@ +import uiScriptLocale + +window = { + "name" : "ChangeGradeNameDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 90, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 90, + + "title" : uiScriptLocale.GUILD_GRADE_CHANGE_GRADE_NAME, + + "children" : + ( + + ## GradeName Slot + { + "name" : "GradeNameSlot", + "type" : "image", + + "x" : 0, + "y" : 34, + "horizontal_align" : "center", + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "GradeNameValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 60, + "height" : 18, + + "input_limit" : 8, + }, + ), + }, + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : 170/2 - 61 - 5, + "y" : 58, + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 170/2 + 5, + "y" : 58, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/changepassworddialog.py b/uiscript/uiscript/changepassworddialog.py new file mode 100644 index 0000000..d613574 --- /dev/null +++ b/uiscript/uiscript/changepassworddialog.py @@ -0,0 +1,193 @@ +import uiScriptLocale + +window = { + "name" : "ChangePasswordDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 220, + "height" : 137, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 220, + "height" : 137, + + "children" : + ( + ## Title + { + "name" : "titlebar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 204, + "color" : "gray", + + "children" : + ( + { + + "name" : "TitleName", + "type" : "text", + + "x" : 0, + "y" : 3, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CHANGE_PASSWORD_TITLE, + "text_horizontal_align":"center" + }, + ), + }, + + ## Password Slot + { + "name" : "old_password_slot", + "type" : "image", + + "x" : 135, + "y" : 34, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "old_password_name", + "type" : "text", + + "x" : -110, + "y" : 3, + "text" : uiScriptLocale.CHANGE_PASSWORD_OLD, + }, + { + "name" : "old_password_value", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 60, + "height" : 18, + + "input_limit" : 6, + "secret_flag" : 1, + }, + ), + }, + { + "name" : "new_password_slot", + "type" : "image", + + "x" : 135, + "y" : 59, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "new_password_name", + "type" : "text", + + "x" : -110, + "y" : 3, + "text" : uiScriptLocale.CHANGE_PASSWORD_NEW, + }, + { + "name" : "new_password_value", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 60, + "height" : 18, + + "input_limit" : 6, + "secret_flag" : 1, + }, + ), + }, + { + "name" : "new_password_check_slot", + "type" : "image", + + "x" : 135, + "y" : 79, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "new_password_check_name", + "type" : "text", + + "x" : -110, + "y" : 3, + "text" : uiScriptLocale.CHANGE_PASSWORD_CONFIRM, + }, + { + "name" : "new_password_check_value", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 60, + "height" : 18, + + "input_limit" : 6, + "secret_flag" : 1, + }, + ), + }, + + ## Button + { + "name" : "accept_button", + "type" : "button", + + "x" : -35, + "y" : 103, + + "text" : uiScriptLocale.OK, + "horizontal_align" : "center", + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 35, + "y" : 103, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/characterwindow.py b/uiscript/uiscript/characterwindow.py new file mode 100644 index 0000000..d5f0443 --- /dev/null +++ b/uiscript/uiscript/characterwindow.py @@ -0,0 +1,788 @@ +import uiScriptLocale + +QUEST_ICON_BACKGROUND = 'd:/ymir work/ui/game/quest/slot_base.sub' + +SMALL_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_00.sub" +MIDDLE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_01.sub" +LARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_03.sub" +ICON_SLOT_FILE = "d:/ymir work/ui/public/Slot_Base.sub" +FACE_SLOT_FILE = "d:/ymir work/ui/game/windows/box_face.sub" +ROOT_PATH = "d:/ymir work/ui/game/windows/" + +LOCALE_PATH = uiScriptLocale.WINDOWS_PATH + +window = { + "name" : "CharacterWindow", + "style" : ("movable", "float",), + + "x" : 24, + "y" : (SCREEN_HEIGHT - 37 - 361) / 2, + + "width" : 253, + "height" : 361, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 253, + "height" : 361, + + "children" : + ( + { + "name" : "Skill_TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 238, + "color" : "red", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":0, "y":-1, "text":uiScriptLocale.CHARACTER_SKILL, "all_align":"center" }, + #{ "name":"TitleName", "type":"image", "style" : ("attach",), "x":101, "y" : 1, "image" : LOCALE_PATH+"title_skill.sub", }, + ), + }, + { + "name" : "Emoticon_TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 238, + "color" : "red", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":0, "y":-1, "text":uiScriptLocale.CHARACTER_ACTION, "all_align":"center" }, + ), + }, + { + "name" : "Quest_TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 238, + "color" : "red", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":0, "y":-1, "text":uiScriptLocale.CHARACTER_QUEST, "all_align":"center" }, + ), + }, + + ## Tab Area + { + "name" : "TabControl", + "type" : "window", + + "x" : 0, + "y" : 328, + + "width" : 250, + "height" : 31, + + "children" : + ( + ## Tab + { + "name" : "Tab_01", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 250, + "height" : 31, + + "image" : LOCALE_PATH+"tab_1.sub", + }, + { + "name" : "Tab_02", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 250, + "height" : 31, + + "image" : LOCALE_PATH+"tab_2.sub", + }, + { + "name" : "Tab_03", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 250, + "height" : 31, + + "image" : LOCALE_PATH+"tab_3.sub", + }, + { + "name" : "Tab_04", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 250, + "height" : 31, + + "image" : LOCALE_PATH+"tab_4.sub", + }, + ## RadioButton + { + "name" : "Tab_Button_01", + "type" : "radio_button", + + "x" : 6, + "y" : 5, + + "width" : 53, + "height" : 27, + }, + { + "name" : "Tab_Button_02", + "type" : "radio_button", + + "x" : 61, + "y" : 5, + + "width" : 67, + "height" : 27, + }, + { + "name" : "Tab_Button_03", + "type" : "radio_button", + + "x" : 130, + "y" : 5, + + "width" : 61, + "height" : 27, + }, + { + "name" : "Tab_Button_04", + "type" : "radio_button", + + "x" : 192, + "y" : 5, + + "width" : 55, + "height" : 27, + }, + ), + }, + + ## Page Area + { + "name" : "Character_Page", + "type" : "window", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 250, + "height" : 304, + + "children" : + ( + + ## Title Area + { + "name" : "Character_TitleBar", "type" : "titlebar", "style" : ("attach",), "x" : 61, "y" : 7, "width" : 185, "color" : "red", + "children" : + ( + #{ "name" : "TitleName", "type" : "image", "style" : ("attach",), "x" : 70, "y" : 1, "image" : LOCALE_PATH+"title_status.sub", }, + { "name" : "TitleName", "type":"text", "x":0, "y":-1, "text":uiScriptLocale.CHARACTER_MAIN, "all_align":"center" }, + ), + }, + + ## Guild Name Slot + { + "name" : "Guild_Name_Slot", + "type" : "image", + "x" : 60, + "y" :27+7, + "image" : LARGE_VALUE_FILE, + + "children" : + ( + { + "name" : "Guild_Name", + "type":"text", + "text":"辨靛 捞抚", + "x":0, + "y":0, + "r":1.0, + "g":1.0, + "b":1.0, + "a":1.0, + "all_align" : "center", + }, + ), + }, + + ## Character Name Slot + { + "name" : "Character_Name_Slot", + "type" : "image", + "x" : 153, + "y" :27+7, + "image" : LARGE_VALUE_FILE, + + "children" : + ( + { + "name" : "Character_Name", + "type":"text", + "text":"某腐磐 捞抚", + "x":0, + "y":0, + "r":1.0, + "g":1.0, + "b":1.0, + "a":1.0, + "all_align" : "center", + }, + ), + }, + + ## Header + { + "name":"Status_Header", "type":"window", "x":3, "y":31, "width":0, "height":0, + "children" : + ( + ## Lv + { + "name":"Status_Lv", "type":"window", "x":9, "y":30, "width":37, "height":42, + "children" : + ( + { "name":"Level_Header", "type":"image", "x":0, "y":0, "image":LOCALE_PATH+"label_level.sub" }, + { "name":"Level_Value", "type":"text", "x":19, "y":19, "fontsize":"LARGE", "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + + ## EXP + { + "name":"Status_CurExp", "type":"window", "x":53, "y":30, "width":87, "height":42, + "children" : + ( + { "name":"Exp_Slot", "type":"image", "x":0, "y":0, "image":LOCALE_PATH+"label_cur_exp.sub" }, + { "name":"Exp_Value", "type":"text", "x":46, "y":19, "fontsize":"LARGE", "text":"12345678901", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, ), + }, + + ## REXP + { + "name":"Status_RestExp", "type":"window", "x":150, "y":30, "width":50, "height":20, + "children" : + ( + { "name":"RestExp_Slot", "type":"image", "x":0, "y":0, "image":LOCALE_PATH+"label_last_exp.sub" }, + { "name":"RestExp_Value", "type":"text", "x":46, "y":19, "fontsize":"LARGE", "text":"12345678901", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + ), + }, + + ## Face Slot + { "name" : "Face_Image", "type" : "image", "x" : 11, "y" : 11, "image" : "d:/ymir work/ui/game/windows/face_warrior.sub" }, + { "name" : "Face_Slot", "type" : "image", "x" : 7, "y" : 7, "image" : FACE_SLOT_FILE, }, + + ## 扁夯 瓷仿 + { + "name":"Status_Standard", "type":"window", "x":3, "y":100, "width":200, "height":250, + "children" : + ( + ## 扁夯 瓷仿 力格 + { "name":"Character_Bar_01", "type":"horizontalbar", "x":12, "y":8, "width":223, }, + { "name":"Character_Bar_01_Text", "type" : "image", "x" : 13, "y" : 9, "image" : LOCALE_PATH+"label_std.sub", }, + + ## 瓷仿 荐访 荐摹 + { + "name":"Status_Plus_Label", + "type":"image", + "x":150, "y":11, + "image":LOCALE_PATH+"label_uppt.sub", + + "children" : + ( + { "name":"Status_Plus_Value", "type":"text", "x":62, "y":0, "text":"99", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + + ## 扁夯 瓷仿 酒捞袍 府胶飘 + {"name":"Status_Standard_ItemList1", "type" : "image", "x":17, "y":31, "image" : LOCALE_PATH+"label_std_item1.sub", }, + {"name":"Status_Standard_ItemList2", "type" : "image", "x":100, "y":30, "image" : LOCALE_PATH+"label_std_item2.sub", }, + + ## HTH + { + "name":"HTH_Label", "type":"window", "x":50, "y":32, "width":60, "height":20, + "children" : + ( + { "name":"HTH_Slot", "type":"image", "x":0, "y":0, "image":SMALL_VALUE_FILE }, + { "name":"HTH_Value", "type":"text", "x":20, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + { "name":"HTH_Plus", "type" : "button", "x":41, "y":3, "default_image" : ROOT_PATH+"btn_plus_up.sub", "over_image" : ROOT_PATH+"btn_plus_over.sub", "down_image" : ROOT_PATH+"btn_plus_down.sub", }, + ), + }, + ## INT + { + "name":"INT_Label", "type":"window", "x":50, "y":32+23, "width":60, "height":20, + "children" : + ( + { "name":"INT_Slot", "type":"image", "x":0, "y":0, "image":SMALL_VALUE_FILE }, + { "name":"INT_Value", "type":"text", "x":20, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + { "name":"INT_Plus", "type" : "button", "x" : 41, "y" : 3, "default_image" : ROOT_PATH+"btn_plus_up.sub", "over_image" : ROOT_PATH+"btn_plus_over.sub", "down_image" : ROOT_PATH+"btn_plus_down.sub", }, + ) + }, + ## STR + { + "name":"STR_Label", "type":"window", "x":50, "y":32+23*2, "width":60, "height":20, + "children" : + ( + { "name":"STR_Slot", "type":"image", "x":0, "y":0, "image":SMALL_VALUE_FILE }, + { "name":"STR_Value", "type":"text", "x":20, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + { "name":"STR_Plus", "type" : "button", "x" : 41, "y" : 3, "default_image" : ROOT_PATH+"btn_plus_up.sub", "over_image" : ROOT_PATH+"btn_plus_over.sub", "down_image" : ROOT_PATH+"btn_plus_down.sub", }, + ) + }, + ## DEX + { + "name":"DEX_Label", "type":"window", "x":50, "y":32+23*3, "width":60, "height":20, + "children" : + ( + { "name":"DEX_Slot", "type":"image", "x":0, "y":0, "image":SMALL_VALUE_FILE }, + { "name":"DEX_Value", "type":"text", "x":20, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + { "name":"DEX_Plus", "type" : "button", "x" : 41, "y" : 3, "default_image" : ROOT_PATH+"btn_plus_up.sub", "over_image" : ROOT_PATH+"btn_plus_over.sub", "down_image" : ROOT_PATH+"btn_plus_down.sub", }, + ) + }, + + { "name":"HTH_Minus", "type" : "button", "x":9, "y":35, "default_image" : ROOT_PATH+"btn_minus_up.sub", "over_image" : ROOT_PATH+"btn_minus_over.sub", "down_image" : ROOT_PATH+"btn_minus_down.sub", }, + { "name":"INT_Minus", "type" : "button", "x":9, "y":35+23, "default_image" : ROOT_PATH+"btn_minus_up.sub", "over_image" : ROOT_PATH+"btn_minus_over.sub", "down_image" : ROOT_PATH+"btn_minus_down.sub", }, + { "name":"STR_Minus", "type" : "button", "x":9, "y":35+23*2, "default_image" : ROOT_PATH+"btn_minus_up.sub", "over_image" : ROOT_PATH+"btn_minus_over.sub", "down_image" : ROOT_PATH+"btn_minus_down.sub", }, + { "name":"DEX_Minus", "type" : "button", "x":9, "y":35+23*3, "default_image" : ROOT_PATH+"btn_minus_up.sub", "over_image" : ROOT_PATH+"btn_minus_over.sub", "down_image" : ROOT_PATH+"btn_minus_down.sub", }, + + #### + + ## HP + { + "name":"HEL_Label", "type":"window", "x":145, "y":32, "width":50, "height":20, + "children" : + ( + { "name":"HP_Slot", "type":"image", "x":0, "y":0, "image":LARGE_VALUE_FILE }, + { "name":"HP_Value", "type":"text", "x":45, "y":3, "text":"9999/9999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + ## SP + { + "name":"SP_Label", "type":"window", "x":145, "y":32+23, "width":50, "height":20, + "children" : + ( + { "name":"SP_Slot", "type":"image", "x":0, "y":0, "image":LARGE_VALUE_FILE }, + { "name":"SP_Value", "type":"text", "x":45, "y":3, "text":"9999/9999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + ## ATT + { + "name":"ATT_Label", "type":"window", "x":145, "y":32+23*2, "width":50, "height":20, + "children" : + ( + { "name":"ATT_Slot", "type":"image", "x":0, "y":0, "image":LARGE_VALUE_FILE }, + { "name":"ATT_Value", "type":"text", "x":45, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + ## DEF + { + "name":"DEF_Label", "type":"window", "x":145, "y":32+23*3, "width":50, "height":20, + "children" : + ( + { "name":"DEF_Slot", "type":"image", "x":0, "y":0, "image":LARGE_VALUE_FILE }, + { "name":"DEF_Value", "type":"text", "x":45, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + ), + }, + + ## 何啊 瓷仿 + { + "name":"Status_Extent", "type":"window", "x":3, "y":221, "width":200, "height":50, + "children" : + ( + + ## 何啊 瓷仿 力格 + { "name":"Status_Extent_Bar", "type":"horizontalbar", "x":12, "y":6, "width":223, }, + { "name":"Status_Extent_Label", "type" : "image", "x" : 13, "y" : 8, "image" : LOCALE_PATH+"label_ext.sub", }, + + ## 扁夯 瓷仿 酒捞袍 府胶飘 + {"name":"Status_Extent_ItemList1", "type" : "image", "x":11, "y":31, "image" : LOCALE_PATH+"label_ext_item1.sub", }, + {"name":"Status_Extent_ItemList2", "type" : "image", "x":128, "y":32, "image" : LOCALE_PATH+"label_ext_item2.sub", }, + + ## MSPD - 捞悼 加档 + { + "name":"MOV_Label", "type":"window", "x":66, "y":33, "width":50, "height":20, + "children" : + ( + { "name":"MSPD_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"MSPD_Value", "type":"text", "x":26, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ## ASPD - 傍拜 加档 + { + "name":"ASPD_Label", "type":"window", "x":66, "y":33+23, "width":50, "height":20, + "children" : + ( + { "name":"ASPD_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"ASPD_Value", "type":"text", "x":26, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ## CSPD - 林巩 加档 + { + "name":"CSPD_Label", "type":"window", "x":66, "y":33+23*2, "width":50, "height":20, + "children" : + ( + { "name":"CSPD_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"CSPD_Value", "type":"text", "x":26, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ## MATT - 付过 傍拜仿 + { + "name":"MATT_Label", "type":"window", "x":183, "y":33, "width":50, "height":20, + "children" : + ( + { "name":"MATT_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"MATT_Value", "type":"text", "x":26, "y":3, "text":"999-999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ## MDEF - 付过 规绢仿 + { + "name":"MDEF_Label", "type":"window", "x":183, "y":33+23, "width":50, "height":20, + "children" : + ( + { "name":"MDEF_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"MDEF_Value", "type":"text", "x":26, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ## 雀乔啦 + { + "name":"ER_Label", "type":"window", "x":183, "y":33+23*2, "width":50, "height":20, + "children" : + ( + { "name":"ER_Slot", "type":"image", "x":0, "y":0, "image":MIDDLE_VALUE_FILE }, + { "name":"ER_Value", "type":"text", "x":26, "y":3, "text":"999", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ) + }, + + ), + }, + ), + }, + { + "name" : "Skill_Page", + "type" : "window", + "style" : ("attach",), + + "x" : 0, + "y" : 24, + + "width" : 250, + "height" : 304, + + "children" : + ( + + { + "name":"Skill_Active_Title_Bar", "type":"horizontalbar", "x":15, "y":17, "width":223, + + "children" : + ( + { + "name":"Active_Skill_Point_Label", "type":"image", "x":145, "y":3, "image":LOCALE_PATH+"label_uppt.sub", + "children" : + ( + { "name":"Active_Skill_Point_Value", "type":"text", "x":62, "y":0, "text":"99", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + + ## Group Button + { + "name" : "Skill_Group_Button_1", + "type" : "radio_button", + + "x" : 5, + "y" : 2, + + "text" : "Group1", + "text_color" : 0xFFFFE3AD, + + "default_image" : "d:/ymir work/ui/game/windows/skill_tab_button_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/skill_tab_button_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/skill_tab_button_03.sub", + }, + + { + "name" : "Skill_Group_Button_2", + "type" : "radio_button", + + "x" : 50, + "y" : 2, + + "text" : "Group2", + "text_color" : 0xFFFFE3AD, + + "default_image" : "d:/ymir work/ui/game/windows/skill_tab_button_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/skill_tab_button_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/skill_tab_button_03.sub", + }, + + { + "name" : "Active_Skill_Group_Name", + "type" : "text", + + "x" : 7, + "y" : 1, + "text" : "Active", + + "vertical_align" : "center", + "text_vertical_align" : "center", + "color" : 0xFFFFE3AD, + }, + + ), + }, + + { + "name":"Skill_ETC_Title_Bar", "type":"horizontalbar", "x":15, "y":200, "width":223, + + "children" : + ( + { + "name" : "Support_Skill_Group_Name", + "type" : "text", + + "x" : 7, + "y" : 1, + "text" : uiScriptLocale.SKILL_SUPPORT_TITLE, + + "vertical_align" : "center", + "text_vertical_align" : "center", + "color" : 0xFFFFE3AD, + }, + + { + "name":"Support_Skill_Point_Label", "type":"image", "x":145, "y":3, "image":LOCALE_PATH+"label_uppt.sub", + "children" : + ( + { "name":"Support_Skill_Point_Value", "type":"text", "x":62, "y":0, "text":"99", "r":1.0, "g":1.0, "b":1.0, "a":1.0, "text_horizontal_align":"center" }, + ), + }, + ), + }, + { "name":"Skill_Board", "type":"image", "x":13, "y":38, "image":"d:/ymir work/ui/game/windows/skill_board.sub", }, + + ## Active Slot + { + "name" : "Skill_Active_Slot", + "type" : "slot", + + "x" : 0 + 16, + "y" : 0 + 15 + 23, + + "width" : 223, + "height" : 223, + "image" : ICON_SLOT_FILE, + + "slot" : ( + {"index": 1, "x": 1, "y": 4, "width":32, "height":32}, + {"index":21, "x":38, "y": 4, "width":32, "height":32}, + {"index":41, "x":75, "y": 4, "width":32, "height":32}, + + {"index": 3, "x": 1, "y": 40, "width":32, "height":32}, + {"index":23, "x":38, "y": 40, "width":32, "height":32}, + {"index":43, "x":75, "y": 40, "width":32, "height":32}, + + {"index": 5, "x": 1, "y": 76, "width":32, "height":32}, + {"index":25, "x":38, "y": 76, "width":32, "height":32}, + {"index":45, "x":75, "y": 76, "width":32, "height":32}, + + {"index": 7, "x": 1, "y":112, "width":32, "height":32}, + {"index":27, "x":38, "y":112, "width":32, "height":32}, + {"index":47, "x":75, "y":112, "width":32, "height":32}, + + #### + + {"index": 2, "x":113, "y": 4, "width":32, "height":32}, + {"index":22, "x":150, "y": 4, "width":32, "height":32}, + {"index":42, "x":187, "y": 4, "width":32, "height":32}, + + {"index": 4, "x":113, "y": 40, "width":32, "height":32}, + {"index":24, "x":150, "y": 40, "width":32, "height":32}, + {"index":44, "x":187, "y": 40, "width":32, "height":32}, + + {"index": 6, "x":113, "y": 76, "width":32, "height":32}, + {"index":26, "x":150, "y": 76, "width":32, "height":32}, + {"index":46, "x":187, "y": 76, "width":32, "height":32}, + + {"index": 8, "x":113, "y":112, "width":32, "height":32}, + {"index":28, "x":150, "y":112, "width":32, "height":32}, + {"index":48, "x":187, "y":112, "width":32, "height":32}, + ), + }, + + ## ETC Slot + { + "name" : "Skill_ETC_Slot", + "type" : "grid_table", + "x" : 18, + "y" : 221, + "start_index" : 101, + "x_count" : 6, + "y_count" : 2, + "x_step" : 32, + "y_step" : 32, + "x_blank" : 5, + "y_blank" : 4, + "image" : ICON_SLOT_FILE, + }, + + ), + }, + { + "name" : "Emoticon_Page", + "type" : "window", + "style" : ("attach",), + + "x" : 0, + "y" : 24, + + "width" : 250, + "height" : 304, + + "children" : + ( + ## 扁夯 咀记 力格 + { "name":"Action_Bar", "type":"horizontalbar", "x":12, "y":11, "width":223, }, + { "name":"Action_Bar_Text", "type":"text", "x":15, "y":13, "text":uiScriptLocale.CHARACTER_NORMAL_ACTION }, + + ## Basis Action Slot + { + "name" : "SoloEmotionSlot", + "type" : "grid_table", + "x" : 30, + "y" : 33, + "horizontal_align" : "center", + "start_index" : 1, + "x_count" : 6, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + "x_blank" : 0, + "y_blank" : 0, + "image" : ICON_SLOT_FILE, + }, + + ## 惑龋 咀记 力格 + { "name":"Reaction_Bar", "type":"horizontalbar", "x":12, "y":8+150, "width":223, }, + { "name":"Reaction_Bar_Text", "type":"text", "x":15, "y":10+150, "text":uiScriptLocale.CHARACTER_MUTUAL_ACTION }, + + ## Reaction Slot + { + "name" : "DualEmotionSlot", + "type" : "grid_table", + "x" : 30, + "y" : 180, + "start_index" : 51, + "x_count" : 6, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + "x_blank" : 0, + "y_blank" : 0, + "image" : ICON_SLOT_FILE, + }, + ), + }, + { + "name" : "Quest_Page", + "type" : "window", + "style" : ("attach",), + + "x" : 0, + "y" : 24, + + "width" : 250, + "height" : 304, + + "children" : + ( + { + "name" : "Quest_Slot", + "type" : "grid_table", + "x" : 18, + "y" : 20, + "start_index" : 0, + "x_count" : 1, + "y_count" : 5, + "x_step" : 32, + "y_step" : 32, + "y_blank" : 28, + "image" : QUEST_ICON_BACKGROUND, + }, + + { + "name" : "Quest_ScrollBar", + "type" : "scrollbar", + + "x" : 25, + "y" : 12, + "size" : 290, + "horizontal_align" : "right", + }, + + { "name" : "Quest_Name_00", "type" : "text", "text" : "捞抚涝聪促", "x" : 60, "y" : 14 }, + { "name" : "Quest_LastTime_00", "type" : "text", "text" : "巢篮 矫埃 涝聪促", "x" : 60, "y" : 30 }, + { "name" : "Quest_LastCount_00", "type" : "text", "text" : "巢篮 俺荐 涝聪促", "x" : 60, "y" : 46 }, + + { "name" : "Quest_Name_01", "type" : "text", "text" : "捞抚涝聪促", "x" : 60, "y" : 74 }, + { "name" : "Quest_LastTime_01", "type" : "text", "text" : "巢篮 矫埃 涝聪促", "x" : 60, "y" : 90 }, + { "name" : "Quest_LastCount_01", "type" : "text", "text" : "巢篮 俺荐 涝聪促", "x" : 60, "y" : 106 }, + + { "name" : "Quest_Name_02", "type" : "text", "text" : "捞抚涝聪促", "x" : 60, "y" : 134 }, + { "name" : "Quest_LastTime_02", "type" : "text", "text" : "巢篮 矫埃 涝聪促", "x" : 60, "y" : 150 }, + { "name" : "Quest_LastCount_02", "type" : "text", "text" : "巢篮 俺荐 涝聪促", "x" : 60, "y" : 166 }, + + { "name" : "Quest_Name_03", "type" : "text", "text" : "捞抚涝聪促", "x" : 60, "y" : 194 }, + { "name" : "Quest_LastTime_03", "type" : "text", "text" : "巢篮 矫埃 涝聪促", "x" : 60, "y" : 210 }, + { "name" : "Quest_LastCount_03", "type" : "text", "text" : "巢篮 俺荐 涝聪促", "x" : 60, "y" : 226 }, + + { "name" : "Quest_Name_04", "type" : "text", "text" : "捞抚涝聪促", "x" : 60, "y" : 254 }, + { "name" : "Quest_LastTime_04", "type" : "text", "text" : "巢篮 矫埃 涝聪促", "x" : 60, "y" : 270 }, + { "name" : "Quest_LastCount_04", "type" : "text", "text" : "巢篮 俺荐 涝聪促", "x" : 60, "y" : 286 }, + + ), + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/connectingdialog.py b/uiscript/uiscript/connectingdialog.py new file mode 100644 index 0000000..a949f61 --- /dev/null +++ b/uiscript/uiscript/connectingdialog.py @@ -0,0 +1,56 @@ +import uiScriptLocale + +window = { + "name" : "QuestionDialog", + + "x" : SCREEN_WIDTH/2 - 125, + "y" : SCREEN_HEIGHT/2 - 52, + + "width" : 280, + "height" : 75, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 280, + "height" : 75, + + "children" : + ( + { + "name" : "message", + "type" : "text", + + "x" : 0, + "y" : 25, + + "text" : uiScriptLocale.LOGIN_CONNECTING, + + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + { + "name" : "countdown_message", + "type" : "text", + + "x" : 0, + "y" : 50, + + "text" : uiScriptLocale.MESSAGE, + + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + ), + + }, + ), +} diff --git a/uiscript/uiscript/costumewindow.py b/uiscript/uiscript/costumewindow.py new file mode 100644 index 0000000..71ffec0 --- /dev/null +++ b/uiscript/uiscript/costumewindow.py @@ -0,0 +1,85 @@ +import uiScriptLocale +import item + +COSTUME_START_INDEX = item.COSTUME_SLOT_START + +window = { + "name" : "CostumeWindow", + + "x" : SCREEN_WIDTH - 175 - 140, + "y" : SCREEN_HEIGHT - 37 - 565, + + "style" : ("movable", "float",), + + "width" : 140, + "height" : 180, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 140, + "height" : 180, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 6, + "y" : 6, + + "width" : 130, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":60, "y":3, "text":uiScriptLocale.COSTUME_WINDOW_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Equipment Slot + { + "name" : "Costume_Base", + "type" : "image", + + "x" : 13, + "y" : 38, + + "image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "costume/costume_bg.jpg", + + "children" : + ( + + { + "name" : "CostumeSlot", + "type" : "slot", + + "x" : 3, + "y" : 3, + + "width" : 127, + "height" : 145, + + "slot" : ( + {"index":COSTUME_START_INDEX+0, "x":61, "y":45, "width":32, "height":64}, + {"index":COSTUME_START_INDEX+1, "x":61, "y": 8, "width":32, "height":32}, + {"index":COSTUME_START_INDEX+2, "x":5, "y":145, "width":32, "height":32}, + ), + }, + ), + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/createcharacterwindow.py b/uiscript/uiscript/createcharacterwindow.py new file mode 100644 index 0000000..98a726a --- /dev/null +++ b/uiscript/uiscript/createcharacterwindow.py @@ -0,0 +1,586 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +LOCALE_PATH = uiScriptLocale.SELECT_PATH + +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) / 800, + "y" : SCREEN_HEIGHT * (510) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (570) / 800, + "y" : SCREEN_HEIGHT * (510) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/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", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/cuberesultwindow.py b/uiscript/uiscript/cuberesultwindow.py new file mode 100644 index 0000000..5515993 --- /dev/null +++ b/uiscript/uiscript/cuberesultwindow.py @@ -0,0 +1,98 @@ +import uiScriptLocale + +window = { + "name" : "CubeWindow", + + "x" : 430, + "y" : 230, + + "style" : ("movable", "float",), + + "width" : 176, + "height" : 175, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 176, + "height" : 175, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 161, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":"钦己 搬苞", "text_horizontal_align":"center" }, + ), + }, + + ## Cube Slot + { + "name" : "CubeSlot", + "type" : "grid_table", + + "x" : 176/2 - 32, + "y" : 40 - 2, + + "start_index" : 0, + "x_count" : 2, + "y_count" : 2, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + + ## Text + { + "name":"label", + "type":"text", + + "x":0, + "y":60, + + "vertical_align" : "bottom", + "horizontal_align" : "center", + + "text":"钦己俊 己傍 沁嚼聪促", + "text_horizontal_align":"center", + }, + + ## Button + { + "name" : "CloseButton", + "type" : "button", + + "x" : 0, + "y" : 35, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/cubewindow.py b/uiscript/uiscript/cubewindow.py new file mode 100644 index 0000000..601e286 --- /dev/null +++ b/uiscript/uiscript/cubewindow.py @@ -0,0 +1,411 @@ +import localeInfo +import uiScriptLocale + +LOCALE_PATH = uiScriptLocale.WINDOWS_PATH +ICON_SLOT_FILE = "d:/ymir work/ui/public/Slot_Base.sub" + +window = { + "name" : "CubeWindow", + +# "x" : 430, +# "y" : 130, + "x" : SCREEN_WIDTH - 176 - 200 - 80, + "y" : SCREEN_HEIGHT - 37 - 563, + + + "style" : ("movable", "float",), + + "width" : 285, + "height" : 521, + + "children" : + ( + { + "name" : "board", + "type" : "expanded_image", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 285, + "height" : 521, + + "image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "new_cube_bg.tga", + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 5, + "y" : 5, + + "width" : 273, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.CUBE_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Cube Slot + { + "name" : "CubeSlot", + "type" : "grid_table", + + "x" : 14, + "y" : 364, + + "start_index" : 0, + "x_count" : 8, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + ## Print + { + "name" : "NeedMoney", + "type" : "text", + + "x" : 20, + "y" : 468, + + "width" : 200, + + "horizontal_align" : "right", + "text_horizontal_align" : "right", + + "text" : localeInfo.NumberToMoneyString(0), + }, + + { + "name" : "contentScrollbar", + "type" : "thin_scrollbar", + + "x" : 253, + "y" : 38, + + "size" : 315, + }, + + # Cube Result List. 1 ~ 3 + { + "name" : "result1board", + "type" : "window", + + "x" : 25, + "y" : 41, + + "width" : 216, + "height" : 64, + + "children" : + ( + { + "name" : "result1", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 0, + "y" : 0, + }, + { + "name" : "material11", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 57, + "y" : 0, + }, + { + "name" : "material12", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 90, + "y" : 0, + }, + { + "name" : "material13", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 123, + "y" : 0, + }, + { + "name" : "material14", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 156, + "y" : 0, + }, + { + "name" : "material15", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 189, + "y" : 0, + }, + ), + + }, + { + "name" : "result2board", + "type" : "window", + + "x" : 25, + "y" : 147, + + "width" : 216, + "height" : 64, + + "children" : + ( + { + "name" : "result2", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 0, + "y" : 0, + }, + { + "name" : "material21", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 57, + "y" : 0, + }, + { + "name" : "material22", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 90, + "y" : 0, + }, + { + "name" : "material23", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 123, + "y" : 0, + }, + { + "name" : "material24", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 156, + "y" : 0, + }, + { + "name" : "material25", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 189, + "y" : 0, + }, + ), + }, + { + "name" : "result3board", + "type" : "window", + + "x" : 25, + "y" : 253, + + "width" : 216, + "height" : 64, + + "children" : + ( + { + "name" : "result3", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 0, + "y" : 0, + }, + { + "name" : "material31", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 57, + "y" : 0, + }, + { + "name" : "material32", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 90, + "y" : 0, + }, + { + "name" : "material33", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 123, + "y" : 0, + }, + { + "name" : "material34", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 156, + "y" : 0, + }, + { + "name" : "material35", + "type" : "grid_table", + "start_index" : 0, + + "x_count" : 1, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + + "x" : 189, + "y" : 0, + }, + ), + }, + + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : 148, + "y" : 32, + "vertical_align" : "bottom", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 211, + "y" : 32, + "vertical_align" : "bottom", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/declareguildwardialog.py b/uiscript/uiscript/declareguildwardialog.py new file mode 100644 index 0000000..fa4ed67 --- /dev/null +++ b/uiscript/uiscript/declareguildwardialog.py @@ -0,0 +1,145 @@ +import uiScriptLocale + +window = { + "name" : "InputDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 230, + "height" : 130, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 230, + "height" : 130, + + "title" : uiScriptLocale.GUILD_WAR_DECLARE, + + "children" : + ( + ## Input Slot + { + "name" : "InputName", + "type" : "text", + + "x" : 15, + "y" : 40, + + "text" : uiScriptLocale.GUILD_WAR_ENEMY, + }, + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 80, + "y" : 37, + "width" : 130, + "height" : 18, + + "children" : + ( + { + "name" : "InputValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + "input_limit" : 12, + }, + ), + }, + ## Input Slot + { + "name" : "GameType", "x" : 15, "y" : 65, "width" : 65+45*4, "height" : 20, + + "children" : + ( + {"name" : "GameTypeLabel", "type" : "text", "x" : 0, "y" : 3, "text" : uiScriptLocale.GUILD_WAR_BATTLE_TYPE,}, + { + "name" : "NormalButton", + "type" : "radio_button", + + "x" : 65, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_NORMAL, + + "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", + }, + { + "name" : "WarpButton", + "type" : "radio_button", + + "x" : 65+45*1, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_WARP, + + "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", + }, + { + "name" : "CTFButton", + "type" : "radio_button", + + "x" : 65+45*2, + "y" : 0, + + "text" : uiScriptLocale.GUILD_WAR_CTF, + + "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", + }, + ), + }, + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 95, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 95, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/equipmentdialog.py b/uiscript/uiscript/equipmentdialog.py new file mode 100644 index 0000000..61fed00 --- /dev/null +++ b/uiscript/uiscript/equipmentdialog.py @@ -0,0 +1,81 @@ +import uiScriptLocale + +window = { + "name" : "EquipmentDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 180, + "height" : 230, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 180, + "height" : 230, + + "title" : "Character Name", + + "children" : + ( + { + "name":"EquipmentBaseImage", + "type":"image", + "style" : ("attach",), + + "x" : 0, + "y" : 9, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/equipment_bg_without_ring.tga", + + "children" : + ( + + { + "name" : "EquipmentSlot", + "type" : "slot", + + "x" : 3, + "y" : 3, + + "width" : 150, + "height" : 182, + + "slot" : ( + {"index":0, "x":39, "y":37, "width":32, "height":64}, + {"index":1, "x":39, "y":2, "width":32, "height":32}, + {"index":2, "x":39, "y":145, "width":32, "height":32}, + {"index":3, "x":75, "y":67, "width":32, "height":32}, + {"index":4, "x":3, "y":3, "width":32, "height":96}, + {"index":5, "x":114, "y":67, "width":32, "height":32}, + {"index":6, "x":114, "y":35, "width":32, "height":32}, + {"index":7, "x":2, "y":145, "width":32, "height":32}, + {"index":8, "x":75, "y":145, "width":32, "height":32}, + {"index":9, "x":114, "y":2, "width":32, "height":32}, + {"index":10, "x":75, "y":35, "width":32, "height":32}, + ## 货 馆瘤1 + ##{"index":21, "x":2, "y":106, "width":32, "height":32}, + ## 货 馆瘤2 + ##{"index":22, "x":75, "y":106, "width":32, "height":32}, + ## 货 骇飘 + {"index":23, "x":39, "y":106, "width":32, "height":32}, + ), + }, + + ), + + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/exchangedialog.py b/uiscript/uiscript/exchangedialog.py new file mode 100644 index 0000000..791cd2b --- /dev/null +++ b/uiscript/uiscript/exchangedialog.py @@ -0,0 +1,217 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/game/" + +window = { + "name" : "ExchangeDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 282, + "height" : 167, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 282, + "height" : 167, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 266, + "color" : "gray", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":133, "y":3, "text":uiScriptLocale.EXCHANGE_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## MiddleBar + { + "name" : "Middle_Bar", + "type" : "image", + + "x" : 139, + "y" : 31, + + "image" : ROOT + "windows/middlebar.sub", + }, + + ## Owner + { + "name" : "Owner", + "type" : "window", + + "x" : 144, + "y" : 33, + + "width" : 130, + "height" : 130, + + "children" : + ( + { + "name" : "Owner_Slot", + "type" : "grid_table", + + "start_index" : 0, + + "x" : 0, + "y" : 0, + + "x_count" : 4, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + "x_blank" : 0, + "y_blank" : 0, + + "image" : "d:/ymir work/ui/public/slot_base.sub", + }, + { + "name" : "Owner_Money", + "type" : "button", + + "x" : 0, + "y" : 102, + + #"image" : "d:/ymir work/ui/public/parameter_slot_02.sub", + + "default_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", + "over_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", + "down_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", + + "children" : + ( + { + "name" : "Owner_Money_Value", + "type" : "text", + + "x" : 59, + "y" : 2, + + "text" : "1234567", + + "text_horizontal_align" : "right", + }, + ), + }, + { + "name" : "Owner_Accept_Light", + "type" : "button", + + "x" : 62, + "y" : 101, + + "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", + "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", + "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", + }, + { + "name" : "Owner_Accept_Button", + "type" : "toggle_button", + + "x" : 85, + "y" : 101, + + "text" : uiScriptLocale.EXCHANGE_ACCEPT, + + "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", + }, + ), + }, + + ## Target + { + "name" : "Target", + "type" : "window", + + "x" : 10, + "y" : 33, + + "width" : 130, + "height" : 130, + + "children" : + ( + { + "name" : "Target_Slot", + "type" : "grid_table", + + "start_index" : 0, + + "x" : 0, + "y" : 0, + + "x_count" : 4, + "y_count" : 3, + "x_step" : 32, + "y_step" : 32, + "x_blank" : 0, + "y_blank" : 0, + + "image" : "d:/ymir work/ui/public/slot_base.sub", + }, + { + "name" : "Target_Money", + "type" : "image", + + "x" : 0, + "y" : 102, + + "image" : "d:/ymir work/ui/public/parameter_slot_02.sub", + + "children" : + ( + { + "name" : "Target_Money_Value", + "type" : "text", + + "x" : 59, + "y" : 2, + + "text" : "1234567", + + "text_horizontal_align" : "right", + }, + ), + }, + { + "name" : "Target_Accept_Light", + "type" : "button", + + "x" : 62, + "y" : 101, + + "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", + "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", + "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", + }, + ), + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/fishingwindow.py b/uiscript/uiscript/fishingwindow.py new file mode 100644 index 0000000..fb290b5 --- /dev/null +++ b/uiscript/uiscript/fishingwindow.py @@ -0,0 +1,230 @@ +FISHING_PATH = "d:/ymir work/ui/game/fishing/" + +window = { + "name" : "FishingWindow", + "style" : ("movable", "float",), + + "x" : 100, + "y" : 100, + + "width" : 150, + "height" : 195, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + "width" : 150, + "height" : 195, + "title" : "超矫", + + "children" : + ( + + { + "name" : "FishingBox1", + "type" : "box", + + "x" : 9, + "y" : 31, + "width" : 131, + "height" : 131, + + "color" : 0xFF6C6359, + }, + + { + "name" : "FishingBox2", + "type" : "box", + + "x" : 10, + "y" : 32, + "width" : 129, + "height" : 129, + + "color" : 0xFF35302D, + }, + + { + "name" : "Water", + "type" : "ani_image", + + "x" : 0, + "y" : 33, + "width" : 128, + "height" : 128, + "horizontal_align" : "center", + + "delay" : 7, + + "images" : + ( + FISHING_PATH + "water/00.dds", + FISHING_PATH + "water/01.dds", + FISHING_PATH + "water/02.dds", + FISHING_PATH + "water/03.dds", + FISHING_PATH + "water/04.dds", + FISHING_PATH + "water/05.dds", + FISHING_PATH + "water/06.dds", + ), + + "children" : + ( + + { + "name" : "FishName", + "type" : "text", + + "x" : 10, + "y" : 10, + + "text" : "拱绊扁 捞抚", + }, + + { + "name" : "Float_Wait", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + "width" : 32, + "height" : 128, + "horizontal_align" : "center", + + "delay" : 5, + + "images" : + ( + FISHING_PATH + "float_wait/fh_wait00.tga", + FISHING_PATH + "float_wait/fh_wait01.tga", + FISHING_PATH + "float_wait/fh_wait02.tga", + FISHING_PATH + "float_wait/fh_wait03.tga", + FISHING_PATH + "float_wait/fh_wait04.tga", + FISHING_PATH + "float_wait/fh_wait05.tga", + FISHING_PATH + "float_wait/fh_wait06.tga", + FISHING_PATH + "float_wait/fh_wait07.tga", + FISHING_PATH + "float_wait/fh_wait08.tga", + FISHING_PATH + "float_wait/fh_wait09.tga", + FISHING_PATH + "float_wait/fh_wait10.tga", + ), + }, + + { + "name" : "Float_Throw", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + "width" : 128, + "height" : 128, + "horizontal_align" : "center", + + "delay" : 5, + + "images" : + ( + FISHING_PATH + "float_throw/fh_fall00.tga", + FISHING_PATH + "float_throw/fh_fall01.tga", + FISHING_PATH + "float_throw/fh_fall02.tga", + FISHING_PATH + "float_throw/fh_fall03.tga", + FISHING_PATH + "float_throw/fh_fall04.tga", + FISHING_PATH + "float_throw/fh_fall05.tga", + FISHING_PATH + "float_throw/fh_fall06.tga", + FISHING_PATH + "float_throw/fh_fall07.tga", + FISHING_PATH + "float_throw/fh_fall08.tga", + FISHING_PATH + "float_throw/fh_fall09.tga", + FISHING_PATH + "float_throw/fh_fall10.tga", + FISHING_PATH + "float_throw/fh_fall11.tga", + FISHING_PATH + "float_throw/fh_fall12.tga", + FISHING_PATH + "float_throw/fh_fall13.tga", + ), + }, + + { + "name" : "Float_React", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + "width" : 64, + "height" : 128, + "horizontal_align" : "center", + + "delay" : 5, + + "images" : + ( + FISHING_PATH + "float_react/fh_bite00.tga", + FISHING_PATH + "float_react/fh_bite01.tga", + FISHING_PATH + "float_react/fh_bite02.tga", + FISHING_PATH + "float_react/fh_bite03.tga", + FISHING_PATH + "float_react/fh_bite04.tga", + FISHING_PATH + "float_react/fh_bite05.tga", + FISHING_PATH + "float_react/fh_bite06.tga", + FISHING_PATH + "float_react/fh_bite07.tga", + FISHING_PATH + "float_react/fh_bite08.tga", + FISHING_PATH + "float_react/fh_bite09.tga", + FISHING_PATH + "float_react/fh_bite10.tga", + FISHING_PATH + "float_react/fh_bite11.tga", + FISHING_PATH + "float_react/fh_bite12.tga", + FISHING_PATH + "float_react/fh_bite13.tga", + ), + }, + + { + "name" : "Float_Catch", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + "width" : 128, + "height" : 128, + "horizontal_align" : "center", + + "delay" : 5, + + "images" : + ( + FISHING_PATH + "float_catch/fh_catch00.tga", + FISHING_PATH + "float_catch/fh_catch01.tga", + FISHING_PATH + "float_catch/fh_catch02.tga", + FISHING_PATH + "float_catch/fh_catch03.tga", + FISHING_PATH + "float_catch/fh_catch04.tga", + FISHING_PATH + "float_catch/fh_catch05.tga", + FISHING_PATH + "float_catch/fh_catch06.tga", + FISHING_PATH + "float_catch/fh_catch07.tga", + FISHING_PATH + "float_catch/fh_catch08.tga", + FISHING_PATH + "float_catch/fh_catch09.tga", + FISHING_PATH + "float_catch/fh_catch10.tga", + FISHING_PATH + "float_catch/fh_catch11.tga", + ), + }, + + ), + + }, + + { + "name" : "FishingButton", + "type" : "button", + + "x" : 0, + "y" : 30, + + "text" : "超矫", + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "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", + }, + + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/gameoptiondialog.py b/uiscript/uiscript/gameoptiondialog.py new file mode 100644 index 0000000..ec0d60c --- /dev/null +++ b/uiscript/uiscript/gameoptiondialog.py @@ -0,0 +1,440 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" + +TEMPORARY_X = +13 +BUTTON_TEMPORARY_X = 5 +PVP_X = -10 + +LINE_LABEL_X = 30 +LINE_DATA_X = 90 +LINE_STEP = 0 +SMALL_BUTTON_WIDTH = 45 +MIDDLE_BUTTON_WIDTH = 65 + +window = { + "name" : "GameOptionDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 300, + "height" : 25*11+8, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 300, + "height" : 25*11+8, + + "children" : + ( + ## Title + { + "name" : "titlebar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 284, + "color" : "gray", + + "children" : + ( + { "name":"titlename", "type":"text", "x":0, "y":3, + "text" : uiScriptLocale.GAMEOPTION_TITLE, + "horizontal_align":"center", "text_horizontal_align":"center" }, + ), + }, + + ## 捞抚祸 + { + "name" : "name_color", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 40+2, + + "text" : uiScriptLocale.OPTION_NAME_COLOR, + }, + { + "name" : "name_color_normal", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 40, + + "text" : uiScriptLocale.OPTION_NAME_COLOR_NORMAL, + + "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" : "name_color_empire", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 40, + + "text" : uiScriptLocale.OPTION_NAME_COLOR_EMPIRE, + + "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" : "target_board", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 65+2, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD, + }, + { + "name" : "target_board_no_view", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 65, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD_NO_VIEW, + + "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" : "target_board_view", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 65, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD_VIEW, + + "default_image" : ROOT_PATH + "Middle_Button_01.sub", + "over_image" : ROOT_PATH + "Middle_Button_02.sub", + "down_image" : ROOT_PATH + "Middle_Button_03.sub", + }, + + + ## PvP Mode + { + "name" : "pvp_mode", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 90+2, + + "text" : uiScriptLocale.OPTION_PVPMODE, + }, + { + "name" : "pvp_peace", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*0, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_PEACE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_PEACE_TOOLTIP, + + "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" : "pvp_revenge", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*1, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_REVENGE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_REVENGE_TOOLTIP, + + "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" : "pvp_guild", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*2, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_GUILD, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_GUILD_TOOLTIP, + + "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" : "pvp_free", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*3, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_FREE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_FREE_TOOLTIP, + + "default_image" : ROOT_PATH + "small_Button_01.sub", + "over_image" : ROOT_PATH + "small_Button_02.sub", + "down_image" : ROOT_PATH + "small_Button_03.sub", + }, + + ## Block + { + "name" : "block", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 115+2, + + "text" : uiScriptLocale.OPTION_BLOCK, + }, + { + "name" : "block_exchange_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_EXCHANGE, + + "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" : "block_party_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_PARTY, + + "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" : "block_guild_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*2, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_GUILD, + + "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" : "block_whisper_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_WHISPER, + + "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" : "block_friend_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_FRIEND, + + "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" : "block_party_request_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*2, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_PARTY_REQUEST, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Chat + { + "name" : "chat", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 165+2, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT, + }, + { + "name" : "view_chat_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 165, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_ON, + + "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" : "view_chat_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 165, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Always Show Name + { + "name" : "always_show_name", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 190+2, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME, + }, + { + "name" : "always_show_name_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 190, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME_ON, + + "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" : "always_show_name_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 190, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Effect On/Off + { + "name" : "effect_on_off", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 215+2, + + "text" : uiScriptLocale.OPTION_EFFECT, + }, + { + "name" : "show_damage_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 215, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_ON, + + "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" : "show_damage_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 215, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_OFF, + + "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" : "salestext_on_off", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 240+2, + + "text" : uiScriptLocale.OPTION_SALESTEXT, + }, + { + "name" : "salestext_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 240, + + "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_ON, + + "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" : "salestext_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 240, + + "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/gameoptiondialog_formobile.py b/uiscript/uiscript/gameoptiondialog_formobile.py new file mode 100644 index 0000000..2776dcf --- /dev/null +++ b/uiscript/uiscript/gameoptiondialog_formobile.py @@ -0,0 +1,479 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" + +TEMPORARY_X = +13 +BUTTON_TEMPORARY_X = 5 +PVP_X = -10 + +LINE_LABEL_X = 30 +LINE_DATA_X = 90 +LINE_STEP = 0 +SMALL_BUTTON_WIDTH = 45 +MIDDLE_BUTTON_WIDTH = 65 + +window = { + "name" : "GameOptionDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 300, + "height" : (258+25), + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 300, + "height" : 25*12+8, + + "children" : + ( + ## Title + { + "name" : "titlebar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 284, + "color" : "gray", + + "children" : + ( + { "name":"titlename", "type":"text", "x":0, "y":3, + "text" : uiScriptLocale.GAMEOPTION_TITLE, + "horizontal_align":"center", "text_horizontal_align":"center" }, + ), + }, + + ## 捞抚祸 + { + "name" : "name_color", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 40+2, + + "text" : uiScriptLocale.OPTION_NAME_COLOR, + }, + { + "name" : "name_color_normal", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 40, + + "text" : uiScriptLocale.OPTION_NAME_COLOR_NORMAL, + + "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" : "name_color_empire", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 40, + + "text" : uiScriptLocale.OPTION_NAME_COLOR_EMPIRE, + + "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" : "target_board", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 65+2, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD, + }, + { + "name" : "target_board_no_view", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 65, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD_NO_VIEW, + + "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" : "target_board_view", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 65, + + "text" : uiScriptLocale.OPTION_TARGET_BOARD_VIEW, + + "default_image" : ROOT_PATH + "Middle_Button_01.sub", + "over_image" : ROOT_PATH + "Middle_Button_02.sub", + "down_image" : ROOT_PATH + "Middle_Button_03.sub", + }, + + + ## PvP Mode + { + "name" : "pvp_mode", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 90+2, + + "text" : uiScriptLocale.OPTION_PVPMODE, + }, + { + "name" : "pvp_peace", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*0, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_PEACE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_PEACE_TOOLTIP, + + "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" : "pvp_revenge", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*1, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_REVENGE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_REVENGE_TOOLTIP, + + "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" : "pvp_guild", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*2, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_GUILD, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_GUILD_TOOLTIP, + + "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" : "pvp_free", + "type" : "radio_button", + + "x" : LINE_DATA_X+SMALL_BUTTON_WIDTH*3, + "y" : 90, + + "text" : uiScriptLocale.OPTION_PVPMODE_FREE, + "tooltip_text" : uiScriptLocale.OPTION_PVPMODE_FREE_TOOLTIP, + + "default_image" : ROOT_PATH + "small_Button_01.sub", + "over_image" : ROOT_PATH + "small_Button_02.sub", + "down_image" : ROOT_PATH + "small_Button_03.sub", + }, + + ## Block + { + "name" : "block", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 115+2, + + "text" : uiScriptLocale.OPTION_BLOCK, + }, + { + "name" : "block_exchange_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_EXCHANGE, + + "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" : "block_party_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_PARTY, + + "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" : "block_guild_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*2, + "y" : 115, + + "text" : uiScriptLocale.OPTION_BLOCK_GUILD, + + "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" : "block_whisper_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*0, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_WHISPER, + + "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" : "block_friend_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*1, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_FRIEND, + + "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" : "block_party_request_button", + "type" : "toggle_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH*2, + "y" : 140, + + "text" : uiScriptLocale.OPTION_BLOCK_PARTY_REQUEST, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Chat + { + "name" : "chat", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 165+2, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT, + }, + { + "name" : "view_chat_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 165, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_ON, + + "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" : "view_chat_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 165, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Always Show Name + { + "name" : "always_show_name", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 190+2, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME, + }, + { + "name" : "always_show_name_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 190, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME_ON, + + "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" : "always_show_name_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 190, + + "text" : uiScriptLocale.OPTION_ALWAYS_SHOW_NAME_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ## Mobile + { + "name" : "mobile", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 215+2, + + "text" : uiScriptLocale.OPTION_MOBILE, + }, + { + "name" : "input_mobile_button", + "type" : "button", + + "x" : LINE_DATA_X, + "y" : 215, + + "text" : uiScriptLocale.OPTION_INPUT_MOBILE_BUTTON, + + "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" : "delete_mobile_button", + "type" : "button", + + "x" : 90, + "y" : 215, + + "text" : uiScriptLocale.OPTION_DELETE_MOBILE_BUTTON, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + + ## Effect On/Off + { + "name" : "effect_on_off", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 240+2, + + "text" : uiScriptLocale.OPTION_EFFECT, + }, + { + "name" : "show_damage_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 240, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_ON, + + "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" : "show_damage_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 240, + + "text" : uiScriptLocale.OPTION_VIEW_CHAT_OFF, + + "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" : "salestext_on_off", + "type" : "text", + + "x" : LINE_LABEL_X, + "y" : 265+2, + + "text" : uiScriptLocale.OPTION_SALESTEXT, + }, + { + "name" : "salestext_on_button", + "type" : "radio_button", + + "x" : LINE_DATA_X, + "y" : 265, + + "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_ON, + + "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" : "salestext_off_button", + "type" : "radio_button", + + "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH, + "y" : 265, + + "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_OFF, + + "default_image" : ROOT_PATH + "middle_button_01.sub", + "over_image" : ROOT_PATH + "middle_button_02.sub", + "down_image" : ROOT_PATH + "middle_button_03.sub", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/gamewindow.py b/uiscript/uiscript/gamewindow.py new file mode 100644 index 0000000..a937f99 --- /dev/null +++ b/uiscript/uiscript/gamewindow.py @@ -0,0 +1,148 @@ +import uiScriptLocale + +window = { + "name" : "GameWindow", + "style" : ("not_pick",), + + "x" : 0, + "y" : 0, + + "width" : SCREEN_WIDTH, + "height" : SCREEN_HEIGHT, + + "children" : + ( + { + "name":"HelpButton", + "type":"button", + "x" : 50, + "y" : SCREEN_HEIGHT-170, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"HelpButtonLabel", + "type":"text", + "x": 16, + "y": 40, + "text":uiScriptLocale.GAME_HELP, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + { + "name":"QuestButton", + "type":"button", + "x" : SCREEN_WIDTH-50-32, + "y" : SCREEN_HEIGHT-170, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"QuestButtonLabel", + "type":"text", + "x": 16, + "y": 40, + "text":uiScriptLocale.GAME_QUEST, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + { + "name":"StatusPlusButton", + "type" : "button", + "x" : 68, + "y" : SCREEN_HEIGHT-100, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"StatusPlusLabel", + "type":"text", + "x": 16, + "y": 40, + "text":uiScriptLocale.GAME_STAT_UP, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + { + "name":"SkillPlusButton", + "type" : "button", + "x" : SCREEN_WIDTH-50-32, + "y" : SCREEN_HEIGHT-100, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"SkillPlusLabel", + "type":"text", + "x": 16, + "y": 40, + "text":uiScriptLocale.GAME_SKILL_UP, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + { + "name":"ExitObserver", + "type" : "button", + "x" : SCREEN_WIDTH-50-32, + "y" : SCREEN_HEIGHT-170, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"ExitObserverButtonName", + "type":"text", + "x": 16, + "y": 40, + "text": uiScriptLocale.GAME_EXIT_OBSERVER, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + { + "name":"BuildGuildBuilding", + "type" : "button", + "x" : SCREEN_WIDTH-50-32, + "y" : SCREEN_HEIGHT-170, + "default_image" : "d:/ymir work/ui/game/windows/btn_bigplus_up.sub", + "over_image" : "d:/ymir work/ui/game/windows/btn_bigplus_over.sub", + "down_image" : "d:/ymir work/ui/game/windows/btn_bigplus_down.sub", + + "children" : + ( + { + "name":"BuildGuildBuildingButtonName", + "type":"text", + "x": 16, + "y": 40, + "text": uiScriptLocale.GUILD_BUILDING_TITLE, + "r":1.0, "g":1.0, "b":1.0, "a":1.0, + "text_horizontal_align":"center" + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/guildwindow.py b/uiscript/uiscript/guildwindow.py new file mode 100644 index 0000000..82f0f36 --- /dev/null +++ b/uiscript/uiscript/guildwindow.py @@ -0,0 +1,185 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/game/guild/" +LOCALE_PATH = uiScriptLocale.GUILD_PATH + +window = { + "name" : "GuildWindow", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 356, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 356, + + "title" : uiScriptLocale.GUILD_NAME, + + "children" : + ( + ## Tab Area + { + "name" : "TabControl", + "type" : "window", + + "x" : 0, + "y" : 328, + + "width" : 376, + "height" : 37, + + "children" : + ( + ## Tab + { + "name" : "Tab_01", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_1.sub", + }, + { + "name" : "Tab_02", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_2.sub", + }, + { + "name" : "Tab_03", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_3.sub", + }, + { + "name" : "Tab_04", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_4.sub", + }, + { + "name" : "Tab_05", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_5.sub", + }, + { + "name" : "Tab_06", + "type" : "image", + + "x" : 0, + "y" : 0, + + "width" : 376, + "height" : 37, + + "image" : LOCALE_PATH+"tab_6.sub", + }, + ## RadioButton + { + "name" : "Tab_Button_01", + "type" : "radio_button", + + "x" : 6, + "y" : 5, + + "width" : 53, + "height" : 27, + }, + { + "name" : "Tab_Button_02", + "type" : "radio_button", + + "x" : 61, + "y" : 5, + + "width" : 67, + "height" : 27, + }, + { + "name" : "Tab_Button_03", + "type" : "radio_button", + + "x" : 130, + "y" : 5, + + "width" : 60, + "height" : 27, + }, + { + "name" : "Tab_Button_04", + "type" : "radio_button", + + "x" : 192, + "y" : 5, + + "width" : 60, + "height" : 27, + }, + { + "name" : "Tab_Button_05", + "type" : "radio_button", + + "x" : 254, + "y" : 5, + + "width" : 60, + "height" : 27, + }, + { + "name" : "Tab_Button_06", + "type" : "radio_button", + + "x" : 316, + "y" : 5, + + "width" : 55, + "height" : 27, + }, + ), + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/guildwindow_baseinfopage.py b/uiscript/uiscript/guildwindow_baseinfopage.py new file mode 100644 index 0000000..aefa1a5 --- /dev/null +++ b/uiscript/uiscript/guildwindow_baseinfopage.py @@ -0,0 +1,190 @@ +import uiScriptLocale + +RESOURCE_NAME_POS = 132 + +window = { + "name" : "GuildWindow_BaseInfoPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## Name + { + "name" : "BaseName", + "type" : "text", + "x" : 90, + "y" : 10, + "text" : uiScriptLocale.GUILD_BASENAME, + }, + { + "name" : "BaseNameSlot", + "type" : "slotbar", + "x" : 180, + "y" : 3, + "width" : 105, + "height" : 24, + "text" : uiScriptLocale.GUILD_BASENAME, + "children" : + ( + { + "name" : "BaseNameValue", + "type" : "text", + "x" : 0, + "y" : 0, + "text" : uiScriptLocale.GUILD_BASENAME, + "fontsize" : "LARGE", + "all_align" : "center", + }, + ), + }, + + ## Resource Information + { + "name" : "HorizontalBar1", + "type" : "horizontalbar", + "x" : 0, + "y" : 32, + "width" : 337, + "horizontal_align" : "center", + "children" : + ( + + { + "name" : "ResourceInformationName", + "type" : "text", + "x" : 0, + "y" : 0, + "text" : uiScriptLocale.GUILD_RESOURCE_INFO, + "all_align" : "center", + }, + + { + "name" : "ResourceSlot1", "type" : "slotbar", "x" : 5 + 31*0, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName1", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_WATER_STONE, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue1", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + { + "name" : "ResourceSlot2", "type" : "slotbar", "x" : 5 + 31*1, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName2", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_METIN_STONE, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue2", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + { + "name" : "ResourceSlot3", "type" : "slotbar", "x" : 5 + 31*2, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName3", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_WATER, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue3", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + { + "name" : "ResourceSlot4", "type" : "slotbar", "x" : 5 + 31*3, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName4", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_CRYSTAL, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue4", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + { + "name" : "ResourceSlot5", "type" : "slotbar", "x" : 5 + 31*4, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName5", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_MINENAL, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue5", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + { + "name" : "ResourceSlot6", "type" : "slotbar", "x" : 5 + 31*5, "y" : 38, "width" : 27, "height" : 18, + "children" : + ( + { "name" : "ResourceName6", "type" : "text", "x" : 0, "y" : -16, "text" : uiScriptLocale.GUILD_GEM, "horizontal_align" : "center", "text_horizontal_align" : "center", }, + { "name" : "ResourceValue6", "type" : "text", "x" : 0, "y" : 0, "text" : "999", "all_align" : "center", }, + ), + }, + + { + "name" : "ResourceBasket", "type" : "bar", "x" : 195, "y" : 21, "width" : 142, "height" : 39, + "children" : + ( + { + "name" : "ResourceBasketDescription1", "type" : "text", "x" : 0, "y" : 5, "text" : uiScriptLocale.GUILD_DROP_RESOURCE1, "horizontal_align" : "center", "text_horizontal_align" : "center", + }, + { + "name" : "ResourceBasketDescription2", "type" : "text", "x" : 0, "y" : 21, "text" : uiScriptLocale.GUILD_DROP_RESOURCE2, "horizontal_align" : "center", "text_horizontal_align" : "center", + }, + ), + }, + + ), + }, + + ## Resource Information + { + "name" : "HorizontalBar1", + "type" : "horizontalbar", + "x" : 0, + "y" : 95, + "width" : 337, + "horizontal_align" : "center", + "children" : + ( + + { + "name" : "ResourceInformationName", + "type" : "text", + "x" : 0, + "y" : 0, + "text" : uiScriptLocale.GUILD_BUILDING_INFO, + "all_align" : "center", + }, + + ## BuildingName + { + "name" : "BuildingName", "type" : "text", "x" : 16, "y" : 20, "text" : uiScriptLocale.GUILD_BUILDING_NAME, + }, + ## Grade + { + "name" : "Grade", "type" : "text", "x" : 89, "y" : 20, "text" : uiScriptLocale.GUILD_BUILDING_GRADE, + }, + + ## Resources + { "name" : "ResourceName1", "type" : "text", "x" : RESOURCE_NAME_POS + 29*0, "y" : 20, "text" : uiScriptLocale.GUILD_WATER_STONE, "text_horizontal_align" : "center", }, + { "name" : "ResourceName2", "type" : "text", "x" : RESOURCE_NAME_POS + 29*1, "y" : 20, "text" : uiScriptLocale.GUILD_METIN_STONE, "text_horizontal_align" : "center", }, + { "name" : "ResourceName3", "type" : "text", "x" : RESOURCE_NAME_POS + 29*2, "y" : 20, "text" : uiScriptLocale.GUILD_WATER, "text_horizontal_align" : "center", }, + { "name" : "ResourceName4", "type" : "text", "x" : RESOURCE_NAME_POS + 29*3, "y" : 20, "text" : uiScriptLocale.GUILD_CRYSTAL, "text_horizontal_align" : "center", }, + { "name" : "ResourceName5", "type" : "text", "x" : RESOURCE_NAME_POS + 29*4, "y" : 20, "text" : uiScriptLocale.GUILD_MINENAL, "text_horizontal_align" : "center", }, + { "name" : "ResourceName6", "type" : "text", "x" : RESOURCE_NAME_POS + 29*5, "y" : 20, "text" : uiScriptLocale.GUILD_GEM, "text_horizontal_align" : "center", }, + + ## Power + { + "name" : "Power", "type" : "text", "x" : 303, "y" : 20, "text" : uiScriptLocale.GUILD_BUILDING_OPERATE, + }, + + ), + }, + + ## Buttons + { + "name" : "RefreshButton", + "type" : "button", + "x" : 337, + "y" : 5, + "default_image" : "d:/ymir work/ui/game/guild/Refresh_Button_01.sub", + "over_image" : "d:/ymir work/ui/game/guild/Refresh_Button_02.sub", + "down_image" : "d:/ymir work/ui/game/guild/Refresh_Button_03.sub", + "tooltip_text" : uiScriptLocale.GUILD_BUILDING_REFRESH, + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_boardpage.py b/uiscript/uiscript/guildwindow_boardpage.py new file mode 100644 index 0000000..3c8299d --- /dev/null +++ b/uiscript/uiscript/guildwindow_boardpage.py @@ -0,0 +1,75 @@ +import uiScriptLocale + +BOARD_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_06.sub" + +window = { + "name" : "GuildWindow_BoardPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## ID + { + "name" : "IndexID", "type" : "text", "x" : 42, "y" : 8, "text" : uiScriptLocale.GUILD_BOARD_ID, + }, + ## Messages + { + "name" : "IndexMessages", "type" : "text", "x" : 212, "y" : 8, "text" : uiScriptLocale.GUILD_BOARD_TEXT, + }, + + ## Refresh Button + { + "name" : "RefreshButton", + "type" : "button", + "x" : 337, + "y" : 5, + "default_image" : "d:/ymir work/ui/game/guild/Refresh_Button_01.sub", + "over_image" : "d:/ymir work/ui/game/guild/Refresh_Button_02.sub", + "down_image" : "d:/ymir work/ui/game/guild/Refresh_Button_03.sub", + "tooltip_text" : uiScriptLocale.GUILD_BOARD_REFRESH, + }, + + ## Post Comment Button + { + "name" : "PostCommentButton", + "type" : "button", + "x" : 337, + "y" : 273, + "default_image" : "d:/ymir work/ui/game/taskbar/Send_Chat_Button_01.sub", + "over_image" : "d:/ymir work/ui/game/taskbar/Send_Chat_Button_02.sub", + "down_image" : "d:/ymir work/ui/game/taskbar/Send_Chat_Button_03.sub", + "tooltip_text" : uiScriptLocale.GUILD_GRADE_WRITE, + }, + + ## EditLine + { + "name" : "CommentSlot", + "type" : "slotbar", + "x" : 15, + "y" : 272, + "width" : 315, + "height" : 18, + + "children" : + ( + { + "name" : "CommentValue", + "type" : "editline", + "x" : 2, + "y" : 3, + "width" : 317, + "height" : 15, + "input_limit" : 49, + "text" : "", + }, + ), + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_gradepage.py b/uiscript/uiscript/guildwindow_gradepage.py new file mode 100644 index 0000000..84b7846 --- /dev/null +++ b/uiscript/uiscript/guildwindow_gradepage.py @@ -0,0 +1,41 @@ +import uiScriptLocale + +window = { + "name" : "GuildWindow_BoardPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## GradeNumber + { + "name" : "GradeNumber", "type" : "text", "x" : 21, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_NUM, + }, + ## GradeName + { + "name" : "GradeName", "type" : "text", "x" : 76, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_RANK, + }, + ## InviteAuthority + { + "name" : "InviteAuthority", "type" : "text", "x" : 126, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_PERMISSION_JOIN, + }, + ## DriveOutAuthority + { + "name" : "DriveOutAuthority", "type" : "text", "x" : 183, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_PERMISSION_DELETE, + }, + ## NoticeAuthority + { + "name" : "NoticeAuthority", "type" : "text", "x" : 240, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_PERMISSION_NOTICE, + }, + ## GeneralAuthority + { + "name" : "SkillAuthority", "type" : "text", "x" : 297, "y" : 5, "text" : uiScriptLocale.GUILD_GRADE_PERMISSION_SKILL, + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_guildinfopage.py b/uiscript/uiscript/guildwindow_guildinfopage.py new file mode 100644 index 0000000..efb8bf5 --- /dev/null +++ b/uiscript/uiscript/guildwindow_guildinfopage.py @@ -0,0 +1,382 @@ +import uiScriptLocale + +SMALL_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_01.sub" +LARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_03.sub" +XLARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_04.sub" + +window = { + "name" : "GuildWindow_GuildInfoPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## Guild Info Title + { + "name":"Guild_Info_Title_Bar", "type":"horizontalbar", "x":5, "y":10, "width":167, + "children" : + ( + { "name":"Guild_Info_Point_Value", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO, }, + + ## GuildName + { + "name" : "GuildName", "type" : "text", "x" : 3, "y" : 31, "text" : uiScriptLocale.GUILD_INFO_NAME, + "children" : + ( + { + "name" : "GuildNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_NAME_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMaster + { + "name" : "GuildMaster", "type" : "text", "x" : 3, "y" : 57, "text" : uiScriptLocale.GUILD_INFO_MASTER, + "children" : + ( + { + "name" : "GuildMasterNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMasterNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_MASTER_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildLevel + { + "name" : "GuildLevel", "type" : "text", "x" : 3, "y" : 93, "text" : uiScriptLocale.GUILD_INFO_LEVEL, + "children" : + ( + { + "name" : "GuildLevelSlot", + "type" : "slotbar", + "x" : 70, + "y" : -2, + "width" : 45, + "height" : 17, + "children" : + ( + {"name" : "GuildLevelValue", "type":"text", "text":"30", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## CurrentExperience + { + "name" : "CurrentExperience", "type" : "text", "x" : 3, "y" : 119, "text" : uiScriptLocale.GUILD_INFO_CUR_EXP, + "children" : + ( + { + "name" : "CurrentExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "CurrentExperienceValue", "type":"text", "text":"10000000", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## LastExperience + { + "name" : "LastExperience", "type" : "text", "x" : 3, "y" : 145, "text" : uiScriptLocale.GUILD_INFO_REST_EXP, + "children" : + ( + { + "name" : "LastExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "LastExperienceValue", "type":"text", "text":"123123123123", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberCount + { + "name" : "GuildMemberCount", "type" : "text", "x" : 3, "y" : 171, "text" : uiScriptLocale.GUILD_INFO_MEMBER_NUM, + "children" : + ( + { + "name" : "GuildMemberCountSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberCountValue", "type":"text", "text":"30 / 32", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberLevelAverage + { + "name" : "GuildMemberLevelAverage", "type" : "text", "x" : 3, "y" : 197, "text" : uiScriptLocale.GUILD_INFO_MEMBER_AVG_LEVEL, + "children" : + ( + { + "name" : "GuildMemberLevelAverageSlot", + "type" : "image", + "x" : 108, + "y" : -2, + "image" : SMALL_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberLevelAverageValue", "type":"text", "text":"53", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ), + }, + + ## Button + { + "name" : "OfferButton", + "type" : "button", + "x" : 127, + "y" : 100, + "text" : uiScriptLocale.GUILD_INFO_OFFER_EXP, + "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", + }, + + ############################################################################################################### + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":10, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_MARK, }, + + ## LargeGuildMark + { + "name" : "LargeGuildMarkSlot", + "type" : "slotbar", + "x" : 5, + "y" : 24, + "width" : 48+1, + "height" : 36+1, + "children" : + ( + { + "name" : "LargeGuildMark", + "type" : "mark", + "x" : 1, + "y" : 1, + }, + ), + }, + + ), + }, + + ## UploadButton + { + "name" : "UploadGuildMarkButton", + "type" : "button", + "x" : 260, + "y" : 33, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_MARK, + "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", + }, + { + "name" : "UploadGuildSymbolButton", + "type" : "button", + "x" : 260, + "y" : 33 + 23, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_SYMBOL, + "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", + }, + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":85, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD, }, + + { + "name" : "EnemyGuildSlot1", + "type" : "image", + "x" : 4, + "y" : 27 + 26*0, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName1", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot2", + "type" : "image", + "x" : 4, + "y" : 27 + 26*1, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName2", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot3", + "type" : "image", + "x" : 4, + "y" : 27 + 26*2, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName3", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot4", + "type" : "image", + "x" : 4, + "y" : 27 + 26*3, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName4", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot5", + "type" : "image", + "x" : 4, + "y" : 27 + 26*4, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName5", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot6", + "type" : "image", + "x" : 4, + "y" : 27 + 26*5, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName6", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + + ), + }, + + ## CancelButtons + { + "name" : "EnemyGuildCancel1", + "type" : "button", + "x" : 310, + "y" : 111 + 26*0, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel2", + "type" : "button", + "x" : 310, + "y" : 111 + 26*1, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel3", + "type" : "button", + "x" : 310, + "y" : 111 + 26*2, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel4", + "type" : "button", + "x" : 310, + "y" : 111 + 26*3, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel5", + "type" : "button", + "x" : 310, + "y" : 111 + 26*4, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel6", + "type" : "button", + "x" : 310, + "y" : 111 + 26*5, + "text" : uiScriptLocale.CANCEL, + "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", + }, + + ## DeclareWar + { + "name" : "DeclareWarButton", + "type" : "button", + "x" : 250 + 15, + "y" : 264, + "text" : uiScriptLocale.GUILD_INFO_DECALRE_WAR, + "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", + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_guildinfopage_eu.py b/uiscript/uiscript/guildwindow_guildinfopage_eu.py new file mode 100644 index 0000000..8af7a52 --- /dev/null +++ b/uiscript/uiscript/guildwindow_guildinfopage_eu.py @@ -0,0 +1,400 @@ +import uiScriptLocale + +SMALL_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_01.sub" +LARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_03.sub" +XLARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_04.sub" + +window = { + "name" : "GuildWindow_GuildInfoPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## Guild Info Title + { + "name":"Guild_Info_Title_Bar", "type":"horizontalbar", "x":5, "y":10, "width":167, + "children" : + ( + { "name":"Guild_Info_Point_Value", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO, }, + + ## GuildName + { + "name" : "GuildName", "type" : "text", "x" : 3, "y" : 31, "text" : uiScriptLocale.GUILD_INFO_NAME, + "children" : + ( + { + "name" : "GuildNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_NAME_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMaster + { + "name" : "GuildMaster", "type" : "text", "x" : 3, "y" : 57, "text" : uiScriptLocale.GUILD_INFO_MASTER, + "children" : + ( + { + "name" : "GuildMasterNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMasterNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_MASTER_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildLevel + { + "name" : "GuildLevel", "type" : "text", "x" : 3, "y" : 93, "text" : uiScriptLocale.GUILD_INFO_LEVEL, + "children" : + ( + { + "name" : "GuildLevelSlot", + "type" : "slotbar", + "x" : 70, + "y" : -2, + "width" : 45, + "height" : 17, + "children" : + ( + {"name" : "GuildLevelValue", "type":"text", "text":"30", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## CurrentExperience + { + "name" : "CurrentExperience", "type" : "text", "x" : 3, "y" : 119, "text" : uiScriptLocale.GUILD_INFO_CUR_EXP, + "children" : + ( + { + "name" : "CurrentExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "CurrentExperienceValue", "type":"text", "text":"10000000", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## LastExperience + { + "name" : "LastExperience", "type" : "text", "x" : 3, "y" : 145, "text" : uiScriptLocale.GUILD_INFO_REST_EXP, + "children" : + ( + { + "name" : "LastExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "LastExperienceValue", "type":"text", "text":"123123123123", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberCount + { + "name" : "GuildMemberCount", "type" : "text", "x" : 3, "y" : 171, "text" : uiScriptLocale.GUILD_INFO_MEMBER_NUM, + "children" : + ( + { + "name" : "GuildMemberCountSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberCountValue", "type":"text", "text":"30 / 32", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberLevelAverage + { + "name" : "GuildMemberLevelAverage", "type" : "text", "x" : 3, "y" : 197, "text" : uiScriptLocale.GUILD_INFO_MEMBER_AVG_LEVEL, + "children" : + ( + { + "name" : "GuildMemberLevelAverageSlot", + "type" : "image", + "x" : 108, + "y" : -2, + "image" : SMALL_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberLevelAverageValue", "type":"text", "text":"53", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMoney + { + "name" : "GuildMoney", "type" : "text", "x" : 3, "y" : 233, "text" : uiScriptLocale.GUILD_MONEY, + "children" : + ( + { + "name" : "GuildMoneySlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMoneyValue", "type":"text", "text":"9999999", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + ), + }, + + ## Button + { + "name" : "OfferButton", + "type" : "button", + "x" : 127, + "y" : 100, + "text" : uiScriptLocale.GUILD_INFO_OFFER_EXP, + "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", + }, + + ############################################################################################################### + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":10, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_MARK, }, + + ## LargeGuildMark + { + "name" : "LargeGuildMarkSlot", + "type" : "slotbar", + "x" : 5, + "y" : 24, + "width" : 48+1, + "height" : 36+1, + "children" : + ( + { + "name" : "LargeGuildMark", + "type" : "mark", + "x" : 1, + "y" : 1, + }, + ), + }, + + ), + }, + + ## UploadButton + { + "name" : "UploadGuildMarkButton", + "type" : "button", + "x" : 260, + "y" : 33, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_MARK, + "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", + }, + { + "name" : "UploadGuildSymbolButton", + "type" : "button", + "x" : 260, + "y" : 33 + 23, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_SYMBOL, + "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", + }, + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":85, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD, }, + + { + "name" : "EnemyGuildSlot1", + "type" : "image", + "x" : 4, + "y" : 27 + 26*0, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName1", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot2", + "type" : "image", + "x" : 4, + "y" : 27 + 26*1, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName2", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot3", + "type" : "image", + "x" : 4, + "y" : 27 + 26*2, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName3", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot4", + "type" : "image", + "x" : 4, + "y" : 27 + 26*3, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName4", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot5", + "type" : "image", + "x" : 4, + "y" : 27 + 26*4, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName5", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot6", + "type" : "image", + "x" : 4, + "y" : 27 + 26*5, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName6", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + + ), + }, + + ## CancelButtons + { + "name" : "EnemyGuildCancel1", + "type" : "button", + "x" : 310, + "y" : 111 + 26*0, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel2", + "type" : "button", + "x" : 310, + "y" : 111 + 26*1, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel3", + "type" : "button", + "x" : 310, + "y" : 111 + 26*2, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel4", + "type" : "button", + "x" : 310, + "y" : 111 + 26*3, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel5", + "type" : "button", + "x" : 310, + "y" : 111 + 26*4, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel6", + "type" : "button", + "x" : 310, + "y" : 111 + 26*5, + "text" : uiScriptLocale.CANCEL, + "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", + }, + + ## DeclareWar + { + "name" : "DeclareWarButton", + "type" : "button", + "x" : 250 + 15, + "y" : 264, + "text" : uiScriptLocale.GUILD_INFO_DECALRE_WAR, + "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", + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_guildinfopage_jp.py b/uiscript/uiscript/guildwindow_guildinfopage_jp.py new file mode 100644 index 0000000..018aa2c --- /dev/null +++ b/uiscript/uiscript/guildwindow_guildinfopage_jp.py @@ -0,0 +1,420 @@ +import uiScriptLocale + +SMALL_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_01.sub" +LARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_03.sub" +XLARGE_VALUE_FILE = "d:/ymir work/ui/public/Parameter_Slot_04.sub" + +window = { + "name" : "GuildWindow_GuildInfoPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## Guild Info Title + { + "name":"Guild_Info_Title_Bar", "type":"horizontalbar", "x":5, "y":10, "width":167, + "children" : + ( + { "name":"Guild_Info_Point_Value", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO, }, + + ## GuildName + { + "name" : "GuildName", "type" : "text", "x" : 3, "y" : 31, "text" : uiScriptLocale.GUILD_INFO_NAME, + "children" : + ( + { + "name" : "GuildNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_NAME_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMaster + { + "name" : "GuildMaster", "type" : "text", "x" : 3, "y" : 57, "text" : uiScriptLocale.GUILD_INFO_MASTER, + "children" : + ( + { + "name" : "GuildMasterNameSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMasterNameValue", "type":"text", "text":uiScriptLocale.GUILD_INFO_MASTER_VALUE, "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildLevel + { + "name" : "GuildLevel", "type" : "text", "x" : 3, "y" : 93, "text" : uiScriptLocale.GUILD_INFO_LEVEL, + "children" : + ( + { + "name" : "GuildLevelSlot", + "type" : "slotbar", + "x" : 70, + "y" : -2, + "width" : 45, + "height" : 17, + "children" : + ( + {"name" : "GuildLevelValue", "type":"text", "text":"30", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## CurrentExperience + { + "name" : "CurrentExperience", "type" : "text", "x" : 3, "y" : 119, "text" : uiScriptLocale.GUILD_INFO_CUR_EXP, + "children" : + ( + { + "name" : "CurrentExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "CurrentExperienceValue", "type":"text", "text":"10000000", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## LastExperience + { + "name" : "LastExperience", "type" : "text", "x" : 3, "y" : 145, "text" : uiScriptLocale.GUILD_INFO_REST_EXP, + "children" : + ( + { + "name" : "LastExperienceSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "LastExperienceValue", "type":"text", "text":"123123123123", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberCount + { + "name" : "GuildMemberCount", "type" : "text", "x" : 3, "y" : 171, "text" : uiScriptLocale.GUILD_INFO_MEMBER_NUM, + "children" : + ( + { + "name" : "GuildMemberCountSlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberCountValue", "type":"text", "text":"30 / 32", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMemberLevelAverage + { + "name" : "GuildMemberLevelAverage", "type" : "text", "x" : 3, "y" : 197, "text" : uiScriptLocale.GUILD_INFO_MEMBER_AVG_LEVEL, + "children" : + ( + { + "name" : "GuildMemberLevelAverageSlot", + "type" : "image", + "x" : 108, + "y" : -2, + "image" : SMALL_VALUE_FILE, + "children" : + ( + {"name" : "GuildMemberLevelAverageValue", "type":"text", "text":"53", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + + ## GuildMoney + { + "name" : "GuildMoney", "type" : "text", "x" : 3, "y" : 233, "text" : uiScriptLocale.GUILD_MONEY, + "children" : + ( + { + "name" : "GuildMoneySlot", + "type" : "image", + "x" : 70, + "y" : -2, + "image" : LARGE_VALUE_FILE, + "children" : + ( + {"name" : "GuildMoneyValue", "type":"text", "text":"9999999", "x":0, "y":0, "all_align":"center"}, + ), + }, + ), + }, + ), + }, + + ## Button + { + "name" : "OfferButton", + "type" : "button", + "x" : 127, + "y" : 100, + "text" : uiScriptLocale.GUILD_INFO_OFFER_EXP, + "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", + }, + { + "name" : "DepositButton", + "type" : "button", + "x" : 78, + "y" : 263, + "text" : uiScriptLocale.GUILD_DEPOSIT, + "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", + }, + { + "name" : "WithdrawButton", + "type" : "button", + "x" : 126, + "y" : 263, + "text" : uiScriptLocale.GUILD_WITHDRAW, + "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", + }, + + ############################################################################################################### + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":10, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_MARK, }, + + ## LargeGuildMark + { + "name" : "LargeGuildMarkSlot", + "type" : "slotbar", + "x" : 5, + "y" : 24, + "width" : 48+1, + "height" : 36+1, + "children" : + ( + { + "name" : "LargeGuildMark", + "type" : "mark", + "x" : 1, + "y" : 1, + }, + ), + }, + + ), + }, + + ## UploadButton + { + "name" : "UploadGuildMarkButton", + "type" : "button", + "x" : 260, + "y" : 33, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_MARK, + "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", + }, + { + "name" : "UploadGuildSymbolButton", + "type" : "button", + "x" : 260, + "y" : 33 + 23, + "text" : uiScriptLocale.GUILD_INFO_UPLOAD_SYMBOL, + "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", + }, + + ## Guild Mark Title + { + "name":"Guild_Mark_Title_Bar", "type":"horizontalbar", "x":188, "y":85, "width":167, + "children" : + ( + + { "name":"Guild_Mark_Title", "type":"text", "x":8, "y":3, "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD, }, + + { + "name" : "EnemyGuildSlot1", + "type" : "image", + "x" : 4, + "y" : 27 + 26*0, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName1", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot2", + "type" : "image", + "x" : 4, + "y" : 27 + 26*1, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName2", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot3", + "type" : "image", + "x" : 4, + "y" : 27 + 26*2, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName3", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot4", + "type" : "image", + "x" : 4, + "y" : 27 + 26*3, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName4", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot5", + "type" : "image", + "x" : 4, + "y" : 27 + 26*4, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName5", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + { + "name" : "EnemyGuildSlot6", + "type" : "image", + "x" : 4, + "y" : 27 + 26*5, + "image" : XLARGE_VALUE_FILE, + "children" : + ( + {"name" : "EnemyGuildName6", "type":"text", "text":uiScriptLocale.GUILD_INFO_ENEMY_GUILD_EMPTY, "x":0, "y":0, "all_align":"center"}, + ), + }, + + ), + }, + + ## CancelButtons + { + "name" : "EnemyGuildCancel1", + "type" : "button", + "x" : 310, + "y" : 111 + 26*0, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel2", + "type" : "button", + "x" : 310, + "y" : 111 + 26*1, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel3", + "type" : "button", + "x" : 310, + "y" : 111 + 26*2, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel4", + "type" : "button", + "x" : 310, + "y" : 111 + 26*3, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel5", + "type" : "button", + "x" : 310, + "y" : 111 + 26*4, + "text" : uiScriptLocale.CANCEL, + "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", + }, + { + "name" : "EnemyGuildCancel6", + "type" : "button", + "x" : 310, + "y" : 111 + 26*5, + "text" : uiScriptLocale.CANCEL, + "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", + }, + + ## DeclareWar + { + "name" : "DeclareWarButton", + "type" : "button", + "x" : 250 + 15, + "y" : 264, + "text" : uiScriptLocale.GUILD_INFO_DECALRE_WAR, + "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", + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_guildskillpage.py b/uiscript/uiscript/guildwindow_guildskillpage.py new file mode 100644 index 0000000..cd75cb0 --- /dev/null +++ b/uiscript/uiscript/guildwindow_guildskillpage.py @@ -0,0 +1,224 @@ +import uiScriptLocale + +ADD_HEIGHT = 17 +LOCALE_PATH = uiScriptLocale.WINDOWS_PATH + +window = { + "name" : "GuildWindow_GuildSkillPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + + ## PassiveSkill + { + "name":"Passive_Skill_Bar", + "type":"horizontalbar", + "x":0, + "y":3 + ADD_HEIGHT, + "width":320, + "horizontal_align" : "center", + "children" : + ( + + { + "name":"Passive_Skill_Title", + "type":"text", + "x" : 7, + "y" : 2, + "vertical_align" : "center", + "text_vertical_align" : "center", + "text" : uiScriptLocale.GUILD_SKILL_PASSIVE, + }, + { + "name":"Passive_Skill_Plus_Label", + "type":"image", + "x":240, + "y":2, + "image":LOCALE_PATH+"label_uppt.sub", + "children" : + ( + { + "name":"Skill_Plus_Value", + "type":"text", + "x":61, + "y":0, + "text":"99", + "text_horizontal_align":"center" + }, + ), + }, + + ), + }, ## end of PassiveSkill's horizontal bar + + { + "name" : "Passive_Skill_Slot_Table", + "type" : "grid_table", + + "x" : 20 + 16, + "y" : 6 + 23 + ADD_HEIGHT, + + "start_index" : 200, + "x_count" : 9, + "y_count" : 1, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + + ## ActiveSkill + { + "name":"Active_Skill_Bar", + "type":"horizontalbar", + "x":0, + "y":70 + ADD_HEIGHT, + "width":320, + "horizontal_align" : "center", + "children" : + ( + + { + "name":"Active_Skill_Title", + "type":"text", + "x" : 7, + "y" : 2, + "vertical_align" : "center", + "text_vertical_align" : "center", + "text" : uiScriptLocale.GUILD_SKILL_ACTIVE, + }, + + ), + }, ## end of PassiveSkill's horizontal bar + + { + "name" : "Active_Skill_Slot_Table", + "type" : "grid_table", + + "x" : 20 + 16, + "y" : 73 + 23 + ADD_HEIGHT, + + "start_index" : 210, + "x_count" : 9, + "y_count" : 1, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + + ## Affect + { + "name":"Affect_Bar", + "type":"horizontalbar", + "x":0, + "y":137 + ADD_HEIGHT, + "width":320, + "horizontal_align" : "center", + "children" : + ( + + { + "name":"Affect_Title", + "type":"text", + "x" : 0, + "y" : 0, + "all_align" : "center", + "text" : uiScriptLocale.GUILD_SKILL_STATE, + }, + + ), + }, ## end of AffectedSkill's horizontal bar + + { + "name" : "Affect_Slot_Table", + "type" : "grid_table", + + "x" : 20 + 16, + "y" : 137 + 30 + ADD_HEIGHT, + + "start_index" : 0, + "x_count" : 9, + "y_count" : 2, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + + ########################################################################################### + + { + "name":"Dragon_God_Power_Title", + "type":"text", + "x" : 20, + "y" : 243 + ADD_HEIGHT + 5, + "text" : uiScriptLocale.GUILD_SKILL_POWER, + }, + { + "name":"Dragon_God_Power_Gauge_Slot", + "type":"image", + "x" : 65, + "y" : 243 + ADD_HEIGHT + 5, + "image" : "d:/ymir work/ui/game/guild/gauge.sub", + }, + { + "name" : "Dragon_God_Power_Gauge", + "type" : "ani_image", + + "x" : 69, + "y" : 243 + ADD_HEIGHT + 5, + + "delay" : 6, + + "images" : + ( + "D:/Ymir Work/UI/Pattern/SPGauge/01.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/02.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/03.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/04.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/05.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/06.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/07.tga", + ), + }, + { + "name" : "Dragon_God_Power_Slot", + "type" : "image", + "x" : 255, + "y" : 241 + ADD_HEIGHT - 4, + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + "children" : + ( + + { + "name":"Dragon_God_Power_Value", + "type":"text", + "x" : 0, + "y" : 0, + "all_align" : "center", + "text" : "3000 / 3000", + }, + + ), + }, + ## OfferButton + { + "name" : "Heal_GSP_Button", + "type" : "button", + "x" : 257, + "y" : 241 + ADD_HEIGHT + 17, + "text" : uiScriptLocale.GUILD_SKIlL_HEAL_GSP, + "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", + }, + + ), +} diff --git a/uiscript/uiscript/guildwindow_memberpage.py b/uiscript/uiscript/guildwindow_memberpage.py new file mode 100644 index 0000000..f4907e4 --- /dev/null +++ b/uiscript/uiscript/guildwindow_memberpage.py @@ -0,0 +1,46 @@ +import uiScriptLocale + +window = { + "name" : "GuildWindow_MemberPage", + + "x" : 8, + "y" : 30, + + "width" : 360, + "height" : 298, + + "children" : + ( + ## ScrollBar + { + "name" : "ScrollBar", + "type" : "scrollbar", + + "x" : 341, + "y" : 20, + "scrollbar_type" : "normal", + "size" : 270, + }, + + ## Grade + { + "name" : "IndexName", "type" : "text", "x" : 43, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_NAME, + }, + { + "name" : "IndexGrade", "type" : "text", "x" : 119, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_RANK, + }, + { + "name" : "IndexJob", "type" : "text", "x" : 177, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_JOB, + }, + { + "name" : "IndexLevel", "type" : "text", "x" : 217, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_LEVEL, + }, + { + "name" : "IndexOffer", "type" : "text", "x" : 251, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_SPECIFIC_GRAVITY, + }, + { + "name" : "IndexGeneral", "type" : "text", "x" : 304, "y" : 8, "text" : uiScriptLocale.GUILD_MEMBER_KNIGHT, + }, + + ), +} diff --git a/uiscript/uiscript/helpwindow.py b/uiscript/uiscript/helpwindow.py new file mode 100644 index 0000000..f81ee93 --- /dev/null +++ b/uiscript/uiscript/helpwindow.py @@ -0,0 +1,277 @@ +import uiScriptLocale + +HELP_STICK_IMAGE_FILE_NAME = "d:/ymir work/ui/pattern/help_stick.tga" + +START_HEIGHT = 50 +HEIGHT_STEP = 20 + +window = { + "name" : "HelpWindow", + + "x" : 0, + "y" : 0, + + "width" : SCREEN_WIDTH, + "height" : SCREEN_HEIGHT, + + "children" : + ( + ## Float Text + { + "name" : "help_01", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*0) / 600, + "text" : uiScriptLocale.HELP_MOVE_KEY, + }, + { + "name" : "help_02", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*1) / 600, + "text" : uiScriptLocale.HELP_CONTROL_CAMERA_BY_RIGHTBUTTON, + }, + { + "name" : "help_02", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*2) / 600, + "text" : uiScriptLocale.HELP_CONTROL_CAMERA_BY_MIDDLEBUTTON, + }, + { + "name" : "help_03", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*3) / 600, + "text" : uiScriptLocale.HELP_SHOW_ALL_NAME, + }, + { + "name" : "help_04", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*4) / 600, + "text" : uiScriptLocale.HELP_OPEN_CHAT, + }, + { + "name" : "help_05", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*5) / 600, + "text" : uiScriptLocale.HELP_OPEN_WHISPER, + }, + { + "name" : "help_06", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*6) / 600, + "text" : uiScriptLocale.HELP_ATTACK_KEY, + }, + { + "name" : "help_07", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*7) / 600, + "text" : uiScriptLocale.HELP_OPEN_CHARACTER, + }, + { + "name" : "help_08", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*8) / 600, + "text" : uiScriptLocale.HELP_OPEN_SKILL, + }, + { + "name" : "help_09", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*9) / 600, + "text" : uiScriptLocale.HELP_OPEN_QUEST, + }, + { + "name" : "help_10", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*10) / 600, + "text" : uiScriptLocale.HELP_OPEN_INVENTORY, + }, + { + "name" : "help_11", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*11) / 600, + "text" : uiScriptLocale.HELP_OPEN_LOG, + }, + { + "name" : "help_12", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*12) / 600, + "text" : uiScriptLocale.HELP_OPEN_ZONEMAP, + }, + { + "name" : "help_13", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*13) / 600, + "text" : uiScriptLocale.HELP_OPEN_MINIMAP, + }, + { + "name" : "help_14", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*14) / 600, + "text" : uiScriptLocale.HELP_CHANGE_PK_MODE, + }, + { + "name" : "help_15", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*15) / 600, + "text" : uiScriptLocale.HELP_PICK_ITEM, + }, + { + "name" : "help_16", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*16) / 600, + "text" : uiScriptLocale.HELP_SCREEN_CAPTURE, + }, + { + "name" : "help_17", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*17) / 600, + "text" : uiScriptLocale.HELP_GUILD_WINDOW, + }, + { + "name" : "help_18", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*18) / 600, + "text" : uiScriptLocale.HELP_MESSENGER_WINDOW, + }, + { + "name" : "help_19", "type" : "text", "outline" : 1, + "x" : SCREEN_WIDTH * 150 / 800, "y" : SCREEN_HEIGHT * (START_HEIGHT+HEIGHT_STEP*19) / 600, + "text" : uiScriptLocale.HELP_HELP, + }, + + ## TaskBar + { + "name" : "taskbar_help_stick_01", "type" : "expanded_image", + "x" : 22, "y" : SCREEN_HEIGHT - 120, + "rect" : (0.0, 0.0, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_01", "type" : "text", + "x" : -20, "y" : -20, + "text" : uiScriptLocale.HELP_FURY, + }, + ), + }, + { + "name" : "taskbar_help_stick_02", "type" : "expanded_image", + "x" : 80, "y" : SCREEN_HEIGHT - 122, + "rect" : (0.0, -0.3, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_02", "type" : "text", + "x" : 4, "y" : 12, + "text" : uiScriptLocale.HELP_HP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_03", "type" : "expanded_image", + "x" : 120, "y" : SCREEN_HEIGHT - 107, + "rect" : (0.0, -0.4, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_03", "type" : "text", + "x" : 4, "y" : 23, + "text" : uiScriptLocale.HELP_SP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_04", "type" : "expanded_image", + "x" : 206, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.7, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_04", "type" : "text", + "x" : 4, "y" : 51, + "text" : uiScriptLocale.HELP_EXP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_05", "type" : "expanded_image", + "x" : SCREEN_WIDTH/2 - 128 + 12, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.5, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_05", "type" : "text", + "x" : 4, "y" : 32, + "text" : uiScriptLocale.HELP_MOUSE_LEFT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_06", "type" : "expanded_image", + "x" : SCREEN_WIDTH/2 + 128 + 66 + 12, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.5, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_06", "type" : "text", + "x" : 4, "y" : 32, + "text" : uiScriptLocale.HELP_MOUSE_RIGHT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_07", "type" : "expanded_image", + "x" : SCREEN_WIDTH * (400 - 4) / 800, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.7, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_07", "type" : "text", + "x" : 4, "y" : 51, + "text" : uiScriptLocale.HELP_QUICKSLOT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_08", "type" : "expanded_image", + "x" : SCREEN_WIDTH - 77 - 4, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.28, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_08a", "type" : "text", + "x" : 4, "y" : -20, + "text" : uiScriptLocale.HELP_SYSTEM_BUTTON, + "text_horizontal_align" : "center", + }, + { + "name" : "taskbar_help_08b", "type" : "text", + "x" : 4, "y" : -5, + "text" : uiScriptLocale.HELP_CHARACTER_BUTTON1, + "text_horizontal_align" : "center", + }, + { + "name" : "taskbar_help_08c", "type" : "text", + "x" : 4, "y" : 10, + "text" : uiScriptLocale.HELP_CHARACTER_BUTTON2, + "text_horizontal_align" : "center", + }, + ), + }, + + ## Button + { + "name" : "close_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (55) / 800, + "y" : SCREEN_HEIGHT * (55) / 600, + + "text" : uiScriptLocale.CLOSE, + + "default_image" : "d:/ymir work/ui/public/xlarge_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/xlarge_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/xlarge_thin_button_03.sub", + }, + ), +} diff --git a/uiscript/uiscript/helpwindow2.py b/uiscript/uiscript/helpwindow2.py new file mode 100644 index 0000000..8de0057 --- /dev/null +++ b/uiscript/uiscript/helpwindow2.py @@ -0,0 +1,342 @@ +import uiScriptLocale + +HELP_STICK_IMAGE_FILE_NAME = "d:/ymir work/ui/pattern/help_stick.tga" + +START_HEIGHT = 50 +HEIGHT_STEP = 20 + +window = { + "name" : "HelpWindow", + + "x" : 0, + "y" : 0, + + "width" : SCREEN_WIDTH, + "height" : SCREEN_HEIGHT, + + "children" : + ( + ## Float Text + { + "name" : "page_1", + "type" : "window", + + "x" : SCREEN_WIDTH * 150 / 800, + "y" : SCREEN_HEIGHT * START_HEIGHT / 600, + "width" : 0, + "height" : 0, + + "children" : + ( + { + "name" : "help_01", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*0, + "text" : uiScriptLocale.HELP_MOVE_KEY, + }, + { + "name" : "help_02", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*1, + "text" : uiScriptLocale.HELP_CONTROL_CAMERA_BY_RIGHTBUTTON, + }, + { + "name" : "help_02", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*2, + "text" : uiScriptLocale.HELP_CONTROL_CAMERA_BY_MIDDLEBUTTON, + }, + { + "name" : "help_03", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*3, + "text" : uiScriptLocale.HELP_SHOW_ALL_NAME, + }, + { + "name" : "help_04", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*4, + "text" : uiScriptLocale.HELP_OPEN_CHAT, + }, + { + "name" : "help_05", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*5, + "text" : uiScriptLocale.HELP_OPEN_WHISPER, + }, + { + "name" : "help_06", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*6, + "text" : uiScriptLocale.HELP_ATTACK_KEY, + }, + { + "name" : "help_07", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*7, + "text" : uiScriptLocale.HELP_OPEN_CHARACTER, + }, + { + "name" : "help_08", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*8, + "text" : uiScriptLocale.HELP_OPEN_SKILL, + }, + { + "name" : "help_09", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*9, + "text" : uiScriptLocale.HELP_OPEN_QUEST, + }, + { + "name" : "help_10", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*10, + "text" : uiScriptLocale.HELP_OPEN_INVENTORY, + }, + { + "name" : "help_11", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*11, + "text" : uiScriptLocale.HELP_OPEN_LOG, + }, + { + "name" : "help_12", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*12, + "text" : uiScriptLocale.HELP_OPEN_ZONEMAP, + }, + { + "name" : "help_13", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*13, + "text" : uiScriptLocale.HELP_OPEN_MINIMAP, + }, + { + "name" : "help_14", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*14, + "text" : uiScriptLocale.HELP_CHANGE_PK_MODE, + }, + { + "name" : "help_15", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*15, + "text" : uiScriptLocale.HELP_PICK_ITEM, + }, + { + "name" : "help_16", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*16, + "text" : uiScriptLocale.HELP_SCREEN_CAPTURE, + }, + { + "name" : "help_17", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*17, + "text" : uiScriptLocale.HELP_GUILD_WINDOW, + }, + { + "name" : "help_18", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*18, + "text" : uiScriptLocale.HELP_MESSENGER_WINDOW, + }, + { + "name" : "help_19", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*19, + "text" : uiScriptLocale.HELP_HELP, + }, + ), + }, + + { + "name" : "page_2", + "type" : "window", + + "x" : SCREEN_WIDTH * 150 / 800, + "y" : SCREEN_HEIGHT * START_HEIGHT / 600, + "width" : 0, + "height" : 0, + + "children" : + ( + { + "name" : "help_02_01", "type" : "text", "outline" : 1, + "x" : 0, "y" : SCREEN_HEIGHT * HEIGHT_STEP*0, + "text" : "- 啊唱促扼付官荤 01", + }, + { + "name" : "help_02_02", "type" : "text", "outline" : 1, + "x" : 0, "y" : HEIGHT_STEP*1, + "text" : "- 啊唱促扼付官荤 02", + }, + + ## 捞 关栏肺 咆胶飘甫 眠啊 窍矫搁 邓聪促. + ), + }, + + ## TaskBar + { + "name" : "taskbar_help_stick_01", "type" : "expanded_image", + "x" : 22, "y" : SCREEN_HEIGHT - 120, + "rect" : (0.0, 0.0, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_01", "type" : "text", + "x" : -20, "y" : -20, + "text" : uiScriptLocale.HELP_FURY, + }, + ), + }, + { + "name" : "taskbar_help_stick_02", "type" : "expanded_image", + "x" : 80, "y" : SCREEN_HEIGHT - 122, + "rect" : (0.0, -0.3, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_02", "type" : "text", + "x" : 4, "y" : 12, + "text" : uiScriptLocale.HELP_HP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_03", "type" : "expanded_image", + "x" : 120, "y" : SCREEN_HEIGHT - 107, + "rect" : (0.0, -0.4, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_03", "type" : "text", + "x" : 4, "y" : 23, + "text" : uiScriptLocale.HELP_SP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_04", "type" : "expanded_image", + "x" : 206, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.7, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_04", "type" : "text", + "x" : 4, "y" : 51, + "text" : uiScriptLocale.HELP_EXP, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_05", "type" : "expanded_image", + "x" : SCREEN_WIDTH/2 - 128 + 12, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.5, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_05", "type" : "text", + "x" : 4, "y" : 32, + "text" : uiScriptLocale.HELP_MOUSE_LEFT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_06", "type" : "expanded_image", + "x" : SCREEN_WIDTH/2 + 128 + 66 + 12, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.5, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_06", "type" : "text", + "x" : 4, "y" : 32, + "text" : uiScriptLocale.HELP_MOUSE_RIGHT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_07", "type" : "expanded_image", + "x" : SCREEN_WIDTH * (400 - 4) / 800, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.7, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_07", "type" : "text", + "x" : 4, "y" : 51, + "text" : uiScriptLocale.HELP_QUICKSLOT, + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "taskbar_help_stick_08", "type" : "expanded_image", + "x" : SCREEN_WIDTH - 77 - 4, "y" : SCREEN_HEIGHT - 116, + "rect" : (0.0, -0.28, 0.0, 0.0), + "image" : HELP_STICK_IMAGE_FILE_NAME, + + "children" : + ( + { + "name" : "taskbar_help_08a", "type" : "text", + "x" : 4, "y" : -20, + "text" : uiScriptLocale.HELP_SYSTEM_BUTTON, + "text_horizontal_align" : "center", + }, + { + "name" : "taskbar_help_08b", "type" : "text", + "x" : 4, "y" : -5, + "text" : uiScriptLocale.HELP_CHARACTER_BUTTON1, + "text_horizontal_align" : "center", + }, + { + "name" : "taskbar_help_08c", "type" : "text", + "x" : 4, "y" : 10, + "text" : uiScriptLocale.HELP_CHARACTER_BUTTON2, + "text_horizontal_align" : "center", + }, + ), + }, + + ## Button + { + "name" : "page_1_button", + "type" : "radio_button", + + "x" : SCREEN_WIDTH * (55) / 800, + "y" : SCREEN_HEIGHT * (50) / 600, + + "text" : "1 Page", + + "default_image" : "d:/ymir work/ui/public/xlarge_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/xlarge_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/xlarge_thin_button_03.sub", + }, + { + "name" : "page_2_button", + "type" : "radio_button", + + "x" : SCREEN_WIDTH * (55) / 800, + "y" : SCREEN_HEIGHT * (35 + 50) / 600, + + "text" : "2 Page", + + "default_image" : "d:/ymir work/ui/public/xlarge_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/xlarge_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/xlarge_thin_button_03.sub", + }, + { + "name" : "close_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (55) / 800, + "y" : SCREEN_HEIGHT * (100 + 50) / 600, + + "text" : uiScriptLocale.CLOSE, + + "default_image" : "d:/ymir work/ui/public/xlarge_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/xlarge_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/xlarge_thin_button_03.sub", + }, + ), +} diff --git a/uiscript/uiscript/imekor.py b/uiscript/uiscript/imekor.py new file mode 100644 index 0000000..d74d99d --- /dev/null +++ b/uiscript/uiscript/imekor.py @@ -0,0 +1,37 @@ +ROOT = "d:/ymir work/ui/game/" + +window = { + "name" : "IME", + + "x" : 100, + "y" : 300, + + "width" : 155, + "height" : 25, + + "children" : + ( + ## Board + { + "name" : "Base_Board_01", + "type" : "image", + + "x" : 0, + "y" : 0, + + "image" : "d:/ymir work/ui/public/HorizontalCandidateBoard.sub" + }, + { + "name" : "CandidateList", + "type" : "candidate_list", + + "x" : 5 + 2, + "y" : 10, + + "item_xsize" : 16, + "item_ysize" : 16, + + "item_step" : 16, + }, + ), +} diff --git a/uiscript/uiscript/inputdialog.py b/uiscript/uiscript/inputdialog.py new file mode 100644 index 0000000..b317a0b --- /dev/null +++ b/uiscript/uiscript/inputdialog.py @@ -0,0 +1,94 @@ +import uiScriptLocale + +window = { + "name" : "InputDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 90, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 90, + + "title" : "", + + "children" : + ( + + ## Input Slot + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 0, + "y" : 34, + "width" : 90, + "height" : 18, + "horizontal_align" : "center", + + #"type" : "image", + #"image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "InputValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + "input_limit" : 12, + }, + ), + }, + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 58, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 58, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/inputdialogwithdescription.py b/uiscript/uiscript/inputdialogwithdescription.py new file mode 100644 index 0000000..3b54b76 --- /dev/null +++ b/uiscript/uiscript/inputdialogwithdescription.py @@ -0,0 +1,103 @@ +import uiScriptLocale + +window = { + "name" : "InputDialog_WithDescription", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 106, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 106, + + "title" : "", + + "children" : + ( + + ## Text + { + "name" : "Description", + "type" : "text", + "text" : "", + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 34, + }, + + ## Input Slot + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 0, + "y" : 51, + "width" : 90, + "height" : 18, + "horizontal_align" : "center", + + "children" : + ( + { + "name" : "InputValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + "input_limit" : 12, + }, + ), + }, + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 74, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 74, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/inputdialogwithdescription2.py b/uiscript/uiscript/inputdialogwithdescription2.py new file mode 100644 index 0000000..35de48a --- /dev/null +++ b/uiscript/uiscript/inputdialogwithdescription2.py @@ -0,0 +1,114 @@ +import uiScriptLocale + +TEMPORARY_HEIGHT = 16 + +window = { + "name" : "InputDialog_WithDescription", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 106 + TEMPORARY_HEIGHT, + + "children" : + ( + { + "name" : "Board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 106 + TEMPORARY_HEIGHT, + + "title" : "", + + "children" : + ( + + ## Text + { + "name" : "Description1", + "type" : "text", + "text" : "", + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 34, + }, + { + "name" : "Description2", + "type" : "text", + "text" : "", + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 34 + TEMPORARY_HEIGHT, + }, + + ## Input Slot + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 0, + "y" : 51 + TEMPORARY_HEIGHT, + "width" : 90, + "height" : 18, + "horizontal_align" : "center", + + "children" : + ( + { + "name" : "InputValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + "input_limit" : 12, + }, + ), + }, + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 74 + TEMPORARY_HEIGHT, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 74 + TEMPORARY_HEIGHT, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/inventorywindow.py b/uiscript/uiscript/inventorywindow.py new file mode 100644 index 0000000..2ec694c --- /dev/null +++ b/uiscript/uiscript/inventorywindow.py @@ -0,0 +1,261 @@ +import uiScriptLocale + +EQUIPMENT_START_INDEX = 90 + +window = { + "name" : "InventoryWindow", + + ## 600 - (width + 坷弗率栏肺 何磐 剁快扁 24 px) + "x" : SCREEN_WIDTH - 176 - 200, + "y" : SCREEN_HEIGHT - 37 - 565, + + "style" : ("movable", "float",), + + "width" : 176, + "height" : 565, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 176, + "height" : 565, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 161, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, "text_horizontal_align":"center" }, + ), + }, + + ## Equipment Slot + { + "name" : "Equipment_Base", + "type" : "image", + + "x" : 10, + "y" : 33, + + "image" : "d:/ymir work/ui/game/windows/equipment_base.sub", + + "children" : + ( + + { + "name" : "EquipmentSlot", + "type" : "slot", + + "x" : 3, + "y" : 3, + + "width" : 150, + "height" : 182, + + "slot" : ( + {"index":EQUIPMENT_START_INDEX+0, "x":39, "y":37, "width":32, "height":64}, + {"index":EQUIPMENT_START_INDEX+1, "x":39, "y":2, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+2, "x":39, "y":145, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+3, "x":75, "y":67, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+4, "x":3, "y":3, "width":32, "height":96}, + {"index":EQUIPMENT_START_INDEX+5, "x":114, "y":84, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+6, "x":114, "y":52, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+7, "x":2, "y":113, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+8, "x":75, "y":113, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+9, "x":114, "y":1, "width":32, "height":32}, + {"index":EQUIPMENT_START_INDEX+10, "x":75, "y":35, "width":32, "height":32}, + ), + }, + + { + "name" : "Equipment_Tab_01", + "type" : "radio_button", + + "x" : 86, + "y" : 161, + + "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", + + "children" : + ( + { + "name" : "Equipment_Tab_01_Print", + "type" : "text", + + "x" : 0, + "y" : 0, + + "all_align" : "center", + + "text" : "I", + }, + ), + }, + { + "name" : "Equipment_Tab_02", + "type" : "radio_button", + + "x" : 86 + 32, + "y" : 161, + + "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", + + "children" : + ( + { + "name" : "Equipment_Tab_02_Print", + "type" : "text", + + "x" : 0, + "y" : 0, + + "all_align" : "center", + + "text" : "II", + }, + ), + }, + + ), + }, + + { + "name" : "Inventory_Tab_01", + "type" : "radio_button", + + "x" : 10, + "y" : 33 + 191, + + "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", + "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_1, + + "children" : + ( + { + "name" : "Inventory_Tab_01_Print", + "type" : "text", + + "x" : 0, + "y" : 0, + + "all_align" : "center", + + "text" : "I", + }, + ), + }, + { + "name" : "Inventory_Tab_02", + "type" : "radio_button", + + "x" : 10 + 78, + "y" : 33 + 191, + + "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", + "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, + + "children" : + ( + { + "name" : "Inventory_Tab_02_Print", + "type" : "text", + + "x" : 0, + "y" : 0, + + "all_align" : "center", + + "text" : "II", + }, + ), + }, + + ## Item Slot + { + "name" : "ItemSlot", + "type" : "grid_table", + + "x" : 8, + "y" : 246, + + "start_index" : 0, + "x_count" : 5, + "y_count" : 9, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub" + }, + + ## Print + { + "name":"Money_Slot", + "type":"button", + + "x":8, + "y":28, + + "horizontal_align":"center", + "vertical_align":"bottom", + + "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", + "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", + "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", + + "children" : + ( + { + "name":"Money_Icon", + "type":"image", + + "x":-18, + "y":20, + + "image":"d:/ymir work/ui/game/windows/money_icon.sub", + }, + + { + "name" : "Money", + "type" : "text", + + "x" : 3, + "y" : 3, + + "horizontal_align" : "right", + "text_horizontal_align" : "right", + + "text" : "123456789", + }, + ), + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/loadingwindow.py b/uiscript/uiscript/loadingwindow.py new file mode 100644 index 0000000..8ea85bd --- /dev/null +++ b/uiscript/uiscript/loadingwindow.py @@ -0,0 +1,102 @@ +import uiScriptLocale + +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" : 0, + + "image" : "d:/ymir work/ui/intro/pattern/Line_Pattern.tga", + + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + }, + { + "name":"ErrorMessage", + "type":"text", "x":10, "y":10, + "text": uiScriptLocale.LOAD_ERROR, + }, + { + "name" : "GageBoard", + "type" : "window", + "x" : float(SCREEN_WIDTH) * 400 / 800.0 - 200, + "y" : float(SCREEN_HEIGHT) * 500 / 600.0 , + "width" : 400, + "height": 80, + + "children" : + ( + { + "name" : "BackGage", + "type" : "ani_image", + + + "x" : 0, + "y" : 0, + + "delay" : 1, + + "images" : + ( + "d:/ymir work/ui/intro/loading/00.sub", + "d:/ymir work/ui/intro/loading/01.sub", + "d:/ymir work/ui/intro/loading/02.sub", + "d:/ymir work/ui/intro/loading/03.sub", + "d:/ymir work/ui/intro/loading/04.sub", + "d:/ymir work/ui/intro/loading/05.sub", + "d:/ymir work/ui/intro/loading/06.sub", + "d:/ymir work/ui/intro/loading/07.sub", + "d:/ymir work/ui/intro/loading/08.sub", + "d:/ymir work/ui/intro/loading/09.sub", + "d:/ymir work/ui/intro/loading/10.sub", + "d:/ymir work/ui/intro/loading/11.sub", + "d:/ymir work/ui/intro/loading/12.sub", + "d:/ymir work/ui/intro/loading/13.sub", + "d:/ymir work/ui/intro/loading/14.sub", + "d:/ymir work/ui/intro/loading/15.sub", + "d:/ymir work/ui/intro/loading/16.sub", + "d:/ymir work/ui/intro/loading/17.sub", + "d:/ymir work/ui/intro/loading/18.sub", + "d:/ymir work/ui/intro/loading/19.sub", + "d:/ymir work/ui/intro/loading/20.sub", + "d:/ymir work/ui/intro/loading/21.sub", + "d:/ymir work/ui/intro/loading/22.sub", + "d:/ymir work/ui/intro/loading/23.sub", + ) + }, + { + "name" : "BackGage", + "type" : "expanded_image", + + "x" : 70, + "y" : 25, + + "image" : "d:/ymir work/ui/intro/loading/gauge_empty.sub", + }, + { + "name" : "FullGage", + "type" : "expanded_image", + + "x" : 70, + "y" : 25, + + "image" : "d:/ymir work/ui/intro/loading/gauge_full.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/mallwindow.py b/uiscript/uiscript/mallwindow.py new file mode 100644 index 0000000..ced2667 --- /dev/null +++ b/uiscript/uiscript/mallwindow.py @@ -0,0 +1,66 @@ +import uiScriptLocale + +window = { + "name" : "SafeboxWindow", + + "x" : 100, + "y" : 20, + + "style" : ("movable", "float",), + + "width" : 176, + "height" : 327, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 176, + "height" : 327, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 161, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.MALL_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Button + { + "name" : "ExitButton", + "type" : "button", + + "x" : 0, + "y" : 37, + + "text" : uiScriptLocale.CLOSE, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "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", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/marklistwindow.py b/uiscript/uiscript/marklistwindow.py new file mode 100644 index 0000000..c09bf43 --- /dev/null +++ b/uiscript/uiscript/marklistwindow.py @@ -0,0 +1,89 @@ +import uiScriptLocale + +window = { + "name" : "MarkListWindow", + + "x" : SCREEN_WIDTH - 170, + "y" : SCREEN_HEIGHT - 400 - 50, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 300, + + "children" : + ( + + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 300, + "title" : uiScriptLocale.MARKLIST_TITLE, + }, + + { + "name" : "ScrollBar", + "type" : "scrollbar", + + "x" : 27, + "y" : 40, + "size" : 220, + "horizontal_align" : "right", + }, + + { + "name" : "ok", + "type" : "button", + + "x" : 15, + "y" : 265, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.OK, + + "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", + }, + { + "name" : "cancel", + "type" : "button", + + "x" : 60, + "y" : 265, + + "width" : 41, + "height" : 21, + + "text" : uiScriptLocale.CANCEL, + + "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", + }, + + { + "name" : "refresh", + "type" : "button", + + "x" : 115, + "y" : 265, + + "width" : 41, + "height" : 21, + + "text" : uiScriptLocale.MARKLIST_REFRESH, + + "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", + }, + ) +} \ No newline at end of file diff --git a/uiscript/uiscript/messengerwindow.py b/uiscript/uiscript/messengerwindow.py new file mode 100644 index 0000000..ce167d2 --- /dev/null +++ b/uiscript/uiscript/messengerwindow.py @@ -0,0 +1,129 @@ +import uiScriptLocale + +BUTTON_START_X_POS = -60 +BUTTON_X_STEP = 30 + +window = { + "name" : "MessengerWindow", + + "x" : SCREEN_WIDTH - 200, + "y" : SCREEN_HEIGHT - 400 - 50, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 300, + + "children" : + ( + + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 300, + "title" : uiScriptLocale.MESSENGER_TITLE, + }, + + { + "name" : "ScrollBar", + "type" : "scrollbar", + + "x" : 27, + "y" : 40, + "size" : 100, + "horizontal_align" : "right", + }, + + { + "name" : "AddFriendButton", + "type" : "button", + + "x" : BUTTON_START_X_POS + BUTTON_X_STEP*0, + "y" : 30, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "tooltip_text" : uiScriptLocale.MESSENGER_ADD_FRIEND, + "tooltip_x" : 0, + "tooltip_y" : 35, + + "default_image" : "d:/ymir work/ui/game/windows/messenger_add_friend_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/messenger_add_friend_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/messenger_add_friend_03.sub", + "disable_image" : "d:/ymir work/ui/game/windows/messenger_add_friend_04.sub", + }, + { + "name" : "WhisperButton", + "type" : "button", + + "x" : BUTTON_START_X_POS + BUTTON_X_STEP*1, + "y" : 30, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "tooltip_text" : uiScriptLocale.MESSENGER_WHISPER, + "tooltip_x" : 0, + "tooltip_y" : 35, + + "default_image" : "d:/ymir work/ui/game/windows/messenger_whisper_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/messenger_whisper_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/messenger_whisper_03.sub", + "disable_image" : "d:/ymir work/ui/game/windows/messenger_whisper_04.sub", + }, + { + "name" : "MobileButton", + "type" : "button", + + "x" : BUTTON_START_X_POS + BUTTON_X_STEP*2, + "y" : 30, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "tooltip_text" : uiScriptLocale.MESSENGER_MOBILE, + "tooltip_x" : 0, + "tooltip_y" : 35, + + "default_image" : "d:/ymir work/ui/game/windows/messenger_mobile_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/messenger_mobile_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/messenger_mobile_03.sub", + "disable_image" : "d:/ymir work/ui/game/windows/messenger_mobile_04.sub", + }, + { + "name" : "RemoveButton", + "type" : "button", + + "x" : BUTTON_START_X_POS + BUTTON_X_STEP*3, + "y" : 30, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "tooltip_text" : uiScriptLocale.MESSENGER_DELETE_FRIEND, + "tooltip_x" : 0, + "tooltip_y" : 35, + + "default_image" : "d:/ymir work/ui/game/windows/messenger_delete_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/messenger_delete_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/messenger_delete_03.sub", + "disable_image" : "d:/ymir work/ui/game/windows/messenger_delete_04.sub", + }, + { + "name" : "GuildButton", + "type" : "button", + + "x" : BUTTON_START_X_POS + BUTTON_X_STEP*4, + "y" : 30, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "tooltip_text" : uiScriptLocale.MESSENGER_OPEN_GUILD, + "tooltip_x" : 0, + "tooltip_y" : 35, + + "default_image" : "d:/ymir work/ui/game/windows/messenger_guild_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/messenger_guild_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/messenger_guild_03.sub", + "disable_image" : "d:/ymir work/ui/game/windows/messenger_guild_04.sub", + }, + + ), ## end of main window +} diff --git a/uiscript/uiscript/minimap.py b/uiscript/uiscript/minimap.py new file mode 100644 index 0000000..8b3844c --- /dev/null +++ b/uiscript/uiscript/minimap.py @@ -0,0 +1,164 @@ +ROOT = "d:/ymir work/ui/minimap/" + +window = { + "name" : "MiniMap", + + "x" : SCREEN_WIDTH - 136, + "y" : 0, + + "width" : 136, + "height" : 137, + + "children" : + ( + ## OpenWindow + { + "name" : "OpenWindow", + "type" : "window", + + "x" : 0, + "y" : 0, + + "width" : 136, + "height" : 137, + + "children" : + ( + { + "name" : "OpenWindowBGI", + "type" : "image", + "x" : 0, + "y" : 0, + "image" : ROOT + "minimap.sub", + }, + ## MiniMapWindow + { + "name" : "MiniMapWindow", + "type" : "window", + + "x" : 4, + "y" : 5, + + "width" : 128, + "height" : 128, + }, + ## ScaleUpButton + { + "name" : "ScaleUpButton", + "type" : "button", + + "x" : 101, + "y" : 116, + + "default_image" : ROOT + "minimap_scaleup_default.sub", + "over_image" : ROOT + "minimap_scaleup_over.sub", + "down_image" : ROOT + "minimap_scaleup_down.sub", + }, + ## ScaleDownButton + { + "name" : "ScaleDownButton", + "type" : "button", + + "x" : 115, + "y" : 103, + + "default_image" : ROOT + "minimap_scaledown_default.sub", + "over_image" : ROOT + "minimap_scaledown_over.sub", + "down_image" : ROOT + "minimap_scaledown_down.sub", + }, + ## MiniMapHideButton + { + "name" : "MiniMapHideButton", + "type" : "button", + + "x" : 111, + "y" : 6, + + "default_image" : ROOT + "minimap_close_default.sub", + "over_image" : ROOT + "minimap_close_over.sub", + "down_image" : ROOT + "minimap_close_down.sub", + }, + ## AtlasShowButton + { + "name" : "AtlasShowButton", + "type" : "button", + + "x" : 12, + "y" : 12, + + "default_image" : ROOT + "atlas_open_default.sub", + "over_image" : ROOT + "atlas_open_over.sub", + "down_image" : ROOT + "atlas_open_down.sub", + }, + ## ServerInfo + { + "name" : "ServerInfo", + "type" : "text", + + "text_horizontal_align" : "center", + + "outline" : 1, + + "x" : 70, + "y" : 140, + + "text" : "", + }, + ## PositionInfo + { + "name" : "PositionInfo", + "type" : "text", + + "text_horizontal_align" : "center", + + "outline" : 1, + + "x" : 70, + "y" : 160, + + "text" : "", + }, + ## ObserverCount + { + "name" : "ObserverCount", + "type" : "text", + + "text_horizontal_align" : "center", + + "outline" : 1, + + "x" : 70, + "y" : 180, + + "text" : "", + }, + ), + }, + { + "name" : "CloseWindow", + "type" : "window", + + "x" : 0, + "y" : 0, + + "width" : 132, + "height" : 48, + + "children" : + ( + ## ShowButton + { + "name" : "MiniMapShowButton", + "type" : "button", + + "x" : 100, + "y" : 4, + + "default_image" : ROOT + "minimap_open_default.sub", + "over_image" : ROOT + "minimap_open_default.sub", + "down_image" : ROOT + "minimap_open_default.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/moneyinputdialog.py b/uiscript/uiscript/moneyinputdialog.py new file mode 100644 index 0000000..cb14d86 --- /dev/null +++ b/uiscript/uiscript/moneyinputdialog.py @@ -0,0 +1,103 @@ +import uiScriptLocale + +window = { + "name" : "InputDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 200, + "height" : 110, + + "children" : + ( + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 110, + + "title" : "", + + "children" : + ( + + ## Input Slot + { + "name" : "InputSlot", + "type" : "slotbar", + + "x" : 0, + "y" : 34, + "width" : 90, + "height" : 18, + "horizontal_align" : "center", + + "children" : + ( + { + "name" : "InputValue", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 90, + "height" : 18, + + "input_limit" : 12, + }, + ), + }, + + ## Input Slot + { + "name" : "MoneyValue", + "type" : "text", + + "x" : 0, + "y" : 59, + "text" : "999999999", + "text_horizontal_align" : "center", + "horizontal_align" : "center", + }, + + ## Button + { + "name" : "AcceptButton", + "type" : "button", + + "x" : - 61 - 5 + 30, + "y" : 78, + "horizontal_align" : "center", + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 5 + 30, + "y" : 78, + "horizontal_align" : "center", + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/mousebuttonwindow.py b/uiscript/uiscript/mousebuttonwindow.py new file mode 100644 index 0000000..5f01054 --- /dev/null +++ b/uiscript/uiscript/mousebuttonwindow.py @@ -0,0 +1,62 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/game/taskbar/" + +window = { + "name" : "ButtonWindow", + + "x" : 0, + "y" : 0, + + "width" : 32, + "height" : 32 * 3, + + "children" : + ( + { + "name" : "button_move_and_attack", + "type" : "button", + + "x" : 0, + "y" : 0, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_ATTACK, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Attack_01.sub", + "over_image" : ROOT + "Mouse_Button_Attack_02.sub", + "down_image" : ROOT + "Mouse_Button_Attack_03.sub", + }, + { + "name" : "button_auto_attack", + "type" : "button", + + "x" : 0, + "y" : 32, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_AUTO_ATTACK, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Auto_Attack_01.sub", + "over_image" : ROOT + "Mouse_Button_Auto_Attack_02.sub", + "down_image" : ROOT + "Mouse_Button_Auto_Attack_03.sub", + }, + { + "name" : "button_camera", + "type" : "button", + + "x" : 0, + "y" : 64, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_CAMERA, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Camera_01.sub", + "over_image" : ROOT + "Mouse_Button_Camera_02.sub", + "down_image" : ROOT + "Mouse_Button_Camera_03.sub", + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/musiclistwindow.py b/uiscript/uiscript/musiclistwindow.py new file mode 100644 index 0000000..36a5e54 --- /dev/null +++ b/uiscript/uiscript/musiclistwindow.py @@ -0,0 +1,89 @@ +import uiScriptLocale + +window = { + "name" : "MusicListWindow", + + "x" : SCREEN_WIDTH - 170, + "y" : SCREEN_HEIGHT - 400 - 50, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 300, + + "children" : + ( + + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 300, + "title" : uiScriptLocale.MUSICLIST_TITLE, + }, + + { + "name" : "ScrollBar", + "type" : "scrollbar", + + "x" : 27, + "y" : 40, + "size" : 220, + "horizontal_align" : "right", + }, + + { + "name" : "ok", + "type" : "button", + + "x" : 15, + "y" : 265, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.OK, + + "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", + }, + { + "name" : "cancel", + "type" : "button", + + "x" : 60, + "y" : 265, + + "width" : 41, + "height" : 21, + + "text" : uiScriptLocale.CANCEL, + + "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", + }, + + { + "name" : "refresh", + "type" : "button", + + "x" : 115, + "y" : 265, + + "width" : 41, + "height" : 21, + + "text" : uiScriptLocale.MARKLIST_REFRESH, + + "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", + }, + ) +} diff --git a/uiscript/uiscript/partymemberinfoboard.py b/uiscript/uiscript/partymemberinfoboard.py new file mode 100644 index 0000000..2e5d5a0 --- /dev/null +++ b/uiscript/uiscript/partymemberinfoboard.py @@ -0,0 +1,148 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "PartyMemeberInfoBoard", + + "x" : 0, + "y" : 0, + + "width" : 106, + "height" : 36, + + "children" : + ( + + { + "name" : "StateButton", + "type" : "button", + + "x" : 0, + "y" : 0, + + "default_image" : "d:/ymir work/ui/game/windows/party_state_normal_01.sub", + "over_image" : "d:/ymir work/ui/game/windows/party_state_normal_02.sub", + "down_image" : "d:/ymir work/ui/game/windows/party_state_normal_03.sub", + }, + + { + "name" : "NameSlot", + "type" : "bar", + "style" : ("not_pick",), + + "x" : 22, + "y" : 0, + "width" : 84, + "height" : 17, + "color" : 0x99000000, + + "children" : + ( + { + "name" : "NamePrint", + "type" : "text", + + "x" : 3, + "y" : 2, + + "text" : uiScriptLocale.PARTY_MEMBER_INFO_NAME, + }, + ), + }, + + { + "name" : "Gauge", + "type" : "gauge", + "style" : ("not_pick",), + + "x" : 22, + "y" : 17, + "width" : 84, + "color" : "red", + }, + + { + "name" : "ExperienceImage", + "type" : "image", + + "x" : 22, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_experience.sub", + }, + { + "name" : "AttackerImage", + "type" : "image", + + "x" : 34, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_attackgrade.sub", + }, + { + "name" : "DefenderImage", + "type" : "image", + + "x" : 46, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_defencegrade.sub", + }, + { + "name" : "BufferImage", + "type" : "image", + + "x" : 34, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_attackgrade.sub", + }, + { + "name" : "SkillMasterImage", + "type" : "image", + + "x" : 46, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_attackgrade.sub", + }, + { + "name" : "TimeBonusImage", + "type" : "image", + + "x" : 58, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_timebonus.sub", + }, + { + "name" : "RegenBonus", + "type" : "image", + + "x" : 70, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_regenbonus.sub", + }, + { + "name" : "IncreaseArea150", + "type" : "image", + + "x" : 82, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_increasearea_150.sub", + }, + { + "name" : "IncreaseArea200", + "type" : "image", + + "x" : 94, + "y" : 24, + + "image" : "d:/ymir work/ui/game/windows/party_affect_increasearea_200.sub", + }, + + ), +} diff --git a/uiscript/uiscript/passworddialog.py b/uiscript/uiscript/passworddialog.py new file mode 100644 index 0000000..e0b605f --- /dev/null +++ b/uiscript/uiscript/passworddialog.py @@ -0,0 +1,114 @@ +import uiScriptLocale + +window = { + "name" : "PasswordDialog", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 90, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 90, + + "children" : + ( + ## Title + { + "name" : "titlebar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 154, + "color" : "gray", + + "children" : + ( + { + "name" : "TitleName", + "type" : "text", + + "x" : 154/2, + "y" : 3, + + "text" : uiScriptLocale.PASSWORD_TITLE, + "text_horizontal_align":"center" + }, + ), + }, + + ## Password Slot + { + "name" : "password_slot", + "type" : "image", + + "x" : 0, + "y" : 34, + "horizontal_align" : "center", + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "password_value", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 60, + "height" : 18, + + "input_limit" : 6, + "secret_flag" : 1, + }, + ), + }, + + ## Button + { + "name" : "accept_button", + "type" : "button", + + "x" : 170/2 - 61 - 5, + "y" : 58, + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 170/2 + 5, + "y" : 58, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/pickmoneydialog.py b/uiscript/uiscript/pickmoneydialog.py new file mode 100644 index 0000000..7018f76 --- /dev/null +++ b/uiscript/uiscript/pickmoneydialog.py @@ -0,0 +1,99 @@ +import uiScriptLocale + +window = { + "name" : "PickMoneyDialog", + + "x" : 100, + "y" : 100, + + "style" : ("movable", "float",), + + "width" : 170, + "height" : 90, + + "children" : + ( + { + "name" : "board", + "type" : "board_with_titlebar", + + "x" : 0, + "y" : 0, + + "width" : 170, + "height" : 90, + "title" : uiScriptLocale.PICK_MONEY_TITLE, + + "children" : + ( + + ## Money Slot + { + "name" : "money_slot", + "type" : "image", + + "x" : 20, + "y" : 34, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_02.sub", + + "children" : + ( + { + "name" : "money_value", + "type" : "editline", + + "x" : 3, + "y" : 2, + + "width" : 60, + "height" : 18, + + "input_limit" : 6, + "only_number" : 1, + + "text" : "1", + }, + { + "name" : "max_value", + "type" : "text", + + "x" : 63, + "y" : 3, + + "text" : "/ 999999", + }, + ), + }, + + ## Button + { + "name" : "accept_button", + "type" : "button", + + "x" : 170/2 - 61 - 5, + "y" : 58, + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 170/2 + 5, + "y" : 58, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/popupdialog.py b/uiscript/uiscript/popupdialog.py new file mode 100644 index 0000000..a8cea5a --- /dev/null +++ b/uiscript/uiscript/popupdialog.py @@ -0,0 +1,60 @@ +import uiScriptLocale + +window = { + "name" : "PopupDialog", + "style" : ("float",), + + "x" : SCREEN_WIDTH/2 - 250, + "y" : SCREEN_HEIGHT/2 - 40, + + "width" : 280, + "height" : 105, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 280, + "height" : 105, + + "children" : + ( + { + "name" : "message", + "type" : "text", + + "x" : 0, + "y" : 38, + + "text" : uiScriptLocale.MESSAGE, + + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + { + "name" : "accept", + "type" : "button", + + "x" : 0, + "y" : 63, + + "width" : 61, + "height" : 21, + + "horizontal_align" : "center", + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/privateshopbuilder.py b/uiscript/uiscript/privateshopbuilder.py new file mode 100644 index 0000000..1b75dd0 --- /dev/null +++ b/uiscript/uiscript/privateshopbuilder.py @@ -0,0 +1,130 @@ +import uiScriptLocale + +window = { + "name" : "PrivateShopBuilder", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : 184, + "height" : 328 + 26, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 184, + "height" : 328 + 26, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 169, + "color" : "gray", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":84, "y":4, "text":uiScriptLocale.PRIVATE_SHOP_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Name_Static + #{ + # "name" : "Name_Static", "type" : "text", "x" : 15, "y" : 35 + 3, "text" : uiScriptLocale.PRIVATE_SHOP_NAME, + #}, + ## Name + { + "name" : "NameSlot", + "type" : "slotbar", + "x" : 13, + "y" : 35, + "width" : 90 + 67, + "height" : 18, + + "children" : + ( + { + "name" : "NameLine", + "type" : "text", + "x" : 3, + "y" : 3, + "width" : 157, + "height" : 15, + "input_limit" : 25, + "text" : "1234567890123456789012345", + }, + ), + }, + + ## Item Slot + { + "name" : "ItemSlot", + "type" : "grid_table", + + "x" : 12, + "y" : 34 + 26, + + "start_index" : 0, + "x_count" : 5, + "y_count" : 8, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub", + }, + + ## Ok + { + "name" : "OkButton", + "type" : "button", + + "x" : 21, + "y" : 295 + 26, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ## Close + { + "name" : "CloseButton", + "type" : "button", + + "x" : 104, + "y" : 295 + 26, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.CLOSE, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/questdialog.py b/uiscript/uiscript/questdialog.py new file mode 100644 index 0000000..63c00c4 --- /dev/null +++ b/uiscript/uiscript/questdialog.py @@ -0,0 +1,30 @@ +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "QuestDialog", + "style" : ("float",),#"movable", + + "x" : 0, + "y" : 0, + + "width" : 800, + "height" : 450, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + "style" : ("attach", "ignore_size",), + + "x" : 0, + "y" : 0, + + "horizontal_align" : "center", + "vertical_align" : "center", + + "width" : 350, + "height" : 300, + }, + ), +} diff --git a/uiscript/uiscript/questiondialog.py b/uiscript/uiscript/questiondialog.py new file mode 100644 index 0000000..b35b173 --- /dev/null +++ b/uiscript/uiscript/questiondialog.py @@ -0,0 +1,77 @@ +import uiScriptLocale + +window = { + "name" : "QuestionDialog", + "style" : ("movable", "float",), + + "x" : SCREEN_WIDTH/2 - 125, + "y" : SCREEN_HEIGHT/2 - 52, + + "width" : 340, + "height" : 105, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 340, + "height" : 105, + + "children" : + ( + { + "name" : "message", + "type" : "text", + + "x" : 0, + "y" : 38, + + "horizontal_align" : "center", + "text" : uiScriptLocale.MESSAGE, + + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + { + "name" : "accept", + "type" : "button", + + "x" : -40, + "y" : 63, + + "width" : 61, + "height" : 21, + + "horizontal_align" : "center", + "text" : uiScriptLocale.YES, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "cancel", + "type" : "button", + + "x" : 40, + "y" : 63, + + "width" : 61, + "height" : 21, + + "horizontal_align" : "center", + "text" : uiScriptLocale.NO, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/questiondialog2.py b/uiscript/uiscript/questiondialog2.py new file mode 100644 index 0000000..1733e91 --- /dev/null +++ b/uiscript/uiscript/questiondialog2.py @@ -0,0 +1,90 @@ +import uiScriptLocale + +window = { + "name" : "QuestionDialog", + "style" : ("movable", "float",), + + "x" : SCREEN_WIDTH/2 - 125, + "y" : SCREEN_HEIGHT/2 - 52, + + "width" : 280, + "height" : 105, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 280, + "height" : 105, + + "children" : + ( + { + "name" : "message1", + "type" : "text", + + "x" : 0, + "y" : 25, + + "text" : uiScriptLocale.MESSAGE, + + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + { + "name" : "message2", + "type" : "text", + + "x" : 0, + "y" : 50, + + "text" : uiScriptLocale.MESSAGE, + + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "text_vertical_align" : "center", + }, + { + "name" : "accept", + "type" : "button", + + "x" : -40, + "y" : 68, + + "width" : 61, + "height" : 21, + + "horizontal_align" : "center", + "text" : uiScriptLocale.YES, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + { + "name" : "cancel", + "type" : "button", + + "x" : +40, + "y" : 68, + + "width" : 61, + "height" : 21, + + "horizontal_align" : "center", + "text" : uiScriptLocale.NO, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/refinedialog.py b/uiscript/uiscript/refinedialog.py new file mode 100644 index 0000000..a13a755 --- /dev/null +++ b/uiscript/uiscript/refinedialog.py @@ -0,0 +1,105 @@ +import uiScriptLocale + +window = { + "name" : "RefineDialog", + "style" : ("movable", "float",), + + "x" : SCREEN_WIDTH - 400, + "y" : 70 * 800 / SCREEN_HEIGHT, + + "width" : 0, + "height" : 0, + + "children" : + ( + { + "name" : "Board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 0, + "height" : 0, + + "children" : + ( + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 0, + "color" : "red", + + "children" : + ( + { + "name" : "TitleName", + "type" : "text", + "text" : uiScriptLocale.REFINE_TTILE, + "horizontal_align" : "center", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 3, + }, + ), + }, + { + "name" : "SuccessPercentage", + "type" : "text", + "text" : uiScriptLocale.REFINE_INFO, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 70, + }, + { + "name" : "Cost", + "type" : "text", + "text" : uiScriptLocale.REFINE_COST, + "horizontal_align" : "center", + "vertical_align" : "bottom", + "text_horizontal_align" : "center", + "x" : 0, + "y" : 54, + }, + { + "name" : "AcceptButton", + "type" : "button", + + "x" : -35, + "y" : 35, + + "text" : uiScriptLocale.OK, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "default_image" : "d:/ymir work/ui/public/Middle_Button_01.sub", + "over_image" : "d:/ymir work/ui/public/Middle_Button_02.sub", + "down_image" : "d:/ymir work/ui/public/Middle_Button_03.sub", + }, + { + "name" : "CancelButton", + "type" : "button", + + "x" : 35, + "y" : 35, + + "text" : uiScriptLocale.CANCEL, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "default_image" : "d:/ymir work/ui/public/Middle_Button_01.sub", + "over_image" : "d:/ymir work/ui/public/Middle_Button_02.sub", + "down_image" : "d:/ymir work/ui/public/Middle_Button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/restartdialog.py b/uiscript/uiscript/restartdialog.py new file mode 100644 index 0000000..3eb1712 --- /dev/null +++ b/uiscript/uiscript/restartdialog.py @@ -0,0 +1,63 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "RestartDialog", + "style" : ("float",), + + "x" : 50, + "y" : 50, + + "width" : 200, + "height" : 88, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 88, + + "r" : 0.3333, + "g" : 0.2941, + "b" : 0.2588, + "a" : 1.0, + + "children" : + ( + { + "name" : "restart_here_button", + "type" : "button", + + "x" : 10, + "y" : 17, + + "text" : uiScriptLocale.RESTART_HERE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "restart_town_button", + "type" : "button", + + "x" : 10, + "y" : 47, + + "text" : uiScriptLocale.RESTART_TOWN, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/rightmousebuttonwindow.py b/uiscript/uiscript/rightmousebuttonwindow.py new file mode 100644 index 0000000..dd1c0ee --- /dev/null +++ b/uiscript/uiscript/rightmousebuttonwindow.py @@ -0,0 +1,62 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/game/taskbar/" + +window = { + "name" : "RightButtonWindow", + + "x" : 0, + "y" : 0, + + "width" : 32 * 2, + "height" : 32, + + "children" : + ( + { + "name" : "button_move_and_attack", + "type" : "button", + + "x" : 0, + "y" : 0, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_ATTACK, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Attack_01.sub", + "over_image" : ROOT + "Mouse_Button_Attack_02.sub", + "down_image" : ROOT + "Mouse_Button_Attack_03.sub", + }, + { + "name" : "button_camera", + "type" : "button", + + "x" : 32, + "y" : 0, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_CAMERA, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Camera_01.sub", + "over_image" : ROOT + "Mouse_Button_Camera_02.sub", + "down_image" : ROOT + "Mouse_Button_Camera_03.sub", + }, + { + "name" : "button_skill", + "type" : "button", + + "x" : 64, + "y" : 0, + + "tooltip_text" : uiScriptLocale.MOUSEBUTTON_SKILL, + "tooltip_x" : -40, + "tooltip_y" : 9, + + "default_image" : ROOT + "Mouse_Button_Skill_01.sub", + "over_image" : ROOT + "Mouse_Button_Skill_02.sub", + "down_image" : ROOT + "Mouse_Button_Skill_03.sub", + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/safeboxwindow.py b/uiscript/uiscript/safeboxwindow.py new file mode 100644 index 0000000..ce86987 --- /dev/null +++ b/uiscript/uiscript/safeboxwindow.py @@ -0,0 +1,81 @@ +import uiScriptLocale + +window = { + "name" : "SafeboxWindow", + + "x" : 100, + "y" : 20, + + "style" : ("movable", "float",), + + "width" : 176, + "height" : 250, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 176, + "height" : 250, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 161, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.SAFE_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Button + { + "name" : "ChangePasswordButton", + "type" : "button", + + "x" : 0, + "y" : 58, + + "text" : uiScriptLocale.SAFE_CHANGE_PASSWORD, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "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", + }, + { + "name" : "ExitButton", + "type" : "button", + + "x" : 0, + "y" : 37, + + "text" : uiScriptLocale.CLOSE, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "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", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/selectcharacterwindow.py b/uiscript/uiscript/selectcharacterwindow.py new file mode 100644 index 0000000..4e775b8 --- /dev/null +++ b/uiscript/uiscript/selectcharacterwindow.py @@ -0,0 +1,580 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +LOCALE_PATH = uiScriptLocale.SELECT_PATH + +BOARD_X = SCREEN_WIDTH * (65) / 800 +BOARD_Y = SCREEN_HEIGHT * (220) / 600 + +BOARD_ITEM_ADD_POSITION = -40 + +window = { + "name" : "SelectCharacterWindow", + + "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, + }, + + ## 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", + }, + + ## 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" : 363 + BOARD_ITEM_ADD_POSITION, + + "children" : + ( + + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 21, + "y" : 12, + "x_scale" : 0.5, + "y_scale" : 0.5, + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + + { + "name" : "EmpireNameSlot", + "type" : "image", + + "x" : 100, + "y" : 12, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "EmpireName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_EMPIRE_NAME, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "GuildNameSlot", + "type" : "image", + + "x" : 100, + "y" : 33, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + + "children" : + ( + { + "name" : "GuildName", + "type" : "text", + + "x" : 0, + "y" : 0, + + "text" : uiScriptLocale.SELECT_NO_GUILD, + + "all_align" : "center", + }, + ), + }, + + { + "name" : "character_name", + "type" : "text", + + "x" : 17, + "y" : 124 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_NAME, + + "children" : + ( + { + "name" : "character_name_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_name_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_level", + "type" : "text", + + "x" : 17, + "y" : 50 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_LEVEL, + + "children" : + ( + { + "name" : "character_level_slot", + "type" : "image", + + "x" : 43, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_05.sub", + }, + { + "name" : "character_level_value", + "type" : "text", + + "x" : 43 + 130/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_play_time", + "type" : "text", + + "x" : 17, + "y" : 76 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_PLAYTIME, + + "children" : + ( + { + "name" : "character_play_time_slot", + "type" : "image", + + "x" : 83, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_03.sub", + }, + { + "name" : "character_play_time_value", + "type" : "text", + + "x" : 83 + 91/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_hth", + "type" : "text", + + "x" : 17, + "y" : 102 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_HP, + + "children" : + ( + { + "name" : "gauge_hth", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "red", + }, + { + "name" : "character_hth_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_hth_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_int", + "type" : "text", + + "x" : 17, + "y" : 128 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SP, + + "children" : + ( + { + "name" : "gauge_int", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "pink", + }, + { + "name" : "character_int_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_int_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_str", + "type" : "text", + + "x" : 17, + "y" : 154 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_ATT_GRADE, + + "children" : + ( + { + "name" : "gauge_str", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "purple", + }, + { + "name" : "character_str_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_str_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + { + "name" : "character_dex", + "type" : "text", + + "x" : 17, + "y" : 180 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DEX_GRADE, + + "children" : + ( + { + "name" : "gauge_dex", + "type" : "gauge", + + "x" : 30, + "y" : 4, + + "width" : 100, + "color" : "blue", + }, + { + "name" : "character_dex_slot", + "type" : "image", + + "x" : 134, + "y" : -2, + + "image" : "d:/ymir work/ui/public/Parameter_Slot_00.sub", + }, + { + "name" : "character_dex_value", + "type" : "text", + + "x" : 134 + 39/2, + "y" : 0, + + "text" : "", + + "text_horizontal_align" : "center", + }, + ), + }, + + ## Buttons + { + "name" : "start_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_SELECT, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "create_button", + "type" : "button", + + "x" : 14, + "y" : 210 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_CREATE, + "text_height" : 6, + + "default_image" : ROOT_PATH + "XLarge_Button_01.sub", + "over_image" : ROOT_PATH + "XLarge_Button_02.sub", + "down_image" : ROOT_PATH + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_EXIT, + + "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" : "delete_button", + "type" : "button", + + "x" : 14, + "y" : 245 + 100 - 21 + BOARD_ITEM_ADD_POSITION, + + "text" : uiScriptLocale.SELECT_DELETE, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (450) / 800, + "y" : SCREEN_HEIGHT * (505) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : SCREEN_WIDTH * (580) / 800, + "y" : SCREEN_HEIGHT * (505) / 600, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/right_button_03.sub", + }, + + ), +} diff --git a/uiscript/uiscript/selectempirewindow.py b/uiscript/uiscript/selectempirewindow.py new file mode 100644 index 0000000..ee049c1 --- /dev/null +++ b/uiscript/uiscript/selectempirewindow.py @@ -0,0 +1,362 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" +LOCALE_PATH = uiScriptLocale.EMPIRE_PATH + +ATALS_X = SCREEN_WIDTH * (282) / 800 +ATALS_Y = SCREEN_HEIGHT * (170) / 600 + +window = { + "name" : "SelectCharacterWindow", + + "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/select/background_alpha.sub", + + "x_scale" : float(SCREEN_WIDTH) / 100.0, + "y_scale" : float(SCREEN_HEIGHT) / 69.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), + }, + + ## Title + { + "name" : "Title", + "type" : "expanded_image", + + "x" : SCREEN_WIDTH * (410 - 346/2) / 800, + "y" : SCREEN_HEIGHT * (114 - 136/2) / 600, + "x_scale" : float(SCREEN_WIDTH) / 800.0, + "y_scale" : float(SCREEN_HEIGHT) / 600.0, + + "image" : LOCALE_PATH+"title.sub" + }, + + ## Atlas + { + "name" : "Atlas", + "type" : "image", + + "x" : ATALS_X, + "y" : ATALS_Y, + + "image" : "d:/ymir work/ui/intro/empire/atlas.sub", + + "children" : + ( + ## Empire Image + { + "name" : "EmpireArea_A", + "type" : "expanded_image", + + "x" : 43, + "y" : 201, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_a.sub" + }, + { + "name" : "EmpireArea_B", + "type" : "expanded_image", + + "x" : 17, + "y" : 16, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_b.sub" + }, + { + "name" : "EmpireArea_C", + "type" : "expanded_image", + + "x" : 314, + "y" : 33, + + "image" : "d:/ymir work/ui/intro/empire/empirearea_c.sub" + }, + + ## Empire Flag + { + "name" : "EmpireAreaFlag_A", + "type" : "expanded_image", + + "x" : 167, + "y" : 235, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_a.sub" + }, + { + "name" : "EmpireAreaFlag_B", + "type" : "expanded_image", + + "x" : 70, + "y" : 42, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_b.sub" + }, + { + "name" : "EmpireAreaFlag_C", + "type" : "expanded_image", + + "x" : 357, + "y" : 78, + + "image" : "d:/ymir work/ui/intro/empire/empireareaflag_c.sub" + }, + ), + }, + + ## Buttons + { + "name" : "left_button", + "type" : "button", + + "x" : ATALS_X + 160, + "y" : ATALS_Y + 340, + + "default_image" : "d:/ymir work/ui/intro/select/left_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/left_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/left_button_03.sub", + }, + { + "name" : "right_button", + "type" : "button", + + "x" : ATALS_X + 160 + 130, + "y" : ATALS_Y + 340, + + "default_image" : "d:/ymir work/ui/intro/select/right_button_01.sub", + "over_image" : "d:/ymir work/ui/intro/select/right_button_02.sub", + "down_image" : "d:/ymir work/ui/intro/select/right_button_03.sub", + }, + + ## Character Board + { + "name" : "empire_board", + "type" : "thinboard", + + "x" : SCREEN_WIDTH * (40) / 800, + "y" : SCREEN_HEIGHT * (211) / 600, + + "width" : 208, + "height" : 314, + + "children" : + ( + ## Bar + { + "name" : "flag_board", + "type" : "bar", + + "x" : 24, + "y" : 17, + "width" : 159, + "height" : 119, + + "children" : + ( + ## Empire Flag + { + "name" : "EmpireFlag_A", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_a.sub" + }, + { + "name" : "EmpireFlag_B", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_b.sub" + }, + { + "name" : "EmpireFlag_C", + "type" : "expanded_image", + + "x" : 0, + "y" : 0, + "horizontal_align" : "center", + "vertical_align" : "center", + + "image" : "d:/ymir work/ui/intro/empire/empireflag_c.sub" + }, + ), + + }, + { + "name" : "text_board", + "type" : "bar", + + "x" : 10, + "y" : 146, + + "width" : 189, + "height" : 122, + + "children" : + ( + { + "name" : "prev_text_button", + "type" : "button", + + "x" : 95, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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_text_button", + "type" : "button", + + "x" : 140, + "y" : 95, + + "text" : uiScriptLocale.EMPIRE_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, + }, + ), + }, + + ## Buttons + { + "name" : "select_button", + "type" : "button", + + "x" : 14, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_SELECT, + + "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" : "exit_button", + "type" : "button", + + "x" : 105, + "y" : 277, + + "text" : uiScriptLocale.EMPIRE_EXIT, + + "default_image" : ROOT_PATH + "Large_Button_01.sub", + "over_image" : ROOT_PATH + "Large_Button_02.sub", + "down_image" : ROOT_PATH + "Large_Button_03.sub", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/selectitemwindow.py b/uiscript/uiscript/selectitemwindow.py new file mode 100644 index 0000000..50e4d0f --- /dev/null +++ b/uiscript/uiscript/selectitemwindow.py @@ -0,0 +1,82 @@ +import uiScriptLocale + +window = { + "name" : "SelectItemWindow", + + "x" : 100, + "y" : 20, + + "style" : ("movable", "float",), + + "width" : 184, + "height" : 332, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 184, + "height" : 332, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : 169, + + "children" : + ( + { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.SELECT_METIN_STONE_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Item Slot + { + "name" : "ItemSlot", + "type" : "grid_table", + + "x" : 12, + "y" : 34, + + "start_index" : 0, + "x_count" : 5, + "y_count" : 8, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub", + }, + + ## Button + { + "name" : "ExitButton", + "type" : "button", + + "x" : 0, + "y" : 34, + + "text" : uiScriptLocale.CLOSE, + "horizontal_align" : "center", + "vertical_align" : "bottom", + + "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", + }, + + ), + }, + ), +} diff --git a/uiscript/uiscript/shopdialog.py b/uiscript/uiscript/shopdialog.py new file mode 100644 index 0000000..22e0d9b --- /dev/null +++ b/uiscript/uiscript/shopdialog.py @@ -0,0 +1,199 @@ +import uiScriptLocale + +window = { + "name" : "ShopDialog", + + "x" : SCREEN_WIDTH - 400, + "y" : 10, + + "style" : ("movable", "float",), + + "width" : 184, + "height" : 328, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 184, + "height" : 328, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 169, + "color" : "gray", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":84, "y":4, "text":uiScriptLocale.SHOP_TITLE, "text_horizontal_align":"center" }, + ), + }, + + ## Item Slot + { + "name" : "ItemSlot", + "type" : "grid_table", + + "x" : 12, + "y" : 34, + + "start_index" : 0, + "x_count" : 5, + "y_count" : 8, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/public/Slot_Base.sub", + }, + + ## Buy + { + "name" : "BuyButton", + "type" : "toggle_button", + + "x" : 21, + "y" : 295, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.SHOP_BUY, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ## Sell + { + "name" : "SellButton", + "type" : "toggle_button", + + "x" : 104, + "y" : 295, + + "width" : 61, + "height" : 21, + + "text" : uiScriptLocale.SHOP_SELL, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ## Close + { + "name" : "CloseButton", + "type" : "button", + + "x" : 0, + "y" : 295, + + "horizontal_align" : "center", + + "text" : uiScriptLocale.PRIVATE_SHOP_CLOSE_BUTTON, + + "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", + }, + + ## MiddleTab1 + { + "name" : "MiddleTab1", + "type" : "radio_button", + + "x" : 21, + "y" : 295, + + "width" : 61, + "height" : 21, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ## MiddleTab2 + { + "name" : "MiddleTab2", + "type" : "radio_button", + + "x" : 104, + "y" : 295, + + "width" : 61, + "height" : 21, + + "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", + "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", + "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", + }, + + ## SmallTab1 + { + "name" : "SmallTab1", + "type" : "radio_button", + + "x" : 21, + "y" : 295, + + "width" : 43, + "height" : 21, + + "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", + }, + + ## SmallTab2 + { + "name" : "SmallTab2", + "type" : "radio_button", + + "x" : 71, + "y" : 295, + + "width" : 43, + "height" : 21, + + "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", + }, + + ## SmallTab3 + { + "name" : "SmallTab3", + "type" : "radio_button", + + "x" : 120, + "y" : 295, + + "width" : 43, + "height" : 21, + + "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", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/skillpointresetdialog.py b/uiscript/uiscript/skillpointresetdialog.py new file mode 100644 index 0000000..a4ed8c1 --- /dev/null +++ b/uiscript/uiscript/skillpointresetdialog.py @@ -0,0 +1,57 @@ +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "SkillResetDialog", + "style" : ("float",), + + "x" : SCREEN_WIDTH/2 - 100, + "y" : SCREEN_HEIGHT/2 - 114, + + "width" : 200, + "height" : 228, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 98, + + "children" : + ( + { + "name" : "reset_button", + "type" : "button", + + "x" : 10, + "y" : 17, + + "text" : "胶懦器牢飘 府悸", + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + + { + "name" : "cancel_button", + "type" : "button", + + "x" : 10, + "y" : 57, + + "text" : "秒家", + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + ), + }, + ), +} \ No newline at end of file diff --git a/uiscript/uiscript/systemdialog.py b/uiscript/uiscript/systemdialog.py new file mode 100644 index 0000000..6800cdd --- /dev/null +++ b/uiscript/uiscript/systemdialog.py @@ -0,0 +1,124 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "SystemDialog", + "style" : ("float",), + + "x" : SCREEN_WIDTH/2 - 100, + "y" : SCREEN_HEIGHT/2 - 114, + + "width" : 200, + "height" : 258, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 258, + + "children" : + ( + { + "name" : "help_button", + "type" : "button", + + "x" : 10, + "y" : 17, + + "text" : uiScriptLocale.SYSTEM_HELP, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + + { + "name" : "system_option_button", + "type" : "button", + + "x" : 10, + "y" : 57, + + "text" : uiScriptLocale.SYSTEMOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "game_option_button", + "type" : "button", + + "x" : 10, + "y" : 87, + + "text" : uiScriptLocale.GAMEOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "change_button", + "type" : "button", + + "x" : 10, + "y" : 117, + + "text" : uiScriptLocale.SYSTEM_CHANGE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "logout_button", + "type" : "button", + + "x" : 10, + "y" : 147, + + "text" : uiScriptLocale.SYSTEM_LOGOUT, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 10, + "y" : 177, + + "text" : uiScriptLocale.SYSTEM_EXIT, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 10, + "y" : 217, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/systemdialog_formall.py b/uiscript/uiscript/systemdialog_formall.py new file mode 100644 index 0000000..17570dd --- /dev/null +++ b/uiscript/uiscript/systemdialog_formall.py @@ -0,0 +1,137 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "SystemDialog", + "style" : ("float",), + + "x" : (SCREEN_WIDTH - 200) /2, + "y" : (SCREEN_HEIGHT - 288) /2, + + "width" : 200, + "height" : 288, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 288, + + "children" : + ( + { + "name" : "help_button", + "type" : "button", + + "x" : 10, + "y" : 17, + + "text" : uiScriptLocale.SYSTEM_HELP, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "mall_button", + "type" : "button", + + "x" : 10, + "y" : 57, + + "text" : uiScriptLocale.SYSTEM_MALL, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + + { + "name" : "system_option_button", + "type" : "button", + + "x" : 10, + "y" : 87, + + "text" : uiScriptLocale.SYSTEMOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "game_option_button", + "type" : "button", + + "x" : 10, + "y" : 117, + + "text" : uiScriptLocale.GAMEOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "change_button", + "type" : "button", + + "x" : 10, + "y" : 147, + + "text" : uiScriptLocale.SYSTEM_CHANGE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "logout_button", + "type" : "button", + + "x" : 10, + "y" : 177, + + "text" : uiScriptLocale.SYSTEM_LOGOUT, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 10, + "y" : 217, + + "text" : uiScriptLocale.SYSTEM_EXIT, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 10, + "y" : 247, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/systemdialog_forportal.py b/uiscript/uiscript/systemdialog_forportal.py new file mode 100644 index 0000000..7183f29 --- /dev/null +++ b/uiscript/uiscript/systemdialog_forportal.py @@ -0,0 +1,111 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "SystemDialog", + "style" : ("float",), + + "x" : SCREEN_WIDTH/2 - 100, + "y" : SCREEN_HEIGHT/2 - 114, + + "width" : 200, + "height" : 225, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + + "x" : 0, + "y" : 0, + + "width" : 200, + "height" : 225, + + "children" : + ( + { + "name" : "help_button", + "type" : "button", + + "x" : 10, + "y" : 17, + + "text" : uiScriptLocale.SYSTEM_HELP, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + + { + "name" : "system_option_button", + "type" : "button", + + "x" : 10, + "y" : 57, + + "text" : uiScriptLocale.SYSTEMOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "game_option_button", + "type" : "button", + + "x" : 10, + "y" : 87, + + "text" : uiScriptLocale.GAMEOPTION_TITLE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "change_button", + "type" : "button", + + "x" : 10, + "y" : 117, + + "text" : uiScriptLocale.SYSTEM_CHANGE, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "exit_button", + "type" : "button", + + "x" : 10, + "y" : 147, + + "text" : uiScriptLocale.SYSTEM_EXIT, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + { + "name" : "cancel_button", + "type" : "button", + + "x" : 10, + "y" : 177, + + "text" : uiScriptLocale.CANCEL, + + "default_image" : ROOT + "XLarge_Button_01.sub", + "over_image" : ROOT + "XLarge_Button_02.sub", + "down_image" : ROOT + "XLarge_Button_03.sub", + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/systemoptiondialog.py b/uiscript/uiscript/systemoptiondialog.py new file mode 100644 index 0000000..2e24ce0 --- /dev/null +++ b/uiscript/uiscript/systemoptiondialog.py @@ -0,0 +1,286 @@ +import uiScriptLocale + +ROOT_PATH = "d:/ymir work/ui/public/" + +TEMPORARY_X = +13 +TEXT_TEMPORARY_X = -10 +BUTTON_TEMPORARY_X = 5 +PVP_X = -10 + +window = { + "name" : "SystemOptionDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 305, + "height" : 255, + + "children" : + ( + { + "name" : "board", + "type" : "board", + + "x" : 0, + "y" : 0, + + "width" : 305, + "height" : 255, + + "children" : + ( + ## Title + { + "name" : "titlebar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 8, + + "width" : 284, + "color" : "gray", + + "children" : + ( + { + "name":"titlename", "type":"text", "x":0, "y":3, + "horizontal_align":"center", "text_horizontal_align":"center", + "text": uiScriptLocale.SYSTEMOPTION_TITLE, + }, + ), + }, + + + ## Music + { + "name" : "music_name", + "type" : "text", + + "x" : 30, + "y" : 75, + + "text" : uiScriptLocale.OPTION_MUSIC, + }, + + { + "name" : "music_volume_controller", + "type" : "sliderbar", + + "x" : 110, + "y" : 75, + }, + + { + "name" : "bgm_button", + "type" : "button", + + "x" : 20, + "y" : 100, + + "text" : uiScriptLocale.OPTION_MUSIC_CHANGE, + + "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" : "bgm_file", + "type" : "text", + + "x" : 100, + "y" : 102, + + "text" : uiScriptLocale.OPTION_MUSIC_DEFAULT_THEMA, + }, + + ## Sound + { + "name" : "sound_name", + "type" : "text", + + "x" : 30, + "y" : 50, + + "text" : uiScriptLocale.OPTION_SOUND, + }, + + { + "name" : "sound_volume_controller", + "type" : "sliderbar", + + "x" : 110, + "y" : 50, + }, + + ## 墨皋扼 + { + "name" : "camera_mode", + "type" : "text", + + "x" : 40 + TEXT_TEMPORARY_X, + "y" : 135+2, + + "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE, + }, + + { + "name" : "camera_short", + "type" : "radio_button", + + "x" : 110, + "y" : 135, + + "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE_SHORT, + + "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" : "camera_long", + "type" : "radio_button", + + "x" : 110+70, + "y" : 135, + + "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE_LONG, + + "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" : "fog_mode", + "type" : "text", + + "x" : 30, + "y" : 160+2, + + "text" : uiScriptLocale.OPTION_FOG, + }, + + { + "name" : "fog_level0", + "type" : "radio_button", + + "x" : 110, + "y" : 160, + + "text" : uiScriptLocale.OPTION_FOG_DENSE, + + "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" : "fog_level1", + "type" : "radio_button", + + "x" : 110+50, + "y" : 160, + + "text" : uiScriptLocale.OPTION_FOG_MIDDLE, + + "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" : "fog_level2", + "type" : "radio_button", + + "x" : 110 + 100, + "y" : 160, + + "text" : uiScriptLocale.OPTION_FOG_LIGHT, + + "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" : "tiling_mode", + "type" : "text", + + "x" : 40 + TEXT_TEMPORARY_X, + "y" : 185+2, + + "text" : uiScriptLocale.OPTION_TILING, + }, + + { + "name" : "tiling_cpu", + "type" : "radio_button", + + "x" : 110, + "y" : 185, + + "text" : uiScriptLocale.OPTION_TILING_CPU, + + "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" : "tiling_gpu", + "type" : "radio_button", + + "x" : 110+50, + "y" : 185, + + "text" : uiScriptLocale.OPTION_TILING_GPU, + + "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" : "tiling_apply", + "type" : "button", + + "x" : 110+100, + "y" : 185, + + "text" : uiScriptLocale.OPTION_TILING_APPLY, + + "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" : "shadow_mode", +# "type" : "text", + +# "x" : 30, +# "y" : 210, + +# "text" : uiScriptLocale.OPTION_SHADOW, +# }, + +# { +# "name" : "shadow_bar", +# "type" : "sliderbar", + +# "x" : 110, +# "y" : 210, +# }, + ), + }, + ), +} diff --git a/uiscript/uiscript/taskbar.py b/uiscript/uiscript/taskbar.py new file mode 100644 index 0000000..6cdaa53 --- /dev/null +++ b/uiscript/uiscript/taskbar.py @@ -0,0 +1,462 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/game/" + +#Y_ADD_POSITION = -2 +Y_ADD_POSITION = 0 + +window = { + "name" : "TaskBar", + + "x" : 0, + "y" : SCREEN_HEIGHT - 37, + + "width" : SCREEN_WIDTH, + "height" : 37, + + "children" : + ( + ## Board + { + "name" : "Base_Board_01", + "type" : "expanded_image", + + "x" : 263, + "y" : 0, + + "rect" : (0.0, 0.0, float(SCREEN_WIDTH - 263 - 256) / 256.0, 0.0), + + "image" : "d:/ymir work/ui/pattern/TaskBar_Base.tga" + }, + + ## Gauge + { + "name" : "Gauge_Board", + "type" : "image", + + "x" : 0, + "y" : -10 + Y_ADD_POSITION, + + "image" : ROOT + "taskbar/gauge.sub", + + "children" : + ( + { + "name" : "RampageGauge", + "type" : "ani_image", + + "x" : 8, + "y" : 4, + + "delay" : 6, + + "images" : + ( + ROOT + "TaskBar/Rampage_01/00.sub", + ROOT + "TaskBar/Rampage_01/01.sub", + ROOT + "TaskBar/Rampage_01/02.sub", + ROOT + "TaskBar/Rampage_01/03.sub", + ROOT + "TaskBar/Rampage_01/04.sub", + ROOT + "TaskBar/Rampage_01/05.sub", + ROOT + "TaskBar/Rampage_01/06.sub", + ROOT + "TaskBar/Rampage_01/07.sub", + ROOT + "TaskBar/Rampage_01/08.sub", + ROOT + "TaskBar/Rampage_01/09.sub", + ROOT + "TaskBar/Rampage_01/11.sub", + ROOT + "TaskBar/Rampage_01/12.sub", + ROOT + "TaskBar/Rampage_01/13.sub", + ROOT + "TaskBar/Rampage_01/14.sub", + ROOT + "TaskBar/Rampage_01/15.sub", + ROOT + "TaskBar/Rampage_01/16.sub", + ) + }, + { + ## 砒屏阑 剁快扁 困茄 扩档快 + "name" : "HPGauge_Board", + "type" : "window", + + "x" : 59, + "y" : 14, + + "width" : 95, + "height" : 11, + + "children" : + ( + { + "name" : "HPRecoveryGaugeBar", + "type" : "bar", + + "x" : 0, + "y" : 0, + "width" : 95, + "height" : 13, + "color" : 0x55ff0000, + }, + { + "name" : "HPGauge", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + + "delay" : 6, + + "images" : + ( + "D:/Ymir Work/UI/Pattern/HPGauge/01.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/02.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/03.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/04.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/05.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/06.tga", + "D:/Ymir Work/UI/Pattern/HPGauge/07.tga", + ), + }, + ), + }, + { + ## 砒屏阑 剁快扁 困茄 扩档快 + "name" : "SPGauge_Board", + "type" : "window", + + "x" : 59, + "y" : 24, + + "width" : 95, + "height" : 11, + + "children" : + ( + { + "name" : "SPRecoveryGaugeBar", + "type" : "bar", + + "x" : 0, + "y" : 0, + "width" : 95, + "height" : 13, + "color" : 0x550000ff, + }, + { + "name" : "SPGauge", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + + "delay" : 6, + + "images" : + ( + "D:/Ymir Work/UI/Pattern/SPGauge/01.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/02.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/03.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/04.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/05.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/06.tga", + "D:/Ymir Work/UI/Pattern/SPGauge/07.tga", + ), + }, + ), + }, + { + ## 砒屏阑 剁快扁 困茄 扩档快 + "name" : "STGauge_Board", + "type" : "window", + + "x" : 59, + "y" : 38, + + "width" : 95, + "height" : 6, + + "children" : + ( + { + "name" : "STGauge", + "type" : "ani_image", + + "x" : 0, + "y" : 0, + + "delay" : 6, + + "images" : + ( + "D:/Ymir Work/UI/Pattern/STGauge/01.tga", + "D:/Ymir Work/UI/Pattern/STGauge/02.tga", + "D:/Ymir Work/UI/Pattern/STGauge/03.tga", + "D:/Ymir Work/UI/Pattern/STGauge/04.tga", + "D:/Ymir Work/UI/Pattern/STGauge/05.tga", + "D:/Ymir Work/UI/Pattern/STGauge/06.tga", + "D:/Ymir Work/UI/Pattern/STGauge/07.tga", + ), + }, + ), + }, + + ), + }, + { + "name" : "EXP_Gauge_Board", + "type" : "image", + + "x" : 158, + "y" : 0 + Y_ADD_POSITION, + + "image" : ROOT + "taskbar/exp_gauge.sub", + + "children" : + ( + { + "name" : "EXPGauge_01", + "type" : "expanded_image", + + "x" : 5, + "y" : 9, + + "image" : ROOT + "TaskBar/EXP_Gauge_Point.sub", + }, + { + "name" : "EXPGauge_02", + "type" : "expanded_image", + + "x" : 30, + "y" : 9, + + "image" : ROOT + "TaskBar/EXP_Gauge_Point.sub", + }, + { + "name" : "EXPGauge_03", + "type" : "expanded_image", + + "x" : 55, + "y" : 9, + + "image" : ROOT + "TaskBar/EXP_Gauge_Point.sub", + }, + { + "name" : "EXPGauge_04", + "type" : "expanded_image", + + "x" : 80, + "y" : 9, + + "image" : ROOT + "TaskBar/EXP_Gauge_Point.sub", + }, + ), + }, + + ## Mouse Button + { + "name" : "LeftMouseButton", + "type" : "button", + + "x" : SCREEN_WIDTH/2 - 128, + "y" : 3 + Y_ADD_POSITION, + + "default_image" : ROOT + "TaskBar/Mouse_Button_Move_01.sub", + "over_image" : ROOT + "TaskBar/Mouse_Button_Move_02.sub", + "down_image" : ROOT + "TaskBar/Mouse_Button_Move_03.sub", + }, + { + "name" : "RightMouseButton", + "type" : "button", + + "x" : SCREEN_WIDTH/2 + 128 + 66 + 11, + "y" : 3 + Y_ADD_POSITION, + + "default_image" : ROOT + "TaskBar/Mouse_Button_Move_01.sub", + "over_image" : ROOT + "TaskBar/Mouse_Button_Move_02.sub", + "down_image" : ROOT + "TaskBar/Mouse_Button_Move_03.sub", + }, + + ## Button + { + "name" : "CharacterButton", + "type" : "button", + + "x" : SCREEN_WIDTH - 144, + "y" : 3 + Y_ADD_POSITION, + + "tooltip_text" : uiScriptLocale.TASKBAR_CHARACTER, + + "default_image" : ROOT + "TaskBar/Character_Button_01.sub", + "over_image" : ROOT + "TaskBar/Character_Button_02.sub", + "down_image" : ROOT + "TaskBar/Character_Button_03.sub", + }, + { + "name" : "InventoryButton", + "type" : "button", + + "x" : SCREEN_WIDTH - 110, + "y" : 3 + Y_ADD_POSITION, + + "tooltip_text" : uiScriptLocale.TASKBAR_INVENTORY, + + "default_image" : ROOT + "TaskBar/Inventory_Button_01.sub", + "over_image" : ROOT + "TaskBar/Inventory_Button_02.sub", + "down_image" : ROOT + "TaskBar/Inventory_Button_03.sub", + }, + { + "name" : "MessengerButton", + "type" : "button", + + "x" : SCREEN_WIDTH - 76, + "y" : 3 + Y_ADD_POSITION, + + "tooltip_text" : uiScriptLocale.TASKBAR_MESSENGER, + + "default_image" : ROOT + "TaskBar/Community_Button_01.sub", + "over_image" : ROOT + "TaskBar/Community_Button_02.sub", + "down_image" : ROOT + "TaskBar/Community_Button_03.sub", + }, + { + "name" : "SystemButton", + "type" : "button", + + "x" : SCREEN_WIDTH - 42, + "y" : 3 + Y_ADD_POSITION, + + "tooltip_text" : uiScriptLocale.TASKBAR_SYSTEM, + + "default_image" : ROOT + "TaskBar/System_Button_01.sub", + "over_image" : ROOT + "TaskBar/System_Button_02.sub", + "down_image" : ROOT + "TaskBar/System_Button_03.sub", + }, + + ## QuickBar + { + "name" : "quickslot_board", + "type" : "window", + + "x" : SCREEN_WIDTH/2 - 128 + 32 + 10, + "y" : 0 + Y_ADD_POSITION, + + "width" : 256 + 14 + 2 + 11, + "height" : 37, + + "children" : + ( + { + "name" : "ChatButton", + "type" : "button", + + "x" : 128, + "y" : 1, + "tooltip_text" : uiScriptLocale.TASKBAR_CHAT, + + "default_image" : ROOT + "TaskBar/Chat_Button_01.sub", + "over_image" : ROOT + "TaskBar/Chat_Button_02.sub", + "down_image" : ROOT + "TaskBar/Chat_Button_03.sub", + }, + { + "name" : "quick_slot_1", + "type" : "grid_table", + + "start_index" : 0, + + "x" : 0, + "y" : 3, + + "x_count" : 4, + "y_count" : 1, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/Public/Slot_Base.sub", + "image_r" : 1.0, + "image_g" : 1.0, + "image_b" : 1.0, + "image_a" : 1.0, + + "children" : + ( + { "name" : "slot_1", "type" : "image", "x" : 3, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/1.sub", }, + { "name" : "slot_2", "type" : "image", "x" : 35, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/2.sub", }, + { "name" : "slot_3", "type" : "image", "x" : 67, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/3.sub", }, + { "name" : "slot_4", "type" : "image", "x" : 99, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/4.sub", }, + ), + }, + { + "name" : "quick_slot_2", + "type" : "grid_table", + + "start_index" : 4, + + "x" : 128 + 14, + "y" : 3, + + "x_count" : 4, + "y_count" : 1, + "x_step" : 32, + "y_step" : 32, + + "image" : "d:/ymir work/ui/Public/Slot_Base.sub", + "image_r" : 1.0, + "image_g" : 1.0, + "image_b" : 1.0, + "image_a" : 1.0, + + "children" : + ( + { "name" : "slot_5", "type" : "image", "x" : 3, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f1.sub", }, + { "name" : "slot_6", "type" : "image", "x" : 35, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f2.sub", }, + { "name" : "slot_7", "type" : "image", "x" : 67, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f3.sub", }, + { "name" : "slot_8", "type" : "image", "x" : 99, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f4.sub", }, + ), + }, + { + "name" : "QuickSlotBoard", + "type" : "window", + + "x" : 128+14+128+2, + "y" : 0, + "width" : 11, + "height" : 37, + "children" : + ( + { + "name" : "QuickSlotNumberBox", + "type" : "image", + "x" : 1, + "y" : 15, + "image" : ROOT + "taskbar/QuickSlot_Button_Board.sub", + }, + { + "name" : "QuickPageUpButton", + "type" : "button", + "tooltip_text" : uiScriptLocale.TASKBAR_PREV_QUICKSLOT, + "x" : 1, + "y" : 9, + "default_image" : ROOT + "TaskBar/QuickSlot_UpButton_01.sub", + "over_image" : ROOT + "TaskBar/QuickSlot_UpButton_02.sub", + "down_image" : ROOT + "TaskBar/QuickSlot_UpButton_03.sub", + }, + + { + "name" : "QuickPageNumber", + "type" : "image", + "x" : 3, "y" : 15, "image" : "d:/ymir work/ui/game/taskbar/1.sub", + }, + { + "name" : "QuickPageDownButton", + "type" : "button", + "tooltip_text" : uiScriptLocale.TASKBAR_NEXT_QUICKSLOT, + + "x" : 1, + "y" : 24, + + "default_image" : ROOT + "TaskBar/QuickSlot_DownButton_01.sub", + "over_image" : ROOT + "TaskBar/QuickSlot_DownButton_02.sub", + "down_image" : ROOT + "TaskBar/QuickSlot_DownButton_03.sub", + }, + + ), + }, + ), + }, + + ), +} diff --git a/uiscript/uiscript/webwindow.py b/uiscript/uiscript/webwindow.py new file mode 100644 index 0000000..e033514 --- /dev/null +++ b/uiscript/uiscript/webwindow.py @@ -0,0 +1,52 @@ +import uiScriptLocale + +WEB_WIDTH = 640 +WEB_HEIGHT = 480 + +window = { + "name" : "MallWindow", + + "x" : 0, + "y" : 0, + + "style" : ("movable", "float",), + + "width" : WEB_WIDTH + 20, + "height" : WEB_HEIGHT + 40, + + "children" : + ( + { + "name" : "board", + "type" : "board", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : WEB_WIDTH + 20, + "height" : WEB_HEIGHT + 40, + + "children" : + ( + ## Title + { + "name" : "TitleBar", + "type" : "titlebar", + "style" : ("attach",), + + "x" : 8, + "y" : 7, + + "width" : WEB_WIDTH + 10, + "color" : "yellow", + + "children" : + ( + { "name":"TitleName", "type":"text", "x":50, "y":3, "text":uiScriptLocale.SYSTEM_MALL, "text_horizontal_align":"center" }, + ), + }, + ), + }, + ), +} diff --git a/uiscript/uiscript/whisperdialog.py b/uiscript/uiscript/whisperdialog.py new file mode 100644 index 0000000..16dca78 --- /dev/null +++ b/uiscript/uiscript/whisperdialog.py @@ -0,0 +1,209 @@ +import uiScriptLocale + +ROOT = "d:/ymir work/ui/public/" + +window = { + "name" : "WhisperDialog", + "style" : ("movable", "float",), + + "x" : 0, + "y" : 0, + + "width" : 280, + "height" : 200, + + "children" : + ( + { + "name" : "board", + "type" : "thinboard", + "style" : ("attach",), + + "x" : 0, + "y" : 0, + + "width" : 280, + "height" : 200, + + "children" : + ( + ## Title + { + "name" : "name_slot", + "type" : "image", + "style" : ("attach",), + + "x" : 10, + "y" : 10, + + "image":"d:/ymir work/ui/public/Parameter_Slot_05.sub", + + "children" : + ( + { + "name" : "titlename", + "type" : "text", + + "x" : 3, + "y" : 3, + + "text" : uiScriptLocale.WHISPER_NAME, + }, + { + "name" : "titlename_edit", + "type" : "editline", + + "x" : 3, + "y" : 3, + + "width" : 120, + "height" : 17, + + "input_limit" : PLAYER_NAME_MAX_LEN, + + "text" : uiScriptLocale.WHISPER_NAME, + }, + ), + }, + + { + "name" : "gamemastermark", + "type" : "expanded_image", + "style" : ("attach",), + + "x" : 206, + "y" : 6, + + "x_scale" : 0.2, + "y_scale" : 0.2, + + "image" : LOCALE_PATH + "/effect/ymirred.tga", + }, + + ## Button + { + "name" : "ignorebutton", + "type" : "toggle_button", + + "x" : 145, + "y" : 10, + + "text" : uiScriptLocale.WHISPER_BAN, + + "default_image" : "d:/ymir work/ui/public/small_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/small_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/small_thin_button_03.sub", + }, + { + "name" : "reportviolentwhisperbutton", + "type" : "button", + + "x" : 145, + "y" : 10, + + "text" : uiScriptLocale.WHISPER_REPORT, + + "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", + }, + { + "name" : "acceptbutton", + "type" : "button", + + "x" : 145, + "y" : 10, + + "text" : uiScriptLocale.OK, + + "default_image" : "d:/ymir work/ui/public/small_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/small_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/small_thin_button_03.sub", + }, + { + "name" : "minimizebutton", + "type" : "button", + + "x" : 280 - 41, + "y" : 12, + + "tooltip_text" : uiScriptLocale.MINIMIZE, + + "default_image" : "d:/ymir work/ui/public/minimize_button_01.sub", + "over_image" : "d:/ymir work/ui/public/minimize_button_02.sub", + "down_image" : "d:/ymir work/ui/public/minimize_button_03.sub", + }, + { + "name" : "closebutton", + "type" : "button", + + "x" : 280 - 24, + "y" : 12, + + "tooltip_text" : uiScriptLocale.CLOSE, + + "default_image" : "d:/ymir work/ui/public/close_button_01.sub", + "over_image" : "d:/ymir work/ui/public/close_button_02.sub", + "down_image" : "d:/ymir work/ui/public/close_button_03.sub", + }, + + ## ScrollBar + { + "name" : "scrollbar", + "type" : "thin_scrollbar", + + "x" : 280 - 25, + "y" : 35, + + "size" : 280 - 160, + }, + + ## Edit Bar + { + "name" : "editbar", + "type" : "bar", + + "x" : 10, + "y" : 200 - 60, + + "width" : 280 - 18, + "height" : 50, + + "color" : 0x77000000, + + "children" : + ( + { + "name" : "chatline", + "type" : "editline", + + "x" : 5, + "y" : 5, + + "width" : 280 - 70, + "height" : 40, + + "with_codepage" : 1, + "input_limit" : 40, + "limit_width" : 280 - 90, + "multi_line" : 1, + }, + { + "name" : "sendbutton", + "type" : "button", + + "x" : 280 - 80, + "y" : 10, + + "text" : uiScriptLocale.WHISPER_SEND, + + "default_image" : "d:/ymir work/ui/public/xlarge_thin_button_01.sub", + "over_image" : "d:/ymir work/ui/public/xlarge_thin_button_02.sub", + "down_image" : "d:/ymir work/ui/public/xlarge_thin_button_03.sub", + }, + ), + }, + ), + }, + ), +}