• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revisione66e7dae0c20e8573fce1faa33e1e76a8d4b3fa5 (tree)
Time2009-03-28 14:59:56
Authorh677 <h677>
Commiterh677

Log Message

サウンドの設定ファイルの指定で、デフォルトを相対パスに変更。
実行ディレクトリより下のファイルを指定した場合、相対パスで保存するように変更。

Change Summary

Incremental Difference

--- a/Option.pas
+++ b/Option.pas
@@ -1321,6 +1321,14 @@ begin
13211321 sndPlaySound(nil, SND_ASYNC);
13221322 if OpenDialog.Execute then begin
13231323 SoundFileEdit.Text := OpenDialog.FileName;
1324+ // ƒAƒvƒŠ”z‰º‚̃tƒ@ƒCƒ‹‚̏ꍇ‘Š‘΃pƒX‚É•ÏŠ·‚·‚éB
1325+ if (AnsiPos(GikoSys.Setting.GetAppDir,SoundFileEdit.Text) = 1) then begin
1326+ // .\ ‚ª‚‚©‚È‚¢‚̂ŁA.\‚ð’ljÁ
1327+ SoundFileEdit.Text := '.\' + ExtractRelativePath(
1328+ GikoSys.Setting.GetAppDir,
1329+ SoundFileEdit.Text);
1330+
1331+ end;
13241332 end;
13251333 end;
13261334
@@ -1328,10 +1336,8 @@ procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
13281336 var
13291337 s : String;
13301338 begin
1331- s := SoundFileEdit.Text;
1332- if (AnsiPos('.\', s) = 1) then begin
1333- s := GikoSys.Setting.GetAppDir + Copy(s, 2, Length(s));
1334- end;
1339+ SetCurrentDir(GikoSys.Setting.GetAppDir);
1340+ s := ExpandFileName(SoundFileEdit.Text);
13351341 if not FileExists(s) then begin
13361342 MsgBox(Handle, '‘¶Ý‚µ‚È‚¢ƒtƒ@ƒCƒ‹‚Å‚·', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK);
13371343 SoundFileEdit.Text := '';
@@ -1357,7 +1363,8 @@ begin
13571363 Item := SoundListView.Selected;
13581364 if Item = nil then Exit;
13591365
1360- if FileExists(SoundFileEdit.Text) then
1366+ SetCurrentDir(GikoSys.Setting.GetAppDir);
1367+ if FileExists(ExpandFileName(SoundFileEdit.Text)) then
13611368 Item.SubItems[0] := SoundFileEdit.Text;
13621369 if Trim(SoundFileEdit.Text) = '' then
13631370 Item.SubItems[0] := '';
--- a/Setting.pas
+++ b/Setting.pas
@@ -1224,18 +1224,13 @@ begin
12241224 for i := 0 to GetSoundCount - 1 do begin
12251225 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
12261226 // ‘Š‘ÎŽQÆ‘΍ô
1227- s := SoundFileName[i];
1228- if (AnsiPos('.\', SoundFileName[i]) = 1) then begin
1229- s := GetAppDir
1230- + Copy(SoundFileName[i], 2, Length(SoundFileName[i]));
1231- end;
12321227 // ƒtƒ@ƒCƒ‹‚Ì‘¶Ýƒ`ƒFƒbƒN
1233- if not FileExists(SoundFileName[i]) then begin
1228+ if not FileExists(ExpandFileName(SoundFileName[i])) then begin
12341229 SoundFileName[i] := '';
12351230 end;
12361231 end;
12371232 end else begin
1238- s := GetAppDir + '\sound\';
1233+ s := 'Sound\';
12391234 SoundFileName[0] := s + 'Žæ“¾¬Œ÷.wav';
12401235 SoundFileName[1] := s + 'Žæ“¾¬Œ÷(·•ª).wav';
12411236 SoundFileName[2] := s + '–¢XV.wav';
@@ -1894,12 +1889,8 @@ var
18941889 begin
18951890 for i := 0 to GetSoundCount - 1 do begin
18961891 if SoundName[i] = Name then begin
1897- Result := SoundFileName[i];
1898- // ‘Š‘΃pƒX‘΍ô
1899- if (AnsiPos('.\', Result) = 1) then begin
1900- Result := GetAppDir
1901- + Copy(Result, 2, Length(Result));
1902- end;
1892+ SysUtils.SetCurrentDir(GetAppDir);
1893+ Result := ExpandFileName(SoundFileName[i]);
19031894 Exit;
19041895 end;
19051896 end;