Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
To Do Break Down
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
breakdown
To Do Break Down
Commits
a437c7bc
Commit
a437c7bc
authored
Jan 17, 2022
by
Julia Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added timestamps to data logs, changed format a little
parent
b884b530
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
Item.gd
Item.gd
+8
-4
Multi.tscn
Multi.tscn
+2
-0
BG.gd
Scripts/BG.gd
+5
-3
No files found.
Item.gd
View file @
a437c7bc
...
@@ -53,27 +53,31 @@ func _input_event(viewport, event, shape_idx): # executes when clicked on
...
@@ -53,27 +53,31 @@ func _input_event(viewport, event, shape_idx): # executes when clicked on
func storeClick(method): # stores the mouse click data to data.save
func storeClick(method): # stores the mouse click data to data.save
var save_data = File.new()
var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"):
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.open("user://data.save",File.WRITE)
save_data.store_string(
method + " " + get_name()
)
save_data.store_string(
": " + method + " " + get_name() + " " + timestamp
)
print("Created file")
print("Created file")
else:
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.seek_end()
save_data.store_string(method + " " + get_name())
save_data.store_string(
": " +
method + " " + get_name())
#print("Writing to file")
#print("Writing to file")
save_data.close()
save_data.close()
func storeInt(selected): # specifically for using one item on another, stores mouse click data to data.save
func storeInt(selected): # specifically for using one item on another, stores mouse click data to data.save
var save_data = File.new()
var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"):
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.open("user://data.save",File.WRITE)
save_data.store_string("Used " + inventory.get_item_text(selected) + " -> " + get_name())
save_data.store_string("
:
Used " + inventory.get_item_text(selected) + " -> " + get_name())
print("Created file")
print("Created file")
else:
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.seek_end()
save_data.store_string("Used " + inventory.get_item_text(selected) + " -> " + get_name())
save_data.store_string("
:
Used " + inventory.get_item_text(selected) + " -> " + get_name())
#print("Writing to file")
#print("Writing to file")
save_data.close()
save_data.close()
...
...
Multi.tscn
View file @
a437c7bc
...
@@ -370,6 +370,8 @@ margin_left = 21.0
...
@@ -370,6 +370,8 @@ margin_left = 21.0
margin_top = 20.0
margin_top = 20.0
margin_right = 518.0
margin_right = 518.0
margin_bottom = 74.0
margin_bottom = 74.0
visible_characters = 0
percent_visible = 0.0
scroll_active = false
scroll_active = false
script = ExtResource( 35 )
script = ExtResource( 35 )
__meta__ = {
__meta__ = {
...
...
Scripts/BG.gd
View file @
a437c7bc
...
@@ -11,14 +11,16 @@ func _unhandled_input(event): # for any input that isn't capture by UI or any ot
...
@@ -11,14 +11,16 @@ func _unhandled_input(event): # for any input that isn't capture by UI or any ot
if event.button_index == BUTTON_LEFT and event.pressed:
if event.button_index == BUTTON_LEFT and event.pressed:
if tracking: # if tracking of coordinates is enabled, turn it off to only track per-item clicks
if tracking: # if tracking of coordinates is enabled, turn it off to only track per-item clicks
var save_data = File.new()
var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"): # creates a new save file if there is none
if !save_data.file_exists("user://data.save"): # creates a new save file if there is none
save_data.open("user://data.save",File.WRITE)
save_data.open("user://data.save",File.WRITE)
save_data.store_string(
str(event.position) + ": "
)
save_data.store_string(
timestamp + " " + str(event.position)
)
print("Created file")
print("Created file")
else: # appends to existing save file if it does exist
else: # appends to existing save file if it does exist
save_data.open("user://data.save",File.READ_WRITE)
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.seek_end()
save_data.store_string("\n"+
str(event.position) + ": "
)
save_data.store_string("\n"+
timestamp + " " + str(event.position)
)
print("Writing coordinates to file")
print("Writing coordinates to file")
save_data.close()
save_data.close()
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