diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-08-15 14:56:48 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-08-15 14:56:48 -0300 |
commit | a859841cb9a600a1e92f6c0730ca5f10dc2a82d6 (patch) | |
tree | cf2a9011b2511935e8b4830c2025b3ab10c19159 /game/gui | |
parent | 1f96ee4658c2df3280e0da7a0ddf09628c91cac9 (diff) | |
download | client-a859841cb9a600a1e92f6c0730ca5f10dc2a82d6.tar.gz client-a859841cb9a600a1e92f6c0730ca5f10dc2a82d6.tar.bz2 client-a859841cb9a600a1e92f6c0730ca5f10dc2a82d6.tar.xz client-a859841cb9a600a1e92f6c0730ca5f10dc2a82d6.zip |
Look and learn, @Xanthem noob - THIS is how you do it!
*flips frying pan*
Just kidding - It was you who gave me this idea in first place.
Hint - You can use "ALT+1", "ALT+2", etc. to manipulate the spheres :-)
Diffstat (limited to 'game/gui')
-rw-r--r-- | game/gui/battle.rpy | 110 |
1 files changed, 68 insertions, 42 deletions
diff --git a/game/gui/battle.rpy b/game/gui/battle.rpy index aa81a1c..c0934a3 100644 --- a/game/gui/battle.rpy +++ b/game/gui/battle.rpy @@ -62,7 +62,18 @@ init python: return return -# FIXME: Allow to drag spheres around + # FIXME: Allow to drag spheres around + def c_swap(idx): + global csid + if csid is None: + csid = copy.copy(idx) + return + o1 = copy.copy(Battle["spheres"][csid]) + o2 = copy.copy(Battle["spheres"][idx]) + Battle["spheres"][csid] = copy.copy(o2) + Battle["spheres"][idx] = copy.copy(o1) + csid = None + return ############################################################################# screen battle_mobs(): @@ -155,32 +166,24 @@ screen battle_core(): child At("gfx/actionarea.png", party1) draggable False yalign 1.0 - # Display the sphere - ## FIXME - ## Alternative 1 - Make this a button - ## Player clicks on the button - some function is called - ## TODO: What does the function do? - ## → backup = copy.copy(Battle["spheres"]) - ## → (We actually could just copy the whole `Battle` - ## and allow players to "revert"/"reset" the screen) - ## → Probably waits for you to click/tap on another sphere? - ## Once it finishes, it swaps the elements in Battle["spheres"] array - ## The blitting is frequent enough - ## So you don't need to cast a redraw() nor anything - ## Just swap them and it *should* work right away as far as - ## visual goes - ## ----------- - ## Note: You do not need to preserve the original array - ## However, well, if the array gets corrupted........ - drag: - child ("gfx/sphere/"+str(Battle["spheres"][0])+".png") - draggable False - droppable False - yalign 1.0 - xalign 0.5 + if (fx1 and Battle["party"][0]["hp"] <= 0): add At("gfx/off.png", party1) + # Display the sphere + imagebutton: + idle ("gfx/sphere/"+str(Battle["spheres"][0])+".png") + selected_idle ("gfx/sphere/s/"+str(Battle["spheres"][0])+".png") + hover ("gfx/sphere/"+str(Battle["spheres"][0])+".png") + selected_hover ("gfx/sphere/s/"+str(Battle["spheres"][0])+".png") + selected csid is 0 + action Function(c_swap, 0) + keysym "alt_1" + xpos 0.125 + xanchor 0.5 + yanchor 1.0 + ypos config.screen_height-10 + # One drag group per party member defined in Battle draggroup: xpos 0.50 @@ -213,15 +216,23 @@ screen battle_core(): child At("gfx/actionarea.png", party2) draggable False yalign 1.0 - drag: - child ("gfx/sphere/"+str(Battle["spheres"][1])+".png") - draggable False - droppable False - yalign 1.0 - xalign 0.5 if (fx2 and Battle["party"][1]["hp"] <= 0): add At("gfx/off.png", party2) + + imagebutton: + idle ("gfx/sphere/"+str(Battle["spheres"][1])+".png") + selected_idle ("gfx/sphere/s/"+str(Battle["spheres"][1])+".png") + hover ("gfx/sphere/"+str(Battle["spheres"][1])+".png") + selected_hover ("gfx/sphere/s/"+str(Battle["spheres"][1])+".png") + selected csid is 1 + action Function(c_swap, 1) + keysym "alt_2" + xpos 0.375 + xanchor 0.5 + yanchor 1.0 + ypos config.screen_height-10 + # One drag group per party member defined in Battle draggroup: xpos 0.75 @@ -254,15 +265,23 @@ screen battle_core(): child At("gfx/actionarea.png", party3) draggable False yalign 1.0 - drag: - child ("gfx/sphere/"+str(Battle["spheres"][2])+".png") - draggable False - droppable False - yalign 1.0 - xalign 0.5 if (fx3 and Battle["party"][2]["hp"] <= 0): add At("gfx/off.png", party3) + + imagebutton: + idle ("gfx/sphere/"+str(Battle["spheres"][2])+".png") + selected_idle ("gfx/sphere/s/"+str(Battle["spheres"][2])+".png") + hover ("gfx/sphere/"+str(Battle["spheres"][2])+".png") + selected_hover ("gfx/sphere/s/"+str(Battle["spheres"][2])+".png") + selected csid is 2 + action Function(c_swap, 2) + keysym "alt_3" + xpos 0.625 + xanchor 0.5 + yanchor 1.0 + ypos config.screen_height-10 + # One drag group per party member defined in Battle draggroup: xpos 1.0 @@ -295,16 +314,23 @@ screen battle_core(): child At("gfx/actionarea.png", party4) draggable False yalign 1.0 - drag: - child ("gfx/sphere/"+str(Battle["spheres"][3])+".png") - draggable False - droppable False - yalign 1.0 - xalign 0.5 if (fx4 and Battle["party"][3]["hp"] <= 0): add At("gfx/off.png", party4) + imagebutton: + idle ("gfx/sphere/"+str(Battle["spheres"][3])+".png") + selected_idle ("gfx/sphere/s/"+str(Battle["spheres"][3])+".png") + hover ("gfx/sphere/"+str(Battle["spheres"][3])+".png") + selected_hover ("gfx/sphere/s/"+str(Battle["spheres"][3])+".png") + selected csid is 3 + action Function(c_swap, 3) + keysym "alt_4" + xpos 0.875 + xanchor 0.5 + yanchor 1.0 + ypos config.screen_height-10 + ############################################################################# screen battle_bars(): #################################################### |