Skip to content

Commit

Permalink
Merge pull request #1108 from cwtickle/feature/0445-imgtype-notes
Browse files Browse the repository at this point in the history
[0445/imgtype-notes] ノートスキンの追加、デフォルト画像を回転させないオプションを追加
  • Loading branch information
cwtickle committed Sep 11, 2021
2 parents 008a28a + c82532c commit 2caa38e
Show file tree
Hide file tree
Showing 17 changed files with 1,483 additions and 9 deletions.
Binary file modified img/classic/arrowShadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,391 changes: 1,391 additions & 0 deletions img/imgbase/arrowShadow_classic.ai

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions img/note/aaShadow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/arrow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/arrowShadow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/note/borderline.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/c.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/note/cursor.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/note/frzbar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/giko.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/iyo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/monar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/morara.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions img/note/onigiri.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 22 additions & 6 deletions js/danoni_main.js
Expand Up @@ -660,7 +660,9 @@ function createColorObject2(_id,
charaStyle = `${rotate}${styleName}`;
} else {
charaStyle = `arrow${styleName}`;
style.transform = `rotate(${rotate}deg)`;
if (g_stateObj.rotateEnabled) {
style.transform = `rotate(${rotate}deg)`;
}
}

style.maskImage = `url("${g_imgObj[charaStyle]}")`;
Expand Down Expand Up @@ -2732,12 +2734,15 @@ function preheaderConvert(_dosObj) {
* @param {array} _imgType
*/
function updateImgType(_imgType) {
resetImgs(..._imgType);
resetImgs(_imgType.name, _imgType.extension);
reloadImgObj();
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_rootPath}${g_imgObj[key]}`);
if (_imgType[1] === undefined && typeof g_presetOverrideExtension === C_TYP_STRING) {
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_imgObj[key].slice(0, -3)}${g_presetOverrideExtension}`);
}
if (!g_isFile) {
g_imgInitList.forEach(img => preloadFile(`image`, g_imgObj[img]));
}
}

/**
Expand Down Expand Up @@ -2765,18 +2770,25 @@ function headerConvert(_dosObj) {
if (tmpImgTypes.length > 0) {
tmpImgTypes.forEach((tmpImgType, j) => {
const imgTypes = tmpImgType.split(`,`);
obj.imgType[j] = [imgTypes[0], imgTypes[1] || `svg`];
obj.imgType[j] = {
name: imgTypes[0],
extension: imgTypes[1] || `svg`,
rotateEnabled: setVal(imgTypes[2], true, C_TYP_BOOLEAN),
flatStepHeight: setVal(imgTypes[3], C_ARW_WIDTH, C_TYP_FLOAT),
};
g_keycons.imgTypes[j] = (imgTypes[0] === `` ? `Original` : imgTypes[0]);
});
}
}

// 末尾にデフォルト画像セットが入るよう追加
if (obj.imgType.findIndex(imgSets => imgSets[0] === ``) === -1) {
obj.imgType.push([``]);
if (obj.imgType.findIndex(imgSets => imgSets.name === ``) === -1) {
obj.imgType.push({ name: ``, extension: `svg`, rotateEnabled: true });
g_keycons.imgTypes.push(`Original`);
}
g_imgType = g_keycons.imgTypes[0];
g_stateObj.rotateEnabled = obj.imgType[0].rotateEnabled;
g_stateObj.flatStepHeight = obj.imgType[0].flatStepHeight;

// サーバ上の場合、画像セットを再読込(ローカルファイル時は読込済みのためスキップ)
if (!g_isFile) {
Expand Down Expand Up @@ -5781,6 +5793,9 @@ function keyConfigInit(_kcType = g_kcType) {
const setImgType = (_scrollNum = 1) => {
const nextNum = getNextNum(_scrollNum, `imgTypes`, g_imgType);
g_imgType = g_keycons.imgTypes[nextNum];
g_stateObj.rotateEnabled = g_headerObj.imgType[nextNum].rotateEnabled;
g_stateObj.flatStepHeight = g_headerObj.imgType[nextNum].flatStepHeight;

updateImgType(g_headerObj.imgType[nextNum]);
keyConfigInit(g_kcType);
}
Expand Down Expand Up @@ -7627,7 +7642,8 @@ function MainInit() {
if (g_stateObj.scroll === `Flat` && g_stateObj.d_stepzone === C_FLG_ON) {

// ステップゾーンの代わり
[0, C_ARW_WIDTH].forEach((y, j) => {
const lineY = [(C_ARW_WIDTH - g_stateObj.flatStepHeight) / 2, (C_ARW_WIDTH + g_stateObj.flatStepHeight) / 2];
lineY.forEach((y, j) => {
mainSprite.appendChild(
createColorObject2(`stepBar${j}`, {
x: 0, y: C_STEP_Y + g_posObj.reverseStepY * Number(g_stateObj.reverse === C_FLG_ON) + y,
Expand Down
13 changes: 10 additions & 3 deletions js/danoni_setting.js
Expand Up @@ -118,13 +118,20 @@ const g_presetSettingUse = {
const g_presetFrzStartjdgUse = `false`;

/*
デフォルト画像セットの設定 (セット対象のフォルダ名,拡張子の順に指定)
デフォルト画像セットの設定
(セット対象のフォルダ名, 拡張子, 画像回転有無(true or false), Flat時ステップ間隔の順に指定)
事前に、[img]フォルダ配下にセット対象のサブフォルダを作成し、その中に一式を入れておく必要あり
下記の場合は[classic]フォルダに[png]形式の画像一式をデフォルト画像セットとして使用する
拡張子は、未指定の場合`svg`形式
未指定の場合のデフォルト値は以下の通り
セット対象のフォルダ名:`` (imgフォルダ直下)
拡張子:`svg`形式
画像回転有無:true(回転有り)
Flat時ステップ間隔:50(px) ※矢印サイズ
*/
// const g_presetImageSets = [``, `classic,png`, `classic-thin,png`];
// const g_presetImageSets = [``, `classic,png`, `classic-thin,png`, `note,svg,false,0`];

// デフォルト画像セット (C_IMG_XXXX, 厳密にはg_imgObj) に対して拡張子の上書きを行うか設定
// 文字列の後ろ3文字をカットして、下記の値を適用する。コメントアウトした場合は、上書きを行わない。
Expand Down
3 changes: 3 additions & 0 deletions js/lib/danoni_constants.js
Expand Up @@ -396,6 +396,9 @@ const g_stateObj = {
d_special: C_FLG_ON,
appearance: `Visible`,
opacity: 100,

rotateEnabled: true,
flatStepHeight: false,
};

const C_VAL_MAXLIFE = 1000;
Expand Down

0 comments on commit 2caa38e

Please sign in to comment.