Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update v0.1.1 #1

Merged
merged 1 commit into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 nojio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 0.1.1
Date: 2022-08-13
Changes:
- Fixed some issues.
- Add ja locale.
---------------------------------------------------------------------------------------------------
Version: 0.1.0
Date: 2022-08-01
Info:
Expand Down
2 changes: 1 addition & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ script.on_event(defines.events.on_gui_click, function(event)

for i, _ in pairs(global.death_history) do
if element.name == "zoom_position_"..global.death_history[i].id or element.name == "hisotry_position_"..global.death_history[i].id then
player.print("zoom_position pressed")
if is_debug_mode then player.print("zoom_position pressed") end
player.zoom_to_world(global.death_history[i].position, 0.5)
end
end
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "death-log",
"version": "0.1.0",
"version": "0.1.1",
"title": "Death Log",
"author": "nojio",
"description": "The number of deaths and their history are displayed on the InformaTron.",
Expand Down
13 changes: 1 addition & 12 deletions locale/en/locale.cfg
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
death_diary=Death Diary
[mod-name]
death-log=Death Log

[mod-description]
death-log=Death Log for informatron.
death-log=The number of deaths and their history are displayed on the InformaTron.

[death_log]
title_death_log=Death Log
menu_death_log=Death Log
death_count_text=You died [color=red]__1__[/color] times.
title_death_log_history=History
menu_death_log_history=History
page_title_history=title: __1__
page_text_history=content: __1__ ha __2__ kai shindayo!
history_death_count_header=Death count
history_player_name_header=Player name
history_cause_header=Killed by
history_tick_header=Tick
history_surface_header=Surface
history_position_header=Position
history_position_cell=View Map
hisotry_text=__1__ was killed by __2__. __3__
history_gps_button=View Map
history_text_cell=__1__ was killed by __2__.
history_title=Log
history_tick_cell=[font=default-bold]__1__[/font]
16 changes: 16 additions & 0 deletions locale/ja/locale.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[mod-name]
death-log=Death Log

[mod-description]
death-log=InformaTronに死亡回数とその履歴を表示します。

[death_log]
title_death_log=Death Log
menu_death_log=Death Log
death_count_text=あなたは [color=red]__1__[/color] 回、死亡しました。
history_tick_header=ティック
history_position_header=場所
history_position_cell=マップで表示
history_text_cell=__1__ は __2__ によって殺されました。
history_title=ログ
history_tick_cell=[font=default-bold]__1__[/font]
2 changes: 1 addition & 1 deletion scripts/informatron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Informatron.page_content(page_name, player_index, element)
-- record
for i = #global.death_history, 1, -1 do
-- for i, _ in pairs(global.death_history) do
local history_tick_cell = history_table.add{type='label',caption={"death_log.history_tick_cell", format_tick_to_time(global.death_history[i].tick)}}
local history_tick_cell = history_table.add{type='label',caption={"death_log.history_tick_cell", Format_tick_to_time(global.death_history[i].tick)}}
local history_text_cell = history_table.add{type='label',caption={"death_log.history_text_cell",
global.death_history[i].player_name,
global.death_history[i].cause,
Expand Down
6 changes: 3 additions & 3 deletions scripts/util.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function make_gps_tag(position)
function Make_gps_tag(position)
return '[gps='..math.floor(position.x)..','..math.floor(position.y)..']'
end

function format_tick_to_time(tick)
function Format_tick_to_time(tick)
local seconds = math.floor(tick / 60)
local days = math.floor(seconds/3600/24)
local hours = math.floor(seconds/3600 - days*24)
Expand All @@ -12,5 +12,5 @@ function format_tick_to_time(tick)
local s_mins = string.format("%02.f", mins);
local s_secs = string.format("%02.f", secs);

return days..":"..s_hours..":"..s_hours..":"..s_mins..":"..s_secs
return days..":"..s_hours..":"..s_mins..":"..s_secs
end