These are my inventory codes:
it works well, draws the empty fields of my eq. But it looks awfull, dont you think that?
and when i start writing the codes for collecting items there will be 2x more of this.
Is there way to optimise these codes to few lines of code?
Code:
//Create event
empty = "<empty>"
eq[0] = empty
eq[1] = empty
eq[2] = empty
eq[3] = empty
eq[4] = empty
eq[5] = empty
eq[6] = empty
eq[7] = empty
eq[8] = empty
eq[9] = empty
eq[10] = empty
eq[11] = empty
eq[12] = empty
eq[13] = empty
eq[14] = empty
eq[15] = empty
eq[16] = empty
eq[17] = empty
eq[18] = empty
Code:
//First page of the eq menu
if window = 2 && option <= 9 {
draw_text(xinv,yinv[0],eq[0])
draw_text(xinv,yinv[1],eq[1])
draw_text(xinv,yinv[2],eq[2])
draw_text(xinv,yinv[3],eq[3])
draw_text(xinv,yinv[4],eq[4])
draw_text(xinv,yinv[5],eq[5])
draw_text(xinv,yinv[6],eq[6])
draw_text(xinv,yinv[7],eq[7])
draw_text(xinv,yinv[8],eq[8])
draw_text(xinv,yinv[9],eq[9])
}
//second page
if window = 2 && option > 9 {
draw_text(xinv,yinv[10],eq[10])
draw_text(xinv,yinv[11],eq[11])
draw_text(xinv,yinv[12],eq[12])
draw_text(xinv,yinv[13],eq[13])
draw_text(xinv,yinv[14],eq[14])
draw_text(xinv,yinv[15],eq[15])
draw_text(xinv,yinv[16],eq[16])
draw_text(xinv,yinv[17],eq[17])
draw_text(xinv,yinv[18],eq[18])
}
and when i start writing the codes for collecting items there will be 2x more of this.
Is there way to optimise these codes to few lines of code?