1
0
Fork 0

steam launch option update

- fixed bug in the backend (was using "path" string as path lmao)
- more useful error message
- better install section styling
This commit is contained in:
Kim, Jimin 2022-02-02 09:49:03 +09:00
parent be74034a13
commit 53fa502c89
4 changed files with 34 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

@ -32,6 +32,7 @@ pub async fn unix_launch_option_setup(
let run_bepinex_sh_path = Path::new(game_path).join("run_bepinex.sh"); let run_bepinex_sh_path = Path::new(game_path).join("run_bepinex.sh");
let run_bepinex_sh_path_str = run_bepinex_sh_path.to_str().unwrap(); let run_bepinex_sh_path_str = run_bepinex_sh_path.to_str().unwrap();
let perms = fs::metadata(&run_bepinex_sh_path); let perms = fs::metadata(&run_bepinex_sh_path);
if perms.is_err() { if perms.is_err() {
println!("Failed to make {} executable", run_bepinex_sh_path_str); println!("Failed to make {} executable", run_bepinex_sh_path_str);
@ -39,9 +40,12 @@ pub async fn unix_launch_option_setup(
} }
let mut perms = perms.unwrap().permissions(); let mut perms = perms.unwrap().permissions();
perms.set_mode(0o755); // rwxr-xr-x perms.set_mode(0o755); // rwxr-xr-x
match fs::set_permissions("path", perms) { match fs::set_permissions(run_bepinex_sh_path_str, perms) {
Err(_) => { Err(err) => {
println!("Failed to make {} executable", run_bepinex_sh_path_str); println!(
"Failed to make {} executable: {}",
run_bepinex_sh_path_str, err
);
} }
_ => {} _ => {}

View file

@ -63,13 +63,8 @@
{:else if lastInstallErr == InstallErr.WBMUnzipFailed} {:else if lastInstallErr == InstallErr.WBMUnzipFailed}
Failed to unzip WBM :( Failed to unzip WBM :(
{:else if lastInstallErr == InstallErr.LaunchOptionNotSet} {:else if lastInstallErr == InstallErr.LaunchOptionNotSet}
<!-- todo: implement click to copy --> Paste the following text to steam launch option (click to copy):<br />
Copy and paste the following text to steam launch option: " <code
<code>{launhOptionString}</code>"
<br />
<button
on:click|once={() => { on:click|once={() => {
writeText(launhOptionString) writeText(launhOptionString)
@ -79,13 +74,20 @@
type: "success", type: "success",
removeAfter: 5000, removeAfter: 5000,
}) })
}} }}>{launhOptionString}</code
> >
Copy
</button> <br />
<br />
<img alt="where to find property settings" src="/img/properties.png" /> <img alt="where to find property settings" src="/img/properties.png" />
<br />
<img alt="where to find launch option" src="/img/launch_option.png" />
<br />
<button <button
on:click|once={() => { on:click|once={() => {
install({ isLaunchOptionSet: true }) install({ isLaunchOptionSet: true })
@ -105,6 +107,20 @@
@import "./styles/button.scss"; @import "./styles/button.scss";
.install { .install {
@apply text-center; /* make install section scrollable */
@apply w-full h-40 text-center overflow-y-auto overflow-x-hidden;
code {
color: rgb(238, 238, 238);
background-color: rgb(68, 68, 68);
border: 1px solid rgb(102, 102, 102);
border-radius: 3px;
padding: 1px 3px;
}
img {
/* center image */
@apply block ml-auto mr-auto;
}
} }
</style> </style>