-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from GameLab-UNIL-EPFL/MapControls
Choose location with keys
- Loading branch information
Showing
11 changed files
with
146 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source_md5="5af8d800314babecccc487fe554ad7c9" | ||
dest_md5="6fdb71a36f05c72dc727140ad9a18232" | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source_md5="a5c32aa00d965ca952623d1b3fe45610" | ||
dest_md5="5377adfcfa3dabf2693b9ab22d876fc9" | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/adminIcon.png-3688bd3c074b54dd0cdc871d8dcdd8ce.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://assets/05_map/adminIcon.png" | ||
dest_files=[ "res://.import/adminIcon.png-3688bd3c074b54dd0cdc871d8dcdd8ce.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=false | ||
svg/scale=1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/breweryIcon.png-342c5fb510f55800453b35945f1f0115.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://assets/05_map/breweryIcon.png" | ||
dest_files=[ "res://.import/breweryIcon.png-342c5fb510f55800453b35945f1f0115.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=false | ||
svg/scale=1.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,57 @@ | ||
/* | ||
Historically accurate educational video game based in 1830s Lausanne. | ||
Copyright (C) 2021 GameLab UNIL-EPFL | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
using Godot; | ||
using System; | ||
|
||
public class Map : Node2D | ||
{ | ||
private bool hidden = true; | ||
|
||
private AudioStreamPlayer ASP; | ||
private Sprite S; | ||
|
||
private TextureButton office; | ||
private TextureButton brasserie; | ||
private TextureButton moulin; | ||
private TextureButton palud; | ||
private TextureButton casino; | ||
private Context context; | ||
|
||
// Called when the node enters the scene tree for the first time. | ||
public override void _Ready() | ||
{ | ||
ASP = GetNode<AudioStreamPlayer>("../ButtonSound"); | ||
S = GetNode<Sprite>("../TabMap"); | ||
office = GetNode<TextureButton>("office_button"); | ||
brasserie = GetNode<TextureButton>("brasserie_button"); | ||
moulin = GetNode<TextureButton>("moulin_button"); | ||
palud = GetNode<TextureButton>("palud_button"); | ||
casino = GetNode<TextureButton>("casino_button"); | ||
context = GetNode<Context>("/root/Context"); | ||
|
||
} | ||
|
||
public void _on_MapButton_pressed() { | ||
if(ASP.Playing == false) { | ||
ASP.Play(); | ||
} | ||
if(hidden) { | ||
Show(); | ||
S.Frame = 0; | ||
} else { | ||
Hide(); | ||
S.Frame = 1; | ||
|
||
private void GrabFocusPos(Locations l) { | ||
switch(l) { | ||
case Locations.INTRO: | ||
office.GrabFocus(); | ||
break; | ||
case Locations.PALUD: | ||
palud.GrabFocus(); | ||
break; | ||
case Locations.CASINO: | ||
casino.GrabFocus(); | ||
break; | ||
case Locations.BRASSERIE: | ||
brasserie.GrabFocus(); | ||
break; | ||
case Locations.MOULIN: | ||
case Locations.FLON: | ||
moulin.GrabFocus(); | ||
break; | ||
default: | ||
break; | ||
} | ||
hidden = !hidden; | ||
} | ||
|
||
|
||
private void _on_Map_visibility_changed() { | ||
if(Visible) { | ||
GrabFocusPos(context._GetLocation()); | ||
} | ||
} | ||
} | ||
|
||
|
||
|