ldkong commited on
Commit
5a70ae3
β€’
1 Parent(s): 6ee80eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -68,30 +68,29 @@ def run(domain_source, action_source, hair_source, top_source, bottom_source, do
68
 
69
  # == Source Avatar ==
70
  # body
71
- #if body == "human":body = '0'
72
- #elif body == "alien": body = '1'
73
- body = '0'
74
 
75
  # hair
76
- if hair == "green": hair = '0'
77
- elif hair == "yellow": hair = '2'
78
- elif hair == "rose": hair = '4'
79
- elif hair == "red": hair = '7'
80
- elif hair == "wine": hair = '8'
81
 
82
  # top
83
- if top == "brown": top = '0'
84
- elif top == "blue": top = '1'
85
- elif top == "white": top = '2'
86
 
87
  # bottom
88
- if bottom == "white": bottom = '0'
89
- elif bottom == "golden": bottom = '1'
90
- elif bottom == "red": bottom = '2'
91
- elif bottom == "silver": bottom = '3'
92
 
93
- file_name_source = './Sprite/frames/domain_1/' + action + '/'
94
- file_name_source = file_name_source + 'front' + '_' + str(body) + str(bottom) + str(top) + str(hair) + '_'
95
 
96
  gif = display_gif_pad(file_name_source, 'avatar_source.gif')
97
 
@@ -112,12 +111,12 @@ def run(domain_source, action_source, hair_source, top_source, bottom_source, do
112
  gr.Interface(
113
  run,
114
  inputs=[
115
- gr.Textbox(value="Source Avatar: Human", interactive=False),
116
  gr.Radio(choices=["slash", "spellcard", "walk"], value="slash"),
117
  gr.Radio(choices=["green", "yellow", "rose", "red", "wine"], value="green"),
118
  gr.Radio(choices=["brown", "blue", "white"], value="brown"),
119
  gr.Radio(choices=["white", "golden", "red", "silver"], value="white"),
120
- gr.Textbox(value="Target Avatar: Alien", interactive=False),
121
  gr.Radio(choices=["slash", "spellcard", "walk"], value="walk"),
122
  gr.Radio(choices=["green", "yellow", "rose", "red", "wine"], value="green"),
123
  gr.Radio(choices=["brown", "blue", "white"], value="brown"),
 
68
 
69
  # == Source Avatar ==
70
  # body
71
+ body_source = '0'
72
+ body_target = '1'
 
73
 
74
  # hair
75
+ if hair_source == "green": hair_source = '0'
76
+ elif hair_source == "yellow": hair_source = '2'
77
+ elif hair_source == "rose": hair_source = '4'
78
+ elif hair_source == "red": hair_source = '7'
79
+ elif hair_source == "wine": hair_source = '8'
80
 
81
  # top
82
+ if top_source == "brown": top_source = '0'
83
+ elif top_source == "blue": top_source = '1'
84
+ elif top_source == "white": top_source = '2'
85
 
86
  # bottom
87
+ if bottom_source == "white": bottom_source = '0'
88
+ elif bottom_source == "golden": bottom_source = '1'
89
+ elif bottom_source == "red": bottom_source = '2'
90
+ elif bottom_source == "silver": bottom_source = '3'
91
 
92
+ file_name_source = './Sprite/frames/domain_1/' + action_source + '/'
93
+ file_name_source = file_name_source + 'front' + '_' + str(body_source) + str(bottom_source) + str(top_source) + str(hair_source) + '_'
94
 
95
  gif = display_gif_pad(file_name_source, 'avatar_source.gif')
96
 
 
111
  gr.Interface(
112
  run,
113
  inputs=[
114
+ gr.Textbox(value="Source Avatar - Human", interactive=False),
115
  gr.Radio(choices=["slash", "spellcard", "walk"], value="slash"),
116
  gr.Radio(choices=["green", "yellow", "rose", "red", "wine"], value="green"),
117
  gr.Radio(choices=["brown", "blue", "white"], value="brown"),
118
  gr.Radio(choices=["white", "golden", "red", "silver"], value="white"),
119
+ gr.Textbox(value="Target Avatar - Alien", interactive=False),
120
  gr.Radio(choices=["slash", "spellcard", "walk"], value="walk"),
121
  gr.Radio(choices=["green", "yellow", "rose", "red", "wine"], value="green"),
122
  gr.Radio(choices=["brown", "blue", "white"], value="brown"),