Browse Source

char attributes loading

shuvit 5 years ago
parent
commit
273d232632

+ 2
- 2
characters/becky.ini View File

2
 ###################
2
 ###################
3
 #becky
3
 #becky
4
 
4
 
5
-shirt_logo = 3
5
+shirt_logo = 2
6
 
6
 
7
 shirt_color_r = 0.61
7
 shirt_color_r = 0.61
8
 shirt_color_g = 0.61
8
 shirt_color_g = 0.61
15
 
15
 
16
 #deck settings
16
 #deck settings
17
 ##############
17
 ##############
18
-deck_index = 2
18
+deck_index = 0
19
 deck_color_r = 1
19
 deck_color_r = 1
20
 deck_color_g = 1.0
20
 deck_color_g = 1.0
21
 deck_color_b = 1
21
 deck_color_b = 1

+ 2
- 2
characters/ralph.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:2181900bf7864a7c8b1c51c70d40dcc6e6390ab874fa285d2ee461319a6a8f77
3
-size 5128460
2
+oid sha256:29eed6d82bd40a2ca6ca8fb9060c4fc2aa78eab75621e452e1f04bb9484c57cc
3
+size 3270524

+ 2
- 2
characters/ralph.blend1 View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:09be7de60e3738a09c618101f6ea2ad7a17d18ea2c916b44b7a7ac746930ac7a
3
-size 5124340
2
+oid sha256:2181900bf7864a7c8b1c51c70d40dcc6e6390ab874fa285d2ee461319a6a8f77
3
+size 5128460

+ 2
- 2
characters/ralph.ini View File

2
 ###################
2
 ###################
3
 #ralph
3
 #ralph
4
 
4
 
5
-shirt_logo = 4
5
+shirt_logo = 1
6
 
6
 
7
 shirt_color_r = 0.54
7
 shirt_color_r = 0.54
8
 shirt_color_g = 0.4
8
 shirt_color_g = 0.4
15
 
15
 
16
 #deck settings
16
 #deck settings
17
 ##############
17
 ##############
18
-deck_index = 7
18
+deck_index = 2
19
 deck_color_r = 1
19
 deck_color_r = 1
20
 deck_color_g = 1.0
20
 deck_color_g = 1.0
21
 deck_color_b = 1
21
 deck_color_b = 1

+ 19
- 19
config.ini View File

48
 #character settings
48
 #character settings
49
 ###################
49
 ###################
50
 
50
 
51
-character = ralph
51
+character = becky
52
 
52
 
53
-shirt_logo = 4
53
+shirt_logo = 2
54
 
54
 
55
-shirt_color_r = 0.54
56
-shirt_color_g = 0.4
57
-shirt_color_b = 0.05
55
+shirt_color_r = 0.61
56
+shirt_color_g = 0.61
57
+shirt_color_b = 0.61
58
 
58
 
59
-shoe_color_r = 0.02
59
+shoe_color_r = 0.16
60
 shoe_color_g = 0.02
60
 shoe_color_g = 0.02
61
 shoe_color_b = 0.02
61
 shoe_color_b = 0.02
62
 #-----------------
62
 #-----------------
63
 
63
 
64
 #deck settings
64
 #deck settings
65
 ##############
65
 ##############
66
-deck_index = 7
66
+deck_index = 0
67
 deck_color_r = 1
67
 deck_color_r = 1
68
 deck_color_g = 1.0
68
 deck_color_g = 1.0
69
 deck_color_b = 1
69
 deck_color_b = 1
70
-trucks_r = 0.46
71
-trucks_g = 0.03
72
-trucks_b = 0.03
70
+trucks_r = 0.95
71
+trucks_g = 1.0
72
+trucks_b = 1
73
 
73
 
74
-wheel1_r = 1
75
-wheel1_g = 0.71
74
+wheel1_r = 0.4
75
+wheel1_g = 0.08
76
 wheel1_b = 0.08
76
 wheel1_b = 0.08
77
-wheel2_r = 1
78
-wheel2_g = 0.71
77
+wheel2_r = 0.08
78
+wheel2_g = 0.34
79
 wheel2_b = 0.08
79
 wheel2_b = 0.08
80
-wheel3_r = 1
81
-wheel3_g = 0.71
82
-wheel3_b = 0.08
83
-wheel4_r = 1
84
-wheel4_g = 0.71
80
+wheel3_r = 0.08
81
+wheel3_g = 0.08
82
+wheel3_b = 0.54
83
+wheel4_r = 0.4
84
+wheel4_g = 0.37
85
 wheel4_b = 0.08
85
 wheel4_b = 0.08
86
 #-------------------
86
 #-------------------
87
 
87
 

BIN
scripts/__pycache__/colors.cpython-36.pyc View File


BIN
scripts/__pycache__/menuV3.cpython-36.pyc View File


+ 31
- 15
scripts/colors.py View File

122
 
122
 
123
 
123
 
124
 def update_truck_tex():
124
 def update_truck_tex():
125
-    #deck graphic testing
126
-    #pass
127
     import glob
125
     import glob
128
     import platform
126
     import platform
127
+    dict = bge.logic.globalDict 
128
+    dict['deckList'] = []
129
     scene = bge.logic.getCurrentScene()
129
     scene = bge.logic.getCurrentScene()
130
     deck = scene.objects["deck"]
130
     deck = scene.objects["deck"]
131
     mainDir = bge.logic.expandPath("//")
131
     mainDir = bge.logic.expandPath("//")
132
     fileName = mainDir + "textures\\decks\\*.png"  
132
     fileName = mainDir + "textures\\decks\\*.png"  
133
+    linux = False
133
     if platform.system() == 'Linux':
134
     if platform.system() == 'Linux':
134
-        fileName = mainDir + 'textures//decks//*.png'  
135
+        fileName = mainDir + 'textures/decks//*.png'  
136
+        linux = True
137
+    deckList = []    
135
     deckList = glob.glob(fileName)
138
     deckList = glob.glob(fileName)
136
     dict['deckList'] = deckList  
139
     dict['deckList'] = deckList  
140
+
137
     ID = texture.materialID(deck, 'MAdeck')
141
     ID = texture.materialID(deck, 'MAdeck')
138
     deck_texture = texture.Texture(deck, ID)
142
     deck_texture = texture.Texture(deck, ID)
139
     new_source = texture.ImageFFmpeg(deckList[dict["deck_index"]])
143
     new_source = texture.ImageFFmpeg(deckList[dict["deck_index"]])
142
     bge.logic.texture.refresh(False)
146
     bge.logic.texture.refresh(False)
143
     deck_name = deckList[dict['deck_index']]
147
     deck_name = deckList[dict['deck_index']]
144
     deck_name = deck_name.replace(mainDir, '')
148
     deck_name = deck_name.replace(mainDir, '')
145
-    deck_name = deck_name.replace('textures\decks', '' )
146
-    deck_name = deck_name.replace('.png', '')   
147
-    deck_name = deck_name.replace("\\", "")  
149
+    if linux == True:
150
+        deck_name = deck_name.replace('textures/decks/', '' )
151
+        deck_name = deck_name.replace('.png', '')   
152
+        deck_name = deck_name.replace("//", "")  
153
+    else:
154
+        deck_name = deck_name.replace('textures\decks', '' )
155
+        deck_name = deck_name.replace('.png', '')   
156
+        deck_name = deck_name.replace("\\", "")      
148
     print('deck texture updted to ', deck_name)
157
     print('deck texture updted to ', deck_name)
149
     dict['deck_name'] = deck_name
158
     dict['deck_name'] = deck_name
150
     
159
     
151
 def update_shirt_tex():
160
 def update_shirt_tex():
152
-    #pass
153
-    #deck graphic testing
154
     import glob
161
     import glob
155
     import platform
162
     import platform
156
     scene = bge.logic.getCurrentScene()
163
     scene = bge.logic.getCurrentScene()
157
-    #deck = scene.objects["deck"]
164
+    dict = bge.logic.globalDict 
165
+    dict['shirtList'] = []
158
     shirt = scene.objects["Char4:Zshirtt1"]
166
     shirt = scene.objects["Char4:Zshirtt1"]
159
     mainDir = bge.logic.expandPath("//")
167
     mainDir = bge.logic.expandPath("//")
160
-    fileName2 = mainDir + "textures\\shirt\\*.png"  
168
+    fileName2 = mainDir + "textures\\shirt\\*.png" 
169
+    linux = False 
161
     if platform.system() == 'Linux':
170
     if platform.system() == 'Linux':
162
-        fileName2 = mainDir + 'textures//shirt//*.png'  
171
+        fileName2 = mainDir + 'textures/shirt//*.png' 
172
+        linux = True 
173
+    shirtList = []    
163
     shirtList = glob.glob(fileName2)
174
     shirtList = glob.glob(fileName2)
164
     dict['shirtList'] = shirtList  
175
     dict['shirtList'] = shirtList  
165
-    print(shirtList, 'shirtList')
176
+    
166
     ID = texture.materialID(shirt, 'MAshirt')
177
     ID = texture.materialID(shirt, 'MAshirt')
167
     shirt_texture = texture.Texture(shirt, ID)
178
     shirt_texture = texture.Texture(shirt, ID)
168
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])
179
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])
171
     bge.logic.texture2.refresh(False)
182
     bge.logic.texture2.refresh(False)
172
     shirt_name = shirtList[dict['shirt_logo']]
183
     shirt_name = shirtList[dict['shirt_logo']]
173
     shirt_name = shirt_name.replace(mainDir, '')
184
     shirt_name = shirt_name.replace(mainDir, '')
174
-    shirt_name = shirt_name.replace('textures\shirt', '' )
175
-    shirt_name = shirt_name.replace('.png', '')   
176
-    shirt_name = shirt_name.replace("\\", "")  
185
+    if linux == True:
186
+        shirt_name = shirt_name.replace('textures/shirt/', '' )
187
+        shirt_name = shirt_name.replace('.png', '')   
188
+        shirt_name = shirt_name.replace("//", "")  
189
+    else:    
190
+        shirt_name = shirt_name.replace('textures\shirt', '' )
191
+        shirt_name = shirt_name.replace('.png', '')   
192
+        shirt_name = shirt_name.replace("\\", "")  
177
     print('shirt texture updted to ', shirt_name)
193
     print('shirt texture updted to ', shirt_name)
178
     dict['shirt_name'] = shirt_name    
194
     dict['shirt_name'] = shirt_name    
179
 
195
 

+ 2
- 2
scripts/menuV3.py View File

599
     if funct == 'shirt logo':
599
     if funct == 'shirt logo':
600
         if motion == 'inc':
600
         if motion == 'inc':
601
             dict['shirt_logo'] = int(dict['shirt_logo'])
601
             dict['shirt_logo'] = int(dict['shirt_logo'])
602
-            if dict['shirt_logo'] < len(dict['shirtList']):
602
+            if dict['shirt_logo'] < (len(dict['shirtList']) - 1):
603
                 dict['shirt_logo'] += 1
603
                 dict['shirt_logo'] += 1
604
                 colors.update_shirt_tex() 
604
                 colors.update_shirt_tex() 
605
                 
605
                 
1380
         if dict['current_opt'] == 'deck color b':
1380
         if dict['current_opt'] == 'deck color b':
1381
             outp = outp + ': ' + str(dict['deck_color_b'])  
1381
             outp = outp + ': ' + str(dict['deck_color_b'])  
1382
         if dict['current_opt'] == 'shirt logo':
1382
         if dict['current_opt'] == 'shirt logo':
1383
-            outp = outp + ': ' + str(dict['shirt_logo'])   
1383
+            outp = outp + ': ' + str(dict['shirt_name'])   
1384
         if dict['current_opt'] == 'deck graphic':
1384
         if dict['current_opt'] == 'deck graphic':
1385
             outp = outp + ': ' + str(dict['deck_name'])               
1385
             outp = outp + ': ' + str(dict['deck_name'])               
1386
             
1386
             

BIN
textures/decks/Thumbs.db View File


BIN
textures/shirt/Thumbs.db View File


Loading…
Cancel
Save