Commit 7a730329 authored by hisuinohoshi's avatar hisuinohoshi

update tooltip

update:{resource_1.php,game.func.php,news.func.php,css}
为显示tooltip的道具名加入正则匹配过滤;
补上了进行状况中礼品盒的tooltip;
为移动端/触屏提供了临时的tooltip支持(能行吗?);
……
PS:这一条改动大部分是AI代笔,应该给AI发一个荣誉苦力称号。
parent d5e65670
This diff is collapsed.
...@@ -354,4 +354,15 @@ background-image: url("../../img/footer_line.gif"); ...@@ -354,4 +354,15 @@ background-image: url("../../img/footer_line.gif");
height: 12px; height: 12px;
outline:none; outline:none;
box-shadow:0 0 6px rgba(246, 219, 251, 0.6); box-shadow:0 0 6px rgba(246, 219, 251, 0.6);
}
span[title]:active:before {
content: attr(title);
display: block;
position: fixed;
background-color: rgba(225, 124, 226, 0.82); *BACKGROUND: rgb(98,135,163); *filter:alpha(opacity=60)
width: 200px;max-width:200px;
font: bold 10pt "微软雅黑" serif; color: white; overflow-x:hidden; overflow-y:auto; text-shadow:none; text-align: center;
padding: 2px;
z-index:10;
} }
\ No newline at end of file
...@@ -85,7 +85,7 @@ function get_itmsk_strlen($sk_value,$max_length=5) ...@@ -85,7 +85,7 @@ function get_itmsk_strlen($sk_value,$max_length=5)
function parse_itm_desc($n,$t,$short=0,$c=NULL) function parse_itm_desc($n,$t,$short=0,$c=NULL)
{ {
global $iteminfo,$itemspkinfo; global $iteminfo,$itemspkinfo;
global $iteminfo_tooltip,$itemkinfo_tooltip,$itemspkinfo_tooltip; global $iteminfo_tooltip,$itemkinfo_tooltip,$itemspkinfo_tooltip,$iteminfo_tooltip_desc;
$s = "<span "; $p1 = ''; $p2 = ''; $ret = ''; $s = "<span "; $p1 = ''; $p2 = ''; $ret = '';
switch($t) switch($t)
{ {
...@@ -118,8 +118,20 @@ function parse_itm_desc($n,$t,$short=0,$c=NULL) ...@@ -118,8 +118,20 @@ function parse_itm_desc($n,$t,$short=0,$c=NULL)
break; break;
//处理名字 //处理名字
case $t=='m': case $t=='m':
if(isset($iteminfo_tooltip[$n]['title'])) $p1 = "title=\"".$iteminfo_tooltip[$n]['title']."\""; $filter_n = preg_replace('/锋利的|电气|毒性|钉|\[.*\]|-改/', '', $n);
if(isset($iteminfo_tooltip[$n]['class'])) $p2 = "class=\"".$iteminfo_tooltip[$n]['class']."\""; if(isset($iteminfo_tooltip[$filter_n]))
{
if(is_array($iteminfo_tooltip[$filter_n]))
{
if(isset($iteminfo_tooltip[$filter_n]['title'])) $p1 = "title=\"".$iteminfo_tooltip[$filter_n]['title']."\"";
if(isset($iteminfo_tooltip[$filter_n]['class'])) $p2 = "class=\"".$iteminfo_tooltip[$filter_n]['class']."\"";
}
elseif(isset($iteminfo_tooltip_desc[$iteminfo_tooltip[$filter_n]]))
{ //使用可复用描述 越来越离谱了
if(isset($iteminfo_tooltip_desc[$iteminfo_tooltip[$filter_n]]['title'])) $p1 = "title=\"".$iteminfo_tooltip_desc[$iteminfo_tooltip[$filter_n]]['title']."\"";
if(isset($iteminfo_tooltip_desc[$iteminfo_tooltip[$filter_n]]['class'])) $p2 = "class=\"".$iteminfo_tooltip_desc[$iteminfo_tooltip[$filter_n]]['class']."\"";
}
}
break; break;
} }
//传入了样式 且道具没有与预设匹配的样式 则使用传入的样式 //传入了样式 且道具没有与预设匹配的样式 则使用传入的样式
......
...@@ -35,8 +35,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') { ...@@ -35,8 +35,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
include_once GAME_ROOT.'./include/game.func.php'; include_once GAME_ROOT.'./include/game.func.php';
//死法(除DN外):道具名登记在$d上;第四个参数:没有检查到特殊样式的给一个红色 //死法(除DN外):道具名登记在$d上;第四个参数:没有检查到特殊样式的给一个红色
if(strpos($news,'death')!==false && $news!=='death28' && isset($d)) $d = parse_itm_desc($d,'m',0,"red"); if(strpos($news,'death')!==false && $news!=='death28' && isset($d)) $d = parse_itm_desc($d,'m',0,"red");
//赠送道具、吃到毒补给、陷阱、改变天气、强化武器、唱歌:道具名登记在$c上; //赠送道具、吃到毒补给、陷阱、改变天气、强化武器、唱歌、打开礼物盒:道具名登记在$c上;
if((strpos($news,'senditem')!==false||strpos($news,'poison')!==false||strpos($news,'trap')!==false||strpos($news,'wth')!==false||strpos($news,'newwep')!==false||strpos($news,'song')!==false) && isset($c)) $c = parse_itm_desc($c,'m'); if((strpos($news,'senditem')!==false||strpos($news,'poison')!==false||strpos($news,'trap')!==false||strpos($news,'wth')!==false||strpos($news,'newwep')!==false||strpos($news,'song')!==false||strpos($news,'present')!==false) && isset($c)) $c = parse_itm_desc($c,'m');
//合成、使用死斗卡:道具名登记在$b上; //合成、使用死斗卡:道具名登记在$b上;
if((strpos($news,'mix')!==false||strpos($news,'duelkey')!==false) && isset($b)) $b = parse_itm_desc($b,'m'); if((strpos($news,'mix')!==false||strpos($news,'duelkey')!==false) && isset($b)) $b = parse_itm_desc($b,'m');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment