Skip to content

Commit

Permalink
Merge branch 'turing' of https://github.com/Turing-Project/SimAIWorld
Browse files Browse the repository at this point in the history
…into turing
  • Loading branch information
Y1ran committed Aug 31, 2023
2 parents 24440c5 + 4a8f439 commit c9ac9b3
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fork_sim_code": "July1_the_ville_isabella_maria_klaus-step-3-19",
"start_date": "February 13, 2023",
"curr_time": "February 14, 2023, 00:02:30",
"start_date": "February 13, 2003",
"curr_time": "February 14, 2003, 00:02:30",
"sec_per_step": 10,
"maze_name": "the_ville",
"persona_names": [
Expand Down
2 changes: 1 addition & 1 deletion environment/frontend_server/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

</head>

<body class="top-navigation" style="background-color: white">
<body class="top-navigation" style="background-color: black">
{% block content %}
{% endblock content %}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 30 additions & 24 deletions environment/frontend_server/templates/demo/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,45 @@
<br>
<div>

<div id="game-container" style="text-align: center"></div>
<!-- <div id="game-container" style="text-align: center"></div>-->

<div style="width:50%; margin: 0 auto; margin-top:4.5em">
<div style="width:90%; margin: 0 auto; margin-top:4.5em">


<h3 style="margin-bottom:-0.5em; font-size:1.5em">虚拟世界当前时间:</h3>
<h3 style="margin-bottom:-0.5em; font-size:2em; color: teal"><b>环界-当前时间:</b></h3>
<div class="row">
<div class="col-md-8" id="game-time" style="">
<h2><span id="game-time-content"></span></h2>
<div class="col-md-12" id="game-time" style="color: aliceblue">
<h2><span id="game-time-content"></span></h2>

</div>
<div class="col-md-4">
<h2 style="text-align: right; {% if mode == 'simulate' %} display: none {% endif %}">
<button id="play_button" type="button" class="btn btn-default">
<strong style=" font-size:1.2em"><i class="glyphicon glyphicon-play"></i> &nbsp;继续演化</strong>
</button>

<button id="pause_button" type="button" class="btn btn-default">
<strong style=" font-size:1.2em"><i class="glyphicon glyphicon-pause"></i> &nbsp;时间暂停</strong>
</button>
</h2>
<img src="https://img.zcool.cn/community/0104425fcde0ec11013fdcc716974d.gif" width="200" height="125" align="right">

<div class="col-md-4" style="">
<div class="media-left media-bottom">
<h2 style="text-align: left; {% if mode == 'simulate' %} display: none {% endif %}">
<button id="play_button" type="button" class="btn btn-default" style="">
<strong style=" font-size:1.2em"><i class="glyphicon glyphicon-play"></i> &nbsp;继续演化</strong>
</button>

<button id="pause_button" type="button" class="btn btn-default">
<strong style=" font-size:1.2em"><i class="glyphicon glyphicon-pause"></i> &nbsp;时间暂停</strong>
</button>
</h2>
</div>
</div>
</div>

<br>
<hr style="border-color:#999999">
<br>

<div class="row">
<div class="row" style="">
<div class="col-md-12" style="border:solid; padding:2em; border-radius: 15px">
<div class="row" style="">
<div class="row" style="color: #999999">
{% for p in persona_names %}
<div class="col-md-2 col-sm-2" style="text-align:center; margin-bottom:0.8em;" >
<div class="col-md-2 col-sm-2" style="text-align:center; margin-bottom:0.8em; color: #999999" >
<a href="#" id="on_screen_det_trigger-{{p.underscore}}">
<div class="row" style="padding:0">
<div class="col-md-4" id="on_screen_det_trigger_container-{{p.underscore}}" style="text-align:center; padding:0; padding-top:0.3em">
<div class="row" style="padding:0; color: #999999">
<div class="col-md-4" id="on_screen_det_trigger_container-{{p.underscore}}" style="text-align:center; padding:0; padding-top:0.3em;color: teal">
{% with 'assets/characters/profile/'|add:p.underscore|add:'.png' as image_static %}
<img src="{% static image_static %}" style="width:64px; padding:0; ">
{% endwith %}
Expand All @@ -63,8 +67,9 @@ <h2 style="text-align: right; {% if mode == 'simulate' %} display: none {% endif
<div class="media-left media-middle">
<em>点击当前AI图标,可以获得更详细的状态信息 </em>
</div>
</div>
</div>

<div id="game-container" style="text-align: center"></div>

{% for p in persona_names %}
<div class="media" id="on_screen_det_content-{{p.underscore}}" style="background-color:#EEEEEE; padding:1em; padding-left:3.5em; padding-right:2em; border-radius:10px; display: none;">
Expand Down Expand Up @@ -93,8 +98,9 @@ <h2 class="col-md-8" id="name__{{ p.underscore }}" style="margin-bottom:0.8em; f
</div>
{% endfor %}


</div>


</div>

<div style="margin-top:10em"></div>
Expand Down Expand Up @@ -124,7 +130,7 @@ <h2 class="col-md-8" id="name__{{ p.underscore }}" style="margin-bottom:0.8em; f
'font-weight': '500',
});
$('#on_screen_det_trigger_container-{{p_i.underscore}}').css({
'background-color': 'white',
'background-color': 'black',
'border-radius': '10px'
});
{% endfor %}
Expand Down
10 changes: 5 additions & 5 deletions environment/frontend_server/templates/demo/main_script.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Configuration meant to be passed to the main Phaser game instance.
const config = {
type: Phaser.AUTO,
width: 2300,
width: 2000,
height: 1500,
parent: "game-container",
pixelArt: true,
Expand All @@ -35,7 +35,7 @@
preload: preload,
create: create,
update: update },
scale: {zoom: 0.6} };
scale: {zoom: 0.55} };

// const config = {
// type: Phaser.AUTO,
Expand Down Expand Up @@ -89,7 +89,7 @@

let start_datetime =new Date(Date.parse("{{start_datetime}}"));
var datetime_options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
document.getElementById("game-time-content").innerHTML = start_datetime.toLocaleTimeString("en-US", datetime_options);
document.getElementById("game-time-content").innerHTML = start_datetime.toLocaleTimeString("ch-CN", datetime_options);

// ###########################################################################
// ENGINE
Expand Down Expand Up @@ -406,7 +406,7 @@
initials = (
(initials.shift()?.[1] || '') + (initials.pop()?.[1] || '')
).toUpperCase();
pronunciatios[curr_persona_name].setText(initials + ": " + pronunciatio_content);
pronunciatios[curr_persona_name].setText("test" + ": " + pronunciatio_content);


var text = "test successful";
Expand Down Expand Up @@ -519,7 +519,7 @@
step = step + 1;

start_datetime = new Date(start_datetime.getTime() + step_size);
document.getElementById("game-time-content").innerHTML = start_datetime.toLocaleTimeString("en-US", datetime_options);
document.getElementById("game-time-content").innerHTML = start_datetime.toLocaleTimeString("ch-CN", datetime_options);
}

execute_count -= 1;
Expand Down
2 changes: 1 addition & 1 deletion environment/frontend_server/translator/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .global_methods import *
from .models import *

with open("D:\\桌面\\Tureco\\SimAIWorld\\environment\\frontend_server\\translator\\name.json", "r", encoding="utf-8") as f:
with open("D:\\Tureco\\SimAIWorld\\environment\\frontend_server\\translator\\name.json", "r", encoding="utf-8") as f:
js = f.read()
names_mapping = json.loads(js)['persona_names_mapping']
# print(names_mapping)
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ zipp==3.6.0

pathlib~=1.0.1
flask~=2.2.2
eel~=0.16.0
eel~=0.16.0
googletrans~=4.0.0rc1
python-dotenv~=1.0.0

0 comments on commit c9ac9b3

Please sign in to comment.