Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
42eb2a99
Commit
42eb2a99
authored
Oct 26, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs
parent
625bc35c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
25 deletions
+18
-25
functions_helper
data_from_portwine/scripts/functions_helper
+18
-25
No files found.
data_from_portwine/scripts/functions_helper
View file @
42eb2a99
...
...
@@ -867,9 +867,6 @@ search_desktop_file () {
fi
done < "
$desktop_file
"
while IFS="
" read -r -a line2 ; do
if [[
${
line2
[0]
}
== "
${
portwine_exe
// /#@_@#
}
" ]] ; then
TIME_CURRENT=
${
line2
[2]
}
fi
if [[
${
line2
[1]
}
== "
$ENTRY_POINT
" ]] ; then
ENTRY_POINT_FIND=1
break
...
...
@@ -882,52 +879,48 @@ search_desktop_file () {
fi
done
IFS=
"
$orig_IFS
"
[[ -z
${
line2
[1]
}
]] && line2[1]=
$ENTRY_POINT
if [[ -n
${
line2
[2]
}
]] ; then
TIME_CURRENT=
${
line2
[2]
}
else
TIME_CURRENT=0
fi
export TIME_CURRENT
# Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню
[[
${
line2
[3]
}
== NEW_DESKTOP ]] && unset PW_NEW_DESKTOP
if [[
$PW_NEW_DESKTOP
== 1 ]]
then
if [[ -n
$TIME_CURRENT
]] ; then
if [[
$PW_NEW_DESKTOP
== 1 ]] && [[
${
line2
[3]
}
!= NEW_DESKTOP ]] ; then
if [[
$ENTRY_POINT_FIND
== 1 ]] ; then
sed -i
"s|
${
line2
[1]
}
${
line2
[2]
}
OLD_DESKTOP|
${
line2
[1]
}
${
line2
[2]
}
NEW_DESKTOP|"
"
$PW_DATABASE_PATH
/times_current"
else
TIME_CURRENT=0
echo
"
${
portwine_exe
// /#@_@#
}
$ENTRY_POINT
$TIME_CURRENT
NEW_DESKTOP"
>>
"
$PW_DATABASE_PATH
/times_current"
echo
"
${
portwine_exe
// /#@_@#
}
${
line2
[1]
}
$TIME_CURRENT
NEW_DESKTOP"
>>
"
$PW_DATABASE_PATH
/times_current"
fi
fi
unset PW_NEW_DESKTOP
# Когда приложение было запущено и завершено
if [[ -n
$PW_TIME_IN_GAME
]] ; then
# Когда есть предыдущее время
if [[ -n
$TIME_CURRENT
]] ; then
TIME_TOTAL=
$((
TIME_CURRENT
+
PW_TIME_IN_GAME
))
if [[
$ENTRY_POINT_FIND
== 1 ]] ; then
# Когда есть предыдущее время
sed -i
"s|
${
line2
[1]
}
${
line2
[2]
}
|
${
line2
[1]
}
$TIME_TOTAL
|"
"
$PW_DATABASE_PATH
/times_current"
else
# Когда только запустили приложение первый раз
TIME_CURRENT=0
TIME_TOTAL=
$((
$TIME_CURRENT
+
PW_TIME_IN_GAME
))
echo
"
${
portwine_exe
// /#@_@#
}
$ENTRY_POINT
$TIME_TOTAL
OLD_DESKTOP"
>>
"
$PW_DATABASE_PATH
/times_current"
echo
"
${
portwine_exe
// /#@_@#
}
${
line2
[1]
}
$TIME_TOTAL
OLD_DESKTOP"
>>
"
$PW_DATABASE_PATH
/times_current"
fi
# Здесь добавляются новые линии для статистики по аналогии, к примеру
${
line2
[4]
}
if [[ -z
${
line2
[4]
}
]] ; then
line2[4]=0
sed -i
"s|
${
line2
[1]
}
\(
.*
\)
|
${
line2
[1]
}
\1
${
line2
[4]
}
|"
"
$PW_DATABASE_PATH
/times_current"
fi
local NUMBER_OF_STARTS
NUMBER_OF_STARTS=
$((
${
line2
[4]
}
+
1
))
sed -i
"s|
${
line2
[1]
}
\(
.*
\)
${
line2
[4]
}
|
${
line2
[1]
}
\1
$NUMBER_OF_STARTS
|"
"
$PW_DATABASE_PATH
/times_current"
else
fi
# Ремонтирует путь на новый, если вдруг путь до .exe файла битый или изменился, но .exe файл он опознал
if [[
$ENTRY_POINT_FIND
== 1 ]] ; then
TIME_CURRENT=
${
line2
[2]
}
if [[ -n
$PW_TIME_IN_GAME
]]
then TIME_TOTAL=
$((
TIME_CURRENT
+
PW_TIME_IN_GAME
))
if [[
$ENTRY_POINT_FIND
== 1 ]] && [[
${
line2
[0]
}
!=
"
${
portwine_exe
// /#@_@#
}
"
]] ; then
if [[ -n
$TIME_TOTAL
]]
then TIME_TOTAL=
$TIME_TOTAL
else TIME_TOTAL=
$TIME_CURRENT
fi
sed -i
"s|
${
line2
[0]
}
${
line2
[1]
}
$TIME_CURRENT
|
${
portwine_exe
// /#@_@#
}
${
line2
[1]
}
$TIME_TOTAL
|"
"
$PW_DATABASE_PATH
/times_current"
else
# Когда .exe файл не был запущен или не был создан ярлык, чтобы отображало менее минуты (чтобы визуально было понятно, то что настройка включена)
TIME_CURRENT=0
fi
fi
export TIME_CURRENT
}
create_name_desktop () {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment