My situation:
I am making an app which is supposed to save events like: an activity, from when, to when, additional notes (for now only that), those are my inputs.
I already saved those onto variables. After that i have to display them in certain ways which is pretty easy.
Now i am wondering, When i press the “save” button it saves it onto the variables then displays those:
e.g.:
Sport
from 14:30 to 15:30
additional Notes: I love sport
My problem is if i go in and try to
make a new entry ofc it overrides the
old one meaning it will display a
different thing now once i press the
“save” button again.
Here some screenshots:
The bar displays how many hours of the day are “used” by an event (in this case 1h of 24h) It’s pretty much just to test. But it will end up looking/working a bit like that.
I was thinking of making an instance
of my GameObject that displays those
variables. Is that a possibilty? If
so how do i do that? I have to be
able to change those values again as
well. E.g. pressing on the displayed
entry and then editing the time or
name (activity)
It’s very hard to phrase this
question but i tryed my best. If you
take some time to answer my question
i would appreciate this so much since
i need this project to succeed for
school (It’s a project)
using javascript!
Thanks in advance! (also, sorry for the bad text, It has been a while since i have asked something here on the forums)
My save values function:
function SaveValues(){
//while(mistakeInCreateRemInput == true){
//When check pressed in "createReminder" Values are stored
activityIV = activityIF.text;
addNotesIV = addNotesIF.text;
//Read the values from the "event from" Dropdown
//
timeHoursFromIS = dropdownHoursFrom.options[dropdownHoursFrom.value].text;
try{
timeHoursFromIV = float.Parse(timeHoursFromIS);
}catch(FormatException){
//do smth
}
timeMinutesFromIS = dropdownMinutesFrom.options[dropdownMinutesFrom.value].text;
try{
timeMinutesFromIV = float.Parse(timeMinutesFromIS);
}catch(FormatException){
//do smth
}
//Read the values from the "event to" Dropdown
//
timeHoursToIS = dropdownHoursTo.options[dropdownHoursTo.value].text;
try{
timeHoursToIV = float.Parse(timeHoursToIS);
}catch(FormatException){
//do smth
}
timeMinutesToIS = dropdownMinutesTo.options[dropdownMinutesTo.value].text;
try{
timeMinutesToIV = float.Parse(timeMinutesToIS);
}catch(FormatException){
//do smth
}
print(activityIV+" from "+timeHoursFromIV+":"+timeMinutesFromIS+" to "+timeHoursToIV+":"+timeMinutesToIS+" has been saved");
print("Additional Notes: "+addNotesIV);
//Resetting the input fields
activityIF.text = "";
addNotesIF.text = "";
//missing: Set the values of drop downs to standard!
// }
//Check for mistakes
//if(timeHoursFromIV > timeHoursToIV)
// mistakeInCreateRemInput = true;
//else if(timeHoursToIV == timeHoursFromIV && timeMinutesToIV == timeMinutesFromIV)
// mistakeInCreateRemInput = true;
//else if(timeHoursToIV == timeHoursFromIV && timeMinutesFromIV > timeMinutesToIV)
// mistakeInCreateRemInput = true;
//else{
// mistakeInCreateRemInput = false;
//Calculate difference between start and stop time
print("WORKING");
timeDifferenceHours = (timeHoursToIV - timeHoursFromIV) * 60; //Difference in minutes
timeDifferenceMinutes = timeMinutesToIV - timeMinutesFromIV; //Difference in minutes
timeSum = timeDifferenceHours + timeDifferenceMinutes; //Value ranging from 5 to 1440
showTimeImg.fillAmount = TranslateTime();
activityText.text = "Activity: "+activityIV;
additionalText.text = "Additional Notes: "+addNotesIV;
DayDisplayInstance = Instantiate(DayDisplay, new Vector3(350, -860), transform.rotation);
// }
createRemPnl.SetActive(false);
}//SaveValues
my check for wrong inputs didnt work yet so i commented it out for now!