mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Support PNG and SVG icon sets for point level icons #1739
This commit is contained in:
parent
f1c839042c
commit
f2ff393592
5 changed files with 29 additions and 4 deletions
|
|
@ -54,7 +54,8 @@ function pointLevelIconTrans($matches, $addon_info)
|
|||
$text = $matches[5];
|
||||
|
||||
// Get a path where level icon is
|
||||
$level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level);
|
||||
$level_icon_type = $config->level_icon_type ?? 'gif';
|
||||
$level_icon = sprintf('%smodules/point/icons/%s/%d.%s', Context::getRequestUri(), $config->level_icon, $level, $level_icon_type);
|
||||
|
||||
// Get per to go to the next level if not a top level
|
||||
$per = NULL;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ $lang->about_point_io = 'Point module can be on or off. If you OFF this module,
|
|||
$lang->max_level = 'Max Level';
|
||||
$lang->about_max_level = 'You may set the max level. Level icons should be considered, and it is strongly recommended that you keep this value below 1000.';
|
||||
$lang->level_icon = 'Level Icon';
|
||||
$lang->about_level_icon = 'Level icons are stored in the ./modules/point/icons/NAME/ folder, and support gif, png and svg extensions.<br />Please be aware that different icon sets may support different ranges of high levels.';
|
||||
$lang->msg_level_icon_not_found = 'Cannot find the selected level icon set.<br />Level icons must be stored in the ./modules/point/icons/NAME/ folder, and must contain at least one of the following files: 1.gif, 1.png, 1.svg';
|
||||
$lang->about_level_icon = 'Path of level icon is "./module/point/icons/[level].gif" and max level could be different with icon set. So please be careful';
|
||||
$lang->point_name = 'Point Name';
|
||||
$lang->about_point_name = 'You may give a name or unit to a point';
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ $lang->about_point_io = '체크 하면 포인트 모듈 기능을 켤 수 있습
|
|||
$lang->max_level = '최고 레벨';
|
||||
$lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고, 1000레벨 이상은 권장하지 않습니다.';
|
||||
$lang->level_icon = '레벨 아이콘';
|
||||
$lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/레벨.gif 로 지정되며 최고레벨과 아이콘셋이 다를 수 있으니 주의해주세요!';
|
||||
$lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/아이콘명/ 폴더에 저장되어 있으며, 확장자는 gif, png, svg를 지원합니다.<br />아이콘셋에 따라 지원하는 최고 레벨이 다를 수 있으니 주의하시기 바랍니다.';
|
||||
$lang->msg_level_icon_not_found = '선택한 레벨 아이콘을 찾을 수 없습니다.<br />레벨 아이콘은 ./modules/point/icons/아이콘명/ 폴더에 저장되어 있어야 하며, 최소 1레벨에 해당하는 gif, png 또는 svg 파일이 존재해야 합니다.';
|
||||
$lang->point_name = '포인트 이름';
|
||||
$lang->about_point_name = '포인트 이름이나 단위를 정할 수 있습니다.';
|
||||
$lang->level_point = '레벨 포인트';
|
||||
|
|
|
|||
|
|
@ -102,6 +102,27 @@ class pointAdminController extends point
|
|||
|
||||
// Set the level icon
|
||||
$config->level_icon = $args->level_icon;
|
||||
$config->level_icon_type = 'gif';
|
||||
$level_icon_dir = $this->module_path . '/icons/' . $config->level_icon;
|
||||
if (!file_exists($level_icon_dir))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_level_icon_not_found');
|
||||
}
|
||||
if (!file_exists($level_icon_dir . '/1.gif'))
|
||||
{
|
||||
if (file_exists($level_icon_dir . '/1.png'))
|
||||
{
|
||||
$config->level_icon_type = 'png';
|
||||
}
|
||||
elseif (file_exists($level_icon_dir . '/1.svg'))
|
||||
{
|
||||
$config->level_icon_type = 'svg';
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'msg_level_icon_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
// Check if downloads are not allowed
|
||||
$config->disable_download = ($args->disable_download === 'Y') ? 'Y' : 'N';
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/1.gif" alt="1" /></td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/1.{$config->level_icon_type ?? 'gif'}" alt="1" /></td>
|
||||
<td><label for="level_step_1" style="margin:0"><input type="number" id="level_step_1" class="level_step" value="{$config->level_step[1]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
{@$point_group_item = $point_group[1]}
|
||||
{@$title=array()}
|
||||
|
|
@ -219,7 +219,7 @@
|
|||
<!--@end-->
|
||||
<tr class="row{(($i-1)%2+1)}">
|
||||
<td>{$i}</td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/{$i}.gif" alt="{$i}" /></td>
|
||||
<td><img src="{getUrl()}modules/point/icons/{$config->level_icon}/{$i}.{$config->level_icon_type ?? 'gif'}" alt="{$i}" /></td>
|
||||
<td><label for="level_step_{$i}" style="margin:0"><input type="number" id="level_step_{$i}" class="level_step" value="{$config->level_step[$i]}" style="width:120px;text-align:right" /> {$config->point_name}</label></td>
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue